EmsMiscell.c
资源名称:mmi.rar [点击查看]
上传用户:lqx1163
上传日期:2014-08-13
资源大小:9183k
文件大小:147k
源码类别:
MTK
开发平台:
C/C++
- U8 minid = 0;
- U8 maxid = 0;
- #endif /* defined(__MMI_IMELODY_SUPPORT__) */
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- PRINT_INFORMATION_2((MMI_TRACE_G6_SMS, "*-------[EmsMiscell.c] GetEmsObjectListDetails -------*n"));
- switch (currEmsObjectDisplayListState)
- {
- case EMS_OBJECT_PICTURE_STATE:
- currMaxEmsObjectList = EmsPictureNum();
- *lskStrID = STR_GLOBAL_VIEW;
- for (index = 0; index < currMaxEmsObjectList; index++)
- {
- strItemListPtr[index] = (PU8) GetString((U16) ManufacturerPictureStrIDs[index]);
- imgItemListPtr[index] = GetEmsObjectDataInsertStatus(index);
- popUpList[index] = GetEmsObjectDataSizeHint(index);
- }
- break;
- case EMS_OBJECT_PREDEFINED_ANIMATION_STATE:
- currMaxEmsObjectList = MAX_EMS_PREDEFINED_ANIMATION;
- *lskStrID = STR_GLOBAL_VIEW;
- for (index = 0; index < currMaxEmsObjectList; index++)
- {
- strItemListPtr[index] = (PU8) GetString((U16) PredefinedAnimationStrIDs[index]);
- imgItemListPtr[index] = EMS_CAN_INSERT_OBJECT_ID;
- popUpList[index] = NULL;
- }
- break;
- #if defined(__MMI_IMELODY_SUPPORT__)
- case EMS_OBJECT_MELODY_STATE:
- EnableDisableAudioPlayback();
- #ifdef MMI_ON_HARDWARE_P
- custom_get_fixed_ems_imelody_range(&minid, &maxid);
- currMaxEmsObjectList = (maxid - minid + 1);
- #else /* MMI_ON_HARDWARE_P */
- currMaxEmsObjectList = EmsMelodyNum();
- #endif /* MMI_ON_HARDWARE_P */
- *lskStrID = STR_GLOBAL_OK;
- for (index = 0; index < currMaxEmsObjectList; index++)
- {
- strItemListPtr[index] = (PU8) GetString((U16) ManufacturerMelodiesStrIDs[index]);
- imgItemListPtr[index] = GetEmsObjectDataInsertStatus(index);
- popUpList[index] = GetEmsObjectDataSizeHint(index);
- }
- break;
- #endif /* defined(__MMI_IMELODY_SUPPORT__) */
- case EMS_OBJECT_PREDEFINED_SOUND_STATE:
- currMaxEmsObjectList = MAX_EMS_PREDEFINED_SOUND;
- *lskStrID = STR_GLOBAL_OK;
- for (index = 0; index < currMaxEmsObjectList; index++)
- {
- strItemListPtr[index] = (PU8) GetString((U16) PredefinedSoundStrIDs[index]);
- imgItemListPtr[index] = EMS_CAN_INSERT_OBJECT_ID;
- popUpList[index] = NULL;
- }
- break;
- default:
- currMaxEmsObjectList = 0;
- break;
- }
- }
- /*****************************************************************************
- * FUNCTION
- * EntryEMSObjectList
- * DESCRIPTION
- * Entry object list screen
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- extern void ShowCategoryEMSScreen(
- U16 title,
- U16 title_icon,
- U16 left_softkey,
- U16 left_softkey_icon,
- U16 right_softkey,
- U16 right_softkey_icon,
- S32 num_of_symbols,
- MMI_ID_TYPE *symbols,
- MMI_ID_TYPE *descriptions,
- S32 highlighted_item,
- U8 *history_buffer);
- extern U16 EMS_predefined_images[];
- extern U16 EMS_predefined_animations[];
- static void RegisterLskAndRightArrowHandler(void);
- static void RegisterEndKeyForPreviewEmsObjectScrnHandler(void);
- static U16 GetLskStringID(void);
- static U16 GetLskImageID(void);
- void EntryEMSObjectList(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U16 lskStrID = 0;
- U8 *guiBuffer = NULL;
- U8 *strItemList[MAX_EMS_OBJECT_LIST_DISPLAY
- /* MTK Joy added for customization, 1014 */
- #if defined(__MMI_IMELODY_SUPPORT__)
- + MAXIMUM_DOWNLOAD_AUDIO + MAXIMUM_COMPOSED_RINGTONE
- #endif
- /* MTK end */
- ];
- U16 imgItemList[MAX_EMS_OBJECT_LIST_DISPLAY
- /* MTK Joy added for customization, 1014 */
- #if defined(__MMI_IMELODY_SUPPORT__)
- + MAXIMUM_DOWNLOAD_AUDIO + MAXIMUM_COMPOSED_RINGTONE
- #endif
- /* MTK end */
- ];
- U8 *popUpList[MAX_EMS_OBJECT_LIST_DISPLAY
- /* MTK Joy added for customization, 1014 */
- #if defined(__MMI_IMELODY_SUPPORT__)
- + MAXIMUM_DOWNLOAD_AUDIO + MAXIMUM_COMPOSED_RINGTONE
- #endif
- /* MTK end */
- ];
- #if (defined(MMI_ON_HARDWARE_P) && defined(__MMI_FILE_MANAGER__))
- U16 driveName;
- S8 temp[4];
- UI_character_type dir_ems_root[4];
- S8 emsObjectFileNameBuf[(MAX_EMS_DOWNLOAD_OBJECT_FILE_LEN + 1) * ENCODING_LENGTH] = {0, 0};
- FMGR_FILTER filter;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- driveName = MMI_PUBLIC_DRV;
- sprintf(temp, "%c:\", (S8) driveName);
- AnsiiToUnicodeString((S8*) dir_ems_root, temp);
- pfnUnicodeStrcpy((S8*) emsObjectFileNameBuf, (S8*) dir_ems_root);
- #endif /* (defined(MMI_ON_HARDWARE_P) && defined(__MMI_FILE_MANAGER__)) */
- switch (currEmsObjectDisplayListState)
- {
- #if (defined(MMI_ON_HARDWARE_P) && defined(__MMI_FILE_MANAGER__))
- case EMS_OBJECT_MY_PICTURE_STATE:
- /* [Bear] 2004/6/23 - begin */
- FMGR_FILTER_INIT(&filter);
- FMGR_FILTER_SET(&filter, FMGR_TYPE_EMS);
- FMGR_FILTER_SET(&filter, FMGR_TYPE_FOLDER);
- FMGR_FILTER_SET(&filter, FMGR_TYPE_FOLDER_DOT);
- pfnUnicodeStrcat((S8*) emsObjectFileNameBuf, (S8*) FMGR_DEFAULT_FOLDER_IMAGES);
- mmi_fmgr_select_path_and_enter(
- APP_MESSAGES,
- FMGR_SELECT_FILE,
- filter,
- (PS8) emsObjectFileNameBuf,
- (PsExtFuncPtr) mmi_ems_preview_object_from_fm);
- /* [Bear] 2004/6/23 - end */
- break;
- case EMS_OBJECT_MY_ANIMATION_STATE:
- /* [Bear] 2004/6/23 - begin */
- FMGR_FILTER_INIT(&filter);
- FMGR_FILTER_SET(&filter, FMGR_TYPE_ANM);
- FMGR_FILTER_SET(&filter, FMGR_TYPE_FOLDER);
- FMGR_FILTER_SET(&filter, FMGR_TYPE_FOLDER_DOT);
- pfnUnicodeStrcat((S8*) emsObjectFileNameBuf, (S8*) FMGR_DEFAULT_FOLDER_IMAGES);
- mmi_fmgr_select_path_and_enter(
- APP_MESSAGES,
- FMGR_SELECT_FILE,
- filter,
- (PS8) emsObjectFileNameBuf,
- (PsExtFuncPtr) mmi_ems_preview_object_from_fm);
- /* [Bear] 2004/6/23 - end */
- break;
- #if defined(__MMI_IMELODY_SUPPORT__)
- case EMS_OBJECT_MY_MELODY_STATE:
- /* [Bear] 2004/6/23 - begin */
- FMGR_FILTER_INIT(&filter);
- FMGR_FILTER_SET(&filter, FMGR_TYPE_IMY);
- FMGR_FILTER_SET(&filter, FMGR_TYPE_FOLDER);
- FMGR_FILTER_SET(&filter, FMGR_TYPE_FOLDER_DOT);
- pfnUnicodeStrcat((S8*) emsObjectFileNameBuf, (S8*) FMGR_DEFAULT_FOLDER_AUDIO);
- mmi_fmgr_select_path_and_enter(
- APP_MESSAGES,
- FMGR_SELECT_FILE,
- filter,
- (PS8) emsObjectFileNameBuf,
- (PsExtFuncPtr) mmi_ems_preview_object_from_fm);
- break;
- #endif /* defined(__MMI_IMELODY_SUPPORT__) */
- #else /* (defined(MMI_ON_HARDWARE_P) && defined(__MMI_FILE_MANAGER__)) */
- case EMS_OBJECT_MY_PICTURE_STATE:
- case EMS_OBJECT_MY_ANIMATION_STATE:
- #if defined(__MMI_IMELODY_SUPPORT__)
- case EMS_OBJECT_MY_MELODY_STATE:
- #endif
- #endif /* (defined(MMI_ON_HARDWARE_P) && defined(__MMI_FILE_MANAGER__)) */
- case EMS_OBJECT_PICTURE_STATE:
- case EMS_OBJECT_MELODY_STATE:
- case EMS_OBJECT_PREDEFINED_SOUND_STATE:
- #if !defined(__MMI_MAINLCD_176X220__) && !defined(__MMI_MAINLCD_240X320__)
- case EMS_OBJECT_PREDEFINED_ANIMATION_STATE:
- #endif
- GetEmsObjectDisplayListDetails(&lskStrID, strItemList, imgItemList, popUpList);
- if (currMaxEmsObjectList > 0)
- {
- #ifdef UI_SMALL_IMAGE_SELECTOR_SCREEN
- #if !defined(__MMI_MAINLCD_176X220__) && !defined(__MMI_MAINLCD_240X320__)
- if (currEmsObjectDisplayListState == EMS_OBJECT_PICTURE_STATE ||
- currEmsObjectDisplayListState == EMS_OBJECT_PREDEFINED_ANIMATION_STATE)
- #else /* !defined(__MMI_MAINLCD_176X220__) && !defined(__MMI_MAINLCD_240X320__) */
- if (currEmsObjectDisplayListState == EMS_OBJECT_PICTURE_STATE)
- #endif /* !defined(__MMI_MAINLCD_176X220__) && !defined(__MMI_MAINLCD_240X320__) */
- {
- enable_resized_small_screen(); /* small screen is only applicable to picture and animation */
- }
- else
- {
- disable_resized_small_screen(); /* small screen is not applicable to sound and melody */
- }
- if (whether_no_small_screen())
- {
- EntryNewScreen(SCR_ID_MSG_EMS_PREVIEW_OBJECT, mmi_msg_exit_generic, EntryEMSObjectList, NULL);
- guiBuffer = GetCurrGuiBuffer(SCR_ID_MSG_EMS_PREVIEW_OBJECT);
- RegisterCategory144ObjectLoader(CallBackLoadUserDefinedObjectDataBuffPtr);
- SetMessagesCurrScrnID(SCR_ID_MSG_EMS_PREVIEW_OBJECT);
- ShowImageSelectorScreen(
- GetString(STR_GLOBAL_SELECT),
- IMG_SMS_ENTRY_SCRN_CAPTION,
- GetLskStringID(),
- GetLskImageID(),
- STR_GLOBAL_BACK,
- IMG_GLOBAL_BACK,
- currEmsObjectDisplayListState,
- currMaxEmsObjectList,
- NULL,
- preDefinedObjectIds,
- userDefinedObjectDataPtrs,
- (PS32) & currObjectListHiliteIndex,
- guiBuffer);
- RegisterLskAndRightArrowHandler();
- RegisterEndKeyForPreviewEmsObjectScrnHandler();
- SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
- }
- else
- {
- restore_small_screen();
- #endif /* UI_SMALL_IMAGE_SELECTOR_SCREEN */
- EntryNewScreen(SCR_ID_MSG_EMS_OBJECT_LIST, ExitEMSObjectList, EntryEMSObjectList, NULL);
- RegisterHighlightHandler(GetEmsObjectHiliteIndex);
- guiBuffer = GetCurrGuiBuffer(SCR_ID_MSG_EMS_OBJECT_LIST);
- if (guiBuffer != NULL)
- {
- change_list_menu_category_history(
- guiBuffer,
- currObjectListHiliteIndex,
- currMaxEmsObjectList,
- 0);
- }
- else
- {
- currObjectListHiliteIndex = 0;
- }
- SetMessagesCurrScrnID(SCR_ID_MSG_EMS_OBJECT_LIST);
- ShowCategory53Screen(
- STR_EMS_OBJECT_LIST,
- IMG_SMS_ENTRY_SCRN_CAPTION,
- lskStrID,
- IMG_GLOBAL_OK,
- STR_GLOBAL_BACK,
- IMG_GLOBAL_BACK,
- currMaxEmsObjectList,
- (U8 **) strItemList,
- imgItemList,
- (U8 **) popUpList,
- 0,
- currObjectListHiliteIndex,
- guiBuffer);
- SetLeftSoftkeyFunction(EntryScrPreviewEmsObject, KEY_EVENT_UP);
- SetKeyHandler(EntryScrPreviewEmsObject, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
- SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
- SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
- #ifdef UI_SMALL_IMAGE_SELECTOR_SCREEN
- }
- #endif
- }
- else
- {
- DisplayPopup(
- (PU8) GetString(STR_GLOBAL_EMPTY),
- IMG_GLOBAL_EMPTY,
- 1,
- MESSAGES_POPUP_TIME_OUT,
- (U8) EMPTY_LIST_TONE);
- }
- break;
- #if defined(__MMI_MAINLCD_176X220__) || defined(__MMI_MAINLCD_240X320__) /* 041205 Calvin modified */
- case EMS_OBJECT_PREDEFINED_ANIMATION_STATE:
- {
- MMI_ID_TYPE *imglist = (currEmsObjectDisplayListState == EMS_OBJECT_PICTURE_STATE) ?
- EMS_predefined_images : EMS_predefined_animations;
- MMI_ID_TYPE *strlist = (currEmsObjectDisplayListState == EMS_OBJECT_PICTURE_STATE) ?
- ManufacturerPictureStrIDs : PredefinedAnimationStrIDs;
- S32 objectcount = (currEmsObjectDisplayListState == EMS_OBJECT_PICTURE_STATE) ?
- EmsPictureNum() : MAX_EMS_PREDEFINED_ANIMATION;
- EntryNewScreen(SCR_ID_MSG_EMS_OBJECT_LIST, mmi_msg_exit_generic, EntryEMSObjectList, NULL);
- guiBuffer = GetCurrGuiBuffer(SCR_ID_MSG_EMS_OBJECT_LIST);
- if (guiBuffer == NULL)
- {
- currObjectListHiliteIndex = 0;
- }
- SetMessagesCurrScrnID(SCR_ID_MSG_EMS_OBJECT_LIST);
- RegisterHighlightHandler(GetEmsObjectHiliteIndex);
- ShowCategoryEMSScreen(
- STR_EMS_OBJECT_LIST,
- IMG_SMS_ENTRY_SCRN_CAPTION,
- STR_GLOBAL_OK,
- IMG_GLOBAL_OK,
- STR_GLOBAL_BACK,
- IMG_GLOBAL_BACK,
- objectcount,
- imglist,
- strlist,
- currObjectListHiliteIndex,
- guiBuffer);
- SetLeftSoftkeyFunction(PreviewEmsObjectIsDone, KEY_EVENT_UP);
- SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
- }
- break;
- #endif /* defined(__MMI_MAINLCD_176X220__) || defined(__MMI_MAINLCD_240X320__) */
- }
- }
- /*****************************************************************************
- * FUNCTION
- * ExitEMSObjectList
- * DESCRIPTION
- * Exit object list screen
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void ExitEMSObjectList(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- /* history currHistory; */
- currObjectListHiliteIndex = GetHighlightedItem();
- StopEmsObjectIMelodyAndSoundIfAny();
- /* currHistory.scrnID = SCR_ID_MSG_EMS_OBJECT_LIST; */
- g_msg_cntx.MessagesScrnIdDelUptoHistoryNodes = SCR_ID_MSG_EMS_OBJECT_LIST;
- //currHistory.entryFuncPtr = EntryEMSObjectList;
- //memset (currHistory.inputBuffer, 0, ENCODING_LENGTH);
- //GetCategoryHistory (currHistory.guiBuffer);
- //AddHistory (currHistory);
- }
- /*****************************************************************************
- * FUNCTION
- * RegisterLskAndRightArrowHandler
- * DESCRIPTION
- * Register LSK handler
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- static void RegisterLskAndRightArrowHandler(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- SetLeftSoftkeyFunction(PreviewEmsObjectIsDone, KEY_EVENT_UP);
- }
- /*****************************************************************************
- * FUNCTION
- * RegisterEndKeyForPreviewEmsObjectScrnHandler
- * DESCRIPTION
- * Register End key handler
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- static void RegisterEndKeyForPreviewEmsObjectScrnHandler(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- }
- /*****************************************************************************
- * FUNCTION
- * GetLskStringID
- * DESCRIPTION
- * Get LSK string
- * PARAMETERS
- * void
- * RETURNS
- * LSK string
- *****************************************************************************/
- static U16 GetLskStringID(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- return STR_GLOBAL_OK;
- }
- /*****************************************************************************
- * FUNCTION
- * GetLskImageID
- * DESCRIPTION
- * Get LSK image
- * PARAMETERS
- * void
- * RETURNS
- * LSK image
- *****************************************************************************/
- static U16 GetLskImageID(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- return IMG_GLOBAL_OK;
- }
- /*****************************************************************************
- * FUNCTION
- * EntryScrPreviewEmsObject
- * DESCRIPTION
- * Entry preview object screen
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void EntryScrPreviewEmsObject(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U32 objectType = 0;
- U8 *guiBuffer = NULL;
- U8 isPictureOrAnimation = FALSE;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- switch (currEmsObjectDisplayListState)
- {
- case EMS_OBJECT_PICTURE_STATE:
- objectType = EMS_PREDEFINED_PICTURE;
- isPictureOrAnimation = TRUE;
- break;
- case EMS_OBJECT_MY_PICTURE_STATE:
- objectType = EMS_USERDEFINED_PICTURE;
- isPictureOrAnimation = TRUE;
- break;
- case EMS_OBJECT_PREDEFINED_ANIMATION_STATE:
- objectType = EMS_PREDEFINED_ANIMATION;
- isPictureOrAnimation = TRUE;
- break;
- case EMS_OBJECT_MY_ANIMATION_STATE:
- objectType = EMS_USERDEFINED_ANIMATION;
- isPictureOrAnimation = TRUE;
- break;
- #if defined(__MMI_IMELODY_SUPPORT__)
- case EMS_OBJECT_MELODY_STATE:
- objectType = EMS_PREDEFINED_MELODY | CATEGORY144_DISABLE_PREVIEW;
- isPictureOrAnimation = FALSE;
- break;
- case EMS_OBJECT_MY_MELODY_STATE:
- objectType = EMS_USERDEFINED_MELODY | CATEGORY144_DISABLE_PREVIEW;
- isPictureOrAnimation = FALSE;
- break;
- #endif /* defined(__MMI_IMELODY_SUPPORT__) */
- case EMS_OBJECT_PREDEFINED_SOUND_STATE:
- objectType = EMS_PREDEFINED_SOUND | CATEGORY144_DISABLE_PREVIEW;
- isPictureOrAnimation = FALSE;
- break;
- }
- if (isPictureOrAnimation == TRUE)
- {
- EntryNewScreen(SCR_ID_MSG_EMS_PREVIEW_OBJECT, mmi_msg_exit_generic, EntryScrPreviewEmsObject, NULL);
- guiBuffer = GetCurrGuiBuffer(SCR_ID_MSG_EMS_PREVIEW_OBJECT);
- if (currEmsObjectDisplayListState == EMS_OBJECT_PREDEFINED_ANIMATION_STATE)
- {
- emsObjectNameWhenPreview = (U8*) GetString(PredefinedAnimationStrIDs[currObjectListHiliteIndex]);
- RegisterHighlightHandler(ChangeEmsObjectTitleWithIndex);
- }
- else
- {
- RegisterCategory144ObjectLoader(CallBackLoadUserDefinedObjectDataBuffPtr);
- }
- SetMessagesCurrScrnID(SCR_ID_MSG_EMS_PREVIEW_OBJECT);
- ShowCategory144Screen(
- emsObjectNameWhenPreview,
- IMG_SMS_ENTRY_SCRN_CAPTION,
- GetLskStringID(),
- GetLskImageID(),
- STR_GLOBAL_BACK,
- IMG_GLOBAL_BACK,
- objectType,
- currMaxEmsObjectList,
- NULL,
- preDefinedObjectIds,
- FALSE,
- userDefinedObjectDataPtrs,
- (PS32) & currObjectListHiliteIndex,
- guiBuffer);
- RegisterLskAndRightArrowHandler();
- RegisterEndKeyForPreviewEmsObjectScrnHandler();
- SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
- }
- else
- {
- ExitCategoryFunction();
- RegisterCategory144ObjectLoader(CallBackLoadUserDefinedObjectDataBuffPtr);
- ShowCategory144Screen(
- (PU8) GetString(STR_PREVIEW_EMS_OBJECT),
- IMG_SMS_ENTRY_SCRN_CAPTION,
- STR_GLOBAL_OK,
- IMG_GLOBAL_OK,
- STR_GLOBAL_BACK,
- IMG_GLOBAL_BACK,
- objectType,
- currMaxEmsObjectList,
- NULL,
- preDefinedObjectIds,
- FALSE,
- userDefinedObjectDataPtrs,
- (PS32) & currObjectListHiliteIndex,
- guiBuffer);
- PreviewEmsObjectIsDone();
- }
- }
- /*****************************************************************************
- * FUNCTION
- * ChangeEmsObjectTitleWithIndex
- * DESCRIPTION
- * This function is just for template.
- * PARAMETERS
- * index [IN] Object index
- * RETURNS
- * void
- *****************************************************************************/
- void ChangeEmsObjectTitleWithIndex(S32 index)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- emsObjectNameWhenPreview = (U8*) GetString(PredefinedAnimationStrIDs[index]);
- ChangeTitleString(emsObjectNameWhenPreview);
- draw_title();
- }
- /*****************************************************************************
- * FUNCTION
- * GetEmsObjectHiliteIndex
- * DESCRIPTION
- * Get object highlight index
- * PARAMETERS
- * index [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void GetEmsObjectHiliteIndex(S32 index)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- currObjectListHiliteIndex = index;
- switch (currEmsObjectDisplayListState)
- {
- #if defined(__MMI_IMELODY_SUPPORT__)
- case EMS_OBJECT_MELODY_STATE:
- StopTimer(MESSAGES_EMS_OBJECT_PLAY_TIMER_ID);
- EMSObjectStopPlayBack();
- if (ReadDownloadObjectDataFromFileSystem(index))
- {
- StartTimer(MESSAGES_EMS_OBJECT_PLAY_TIMER_ID, MESSAGES_ONE_SEC_TIME_OUT, PlayEmsManufacturerIMelody);
- }
- break;
- #endif /* defined(__MMI_IMELODY_SUPPORT__) */
- case EMS_OBJECT_PREDEFINED_SOUND_STATE:
- StopTimer(MESSAGES_EMS_OBJECT_PLAY_TIMER_ID);
- EMSObjectStopPlayBack();
- StartTimer(MESSAGES_EMS_OBJECT_PLAY_TIMER_ID, MESSAGES_ONE_SEC_TIME_OUT, PlayEmsManufacturerSound);
- break;
- }
- }
- /* MTK Joy added for customization, 1014 */
- #if defined(__MMI_IMELODY_SUPPORT__)
- /*****************************************************************************
- * FUNCTION
- * PlayEmsManufacturerIMelody
- * DESCRIPTION
- * Play manufacturer melody
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void PlayEmsManufacturerIMelody(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- StopTimer(MESSAGES_EMS_OBJECT_PLAY_TIMER_ID);
- EMSObjectStopPlayBack();
- if (!IsSilentModeActivated())
- #ifdef __MMI_SILENT_MEETING_PROFILE__
- if (!IsMeetingModeActivated())
- #endif
- EMSObjectPlayback(EMS_PREDEFINED_MELODY, userDefinedObjectDataBuff, -1);
- }
- #endif /* defined(__MMI_IMELODY_SUPPORT__) */
- /* MTK end */
- /*****************************************************************************
- * FUNCTION
- * PlayEmsManufacturerSound
- * DESCRIPTION
- * Play manufacturer sound
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void PlayEmsManufacturerSound(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- StopTimer(MESSAGES_EMS_OBJECT_PLAY_TIMER_ID);
- EMSObjectStopPlayBack();
- if (!IsSilentModeActivated())
- #ifdef __MMI_SILENT_MEETING_PROFILE__
- if (!IsMeetingModeActivated())
- #endif
- EMSObjectPlayback(EMS_PREDEFINED_SOUND, NULL, currObjectListHiliteIndex);
- }
- /*****************************************************************************
- * FUNCTION
- * StopEmsObjectIMelodyAndSoundIfAny
- * DESCRIPTION
- * Stop melody/sound
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void StopEmsObjectIMelodyAndSoundIfAny(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- switch (currEmsObjectDisplayListState)
- {
- #if defined(__MMI_IMELODY_SUPPORT__)
- case EMS_OBJECT_MELODY_STATE:
- StopTimer(MESSAGES_EMS_OBJECT_PLAY_TIMER_ID);
- EMSObjectStopPlayBack();
- break;
- #endif /* defined(__MMI_IMELODY_SUPPORT__) */
- case EMS_OBJECT_PREDEFINED_SOUND_STATE:
- StopTimer(MESSAGES_EMS_OBJECT_PLAY_TIMER_ID);
- EMSObjectStopPlayBack();
- break;
- }
- }
- /*****************************************************************************
- * FUNCTION
- * PreviewEmsObjectIsDone
- * DESCRIPTION
- * After preview, add object to message body
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void PreviewEmsObjectIsDone(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- EMSTATUS emsObjectStatus;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if ((currEmsObjectDisplayListState != EMS_OBJECT_PREDEFINED_ANIMATION_STATE) &&
- (currEmsObjectDisplayListState != EMS_OBJECT_PREDEFINED_SOUND_STATE) &&
- (!listOfIsAllowedData[currObjectListHiliteIndex]))
- {
- DisplayPopup(
- (PU8) GetString(STR_EMS_OBJECT_SIZE_NOT_ALLOWED_ID),
- IMG_GLOBAL_UNFINISHED,
- 1,
- MESSAGES_POPUP_TIME_OUT,
- (U8) ERROR_TONE);
- }
- else
- {
- switch (currEmsObjectDisplayListState)
- {
- case EMS_OBJECT_PICTURE_STATE:
- emsObjectStatus = EMS_inputbox_insert_predefined_picture(currObjectListHiliteIndex);
- break;
- case EMS_OBJECT_MY_PICTURE_STATE:
- emsObjectStatus = EMS_inputbox_insert_userdefined_picture(userDefinedObjectDataBuff);
- break;
- case EMS_OBJECT_PREDEFINED_ANIMATION_STATE:
- emsObjectStatus = EMS_inputbox_insert_predefined_animation(currObjectListHiliteIndex);
- break;
- case EMS_OBJECT_MY_ANIMATION_STATE:
- emsObjectStatus = EMS_inputbox_insert_userdefined_animation(userDefinedObjectDataBuff);
- break;
- #if defined(__MMI_IMELODY_SUPPORT__)
- case EMS_OBJECT_MELODY_STATE:
- emsObjectStatus = EMS_inputbox_insert_predefined_melody(currObjectListHiliteIndex);
- break;
- case EMS_OBJECT_MY_MELODY_STATE:
- emsObjectStatus = EMS_inputbox_insert_userdefined_melody(userDefinedObjectDataBuff);
- break;
- #endif /* defined(__MMI_IMELODY_SUPPORT__) */
- case EMS_OBJECT_PREDEFINED_SOUND_STATE:
- emsObjectStatus = EMS_inputbox_insert_predefined_sound(currObjectListHiliteIndex);
- break;
- default:
- emsObjectStatus = EMS_inputbox_insert_predefined_picture(currObjectListHiliteIndex);
- break;
- }
- GoBackToHistory(SCR_ID_MSG_WRITE);
- ErrorHandlingWhileInsertingObject(emsObjectStatus); /* check whetehr it is inserted or not. */
- }
- }
- /*****************************************************************************
- * FUNCTION
- * EntryScrInsertObjectMenu
- * DESCRIPTION
- * Entry insert object screen
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void EntryScrInsertObjectMenu(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U16 numItems = 0;
- PU8 guiBuffer = NULL;
- U16 nStrItemList[MAX_SUB_MENUS];
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- EntryNewScreen(SCR_ID_MSG_EMS_INSERT_OBJECT, mmi_msg_exit_generic, EntryScrInsertObjectMenu, NULL);
- guiBuffer = GetCurrGuiBuffer(SCR_ID_MSG_EMS_INSERT_OBJECT);
- SetParentHandler(EMS_ED_OPT_INS_OBJ);
- RegisterHighlightHandler(ExecuteCurrHiliteHandler);
- numItems = GetNumOfChild(EMS_ED_OPT_INS_OBJ);
- GetSequenceStringIds(EMS_ED_OPT_INS_OBJ, nStrItemList);
- SetMessagesCurrScrnID(SCR_ID_MSG_EMS_INSERT_OBJECT);
- ShowCategory52Screen(
- STR_OPT_INS_OBJECT_MENUENTRY,
- IMG_SMS_ENTRY_SCRN_CAPTION,
- STR_GLOBAL_OK,
- IMG_GLOBAL_OK,
- STR_GLOBAL_BACK,
- IMG_GLOBAL_BACK,
- numItems,
- nStrItemList,
- (U16*) gIndexIconsImageList,
- NULL,
- 0,
- 0,
- guiBuffer);
- }
- /*****************************************************************************
- * FUNCTION
- * HighlightEditOptionInsertObject
- * DESCRIPTION
- * Highlight insert object handler
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void HighlightEditOptionInsertObject(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- ChangeLeftSoftkey(STR_GLOBAL_OK, IMG_SMS_COMMON_NOIMAGE);
- ChangeRightSoftkey(STR_GLOBAL_BACK, IMG_SMS_COMMON_NOIMAGE);
- SetLeftSoftkeyFunction(EntryScrInsertObjectMenu, KEY_EVENT_UP);
- SetKeyHandler(EntryScrInsertObjectMenu, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
- SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
- SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
- }
- /*****************************************************************************
- * FUNCTION
- * HighlightInsObjPicture
- * DESCRIPTION
- * Highlight insert picture handler
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void HighlightInsObjPicture(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- ChangeLeftSoftkey(STR_GLOBAL_OK, IMG_SMS_COMMON_NOIMAGE);
- ChangeRightSoftkey(STR_GLOBAL_BACK, IMG_SMS_COMMON_NOIMAGE);
- SetLeftSoftkeyFunction(EntryEMSObjectList, KEY_EVENT_UP);
- ClearKeyHandler(KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
- SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
- SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
- currEmsObjectDisplayListState = EMS_OBJECT_PICTURE_STATE;
- currObjectListHiliteIndex = 0;
- }
- /*****************************************************************************
- * FUNCTION
- * HighlightInsObjMyPicture
- * DESCRIPTION
- * Highlight insert my picture handler
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void HighlightInsObjMyPicture(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- ChangeLeftSoftkey(STR_GLOBAL_OK, IMG_SMS_COMMON_NOIMAGE);
- ChangeRightSoftkey(STR_GLOBAL_BACK, IMG_SMS_COMMON_NOIMAGE);
- SetLeftSoftkeyFunction(EntryEMSObjectList, KEY_EVENT_UP);
- ClearKeyHandler(KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
- SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
- SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
- currEmsObjectDisplayListState = EMS_OBJECT_MY_PICTURE_STATE;
- }
- /*****************************************************************************
- * FUNCTION
- * HighlightInsObjPredefinedAnimation
- * DESCRIPTION
- * Highlight insert predefined animation handler
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void HighlightInsObjPredefinedAnimation(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- ChangeLeftSoftkey(STR_GLOBAL_OK, IMG_SMS_COMMON_NOIMAGE);
- ChangeRightSoftkey(STR_GLOBAL_BACK, IMG_SMS_COMMON_NOIMAGE);
- SetLeftSoftkeyFunction(EntryEMSObjectList, KEY_EVENT_UP);
- ClearKeyHandler(KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
- SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
- SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
- currEmsObjectDisplayListState = EMS_OBJECT_PREDEFINED_ANIMATION_STATE;
- currMaxEmsObjectList = MAX_EMS_PREDEFINED_ANIMATION;
- }
- /*****************************************************************************
- * FUNCTION
- * HighlightInsObjMyAnimation
- * DESCRIPTION
- * Highlight insert my animation handler
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void HighlightInsObjMyAnimation(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- ChangeLeftSoftkey(STR_GLOBAL_OK, IMG_SMS_COMMON_NOIMAGE);
- ChangeRightSoftkey(STR_GLOBAL_BACK, IMG_SMS_COMMON_NOIMAGE);
- SetLeftSoftkeyFunction(EntryEMSObjectList, KEY_EVENT_UP);
- ClearKeyHandler(KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
- SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
- SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
- currEmsObjectDisplayListState = EMS_OBJECT_MY_ANIMATION_STATE;
- }
- /*****************************************************************************
- * FUNCTION
- * HighlightInsObjMelody
- * DESCRIPTION
- * Highlight insert melody handler
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- /* MTK Joy added for customization, 1014 */
- #if defined(__MMI_IMELODY_SUPPORT__)
- void HighlightInsObjMelody(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- ChangeLeftSoftkey(STR_GLOBAL_OK, IMG_SMS_COMMON_NOIMAGE);
- ChangeRightSoftkey(STR_GLOBAL_BACK, IMG_SMS_COMMON_NOIMAGE);
- SetLeftSoftkeyFunction(EntryEMSObjectList, KEY_EVENT_UP);
- ClearKeyHandler(KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
- #ifdef MMI_ON_WIN32
- SetLeftSoftkeyFunction(PopupNoSupport, KEY_EVENT_UP);
- SetKeyHandler(PopupNoSupport, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
- #endif /* MMI_ON_WIN32 */
- SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
- SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
- currEmsObjectDisplayListState = EMS_OBJECT_MELODY_STATE;
- }
- /*****************************************************************************
- * FUNCTION
- * HighlightInsObjMyMelody
- * DESCRIPTION
- * Highlight insert my melody handler
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void HighlightInsObjMyMelody(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- ChangeLeftSoftkey(STR_GLOBAL_OK, IMG_SMS_COMMON_NOIMAGE);
- ChangeRightSoftkey(STR_GLOBAL_BACK, IMG_SMS_COMMON_NOIMAGE);
- SetLeftSoftkeyFunction(EntryEMSObjectList, KEY_EVENT_UP);
- ClearKeyHandler(KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
- #ifdef MMI_ON_WIN32
- SetLeftSoftkeyFunction(PopupNoSupport, KEY_EVENT_UP);
- SetKeyHandler(PopupNoSupport, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
- #endif /* MMI_ON_WIN32 */
- SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
- SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
- currEmsObjectDisplayListState = EMS_OBJECT_MY_MELODY_STATE;
- }
- #endif /* defined(__MMI_IMELODY_SUPPORT__) */
- /* MTK end */
- /*****************************************************************************
- * FUNCTION
- * HighlightInsObjPredefinedSound
- * DESCRIPTION
- * Highlight insert predefined sound handler
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void HighlightInsObjPredefinedSound(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- ChangeLeftSoftkey(STR_GLOBAL_OK, IMG_SMS_COMMON_NOIMAGE);
- ChangeRightSoftkey(STR_GLOBAL_BACK, IMG_SMS_COMMON_NOIMAGE);
- SetLeftSoftkeyFunction(EntryEMSObjectList, KEY_EVENT_UP);
- ClearKeyHandler(KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
- SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
- SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
- currEmsObjectDisplayListState = EMS_OBJECT_PREDEFINED_SOUND_STATE;
- }
- #if (defined(__MMI_FILE_MANAGER__))
- /*****************************************************************************
- * FUNCTION
- * mmi_ems_add_object_from_fm
- * DESCRIPTION
- * Add object from file manager
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_ems_add_object_from_fm(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- EMSTATUS emsObjectStatus;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- userDefinedObjectDataSize = GetEmsObjectDataSize();
- if (IsAllowed == TRUE)
- {
- switch (currEmsObjectDisplayListState)
- {
- case EMS_OBJECT_MY_PICTURE_STATE:
- emsObjectStatus = EMS_inputbox_insert_userdefined_picture(userDefinedObjectDataBuff);
- break;
- case EMS_OBJECT_MY_ANIMATION_STATE:
- emsObjectStatus = EMS_inputbox_insert_userdefined_animation(userDefinedObjectDataBuff);
- break;
- #if defined(__MMI_IMELODY_SUPPORT__)
- case EMS_OBJECT_MY_MELODY_STATE:
- emsObjectStatus = EMS_inputbox_insert_userdefined_melody(userDefinedObjectDataBuff);
- break;
- #endif /* defined(__MMI_IMELODY_SUPPORT__) */
- default:
- emsObjectStatus = EMS_inputbox_insert_userdefined_picture(userDefinedObjectDataBuff);
- break;
- }
- GoBackToHistory(SCR_ID_MSG_WRITE);
- ErrorHandlingWhileInsertingObject(emsObjectStatus);
- }
- else
- {
- DisplayPopup(
- (PU8) GetString(STR_EMS_OBJECT_SIZE_NOT_ALLOWED_ID),
- IMG_GLOBAL_UNFINISHED,
- 1,
- MESSAGES_POPUP_TIME_OUT,
- (U8) ERROR_TONE);
- }
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_ems_go_back_from_preview_object
- * DESCRIPTION
- * clear screen for file manager preview
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_ems_go_back_from_preview_object(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- GoBackToHistory(SCR_ID_MSG_EMS_INSERT_OBJECT);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_ems_entry_preview_object_from_fm
- * DESCRIPTION
- * Entry preview object screen from file manager
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_ems_entry_preview_object_from_fm(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U32 objectType = 0;
- U8 *guiBuffer = NULL;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- EntryNewScreen(SCR_ID_MSG_EMS_PREVIEW_OBJECT, mmi_msg_exit_generic, mmi_ems_entry_preview_object_from_fm, NULL);
- switch (currEmsObjectDisplayListState)
- {
- case EMS_OBJECT_MY_PICTURE_STATE:
- objectType = EMS_USERDEFINED_PICTURE;
- break;
- case EMS_OBJECT_MY_ANIMATION_STATE:
- objectType = EMS_USERDEFINED_ANIMATION;
- break;
- #if defined(__MMI_IMELODY_SUPPORT__)
- case EMS_OBJECT_MY_MELODY_STATE:
- objectType = EMS_USERDEFINED_MELODY;
- #endif /* defined(__MMI_IMELODY_SUPPORT__) */
- break;
- }
- guiBuffer = GetCurrGuiBuffer(SCR_ID_MSG_EMS_PREVIEW_OBJECT);
- SetMessagesCurrScrnID(SCR_ID_MSG_EMS_PREVIEW_OBJECT);
- emsObjectNameWhenPreview = (U8*) GetString(STR_PREVIEW_EMS_OBJECT);
- currObjectListHiliteIndex = 0;
- userDefinedObjectDataPtrs[0] = userDefinedObjectDataBuff;
- ShowCategory144Screen(
- emsObjectNameWhenPreview,
- IMG_SMS_ENTRY_SCRN_CAPTION,
- STR_GLOBAL_OK,
- IMG_GLOBAL_OK,
- STR_GLOBAL_BACK,
- IMG_GLOBAL_BACK,
- objectType,
- 1,
- NULL,
- preDefinedObjectIds,
- FALSE,
- userDefinedObjectDataPtrs,
- (PS32) & currObjectListHiliteIndex,
- guiBuffer);
- SetLeftSoftkeyFunction(mmi_ems_add_object_from_fm, KEY_EVENT_UP);
- SetRightSoftkeyFunction(mmi_ems_go_back_from_preview_object, KEY_EVENT_UP);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_ems_preview_object_from_fm
- * DESCRIPTION
- * Preview object from file manager
- * PARAMETERS
- * filePath [IN]
- * is_short [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_ems_preview_object_from_fm(PU16 filePath, S32 is_short)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- EMSTATUS emsObjectStatus;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (filePath == NULL)
- {
- GoBackToHistory(SCR_ID_MSG_EMS_INSERT_OBJECT);
- return;
- }
- emsObjectStatus = mmi_ems_fm_open_file((S8*) filePath, currEmsObjectDisplayListState);
- if (emsObjectStatus != EMS_OK)
- {
- ErrorHandlingWhileInsertingObject(emsObjectStatus);
- DeleteUptoScrID(SCR_ID_MSG_EMS_INSERT_OBJECT);
- return;
- }
- else
- {
- mmi_ems_entry_preview_object_from_fm();
- }
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_ems_fm_open_file
- * DESCRIPTION
- * Open file
- * PARAMETERS
- * emsObjectFileNameBuf [IN] File name
- * emsObjectType [IN] Object type
- * RETURNS
- * TRUE: open success, FALSE: open fail
- *****************************************************************************/
- EMSTATUS mmi_ems_fm_open_file(S8 *emsObjectFileNameBuf, EMS_OBJECT_DISPLAY_STATE emsObjectType)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S32 errorCode = 0;
- FILE_HANDLE emsObjectFilePtr = 0;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- MemsetUserDefinedObjectDataBuff();
- emsObjectFilePtr = pfopen(emsObjectFileNameBuf, PFS_READ);
- if (!pfOpenError(emsObjectFilePtr))
- {
- userDefinedObjectDataSize = GetFSFileSize(emsObjectFilePtr);
- switch (emsObjectType)
- {
- #if defined(__MMI_IMELODY_SUPPORT__) /* Pending work here ...abt hint for over sized.. */
- case EMS_OBJECT_MY_MELODY_STATE:
- if (userDefinedObjectDataSize > MAX_EMS_OBJECT_INSERT_SIZE /* 128 bytes */ )
- {
- pfclose(emsObjectFilePtr);
- return EMS_EMS_DATA_EXCEEDED;
- }
- #endif /* defined(__MMI_IMELODY_SUPPORT__) */
- default:
- if (userDefinedObjectDataSize > MAX_CURR_EMS_OBJECT_DATA_BUFF /* bytes */ )
- {
- pfclose(emsObjectFilePtr);
- return EMS_EMS_DATA_EXCEEDED;
- }
- }
- pfread(userDefinedObjectDataBuff, 1, userDefinedObjectDataSize, emsObjectFilePtr, &errorCode);
- pfclose(emsObjectFilePtr);
- if (pfError(errorCode))
- {
- return EMS_UNSPECIFIED_ERROR;
- }
- switch (emsObjectType)
- {
- #if defined(__MMI_IMELODY_SUPPORT__)
- case EMS_OBJECT_MY_MELODY_STATE:
- {
- U8 userDefinedObjectDataBuffTemp[MAX_CURR_EMS_OBJECT_DATA_BUFF];
- EMS_userdefined_melody_attach_header(
- userDefinedObjectDataBuff,
- userDefinedObjectDataBuffTemp,
- &userDefinedObjectDataSize);
- memcpy(userDefinedObjectDataBuff, userDefinedObjectDataBuffTemp, userDefinedObjectDataSize);
- }
- break;
- #endif /* defined(__MMI_IMELODY_SUPPORT__) */
- }
- return EMS_OK;
- }
- return EMS_UNSPECIFIED_ERROR;
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_ems_fm_send_by_ems
- * DESCRIPTION
- * Send by EMS from file manager
- * PARAMETERS
- * emsObjectFileNameBuf [IN] File name
- * emsObjectType [IN] Object type
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_ems_fm_send_by_ems(S8 *emsObjectFileNameBuf, EMS_OBJECT_DISPLAY_STATE emsObjectType)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- EMSTATUS emsObjectStatus;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- currEmsObjectDisplayListState = emsObjectType;
- g_msg_cntx.number_from_phb = 0;
- /* disallow re-entering SMS application when there is a pending SMS job running in the background */
- if (mmi_frm_sms_check_action_pending())
- {
- DisplayPopup(
- (PU8) GetString(STR_SMS_MSG_NOT_READY_YET),
- IMG_GLOBAL_UNFINISHED,
- 1,
- MESSAGES_POPUP_TIME_OUT,
- (U8) ERROR_TONE);
- return;
- }
- emsObjectStatus = mmi_ems_fm_open_file(emsObjectFileNameBuf, emsObjectType);
- if (emsObjectStatus != EMS_OK)
- {
- ErrorHandlingWhileInsertingObject(emsObjectStatus);
- return;
- }
- GetEmsObjectDataSize();
- if (!IsAllowed)
- {
- DisplayPopup(
- (PU8) GetString(STR_EMS_OBJECT_SIZE_NOT_ALLOWED_ID),
- IMG_GLOBAL_UNFINISHED,
- 1,
- MESSAGES_POPUP_TIME_OUT,
- (U8) ERROR_TONE);
- return;
- }
- else
- {
- EMSTATUS emsObjectStatus = EMS_UNSPECIFIED_ERROR;
- #if(UI_DOUBLE_BUFFER_SUPPORT)
- gui_lock_double_buffer();
- #endif
- GetEMSDataForEdit(0, 1); /* Force init */
- g_msg_cntx.sendMessageCase = SEND_CASE_SEND_ONLY;
- mmi_msg_entry_write_msg();
- switch (emsObjectType)
- {
- case EMS_OBJECT_MY_PICTURE_STATE:
- emsObjectStatus = EMS_inputbox_insert_userdefined_picture(userDefinedObjectDataBuff);
- break;
- case EMS_OBJECT_MY_ANIMATION_STATE:
- emsObjectStatus = EMS_inputbox_insert_userdefined_animation(userDefinedObjectDataBuff);
- break;
- #if defined(__MMI_IMELODY_SUPPORT__)
- case EMS_OBJECT_MY_MELODY_STATE:
- emsObjectStatus = EMS_inputbox_insert_userdefined_melody(userDefinedObjectDataBuff);
- break;
- #endif /* defined(__MMI_IMELODY_SUPPORT__) */
- }
- handle_category28_input();
- #if(UI_DOUBLE_BUFFER_SUPPORT)
- gui_unlock_double_buffer();
- #endif
- #ifdef __MMI_T9__
- switch (MMI_current_input_type & INPUT_TYPE_MASK)
- {
- case INPUT_TYPE_TR_BOPOMO:
- case INPUT_TYPE_SM_PINYIN:
- case INPUT_TYPE_TR_STROKE:
- case INPUT_TYPE_SM_STROKE:
- case INPUT_TYPE_SMART_UPPERCASE_ABC:
- case INPUT_TYPE_SMART_LOWERCASE_ABC:
- case INPUT_TYPE_TR_MULTITAP_BOPOMO:
- case INPUT_TYPE_SM_MULTITAP_PINYIN:
- /* PMT dara added for t9 thai */
- #if defined(__MMI_T9_THAI__)
- case INPUT_TYPE_SMART_THAI:
- #endif
- /* PMT NO_AR_SL_DU START 20050909 */
- #if defined(__MMI_T9_ARABIC__)
- case INPUT_TYPE_SMART_ARABIC:
- #endif
- /* PMT VIKAS GUPTA START 20051129 */
- #if defined(__MMI_T9_HINDI__)
- case INPUT_TYPE_SMART_HINDI:
- #endif
- //PMT VIKAS GUPTA END 20051129
- //PMT NO_AR_SL_DU END 20050909
- //MTK Terry for Spanish French German Italian
- #if defined(__MMI_T9_SPANISH__)
- case INPUT_TYPE_SMART_UPPERCASE_SPANISH:
- case INPUT_TYPE_SMART_LOWERCASE_SPANISH:
- #endif /* defined(__MMI_T9_SPANISH__) */
- /* PMT VIKASG START 20050729 */
- #if defined(__MMI_T9_DANISH__) /* Vikas */
- case INPUT_TYPE_SMART_UPPERCASE_DANISH:
- case INPUT_TYPE_SMART_LOWERCASE_DANISH:
- #endif /* defined(__MMI_T9_DANISH__) */
- //PMT VIKASG END 20050729
- //PMT CZ_PO_TU START 20050812
- #if defined(__MMI_T9_POLISH__) /* Vikas */
- case INPUT_TYPE_SMART_UPPERCASE_POLISH:
- case INPUT_TYPE_SMART_LOWERCASE_POLISH:
- #endif /* defined(__MMI_T9_POLISH__) */
- /* PMT CZ_PO_TU END 20050812 */
- #if defined(__MMI_T9_FRENCH__)
- case INPUT_TYPE_SMART_UPPERCASE_FRENCH:
- case INPUT_TYPE_SMART_LOWERCASE_FRENCH:
- #endif /* defined(__MMI_T9_FRENCH__) */
- #if defined(__MMI_T9_GERMAN__)
- case INPUT_TYPE_SMART_UPPERCASE_GERMAN:
- case INPUT_TYPE_SMART_LOWERCASE_GERMAN:
- #endif /* defined(__MMI_T9_GERMAN__) */
- #if defined(__MMI_T9_ITALIAN__)
- case INPUT_TYPE_SMART_UPPERCASE_ITALIAN:
- case INPUT_TYPE_SMART_LOWERCASE_ITALIAN:
- #endif /* defined(__MMI_T9_ITALIAN__) */
- /* PMT BHASKAR START 20052907 */
- #if defined(__MMI_T9_VIETNAMESE__)
- case INPUT_TYPE_SMART_UPPERCASE_VIETNAMESE:
- case INPUT_TYPE_SMART_LOWERCASE_VIETNAMESE:
- #endif /* defined(__MMI_T9_VIETNAMESE__) */
- /* PMT BHASKAR END 20052907 */
- /* PMT Gurdev Start 20050729 */
- #if defined(__MMI_T9_INDONESIAN__)
- case INPUT_TYPE_SMART_UPPERCASE_INDONESIAN:
- case INPUT_TYPE_SMART_LOWERCASE_INDONESIAN:
- #endif /* defined(__MMI_T9_INDONESIAN__) */
- //PMT Gurdev End 20050729
- //PMT CZ_PO_TU START 20050812
- #if defined(__MMI_T9_CZECH__)
- case INPUT_TYPE_SMART_UPPERCASE_CZECH:
- case INPUT_TYPE_SMART_LOWERCASE_CZECH:
- #endif /* defined(__MMI_T9_CZECH__) */
- //PMT CZ_PO_TU END 20050812
- //PMT CZ_PO_TU START 20050812
- #if defined(__MMI_T9_TURKISH__)
- case INPUT_TYPE_SMART_UPPERCASE_TURKISH:
- case INPUT_TYPE_SMART_LOWERCASE_TURKISH:
- #endif /* defined(__MMI_T9_TURKISH__) */
- /* PMT CZ_PO_TU END 20050812 */
- /* START PMT VANDANA 20051506 */
- #if defined(__MMI_T9_RUSSIAN__)
- case INPUT_TYPE_SMART_UPPERCASE_RUSSIAN:
- case INPUT_TYPE_SMART_LOWERCASE_RUSSIAN:
- #endif /* defined(__MMI_T9_RUSSIAN__) */
- //END PMT
- //MTK end
- /* PMT BULGARIAN START 20051201 */
- #if defined(__MMI_T9_BULGARIAN__)
- case INPUT_TYPE_SMART_UPPERCASE_BULGARIAN:
- case INPUT_TYPE_SMART_LOWERCASE_BULGARIAN:
- #endif /* defined(__MMI_T9_BULGARIAN__) */
- //PMT BULGARIAN END 20051201
- //PMT SHARIQ START 20050729
- #if defined(__MMI_T9_PORTUGUESE__)
- case INPUT_TYPE_SMART_UPPERCASE_PORTUGUESE:
- case INPUT_TYPE_SMART_LOWERCASE_PORTUGUESE:
- #endif /* defined(__MMI_T9_PORTUGUESE__) */
- /* PMT SHARIQ END 20050729 */
- /* PMT START HU_FI 20050825 */
- #if defined(__MMI_T9_FINNISH__)
- case INPUT_TYPE_SMART_UPPERCASE_FINNISH:
- case INPUT_TYPE_SMART_LOWERCASE_FINNISH:
- #endif /* defined(__MMI_T9_FINNISH__) */
- #if defined(__MMI_T9_HUNGARIAN__)
- case INPUT_TYPE_SMART_UPPERCASE_HUNGARIAN:
- case INPUT_TYPE_SMART_LOWERCASE_HUNGARIAN:
- #endif /* defined(__MMI_T9_HUNGARIAN__) */
- //PMT END HU_FI 20050825
- //PMT NO_AR_SL_DU START 20050909
- //Norwegian start
- #if defined(__MMI_T9_NORWEGIAN__)
- case INPUT_TYPE_SMART_UPPERCASE_NORWEGIAN:
- case INPUT_TYPE_SMART_LOWERCASE_NORWEGIAN:
- #endif /* defined(__MMI_T9_NORWEGIAN__) */
- //Norwegian end
- //START DUTCH_T9 20051021
- #if defined(__MMI_T9_DUTCH__)
- case INPUT_TYPE_SMART_UPPERCASE_DUTCH:
- case INPUT_TYPE_SMART_LOWERCASE_DUTCH:
- #endif /* defined(__MMI_T9_DUTCH__) */
- //END DUTCH_T9 20051021
- //PMT NO_AR_SL_DU END 20050909
- //PMT LANGUAGE START 20051221
- #if defined(__MMI_T9_SLOVENIAN__)
- case INPUT_TYPE_SMART_UPPERCASE_SLOVENIAN:
- case INPUT_TYPE_SMART_LOWERCASE_SLOVENIAN:
- #endif /* defined(__MMI_T9_SLOVENIAN__) */
- #if defined(__MMI_T9_SWEDISH__)
- case INPUT_TYPE_SMART_UPPERCASE_SWEDISH:
- case INPUT_TYPE_SMART_LOWERCASE_SWEDISH:
- #endif /* defined(__MMI_T9_SWEDISH__) */
- /* PMT SLO_SWE END 20051213 */
- #if defined(__MMI_T9_GREEK__)
- case INPUT_TYPE_SMART_UPPERCASE_GREEK:
- case INPUT_TYPE_SMART_LOWERCASE_GREEK:
- #endif /* defined(__MMI_T9_GREEK__) */
- #if defined(__MMI_T9_HEBREW__)
- case INPUT_TYPE_SMART_HEBREW:
- #endif /* defined(__MMI_T9_HEBREW__) */
- //PMT LANGUAGE END 20051221
- //PMT START LANGUAGE 20060104
- #if defined(__MMI_T9_CROATIAN__)
- case INPUT_TYPE_SMART_UPPERCASE_CROATIAN:
- case INPUT_TYPE_SMART_LOWERCASE_CROATIAN:
- #endif /* defined(__MMI_T9_CROATIAN__) */
- #if defined(__MMI_T9_MALAY__)
- case INPUT_TYPE_SMART_UPPERCASE_MALAY:
- case INPUT_TYPE_SMART_LOWERCASE_MALAY:
- #endif /* defined(__MMI_T9_MALAY__) */
- #if defined(__MMI_T9_SLOVAK__)
- case INPUT_TYPE_SMART_UPPERCASE_SLOVAK:
- case INPUT_TYPE_SMART_LOWERCASE_SLOVAK:
- #endif /* defined(__MMI_T9_SLOVAK__) */
- #if defined(__MMI_T9_ROMANIAN__)
- case INPUT_TYPE_SMART_UPPERCASE_ROMANIAN:
- case INPUT_TYPE_SMART_LOWERCASE_ROMANIAN:
- #endif /* defined(__MMI_T9_ROMANIAN__) */
- /* PMT END LANGUAGE 20060104 */
- T9SynT9WithInputBox();
- break;
- }
- #endif /* __MMI_T9__ */
- dm_redraw_category_screen();
- ErrorHandlingWhileInsertingObject(emsObjectStatus); /* check whetehr it is inserted or not. */
- }
- }
- /* MTk end */
- #endif /* (defined(__MMI_FILE_MANAGER__)) */
- /*****************************************************************************
- * FUNCTION
- * EntryScrSaveObjectList
- * DESCRIPTION
- * Entry save object list screen
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void EntryScrSaveObjectList(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U8 *guiBuffer = NULL;
- EMSData *pEms;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- guiBuffer = GetCurrGuiBuffer(SCR_ID_MSG_SAVE_OBJECT_LIST);
- if (guiBuffer == NULL)
- {
- currObjectIndex = 0;
- }
- CreateCategory143ObjectList(GetEMSDataForView(&pEms, 0), &previewObjectListPtr);
- if (previewObjectListPtr != NULL)
- {
- EntryNewScreen(SCR_ID_MSG_SAVE_OBJECT_LIST, ExitScrSaveObjectList, NULL, NULL);
- EnableDisableAudioPlayback();
- ShowCategory143Screen(
- STR_EMS_OBJECT_LIST,
- IMG_SMS_ENTRY_SCRN_CAPTION,
- STR_GLOBAL_OK,
- IMG_GLOBAL_OK,
- STR_GLOBAL_BACK,
- IMG_GLOBAL_BACK,
- previewObjectListPtr,
- &nObjectLists,
- &currObjectIndex,
- guiBuffer);
- SetLeftSoftkeyFunction(PreEntryScrSaveObjectName, KEY_EVENT_UP);
- SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
- SetKeyHandler(PreEntryScrSaveObjectName, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
- }
- else
- {
- DisplayPopup(
- (PU8) GetString(STR_GLOBAL_EMPTY),
- IMG_GLOBAL_EMPTY,
- 1,
- MESSAGES_POPUP_TIME_OUT,
- (U8) EMPTY_LIST_TONE);
- }
- }
- /*****************************************************************************
- * FUNCTION
- * ExitScrSaveObjectList
- * DESCRIPTION
- * Exit save object list screen
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void ExitScrSaveObjectList(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- history currHistory;
- S16 ucs2InputBuffer = 0;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- FreeCategory143ObjectList(&previewObjectListPtr);
- currHistory.scrnID = SCR_ID_MSG_SAVE_OBJECT_LIST;
- g_msg_cntx.MessagesScrnIdDelUptoHistoryNodes = SCR_ID_MSG_SAVE_OBJECT_LIST;
- currHistory.entryFuncPtr = EntryScrSaveObjectList;
- pfnUnicodeStrcpy((S8*) currHistory.inputBuffer, (S8*) & ucs2InputBuffer);
- GetCategoryHistory(currHistory.guiBuffer);
- AddHistory(currHistory);
- }
- /*****************************************************************************
- * FUNCTION
- * PreEntryScrSaveObjectName
- * DESCRIPTION
- * Before entry save object name, get object type and size
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void PreEntryScrSaveObjectName(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- FreeUserEmsObjectNameInputBuff();
- MemsetUserDefinedObjectDataBuff();
- SetCurrEmsObjectDisplayListState(GetCategory143DataType());
- userDefinedObjectDataSize = GetCategory143DataSize();
- #if defined(__MMI_IMELODY_SUPPORT__)
- if (currEmsObjectDisplayListState == EMS_OBJECT_MY_MELODY_STATE)
- {
- U8 userDefinedObjectDataBuffTemp[MAX_CURR_EMS_OBJECT_DATA_BUFF];
- GetCategory143Data(userDefinedObjectDataBuffTemp);
- EMS_userdefined_melody_detach_header(
- userDefinedObjectDataBuffTemp,
- userDefinedObjectDataBuff,
- &userDefinedObjectDataSize);
- }
- else
- #endif /* defined(__MMI_IMELODY_SUPPORT__) */
- {
- GetCategory143Data(userDefinedObjectDataBuff);
- }
- EntryScrSaveObjectName();
- }
- /*****************************************************************************
- * FUNCTION
- * EntryScrSaveObjectName
- * DESCRIPTION
- * Entry save object name screen
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void EntryScrSaveObjectName(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U8 *guiBuffer = NULL;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- EntryNewScreen(SCR_ID_MSG_SAVE_OBJECT_NAME, mmi_msg_exit_generic, EntryScrSaveObjectName, NULL);
- guiBuffer = GetCurrGuiBuffer(SCR_ID_MSG_SAVE_OBJECT_NAME);
- /* SetMessagesScrnIdToDelHistoryNodes (SCR_ID_MSG_SAVE_OBJECT_NAME); */
- ShowCategory5Screen(
- STR_EMS_OBJECT_NAME,
- IMG_SMS_ENTRY_SCRN_CAPTION,
- STR_GLOBAL_OPTIONS,
- IMG_GLOBAL_OPTIONS,
- STR_GLOBAL_BACK,
- IMG_GLOBAL_BACK,
- INPUT_TYPE_ALPHANUMERIC_SENTENCECASE,
- (PU8) userEmsObjectNameInput,
- MAX_EMS_DOWNLOAD_OBJECT_NAME_LEN,
- guiBuffer);
- SetLeftSoftkeyFunction(EntryEmsSaveObjectOption, KEY_EVENT_UP);
- SetCategory5RightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
- }
- /*****************************************************************************
- * FUNCTION
- * EntryEmsSaveObjectOption
- * DESCRIPTION
- * Entry save object option screen
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void EntryEmsSaveObjectOption(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U16 numItems = 0;
- U8 *guiBuffer = NULL;
- U16 nStrItemList[MAX_SUB_MENUS];
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- EntryNewScreen(SCR_ID_MSG_SAVE_OBJECT_OPTION, mmi_msg_exit_generic, EntryEmsSaveObjectOption, NULL);
- guiBuffer = GetCurrGuiBuffer(SCR_ID_MSG_SAVE_OBJECT_OPTION);
- SetParentHandler(SMS_INBOX_OPT_SAVE_OBJECT_OPTION);
- RegisterHighlightHandler(ExecuteCurrHiliteHandler);
- numItems = GetNumOfChild(SMS_INBOX_OPT_SAVE_OBJECT_OPTION);
- GetSequenceStringIds(SMS_INBOX_OPT_SAVE_OBJECT_OPTION, nStrItemList);
- SetMessagesCurrScrnID(SCR_ID_MSG_SAVE_OBJECT_OPTION);
- ShowCategory52Screen(
- STR_GLOBAL_OPTIONS,
- IMG_SMS_ENTRY_SCRN_CAPTION,
- STR_GLOBAL_OK,
- IMG_GLOBAL_OK,
- STR_GLOBAL_BACK,
- IMG_GLOBAL_BACK,
- numItems,
- nStrItemList,
- (U16*) gIndexIconsImageList,
- NULL,
- 0,
- 0,
- guiBuffer);
- }
- /*****************************************************************************
- * FUNCTION
- * SaveEmsObjectNameAndDownLoadEmsObject
- * DESCRIPTION
- * Save object name and data
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void SaveEmsObjectNameAndDownLoadEmsObject(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- EMSTATUS saveResult;
- S32 create_directory_result = 0;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- create_directory_result = mmi_ems_create_ems_folder();
- /* Create folder success */
- if (create_directory_result == FS_FILE_EXISTS || create_directory_result == FS_NO_ERROR)
- {
- saveResult = WriteDownloadObjectDataIntoFileSystem();
- ErrorHandlingWhileSavingObject(saveResult);
- if (saveResult != EMS_ALREADY_INITIALIZED &&
- saveResult != EMS_INVALID_FILE_NAME)
- {
- DeleteUptoScrID(SCR_ID_MSG_SAVE_OBJECT_LIST);
- FreeUserEmsObjectNameInputBuff();
- }
- else
- {
- DeleteUptoScrID(SCR_ID_MSG_SAVE_OBJECT_NAME);
- }
- }
- else
- {
- DisplayPopup(
- (PU8) GetString(GetFileSystemErrorString(create_directory_result)),
- IMG_GLOBAL_UNFINISHED,
- 1,
- MESSAGES_POPUP_TIME_OUT,
- (U8) ERROR_TONE);
- DeleteUptoScrID(SCR_ID_MSG_SAVE_OBJECT_NAME);
- }
- }
- /*****************************************************************************
- * FUNCTION
- * HighlightEmsSaveObjectDone
- * DESCRIPTION
- * Highlight save object done handler
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void HighlightEmsSaveObjectDone(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- ChangeLeftSoftkey(STR_GLOBAL_OK, IMG_SMS_COMMON_NOIMAGE);
- ChangeRightSoftkey(STR_GLOBAL_BACK, IMG_SMS_COMMON_NOIMAGE);
- SetLeftSoftkeyFunction(SaveEmsObjectNameAndDownLoadEmsObject, KEY_EVENT_UP);
- ClearKeyHandler(KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
- SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
- SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_ems_create_ems_folder
- * DESCRIPTION
- * Create EMS object folder in boot up
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- S32 mmi_ems_create_ems_folder(void)
- {
- #if (defined(MMI_ON_HARDWARE_P) && defined(__MMI_FILE_MANAGER__))
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S8 emsObjectFileNameBuf[(MAX_EMS_DOWNLOAD_OBJECT_NAME_INIT_PATH + 1) * ENCODING_LENGTH] = {0, 0};
- U16 driveName;
- S8 temp[4];
- S32 result = FS_NO_ERROR;
- UI_character_type dir_ems_root[4];
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- driveName = MMI_PUBLIC_DRV;
- sprintf(temp, "%c:\", (S8) driveName);
- AnsiiToUnicodeString((S8*) dir_ems_root, temp);
- memset(emsObjectFileNameBuf, 0, ENCODING_LENGTH);
- pfnUnicodeStrcpy((S8*) emsObjectFileNameBuf, (S8*) dir_ems_root);
- pfnUnicodeStrcat((S8*) emsObjectFileNameBuf, (S8*) FMGR_DEFAULT_FOLDER_IMAGES);
- pcreateDir(emsObjectFileNameBuf);
- memset(emsObjectFileNameBuf, 0, ENCODING_LENGTH);
- pfnUnicodeStrcpy((S8*) emsObjectFileNameBuf, (S8*) dir_ems_root);
- pfnUnicodeStrcat((S8*) emsObjectFileNameBuf, (S8*) FMGR_DEFAULT_FOLDER_AUDIO);
- result = (S32) pcreateDir(emsObjectFileNameBuf);
- #else /* (defined(MMI_ON_HARDWARE_P) && defined(__MMI_FILE_MANAGER__)) */
- S32 result = 0;
- pcreateDir(MessagesGetString((S8*) STR_EMS_PIC_A_ANIM_OBJECT_FILE_NAME_INIT_PATH_ID));
- pcreateDir(MessagesGetString((S8*) STR_EMS_IMELODY_OBJECT_FILE_NAME_INIT_PATH_ID));
- #endif /* (defined(MMI_ON_HARDWARE_P) && defined(__MMI_FILE_MANAGER__)) */
- return result;
- }
- #endif /* defined(__MMI_MESSAGES_EMS__) */
- #endif /* __MOD_SMSAL__ */