/*! * \brief Creates the GUI for the notification property dialog. Show in App (LSK Option, RSK Back) * * \param * \return void *****************************************************************************/ void meaCreateMvNotifPropView(MmsMsgId msgId) { ctk_screen_handle scrid; kal_uint8 *text; extern char *meaCreateNotifPropText(MmsMsgId msgId); if (0 != meaMvPropView.formHandle) { return; } memset(&meaMvPropView, 0, sizeof(MeaMvPropView)); /* Create widow */ text = (kal_uint8 *)meaCreateNotifPropText(msgId); meaMvPropView.formHandle = HDIa_widgetExtCreateTextViewSeparator(MSF_MODID_MEA, text, MEA_STR_ID_PROPERTIES, 0); MEA_FREE(text); meaAddWidgetList(meaMvPropView.formHandle); /* Set Key */ scrid = HDIa_widgetCtkGetScreenHandle(meaMvPropView.formHandle); ctk_screen_addRSK_UA(scrid, STR_GLOBAL_BACK, IMG_GLOBAL_BACK, NULL, meaMvPropViewOnlyGoBack, KAL_TRUE); ctk_screen_add_key_UA(scrid, KEY_LEFT_ARROW, NULL, meaMvPropViewOnlyGoBack, KAL_TRUE); ctk_screen_addLSK_UA(scrid, MEA_STR_ID_OPTIONS, IMG_GLOBAL_OK, NULL, handleMvPropOptionAction, KAL_TRUE); meaDisplayWindow(meaMvPropView.formHandle, meaGetPosLeftTop()); return; }
/*! \brief Display the panic dialog. * * \return TRUE if successful, otherwise FALSE. *****************************************************************************/ MSF_BOOL meaShowPanicDialog(void) { if (0 != meaPanicDialog) { return meaDisplayWindow(meaPanicDialog, meaGetPosLeftTop()); } return FALSE; }
/*!\brief Displayes a previously created menu. * \return TRUE if the menu could be displayed. otherwise FALSE. *****************************************************************************/ MSF_BOOL meaShowPropNavMenu(void) { if (0 == meaPropNavMenu.menuHandle) { return FALSE; } /* Title */ (void)meaSetTitle(meaPropNavMenu.menuHandle, MEA_GET_STR_ID(MEA_STR_ID_OPTIONS), 0); return meaDisplayWindow(meaPropNavMenu.menuHandle, meaGetPosLeftTop()); }
/*! * \brief Creates the GUI for the message status dialog. * * \param propItem The current message properties. * \param * \return TRUE if the operation was successful, otherwise FALSE. *****************************************************************************/ MSF_BOOL meaCreateMvStatusView(U32 str_id, U8 ntt, U8 quota) { ctk_screen_handle scrid; ctk_string_id titleid; kal_uint8 *text, *str; int text_size; if (0 != meaMvStatusView.formHandle) { return FALSE; } memset(&meaMvStatusView, 0, sizeof(MeaMvPropView)); text_size = 300; text = MEA_ALLOC(text_size); str = MEA_ALLOC(3); widget_utf8_to_ucs2_string(text, text_size, (kal_uint8*) ""); text = widget_ucs2str_append_id(MSF_MODID_MEA, text, &text_size, MEA_STR_ID_STATUS); text = widget_ucs2str_append_utf8(MSF_MODID_MEA, text, &text_size, (kal_uint8*)" "); text = widget_ucs2str_append_id(MSF_MODID_MEA, text, &text_size, str_id); text = widget_ucs2str_append_utf8(MSF_MODID_MEA, text, &text_size, (kal_uint8*)"\x1B\n"); text = widget_ucs2str_append_id(MSF_MODID_MEA, text, &text_size, MEA_STR_ID_NEXT_TRANS_TIME); text = widget_ucs2str_append_utf8(MSF_MODID_MEA, text, &text_size, (kal_uint8*)": "); sprintf((S8 *)str,"%d", ntt); text = widget_ucs2str_append_utf8(MSF_MODID_MEA, text, &text_size, (kal_uint8*)str); text = widget_ucs2str_append_utf8(MSF_MODID_MEA, text, &text_size, (kal_uint8*)" "); text = widget_ucs2str_append_id(MSF_MODID_MEA, text, &text_size, MEA_STR_ID_MINS); text = widget_ucs2str_append_utf8(MSF_MODID_MEA, text, &text_size, (kal_uint8*)"\x1B\n"); text = widget_ucs2str_append_id(MSF_MODID_MEA, text, &text_size, MEA_STR_ID_REMAIN_QUOTA); text = widget_ucs2str_append_utf8(MSF_MODID_MEA, text, &text_size, (kal_uint8*)": "); sprintf((S8 *)str,"%d", quota); text = widget_ucs2str_append_utf8(MSF_MODID_MEA, text, &text_size, (kal_uint8*)str); text = widget_ucs2str_append_utf8(MSF_MODID_MEA, text, &text_size, (kal_uint8*)"\x1B\n"); /* Create widow */ titleid = MEA_STR_ID_SHOW_STATUS; meaMvStatusView.formHandle = HDIa_widgetExtCreateTextViewSeparator(MSF_MODID_MEA, text, titleid , 0); MEA_FREE(text); MEA_FREE(str); meaAddWidgetList(meaMvStatusView.formHandle); /* Set Key */ scrid = HDIa_widgetCtkGetScreenHandle(meaMvStatusView.formHandle); ctk_screen_addRSK_UA(scrid, STR_GLOBAL_BACK, IMG_GLOBAL_BACK, NULL, meaMvStatusViewGoBack, KAL_TRUE); ctk_screen_add_key_UA(scrid, KEY_LEFT_ARROW, NULL, meaMvStatusViewGoBack, KAL_TRUE); return meaDisplayWindow(meaMvStatusView.formHandle, meaGetPosLeftTop()); }
/*!\brief Displayes a previously created menu. * * \return TRUE if the menu could be displayed. otherwise FALSE. * *****************************************************************************/ MSF_BOOL meaShowNavMenu() { if (0 == meaNavMenu.menuHandle) { return FALSE; } #ifdef WAP_SUPPORT /* Title */ (void)meaSetTitle(meaNavMenu.menuHandle, MEA_GET_STR_ID(MEA_STR_ID_OPTIONS), 0); #endif /*WAP_SUPPORT*/ return meaDisplayWindow(meaNavMenu.menuHandle, meaGetPosLeftTop()); }
/*! * \brief Creates the GUI for the message property dialog. * * \param propItem The current message properties. * \param * \return TRUE if the operation was successful, otherwise FALSE. *****************************************************************************/ MSF_BOOL meaCreateMvPropView(MmsMsgId msgId, MSF_BOOL appActivated) { ctk_screen_handle scrid; ctk_string_id titleid; kal_uint8 *text; if (0 != meaMvPropView.formHandle) { return FALSE; } memset(&meaMvPropView, 0, sizeof(MeaMvPropView)); text = (kal_uint8 *)meaCreateMsgPropText(msgId); /* Create widow */ titleid = (appActivated == TRUE) ? MEA_STR_ID_VIEW_TITLE : MEA_STR_ID_PROPERTIES; meaMvPropView.formHandle = HDIa_widgetExtCreateTextViewSeparator(MSF_MODID_MEA, text, titleid , 0); MEA_FREE(text); meaAddWidgetList(meaMvPropView.formHandle); /* Set Key */ scrid = HDIa_widgetCtkGetScreenHandle(meaMvPropView.formHandle); if (appActivated == TRUE) { ctk_screen_addRSK_UA(scrid, STR_GLOBAL_BACK, IMG_GLOBAL_BACK, NULL, meaMvPropViewGoBack, KAL_TRUE); ctk_screen_add_key_UA(scrid, KEY_LEFT_ARROW, NULL, meaMvPropViewGoBack, KAL_TRUE); ctk_screen_addLSK_UA(scrid, SMA_STR_ID_MENU_PLAY, IMG_GLOBAL_OK, NULL, meaMvPropViewGoNext, KAL_TRUE); //ctk_screen_add_key_UA(scrid, KEY_LEFT_ARROW, NULL, meaMvPropViewGoNext, KAL_TRUE); } else { #if defined(__UNIFIED_MSG_SUPPORT__) && !defined(__UNIFIED_MESSAGE_LIST_OPTION_SUPPORT__) /* For delete option */ if (mmcIsJSRMsg(msgId)) { ctk_screen_addLSK_UA(scrid, MEA_STR_ID_OPTIONS, IMG_GLOBAL_OK, NULL, handleMvPropOptionAction, KAL_TRUE); } #endif ctk_screen_addRSK_UA(scrid, STR_GLOBAL_BACK, IMG_GLOBAL_BACK, NULL, meaMvPropViewOnlyGoBack, KAL_TRUE); ctk_screen_add_key_UA(scrid, KEY_LEFT_ARROW, NULL, meaMvPropViewOnlyGoBack, KAL_TRUE); } return meaDisplayWindow(meaMvPropView.formHandle, meaGetPosLeftTop()); }
/*! * \brief Creates and displays a dialog. * * \return TRUE if successful, otherwise FALSE. *****************************************************************************/ static MSF_BOOL showDialog() { int i; MsfDialogType msfDialogType; if (0 != meaDialog.dialogHandle) { MSF_LOG_MSG_OFF((MSF_LOG_DETAIL_HIGH, MSF_MODID_MEA, MAUIDIA_5AA3B4FB841AC6A9C5FC4188FD141007, "(%s) (%d) instance busy!\n", __FILE__, __LINE__)); return FALSE; } if (0 == meaDialogQueue[0].strHandle) { #ifdef WAP_SUPPORT // justin if (meaWindowToShowAfterDialog != 0) { meaDisplayWindow(meaWindowToShowAfterDialog, meaGetPosLeftTop()); meaWindowToShowAfterDialog = 0; } #endif /* WAP_SUPPORT */ return FALSE; } msfDialogType = MsfWarning; switch (meaDialogQueue[0].dialogType) { case(MEA_DIALOG_ALERT): msfDialogType = MsfAlert; break; case(MEA_DIALOG_WARNING): msfDialogType = MsfWarning; break; case(MEA_DIALOG_INFO): msfDialogType = MsfInfo; break; case(MEA_DIALOG_ERROR): msfDialogType = MsfError; break; #ifdef WAP_SUPPORT case(MEA_DIALOG_CONFIRMATION): msfDialogType = MsfConfirmation; break; case(MEA_DIALOG_PROMPT): msfDialogType = MsfPrompt; break; case(MEA_DIALOG_PROMPT_EMPTY): msfDialogType = (MsfDialogType)MsfPromptEmpty; break; case(MEA_DIALOG_PROMPT_DONE): msfDialogType = (MsfDialogType)MsfPromptSaveDone; break; #endif /* WAP_SUPPORT */ } /* Create dialog */ meaDialog.dialogHandle = MSF_WIDGET_DIALOG_CREATE(MSF_MODID_MEA, meaDialogQueue[0].strHandle, msfDialogType, MEA_DIALOG_DEFAULT_TIME_OUT, MSF_WINDOW_PROPERTY_NOTIFY, 0); if (0 == meaDialog.dialogHandle) { return FALSE; } /* copy callback info for this dialog */ meaDialog.fsm = meaDialogQueue[0].fsm; meaDialog.signal = meaDialogQueue[0].signal; /* Display the dialog */ if (0 <= MSF_WIDGET_SCREEN_ADD_WINDOW(meaGetScreenHandle(), meaDialog.dialogHandle, meaGetPosLeftTop(), meaGetScreenHandle(), 0)) { (void)MSF_WIDGET_SET_IN_FOCUS(meaGetScreenHandle(), TRUE); (void)MSF_WIDGET_SET_IN_FOCUS(meaDialog.dialogHandle, TRUE); (void)meaRegisterNotification(meaDialog.dialogHandle, MsfNotifyLostFocus, meaDeleteDialogCb, 0, 0); } else { (void)MSF_WIDGET_RELEASE(meaDialog.dialogHandle); meaDialog.dialogHandle = 0; return FALSE; } /* Remove the item from the queue */ for(i = 0; i < MEA_MAX_DIALOGS - 1; i++) { memcpy(&meaDialogQueue[i], &meaDialogQueue[i + 1], sizeof(MeaDialogItem)); } /* Set last item to zero */ meaDialogQueue[MEA_MAX_DIALOGS - 1].dialogType = (MeaDialogType)0; meaDialogQueue[MEA_MAX_DIALOGS - 1].strHandle = 0; return TRUE; }
/*! * \brief Displays a dialog that requires End User actions to disappear. * * \param textStrId The text to be displayed or 0 if the str param is used * instead. * \param str The text string to displayed if textStrId is 0 * \param fsm The FSM to respond the result to. * \param signal The response signal. * \param id A optional id that is sent back in the response as u_param2. * \return TRUE if successful, otherwise FALSE. *****************************************************************************/ MSF_BOOL meaShowDialogWithConfirm(MsfDialogType dlgType, MSF_UINT32 lskStrId, MSF_UINT32 rskStrId, MSF_UINT32 textStrId, MeaStateMachine fsm, int signal, unsigned int id) { if (0 != meaConfirmDialog.dialogHandle) { meaDeleteDialog(meaConfirmDialog.dialogHandle); MSF_LOG_MSG_OFF((MSF_LOG_DETAIL_HIGH, MSF_MODID_MEA, MAUIDIA_B308D4280296A2DC7B04F7DE3E738342, "(%s) (%d) instance is busy!\n", __FILE__, __LINE__)); return FALSE; } meaConfirmDialog.fsm = fsm; meaConfirmDialog.signal = signal; meaConfirmDialog.id = id; /* Create string handle */ if (0 == textStrId) { return FALSE; } /* Create dialog */ if (0 == (meaConfirmDialog.dialogHandle = MSF_WIDGET_DIALOG_CREATE(MSF_MODID_MEA, MEA_GET_STR_ID(textStrId), dlgType, 0, MSF_WINDOW_PROPERTY_NOTIFY, 0))) { return FALSE; } /* Create LSK action */ if(0 == lskStrId) { meaConfirmDialog.okActionHandle = 0; } else { meaConfirmDialog.okActionHandle = MSF_WIDGET_ACTION_CREATE(MSF_MODID_MEA, MEA_GET_STR_ID(lskStrId), MsfOk, 0, MSF_ACTION_PROPERTY_ENABLED); } if (meaConfirmDialog.okActionHandle > 0 && 0 > MSF_WIDGET_ADD_ACTION(meaConfirmDialog.dialogHandle, meaConfirmDialog.okActionHandle)) { (void)MSF_WIDGET_RELEASE(meaConfirmDialog.dialogHandle); memset(&meaConfirmDialog, 0 , sizeof(MeaConfirmDialog)); return FALSE; } /* Create RSK action */ if(0 == rskStrId) { meaConfirmDialog.cancelActionHandle = 0; } else { meaConfirmDialog.cancelActionHandle = MSF_WIDGET_ACTION_CREATE(MSF_MODID_MEA, MEA_GET_STR_ID(rskStrId), MsfCancel, 0, MSF_ACTION_PROPERTY_ENABLED); } if (meaConfirmDialog.cancelActionHandle> 0 && 0 > MSF_WIDGET_ADD_ACTION(meaConfirmDialog.dialogHandle, meaConfirmDialog.cancelActionHandle)) { (void)MSF_WIDGET_RELEASE(meaConfirmDialog.dialogHandle); if(meaConfirmDialog.okActionHandle != 0) { (void)MSF_WIDGET_RELEASE(meaConfirmDialog.okActionHandle); } memset(&meaConfirmDialog, 0 , sizeof(MeaConfirmDialog)); return FALSE; } /* Display the dialog */ if (0 <= MSF_WIDGET_SCREEN_ADD_WINDOW(meaGetScreenHandle(), meaConfirmDialog.dialogHandle, meaGetPosLeftTop(), meaGetScreenHandle(), 0)) { (void)MSF_WIDGET_SET_IN_FOCUS(meaGetScreenHandle(), TRUE); (void)MSF_WIDGET_SET_IN_FOCUS(meaConfirmDialog.dialogHandle, TRUE); } else { (void)MSF_WIDGET_RELEASE(meaConfirmDialog.dialogHandle); if(meaConfirmDialog.okActionHandle != 0) { (void)MSF_WIDGET_RELEASE(meaConfirmDialog.okActionHandle); } if(meaConfirmDialog.cancelActionHandle != 0) { (void)MSF_WIDGET_RELEASE(meaConfirmDialog.cancelActionHandle); } memset(&meaConfirmDialog, 0 , sizeof(MeaConfirmDialog)); return FALSE; } return TRUE; }
/*! * \brief Displays a dialog that requires End User actions to disappear. * * \param textStrId The text to be displayed or 0 if the str param is used * instead. * \param str The text string to displayed if textStrId is 0 * \param fsm The FSM to respond the result to. * \param signal The response signal. * \param id A optional id that is sent back in the response as u_param2. * \return TRUE if successful, otherwise FALSE. *****************************************************************************/ MSF_BOOL meaShowConfirmDialog(MSF_UINT32 textStrId, const char *str, MeaStateMachine fsm, int signal, unsigned int id) { MsfStringHandle strHandle; if (0 != meaConfirmDialog.dialogHandle) { #ifdef WAP_SUPPORT meaDeleteDialog(meaConfirmDialog.dialogHandle); #else MSF_LOG_MSG_OFF((MSF_LOG_DETAIL_HIGH, MSF_MODID_MEA, MAUIDIA_B308D4280296A2DC7B04F7DE3E738342, "(%s) (%d) instance is busy!\n", __FILE__, __LINE__)); return FALSE; #endif /* WAP_SUPPORT */ } meaConfirmDialog.fsm = fsm; meaConfirmDialog.signal = signal; meaConfirmDialog.id = id; /* Create string handle */ /*lint -e{539} */ if (0 == textStrId) { if (0 == (strHandle = MSF_WIDGET_STRING_CREATE(MSF_MODID_MEA, str, MsfUtf8, (int)strlen(str) + 1, 0))) { return FALSE; } } else { strHandle = MEA_GET_STR_ID(textStrId); } /* Create dialog */ if (0 == (meaConfirmDialog.dialogHandle = MSF_WIDGET_DIALOG_CREATE( MSF_MODID_MEA, strHandle, MsfConfirmation, 0, MSF_WINDOW_PROPERTY_NOTIFY, 0))) { if (0 == textStrId) { (void)MSF_WIDGET_RELEASE(strHandle); } return FALSE; } if (0 == textStrId) { (void)MSF_WIDGET_RELEASE(strHandle); } /* Create actions */ #ifdef WAP_SUPPORT if (textStrId==MEA_STR_ID_NEW_MMS_MSG #ifdef __MMS_DUAL_SIM_SUPPORT__ || textStrId == WIDGET_STR_ID_RECEIVED_MMS_MSG_SIM_1 || textStrId == WIDGET_STR_ID_RECEIVED_MMS_MSG_SIM_2 #endif /*__MMS_DUAL_SIM_SUPPORT__*/ ) meaConfirmDialog.okActionHandle = MSF_WIDGET_ACTION_CREATE(MSF_MODID_MEA, MEA_GET_STR_ID(MEA_STR_ID_LSK_READ), MsfOk, 0, MSF_ACTION_PROPERTY_ENABLED); else meaConfirmDialog.okActionHandle = MSF_WIDGET_ACTION_CREATE(MSF_MODID_MEA, MEA_GET_STR_ID(MEA_STR_ID_LSK_YES), MsfOk, 0, MSF_ACTION_PROPERTY_ENABLED); #else meaConfirmDialog.okActionHandle = MSF_WIDGET_ACTION_CREATE(MSF_MODID_MEA, MEA_GET_STR_ID(MEA_STR_ID_OK), MsfOk, 0, MSF_ACTION_PROPERTY_ENABLED); #endif /* WAP_SUPPORT */ if (0 > MSF_WIDGET_ADD_ACTION(meaConfirmDialog.dialogHandle, meaConfirmDialog.okActionHandle)) { (void)MSF_WIDGET_RELEASE(meaConfirmDialog.dialogHandle); memset(&meaConfirmDialog, 0 , sizeof(MeaConfirmDialog)); return FALSE; } #ifdef WAP_SUPPORT if (textStrId==MEA_STR_ID_NEW_MMS_MSG #ifdef __MMS_DUAL_SIM_SUPPORT__ || textStrId == WIDGET_STR_ID_RECEIVED_MMS_MSG_SIM_1 || textStrId == WIDGET_STR_ID_RECEIVED_MMS_MSG_SIM_2 #endif /*__MMS_DUAL_SIM_SUPPORT__*/ ) meaConfirmDialog.cancelActionHandle = MSF_WIDGET_ACTION_CREATE(MSF_MODID_MEA, MEA_GET_STR_ID(MEA_STR_ID_BACK), MsfCancel, 0, MSF_ACTION_PROPERTY_ENABLED); else meaConfirmDialog.cancelActionHandle = MSF_WIDGET_ACTION_CREATE( MSF_MODID_MEA, MEA_GET_STR_ID(MEA_STR_ID_RSK_NO), MsfCancel, 0, MSF_ACTION_PROPERTY_ENABLED); #else meaConfirmDialog.cancelActionHandle = MSF_WIDGET_ACTION_CREATE( MSF_MODID_MEA, MEA_GET_STR_ID(MEA_STR_ID_CANCEL), MsfCancel, 0, MSF_ACTION_PROPERTY_ENABLED); #endif /* WAP_SUPPORT */ if (0 > MSF_WIDGET_ADD_ACTION(meaConfirmDialog.dialogHandle, meaConfirmDialog.cancelActionHandle)) { (void)MSF_WIDGET_RELEASE(meaConfirmDialog.dialogHandle); (void)MSF_WIDGET_RELEASE(meaConfirmDialog.okActionHandle); memset(&meaConfirmDialog, 0 , sizeof(MeaConfirmDialog)); return FALSE; } /* Display the dialog */ if (0 <= MSF_WIDGET_SCREEN_ADD_WINDOW(meaGetScreenHandle(), meaConfirmDialog.dialogHandle, meaGetPosLeftTop(), meaGetScreenHandle(), 0)) { (void)MSF_WIDGET_SET_IN_FOCUS(meaGetScreenHandle(), TRUE); (void)MSF_WIDGET_SET_IN_FOCUS(meaConfirmDialog.dialogHandle, TRUE); } else { (void)MSF_WIDGET_RELEASE(meaConfirmDialog.dialogHandle); (void)MSF_WIDGET_RELEASE(meaConfirmDialog.okActionHandle); (void)MSF_WIDGET_RELEASE(meaConfirmDialog.cancelActionHandle); memset(&meaConfirmDialog, 0 , sizeof(MeaConfirmDialog)); return FALSE; } return TRUE; }
/*! * \brief Creates the GUI for read or delivery reports. * * \param titleStrId The form title. * \param from The from address. * \param subject The subject. * \param statusStrId The status of the message. * \param date The date of the message * \return TRUE if successful, otherwise FALSE. *****************************************************************************/ MSF_BOOL meaCreateMvRrDrView(MSF_UINT32 titleStrId, const char *from, const char *subject, MSF_UINT32 statusStrId, MmsTimeSec rDate) { ctk_screen_handle scrid; kal_uint8 *text; int text_size; MYTIME time; MSF_UINT16* dateOrTimeString; MeaAddrType addrType; char *name = NULL; if (0 != meaMvRrDrView.formHandle) { /* Delete the GUI so that all resources are de-allocated */ meaDeleteMvRrDrView(); } memset(&meaMvRrDrView, 0, sizeof(meaMvRrDrView)); /* Prepare text */ text_size = 150; /* The default size. widget_ucs2str_append_* will realloc the buffer on necessary */ text = MEA_ALLOC(text_size); widget_utf8_to_ucs2_string(text, text_size, (kal_uint8*) ""); text = widget_ucs2str_append_id(MSF_MODID_MEA, text, &text_size, (MSF_UINT16)titleStrId); text = widget_ucs2str_append_utf8(MSF_MODID_MEA, text, &text_size, (kal_uint8*)"\n\n"); /* To */ text = widget_ucs2str_append_id(MSF_MODID_MEA, text, &text_size, MEA_STR_ID_TO); text = widget_ucs2str_append_utf8(MSF_MODID_MEA, text, &text_size, (kal_uint8*)":\n"); if (MEA_ADDR_TYPE_PLMN == (addrType = meaGetAddrType(from))) { name = meaLookupNameFromPHB((char *)from); text = widget_ucs2str_append_utf8(MSF_MODID_MEA, text, &text_size, (kal_uint8*)name); } else { text = widget_ucs2str_append_utf8(MSF_MODID_MEA, text, &text_size, (kal_uint8*)from); } text = widget_ucs2str_append_utf8(MSF_MODID_MEA, text, &text_size, (kal_uint8*)"\x1B\n"); /* Subject */ text = widget_ucs2str_append_id(MSF_MODID_MEA, text, &text_size, MEA_STR_ID_SUBJECT); text = widget_ucs2str_append_utf8(MSF_MODID_MEA, text, &text_size, (kal_uint8*)":\n"); if (subject) { text = widget_ucs2str_append_utf8(MSF_MODID_MEA, text, &text_size, (kal_uint8*)subject); } else { text = widget_ucs2str_append_id(MSF_MODID_MEA, text, &text_size, MEA_STR_ID_NO_SUBJECT); } text = widget_ucs2str_append_utf8(MSF_MODID_MEA, text, &text_size, (kal_uint8*)"\x1B\n"); /* Date */ text = widget_ucs2str_append_id(MSF_MODID_MEA, text, &text_size, MEA_STR_ID_DATE); text = widget_ucs2str_append_utf8(MSF_MODID_MEA, text, &text_size, (kal_uint8*)"\n"); dateOrTimeString = MEA_ALLOC(MEA_MAX_DATE_SIZE); rDate += (HDIa_timeGetTimeZone() * 60); mmi_dt_utc_sec_2_mytime((kal_int32)rDate, &time, KAL_TRUE); date_string(&time, dateOrTimeString, DT_IDLE_SCREEN); text = widget_ucs2str_append_ucs2(MSF_MODID_MEA, text, &text_size, (kal_uint8 *)dateOrTimeString); text = widget_ucs2str_append_utf8(MSF_MODID_MEA, text, &text_size, (kal_uint8*)"\n"); time_string(&time, dateOrTimeString, DT_IDLE_SCREEN); text = widget_ucs2str_append_ucs2(MSF_MODID_MEA, text, &text_size, (kal_uint8 *)dateOrTimeString); MEA_FREE(dateOrTimeString); text = widget_ucs2str_append_utf8(MSF_MODID_MEA, text, &text_size, (kal_uint8*)"\x1B\n"); /* Status */ text = widget_ucs2str_append_id(MSF_MODID_MEA, text, &text_size, MEA_STR_ID_STATUS); text = widget_ucs2str_append_utf8(MSF_MODID_MEA, text, &text_size, (kal_uint8*)"\n"); text = widget_ucs2str_append_id(MSF_MODID_MEA, text, &text_size, (MSF_UINT16)statusStrId); /* Create widow */ meaMvRrDrView.formHandle = HDIa_widgetExtCreateTextViewSeparator(MSF_MODID_MEA, text, (MSF_UINT16)titleStrId, 0); MEA_FREE(text); meaAddWidgetList(meaMvRrDrView.formHandle); /* Set Key */ scrid = HDIa_widgetCtkGetScreenHandle(meaMvRrDrView.formHandle); #ifdef __UNIFIED_MSG_SUPPORT__ ctk_screen_addRSK_UA(scrid, STR_GLOBAL_BACK, IMG_GLOBAL_BACK, NULL, meaMvDrViewOk, KAL_TRUE); ctk_screen_add_key_UA(scrid, KEY_LEFT_ARROW, NULL, meaMvDrViewOk, KAL_TRUE); ctk_screen_addLSK_UA(scrid, MEA_STR_ID_OPTIONS, IMG_GLOBAL_OK, NULL, handleMvPropOptionAction, KAL_TRUE); #else ctk_screen_addLSK_UA(scrid, STR_GLOBAL_OK, IMG_GLOBAL_OK, NULL, meaMvDrViewOk, KAL_TRUE); //ctk_screen_add_key_UA(scrid, KEY_LEFT_ARROW, NULL, meaMvPropViewOnlyGoBack, KAL_TRUE); #endif return meaDisplayWindow(meaMvRrDrView.formHandle, meaGetPosLeftTop()); }
/*! * \brief Creates a input form. * * \param item The type of input form to create. * \param titleStrHandle The title of the form. * \return TRUE of successful, otherwise FALSE: *****************************************************************************/ MSF_BOOL meaCreateInputForm(const MeaInputItem *item, MSF_UINT32 titleStrHandle) { int i; MsfStringHandle strHandle; MeaInputForm *inst; MsfActionHandle actionHandle; const MsfSize maxSize = {MEA_GADGET_DEF_HEIGHT, MEA_GADGET_DEF_WIDTH}; MsfSize newSize = {0, 0}; actionHandle = 0; if (NULL == (inst = createInstance(item))) { MSF_LOG_MSG_OFF((MSF_LOG_DETAIL_HIGH, MSF_MODID_MEA, MAUIFORM_46E7974CE7354600D97E60808E9536EF, "(%s) (%d) Input form instance is busy!\n", __FILE__, __LINE__)); return FALSE; } /* Do not copy the list of elements */ inst->item.items = NULL; /* Create gadget */ switch(item->type) { case MEA_SINGLE_LINE_INPUT: /* Create string handle */ if (NULL != item->text) { if (0 == (strHandle = MSF_WIDGET_STRING_CREATE(MSF_MODID_MEA, item->text, MsfUtf8, strlen(item->text) + 1, 0))) { return FALSE; } } else { if (0 == (strHandle = MSF_WIDGET_STRING_CREATE(MSF_MODID_MEA, "", MsfUtf8, 1, 0))) { return FALSE; } } if (0 == (inst->winHandle = MSF_WIDGET_FORM_CREATE( MSF_MODID_MEA, NULL, 0, 0))) { (void)MSF_WIDGET_RELEASE(strHandle); return FALSE; } if (0 == (inst->gadgetHandle = MSF_WIDGET_TEXT_INPUT_CREATE(MSF_MODID_MEA, meaGetEmptyStringHandle(), strHandle, item->textType, (int)item->maxTextSize, TRUE, NULL, MSF_GADGET_PROPERTY_FOCUS, 0))) { (void)MSF_WIDGET_RELEASE(strHandle); (void)MSF_WIDGET_RELEASE(inst->winHandle); inst->winHandle = 0; } /* Calculate optimal size of gadget */ meaCalculateStringGadgetSize(inst->winHandle, inst->gadgetHandle, strHandle, (MsfPosition*)&meaInputPos, (MsfSize*)&maxSize, &newSize, FALSE); (void)MSF_WIDGET_SET_SIZE(inst->gadgetHandle, &newSize); (void)MSF_WIDGET_RELEASE(strHandle); if (0 > MSF_WIDGET_WINDOW_ADD_GADGET(inst->winHandle, inst->gadgetHandle, NULL, (MsfAlignment *)&meaInputPos)) { (void)MSF_WIDGET_RELEASE(inst->winHandle); inst->winHandle = 0; (void)MSF_WIDGET_RELEASE(inst->gadgetHandle); inst->gadgetHandle = 0; return FALSE; } break; case MEA_TEXT_INPUT: /* Create string handle */ if (NULL != item->text) { if (0 == (strHandle = MSF_WIDGET_STRING_CREATE(MSF_MODID_MEA, item->text, MsfUtf8, strlen(item->text) + 1, 0))) { return FALSE; } } else { if (0 == (strHandle = MSF_WIDGET_STRING_CREATE(MSF_MODID_MEA, "", MsfUtf8, 1, 0))) { return FALSE; } } /* Create editor */ if (0 == (inst->winHandle = MSF_WIDGET_EDITOR_CREATE( MSF_MODID_MEA, meaGetEmptyStringHandle(), strHandle, item->textType, (int)item->maxTextSize, (MEA_TEXT_INPUT == item->type), NULL, 0, 0))) { (void)MSF_WIDGET_RELEASE(strHandle); return FALSE; } (void)MSF_WIDGET_RELEASE(strHandle); break; case MEA_RADIO_BUTTON_INPUT: /* Create radio button list */ if (0 == (inst->winHandle = MSF_WIDGET_MENU_CREATE( MSF_MODID_MEA, MsfExclusiveChoice, NULL, 0, NULL, MSF_CHOICE_ELEMENT_STRING_1 | MSF_CHOICE_ELEMENT_ICON, 0, 0))) { return FALSE; } /* Add items to the list */ for(i = 0; 0 != item->items[i]; i++) { if (0 > MSF_WIDGET_CHOICE_SET_ELEMENT(inst->winHandle, i, item->items[i], 0, 0, 0, TRUE)) { (void)MSF_WIDGET_RELEASE(inst->winHandle); return FALSE; } } /* Set selected index */ if ((inst->item.selectedItem < i) && (i >= 0)) { (void)MSF_WIDGET_CHOICE_SET_ELEM_STATE(inst->winHandle, inst->item.selectedItem, MSF_CHOICE_ELEMENT_SELECTED); } else { MSF_LOG_MSG_OFF((MSF_LOG_DETAIL_HIGH, MSF_MODID_MEA, MAUIFORM_7C3400E063A6C6DC06716EB479BBE41B, "(%s) (%d) erroneous selected index!\n", __FILE__, __LINE__)); } break; case MEA_SELECT_INPUT: actionHandle = MSF_WIDGET_ACTION_CREATE(MSF_MODID_MEA, MEA_GET_STR_ID(MEA_STR_ID_OK), MsfSelect, 0, MSF_ACTION_PROPERTY_ENABLED); if (0 == (inst->winHandle = MSF_WIDGET_MENU_CREATE( MSF_MODID_MEA, MsfImplicitChoice, NULL, actionHandle, NULL, MSF_CHOICE_ELEMENT_STRING_1, 0, 0))) { return FALSE; } /* Add items to the list */ for(i = 0; 0 != item->items[i]; i++) { #ifdef WAP_SUPPORT if (0 > MSF_WIDGET_CHOICE_SET_ELEMENT(inst->winHandle, i, item->items[i], 0, meaGetListNumImage(i), 0, TRUE)) #else if (0 > MSF_WIDGET_CHOICE_SET_ELEMENT(inst->winHandle, i, item->items[i], 0, 0, 0, TRUE)) #endif /* WAP_SUPPORT */ { (void)MSF_WIDGET_RELEASE(inst->winHandle); return FALSE; } } /* Set selected index */ if ((inst->item.selectedItem < i) && (i >= 0)) { (void)MSF_WIDGET_CHOICE_SET_ELEM_STATE(inst->winHandle, inst->item.selectedItem, MSF_CHOICE_ELEMENT_SELECTED); } else { MSF_LOG_MSG_OFF((MSF_LOG_DETAIL_HIGH, MSF_MODID_MEA, MAUIFORM_7C3400E063A6C6DC06716EB479BBE41B, "(%s) (%d) erroneous selected index!\n", __FILE__, __LINE__)); } break; } /* Actions */ if (MEA_SELECT_INPUT == item->type) { if (!meaRegisterAction(inst->winHandle, actionHandle, meaHandleOkFormAction, 0, 0)) { (void)MSF_WIDGET_RELEASE(actionHandle); return FALSE; } /* Back action */ if (0 == meaCreateAction(inst->winHandle, MsfBack, meaHandleBackFormAction, 0, 0, MEA_STR_ID_BACK)) { return FALSE; } } else { if (0 == meaCreateAction(inst->winHandle, MsfOk, meaHandleOkFormAction, 0, 0, MEA_STR_ID_OK)) { return FALSE; } /* Cancel action */ if (0 == meaCreateAction(inst->winHandle, MsfCancel, meaHandleBackFormAction, 0, 0, MEA_STR_ID_CANCEL)) { return FALSE; } } /* Set title*/ if (!meaSetTitle(inst->winHandle, titleStrHandle, 0)) { return FALSE; } #ifdef WAP_SUPPORT //MSF_WIDGET_WINDOW_SET_PROPERTIES(inst->winHandle, (int) MSF_WINDOW_PROPERTY_EXT_DISABLE_RIGHT_ARROW | MSF_WINDOW_PROPERTY_TITLE); #endif /* WAP_SUPPORT */ /* Display form */ return meaDisplayWindow(inst->winHandle, meaGetPosLeftTop()); }