EmsMiscell.c
资源名称:mmi.rar [点击查看]
上传用户:lqx1163
上传日期:2014-08-13
资源大小:9183k
文件大小:147k
源码类别:
MTK
开发平台:
C/C++
- /*****************************************************************************
- * Copyright Statement:
- * --------------------
- * This software is protected by Copyright and the information contained
- * herein is confidential. The software may not be copied and the information
- * contained herein may not be used or disclosed except with the written
- * permission of MediaTek Inc. (C) 2005
- *
- * BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
- * THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
- * RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
- * AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
- * NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
- * SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
- * SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
- * THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
- * NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
- * SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
- *
- * BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
- * LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
- * AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
- * OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
- * MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
- *
- * THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
- * WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
- * LAWS PRINCIPLES. ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
- * RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
- * THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
- *
- *****************************************************************************/
- /*****************************************************************************
- *
- * Filename:
- * ---------
- * EmsMiscell.C
- *
- * Project:
- * --------
- * MAUI
- *
- * Description:
- * ------------
- * This file is intends for MMI SMS APP.
- *
- * Author:
- * -------
- * -------
- *
- *============================================================================
- * HISTORY
- * Below this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
- *------------------------------------------------------------------------------
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- *------------------------------------------------------------------------------
- * Upper this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
- *============================================================================
- ****************************************************************************/
- /**
- * Copyright Notice
- * ?2002 - 2003, Pixtel Communications, Inc., 1489 43rd Ave. W.,
- * Vancouver, B.C. V6M 4K8 Canada. All Rights Reserved.
- * (It is illegal to remove this copyright notice from this software or any
- * portion of it)
- */
- /**************************************************************
- FILENAME : EmsMiscell.c
- PURPOSE : Dislay all EMS objects(Manufacture picture,
- User defined picture, Predefined animation, Usedefiend animation,
- Manufacturer melodies, Usedefined melodies, Predefined sound.)
- REMARKS : nil
- AUTHOR : Hiran, Magesh k
- DATE :
- **************************************************************/
- #ifdef __MOD_SMSAL__
- /* */
- #include "MMI_features.h"
- #include "stdC.h"
- #include "L4Dr1.h"
- #include "PixtelDataTypes.h"
- /* ... Add More MMI header */
- #include "EventsGprot.h"
- #include "HistoryGprot.h"
- #include "GlobalMenuItems.h"
- #include "GlobalConstants.h"
- #include "Globaldefs.h"
- #include "wgui_categories.h"
- #include "wgui_categories_inputs.h"
- #include "CustMenuRes.h"
- #include "CommonScreens.h"
- #include "Unicodexdcl.h"
- #include "TimerEvents.h"
- #include "DebugInitDef.h"
- #include "FrameworkStruct.h" /* for PsExtFuncPtr */
- #include "Fs_errcode.h"
- /* ...Add MSG header */
- #include "customer_ps_inc.h"
- #include "mmi_msg_context.h"
- #include "MessagesL4Def.h"
- #include "MessagesResourceData.h"
- #include "MessagesMiscell.h"
- #include "MessagesExDcl.h"
- #include "SmsGuiInterfaceProt.h"
- #include "SMsGuiInterfaceType.h"
- #include "SmsPsHandler.h"
- /* */
- #include "ProfileGprots.h"
- /* */
- #include "ems.h"
- #include "Gui_ems.h"
- #include "wgui_ems.h"
- #include "wgui_categories_ems.h"//062706 revise
- #include "GSM7BitDefaultAlphabet.h"
- /* */
- #include "SettingProfile.h"
- #include "FileSystemDef.h"
- #include "FileSystemGProt.h"
- #include "DownloadDefs.h"
- #include "DownloadProtos.h"
- /* */
- #include "NVRAMEnum.h"
- #include "NVRAMProt.h"
- #include "NVRAMType.h"
- /* */
- #if (defined(MMI_ON_HARDWARE_P) && defined(__MMI_FILE_MANAGER__))
- #include "FileMgr.h"
- #include "FileManagerDef.h"
- #include "FileManagerGProt.h"
- #endif /* (defined(MMI_ON_HARDWARE_P) && defined(__MMI_FILE_MANAGER__)) */
- #ifdef __MMI_IMELODY_SUPPORT__
- #include "resource_audio.h"
- extern audio_resource_struct *resource_ems_imelodys;
- #endif /* __MMI_IMELODY_SUPPORT__ */
- #ifdef MMI_ON_HARDWARE_P
- #include "nvram_user_defs.h"
- #endif
- #include "SMSApi.h"
- #if defined(__MMI_MESSAGES_EMS__)
- /* */
- #ifndef NVRAM_EMS_MY_PICTURE_NAME_RECORD_SIZE
- #define NVRAM_EMS_MY_PICTURE_NAME_RECORD_SIZE 140
- #endif
- #ifndef NVRAM_EMS_MY_ANIMATION_NAME_RECORD_SIZE
- #define NVRAM_EMS_MY_ANIMATION_NAME_RECORD_SIZE 140
- #endif
- #if defined(__MMI_IMELODY_SUPPORT__)
- #ifndef NVRAM_EMS_MY_MELODY_NAME_RECORD_SIZE
- #define NVRAM_EMS_MY_MELODY_NAME_RECORD_SIZE 140
- #endif
- #endif /* defined(__MMI_IMELODY_SUPPORT__) */
- #define MESSAGES_ONE_SEC_TIME_OUT 1000
- #define MAX_EMS_OBJECT_LIST_DISPLAY 15
- #define MAX_EMS_PREDEFINED_ANIMATION 15
- #define MAX_EMS_PREDEFINED_SOUND 10
- #ifdef __EMS_REL5__
- #define MAX_CURR_EMS_OBJECT_DATA_BUFF 1588+12
- #define MAX_EMS_OBJECT_INSERT_SIZE 1588
- #else /* __EMS_REL5__ */
- #define MAX_CURR_EMS_OBJECT_DATA_BUFF 128+12
- #define MAX_EMS_OBJECT_INSERT_SIZE 128
- #endif /* __EMS_REL5__ */
- #if defined(MMI_ON_WIN32)
- #define MAX_EMS_DOWNLOAD_OBJECTS MAXIMUM_EMS_DOWNLOAD_IMELODY
- #define MAX_EMS_DOWNLOAD_PICTURE_OBJECTS MAX_EMS_DOWNLOAD_OBJECTS
- #define MAX_EMS_DOWNLOAD_ANIMATION_OBJECTS MAX_EMS_DOWNLOAD_OBJECTS
- #define MAX_EMS_DOWNLOAD_IMELODY_OBJECTS MAXIMUM_EMS_DOWNLOAD_IMELODY
- #define MAX_EMS_DOWNLOAD_OBJECT_NAME_LEN 13
- #define MAX_EMS_DOWNLOAD_OBJECT_NAME_INIT_PATH 30
- #define MAX_EMS_DOWNLOAD_OBJECT_NAME_EXTN_LEN 5
- #define MAX_EMS_DISPLAY_NAME_LEN (MAX_EMS_DOWNLOAD_OBJECT_NAME_LEN*ENCODING_LENGTH)+ENCODING_LENGTH
- #define MAX_EMS_DOWNLOAD_OBJECT_FILE_LEN MAX_EMS_DOWNLOAD_OBJECT_NAME_LEN+MAX_EMS_DOWNLOAD_OBJECT_NAME_INIT_PATH+MAX_EMS_DOWNLOAD_OBJECT_NAME_EXTN_LEN
- #elif defined (__MMI_FILE_MANAGER__)
- #define MAX_EMS_DOWNLOAD_OBJECT_NAME_LEN FMGR_MAX_INPUT_FILE_LEN
- #define MAX_EMS_DOWNLOAD_OBJECT_NAME_INIT_PATH FMGR_MAX_PATH_LEN
- #define MAX_EMS_DOWNLOAD_OBJECT_NAME_EXTN_LEN FMGR_MAX_EXT_LEN
- #define MAX_EMS_DOWNLOAD_OBJECT_FILE_LEN FMGR_MAX_PATH_LEN+FMGR_MAX_FILE_LEN
- #endif
- #ifndef MAX_EMS_DOWNLOAD_OBJECT_NAME_LEN
- #define MAX_EMS_DOWNLOAD_OBJECT_NAME_LEN 13
- #endif
- /* */
- #define STR_EMS_PICTURE_OBJECT_FILE_NAME_EXTN_ID ".ems"
- #define STR_EMS_ANIMATION_OBJECT_FILE_NAME_EXTN_ID ".anm"
- #define STR_EMS_IMELODY_OBJECT_FILE_NAME_EXTN_ID ".imy"
- #if (defined(MMI_ON_HARDWARE_P) && defined(__MMI_FILE_MANAGER__))
- #define STR_EMS_PIC_A_ANIM_OBJECT_FILE_NAME_INIT_PATH_ID FMGR_DEFAULT_FOLDER_IMAGES /* "USER\image\ems\" */
- #define STR_EMS_IMELODY_OBJECT_FILE_NAME_INIT_PATH_ID FMGR_DEFAULT_FOLDER_AUDIO /* "USER\sound\ems\" */
- #else /* (defined(MMI_ON_HARDWARE_P) && defined(__MMI_FILE_MANAGER__)) */
- #define STR_EMS_PIC_A_ANIM_OBJECT_FILE_NAME_INIT_PATH_ID "c:\USER\image\ems\"
- #define STR_EMS_IMELODY_OBJECT_FILE_NAME_INIT_PATH_ID "c:\USER\sound\ems\"
- #endif /* (defined(MMI_ON_HARDWARE_P) && defined(__MMI_FILE_MANAGER__)) */
- /* MTK Joy added for file names, 1128 */
- #define STR_EMS_MANUFACTURER_PIC_OBJECT_FILE_NAME_0 "ems0"
- #define STR_EMS_MANUFACTURER_PIC_OBJECT_FILE_NAME_1 "ems1"
- #define STR_EMS_MANUFACTURER_PIC_OBJECT_FILE_NAME_2 "ems2"
- #define STR_EMS_MANUFACTURER_PIC_OBJECT_FILE_NAME_3 "ems3"
- #define STR_EMS_MANUFACTURER_PIC_OBJECT_FILE_NAME_4 "ems4"
- #define STR_EMS_MANUFACTURER_PIC_OBJECT_FILE_NAME_5 "ems5"
- #define STR_EMS_MANUFACTURER_PIC_OBJECT_FILE_NAME_6 "ems6"
- #define STR_EMS_MANUFACTURER_PIC_OBJECT_FILE_NAME_7 "ems7"
- #define STR_EMS_MANUFACTURER_PIC_OBJECT_FILE_NAME_8 "ems8"
- #define STR_EMS_MANUFACTURER_PIC_OBJECT_FILE_NAME_9 "ems9"
- /* MTK end */
- extern S32 pfError(S32 err);
- #ifdef MMI_ON_WIN32
- extern S32 fdelete(U8 *fName);
- #endif
- extern void (*EMS_inputbox_input_callback) (void);
- #endif /* defined(__MMI_MESSAGES_EMS__) */
- #if defined (__MMI_VCARD__) || defined (__MMI_VCALENDAR__)
- #ifndef MAX_EMS_OBJECT_INSERT_SIZE
- #ifdef __EMS_REL5__
- #define MAX_EMS_OBJECT_INSERT_SIZE 1588
- #else
- #define MAX_EMS_OBJECT_INSERT_SIZE 128
- #endif
- #endif /* MAX_EMS_OBJECT_INSERT_SIZE */
- #ifndef MAX_EMS_DOWNLOAD_OBJECT_FILE_LEN
- #define MAX_EMS_DOWNLOAD_OBJECT_FILE_LEN 260+41 /* FMGR_MAX_PATH_LEN+FMGR_MAX_FILE_LEN */
- #endif
- PsFuncPtr emscallback;
- static S8 *file_path;
- #endif /* defined (__MMI_VCARD__) || defined (__MMI_VCALENDAR__) */
- /* */
- #if defined(__MMI_MESSAGES_EMS__)
- U16 PredefinedAnimationStrIDs[] = /* Predefined Animations */
- {
- STR_PREDEFINED_ANIMATION_0,
- STR_PREDEFINED_ANIMATION_1,
- STR_PREDEFINED_ANIMATION_2,
- STR_PREDEFINED_ANIMATION_3,
- STR_PREDEFINED_ANIMATION_4,
- STR_PREDEFINED_ANIMATION_5,
- STR_PREDEFINED_ANIMATION_6,
- STR_PREDEFINED_ANIMATION_7,
- STR_PREDEFINED_ANIMATION_8,
- STR_PREDEFINED_ANIMATION_9,
- STR_PREDEFINED_ANIMATION_10,
- STR_PREDEFINED_ANIMATION_11,
- STR_PREDEFINED_ANIMATION_12,
- STR_PREDEFINED_ANIMATION_13,
- STR_PREDEFINED_ANIMATION_14
- };
- const U16 PredefinedSoundStrIDs[] = /* Predefined Sounds */
- {
- STR_PREDEFINED_SOUND_0,
- STR_PREDEFINED_SOUND_1,
- STR_PREDEFINED_SOUND_2,
- STR_PREDEFINED_SOUND_3,
- STR_PREDEFINED_SOUND_4,
- STR_PREDEFINED_SOUND_5,
- STR_PREDEFINED_SOUND_6,
- STR_PREDEFINED_SOUND_7,
- STR_PREDEFINED_SOUND_8,
- STR_PREDEFINED_SOUND_9
- };
- U16 ManufacturerPictureStrIDs[] = /* ManufacturerPicture Str IDs */
- {
- STR_MANUFACTURER_PICTURE_0,
- STR_MANUFACTURER_PICTURE_1,
- STR_MANUFACTURER_PICTURE_2,
- STR_MANUFACTURER_PICTURE_3,
- STR_MANUFACTURER_PICTURE_4,
- STR_MANUFACTURER_PICTURE_5,
- STR_MANUFACTURER_PICTURE_6,
- STR_MANUFACTURER_PICTURE_7,
- STR_MANUFACTURER_PICTURE_8,
- STR_MANUFACTURER_PICTURE_9
- };
- const U16 ManufacturerMelodiesStrIDs[] = /* Manufacturer Melodies Str IDs */
- {
- STR_MANUFACTURER_MELODIES_0,
- STR_MANUFACTURER_MELODIES_1,
- STR_MANUFACTURER_MELODIES_2,
- STR_MANUFACTURER_MELODIES_3,
- STR_MANUFACTURER_MELODIES_4,
- STR_MANUFACTURER_MELODIES_5,
- STR_MANUFACTURER_MELODIES_6,
- STR_MANUFACTURER_MELODIES_7,
- STR_MANUFACTURER_MELODIES_8,
- STR_MANUFACTURER_MELODIES_9
- };
- static U16 preDefinedObjectIds[MAX_EMS_OBJECT_LIST_DISPLAY] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14};
- static U8 *userDefinedObjectDataPtrs[MAX_EMS_OBJECT_LIST_DISPLAY];
- static U8 userDefinedObjectDataBuff[MAX_CURR_EMS_OBJECT_DATA_BUFF] = {0, 0};
- static S32 userDefinedObjectDataSize = 0;
- static S32 currObjectListHiliteIndex = 0;
- static U8 currMaxEmsObjectList = 0;
- static U8 currMaxEmsPictureObjects = 0;
- static U8 userEmsObjectNameInput[(MAX_EMS_DOWNLOAD_OBJECT_NAME_LEN + 1) * ENCODING_LENGTH] = {0, 0};
- static U8 *emsObjectNameWhenPreview = NULL;
- static EMS_OBJECT_DISPLAY_STATE currEmsObjectDisplayListState;
- static U8 emsFmtTextStyleStates[4] = {0, 0, 0, 0};
- static U8 IsAllowed = FALSE;
- static S32 listOfIsAllowedData[MAX_EMS_OBJECT_LIST_DISPLAY];
- /* */
- static EMSObject *previewObjectListPtr = NULL;
- static S32 nObjectLists = 0;
- static S32 currObjectIndex = 0;
- extern UI_EMS_input_box MMI_EMS_inputbox;
- extern EMSTextFormat wgui_EMS_text_format;
- /* MTK end */
- #if (defined(__MMI_FILE_MANAGER__))
- void mmi_ems_fm_send_by_ems(S8 *emsObjectFileNameBuf, EMS_OBJECT_DISPLAY_STATE emsObjectType);
- void mmi_ems_add_object_from_fm(void);
- void mmi_ems_preview_object_from_fm(PU16 filePath, S32 is_short);
- EMSTATUS mmi_ems_fm_open_file(S8 *emsObjectFileNameBuf, EMS_OBJECT_DISPLAY_STATE emsObjectType);
- #endif /* (defined(__MMI_FILE_MANAGER__)) */
- #if defined(__MMI_IMELODY_SUPPORT__)
- extern U32 GetEmsMelodyLength(S32 index);
- extern PU8 GetEmsMelodyData(S32 index);
- #ifdef MMI_ON_HARDWARE_P
- extern void custom_get_fixed_ems_imelody_range(U8 *min_id, U8 *max_id);
- #endif
- #endif /* defined(__MMI_IMELODY_SUPPORT__) */
- extern U32 GetEmsPictureLength(S32 index);
- extern PU8 GetEmsPictureData(S32 index);
- extern void handle_category28_input(void);
- extern void T9SynT9WithInputBox(void);
- #endif /* defined(__MMI_MESSAGES_EMS__) */
- extern EMSData *GetEMSDataForView(EMSData **p, U8 force);
- extern EMSData *GetEMSDataForEdit(EMSData **p, U8 force);
- extern U8 DeInitMessagesEMSBuffer(msg_ems_data_struct *pE);
- //////////////////////////////////////////////////////////////////////
- // Routines for manipulating local buffers for EMS Edit and View
- //////////////////////////////////////////////////////////////////////
- /*****************************************************************************
- * FUNCTION
- * ErrorHandlingWhileInsertingObject
- * DESCRIPTION
- * Handle error case when insert object
- * PARAMETERS
- * emsObjectStatus [IN] Insert status
- * RETURNS
- * void
- *****************************************************************************/
- void ErrorHandlingWhileInsertingObject(EMSTATUS emsObjectStatus)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- /* hander error case, if could not insert objects. */
- switch (emsObjectStatus)
- {
- case EMS_OK:
- break;
- case EMS_NO_MEMORY:
- DisplayPopup(
- (PU8) GetString(STR_EMS_OBJECT_NUM_EXCEED),
- IMG_GLOBAL_UNFINISHED,
- 1,
- MESSAGES_POPUP_TIME_OUT,
- (U8) ERROR_TONE);
- break;
- case EMS_NO_SPACE:
- DisplayPopup(
- (PU8) GetString(STR_NO_SPACE_TO_INSERT_OBJECT),
- IMG_GLOBAL_UNFINISHED,
- 1,
- MESSAGES_POPUP_TIME_OUT,
- (U8) ERROR_TONE);
- break;
- case EMS_INVALID_OBJECT:
- #if (defined(MMI_ON_HARDWARE_P) && defined(__MMI_FILE_MANAGER__))
- DisplayPopup(
- (PU8) GetString(STR_FMGR_INVALID_FORMAT),
- IMG_GLOBAL_UNFINISHED,
- 1,
- MESSAGES_POPUP_TIME_OUT,
- (U8) ERROR_TONE);
- #else /* (defined(MMI_ON_HARDWARE_P) && defined(__MMI_FILE_MANAGER__)) */
- DisplayPopup(
- (PU8) GetString(STR_SMS_DOES_NOT_SUPPORT),
- IMG_GLOBAL_UNFINISHED,
- 1,
- MESSAGES_POPUP_TIME_OUT,
- (U8) ERROR_TONE);
- #endif /* (defined(MMI_ON_HARDWARE_P) && defined(__MMI_FILE_MANAGER__)) */
- break;
- case EMS_EMS_DATA_EXCEEDED:
- #if (defined(MMI_ON_HARDWARE_P) && defined(__MMI_FILE_MANAGER__))
- DisplayPopup(
- (PU8) GetString(FMGR_FS_FILE_TOO_LARGE_TEXT),
- IMG_GLOBAL_UNFINISHED,
- 1,
- MESSAGES_POPUP_TIME_OUT,
- (U8) ERROR_TONE);
- #else /* (defined(MMI_ON_HARDWARE_P) && defined(__MMI_FILE_MANAGER__)) */
- DisplayPopup(
- (PU8) GetString(STR_SMS_FAILURE_MSG_LEN_EXCEEDED),
- IMG_GLOBAL_UNFINISHED,
- 1,
- MESSAGES_POPUP_TIME_OUT,
- (U8) ERROR_TONE);
- #endif /* (defined(MMI_ON_HARDWARE_P) && defined(__MMI_FILE_MANAGER__)) */
- break;
- case EMS_NULL_POINTER:
- DisplayPopup(
- (PU8) GetString(STR_READ_SMS_DATA_FAILED),
- IMG_GLOBAL_UNFINISHED,
- 1,
- MESSAGES_POPUP_TIME_OUT,
- (U8) ERROR_TONE);
- break;
- case EMS_NO_ALIGNMENT_FMT:
- DisplayPopup(
- (PU8) GetString(STR_SMS_OBJECT_EXISTENCE_ERROR),
- IMG_GLOBAL_UNFINISHED,
- 1,
- MESSAGES_POPUP_TIME_OUT,
- (U8) ERROR_TONE);
- break;
- default /* EMS_UNSPECIFIED_ERROR */ :
- DisplayPopup(
- (PU8) GetString(STR_SMS_DOES_NOT_SUPPORT),
- IMG_GLOBAL_UNFINISHED,
- 1,
- MESSAGES_POPUP_TIME_OUT,
- (U8) ERROR_TONE);
- break;
- }
- }
- #if defined (__MMI_VCARD__) || defined (__MMI_VCALENDAR__)
- /*****************************************************************************
- * FUNCTION
- * mmi_ems_vobject_send_by_ems_callback
- * DESCRIPTION
- * Call back vobject send by ems function
- * PARAMETERS
- * dummy [?]
- * mod [IN]
- * flag [IN] Send result
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_ems_vobject_send_by_ems_callback(void *dummy, module_type mod, U16 flag)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- switch (flag)
- {
- case MMI_FRM_SMS_OK:
- DisplayPopup(
- (PU8) GetString(STR_SMS_SEND_SUCCESS),
- IMG_SEND_SUCCESS_PIC_MSG,
- 1,
- MESSAGES_POPUP_TIME_OUT,
- (U8) SUCCESS_TONE);
- mmi_frm_sms_delete_screen_history();
- break;
- case MMI_FRM_SMS_RETURN:
- case MMI_FRM_SMS_END:
- /* do not keep vcard and vcalendar content when sending fail */
- ReleaseEMSEditBuffer();
- break;
- case MMI_FRM_SMS_DATAEXCEED:
- #if (defined(MMI_ON_HARDWARE_P) && defined(__MMI_FILE_MANAGER__))
- DisplayPopup(
- (PU8) GetString(FMGR_FS_FILE_TOO_LARGE_TEXT),
- IMG_GLOBAL_UNFINISHED,
- 1,
- MESSAGES_POPUP_TIME_OUT,
- (U8) ERROR_TONE);
- #else /* (defined(MMI_ON_HARDWARE_P) && defined(__MMI_FILE_MANAGER__)) */
- DisplayPopup(
- (PU8) GetString(STR_SMS_FAILURE_MSG_LEN_EXCEEDED),
- IMG_GLOBAL_UNFINISHED,
- 1,
- MESSAGES_POPUP_TIME_OUT,
- (U8) ERROR_TONE);
- #endif /* (defined(MMI_ON_HARDWARE_P) && defined(__MMI_FILE_MANAGER__)) */
- mmi_frm_sms_delete_screen_history();
- break;
- case MMI_FRM_SMS_NOTREADY:
- DisplayPopup(
- (PU8) GetString(STR_SMS_MSG_NOT_READY_YET),
- IMG_SEND_FAIL_PIC_MSG,
- 1,
- MESSAGES_POPUP_TIME_OUT,
- (U8) ERROR_TONE);
- break;
- case MMI_FRM_SMS_ABORT:
- /* do not keep vcard and vcalendar content when sending aborts */
- ReleaseEMSEditBuffer();
- DisplayPopup(
- (PU8) GetString(STR_ABORT_SENDING_SMS),
- IMG_GLOBAL_ACTIVATED,
- 1,
- MESSAGES_POPUP_TIME_OUT,
- (U8) SUCCESS_TONE);
- mmi_frm_sms_delete_screen_history();
- break;
- default:
- /* do not keep vcard and vcalendar content when sending fail */
- ReleaseEMSEditBuffer();
- DisplayPopup(
- (PU8) GetString(STR_SMS_SEND_FAILED),
- IMG_SEND_FAIL_PIC_MSG,
- 1,
- MESSAGES_POPUP_TIME_OUT,
- (U8) ERROR_TONE);
- mmi_frm_sms_delete_screen_history();
- break;
- }
- if (file_path != NULL)
- {
- OslMfree(file_path);
- file_path = NULL;
- }
- if (emscallback)
- {
- emscallback(&flag);
- }
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_ems_vobject_send_by_ems
- * DESCRIPTION
- * Send vobject by ems
- * PARAMETERS
- * scrport [IN] Source port
- * dstport [IN] Destination port
- * filepath [IN] Filepath
- * callback [IN] Callback function
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_ems_vobject_send_by_ems(U16 scrport, U16 dstport, S8 *filepath, PsFuncPtr callback)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S32 result = TRUE;
- mmi_frm_sms_send_struct *sendData = OslMalloc(sizeof(mmi_frm_sms_send_struct));
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- memset((S8*) sendData, 0, sizeof(mmi_frm_sms_send_struct));
- emscallback = callback;
- sendData->sendrequire |= MMI_FRM_SMS_PORT;
- sendData->srcport = scrport;
- sendData->desport = dstport;
- sendData->dcs = SMSAL_8BIT_DCS;
- if (IsMessagesReEntering())
- {
- result = FALSE;
- DisplayPopup(
- (PU8) GetString(STR_SMS_MSG_NOT_READY_YET),
- IMG_GLOBAL_UNFINISHED,
- 1,
- MESSAGES_POPUP_TIME_OUT,
- (U8) ERROR_TONE);
- if (emscallback != NULL)
- {
- emscallback((PU16) & result);
- }
- OslMfree(sendData);
- return;
- }
- if ((pfnUnicodeStrlen(filepath) == 0) || (pfnUnicodeStrlen(filepath) > MAX_EMS_DOWNLOAD_OBJECT_FILE_LEN))
- {
- result = FALSE;
- DisplayPopup(
- (PU8) GetString(STR_EMS_OBJECT_SIZE_NOT_ALLOWED_ID),
- IMG_GLOBAL_UNFINISHED,
- 1,
- MESSAGES_POPUP_TIME_OUT,
- (U8) ERROR_TONE);
- if (emscallback != NULL)
- {
- emscallback((PU16) & result);
- }
- OslMfree(sendData);
- return;
- }
- if (file_path != NULL)
- {
- OslMfree(file_path);
- file_path = NULL;
- }
- file_path = OslMalloc((pfnUnicodeStrlen(filepath) + 1) * ENCODING_LENGTH);
- pfnUnicodeStrcpy(file_path, filepath);
- sendData->filename = file_path;
- mmi_frm_sms_send_sms(mmi_ems_vobject_send_by_ems_callback, MOD_MMI, sendData);
- OslMfree(sendData);
- }
- #if 0
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- #ifdef MMI_ON_HARDWARE_P
- /* under construction !*/
- #endif
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- #endif /* 0 */
- #endif /* defined (__MMI_VCARD__) || defined (__MMI_VCALENDAR__) */
- #if defined(__MMI_MESSAGES_EMS__)
- /**************************************************************
- text format
- **************************************************************/
- /*****************************************************************************
- * FUNCTION
- * GetFmtTextSize
- * DESCRIPTION
- * Get text format size
- * PARAMETERS
- * void
- * RETURNS
- * size
- *****************************************************************************/
- U8 GetFmtTextSize(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- switch (EMS_inputbox_get_text_size())
- {
- case EMS_FONTSIZE_SMALL:
- return (U8) 0;
- case EMS_FONTSIZE_NORMAL:
- return (U8) 1;
- case EMS_FONTSIZE_LARGE:
- return (U8) 2;
- }
- return (U8) 0;
- }
- /*****************************************************************************
- * FUNCTION
- * SetFmtTextSize
- * DESCRIPTION
- * Set text format size
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void SetFmtTextSize(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- switch (GetHighlightedItem())
- {
- case 0:
- EMS_inputbox_set_text_size(EMS_FONTSIZE_SMALL);
- break;
- case 1:
- EMS_inputbox_set_text_size(EMS_FONTSIZE_NORMAL);
- break;
- case 2:
- EMS_inputbox_set_text_size(EMS_FONTSIZE_LARGE);
- break;
- }
- GoBackToHistory(SCR_ID_MSG_WRITE);
- }
- /*****************************************************************************
- * FUNCTION
- * SetFmtTextStyle
- * DESCRIPTION
- * Set text format style
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void SetFmtTextStyle(void)
- {
- #ifndef __MMI_TEXT_FORMAT_WITHOUT_BOLD__
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- EMS_inputbox_set_text_style(
- emsFmtTextStyleStates[0],
- emsFmtTextStyleStates[1],
- emsFmtTextStyleStates[2],
- emsFmtTextStyleStates[3]);
- #else /* __MMI_TEXT_FORMAT_WITHOUT_BOLD__ */
- EMS_inputbox_set_text_style(
- emsFmtTextStyleStates[3],
- emsFmtTextStyleStates[0],
- emsFmtTextStyleStates[1],
- emsFmtTextStyleStates[2]);
- #endif /* __MMI_TEXT_FORMAT_WITHOUT_BOLD__ */
- GoBackToHistory(SCR_ID_MSG_WRITE);
- }
- /*****************************************************************************
- * FUNCTION
- * GetFmtTextAlignment
- * DESCRIPTION
- * Get text format alignment
- * PARAMETERS
- * void
- * RETURNS
- * alignment
- *****************************************************************************/
- U8 GetFmtTextAlignment(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- switch (EMS_inputbox_get_text_alignment())
- {
- case EMS_ALIGN_LANG_DEP:
- return (U8) 0;
- case EMS_ALIGN_LEFT:
- return (U8) 1;
- case EMS_ALIGN_CENTER:
- return (U8) 2;
- case EMS_ALIGN_RIGHT:
- return (U8) 3;
- }
- return (U8) 0;
- }
- /*****************************************************************************
- * FUNCTION
- * SetFmtTextAlignment
- * DESCRIPTION
- * Set text format alignment
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void SetFmtTextAlignment(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- EMSTATUS emsObjectStatus;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- switch (GetHighlightedItem())
- {
- case 0:
- emsObjectStatus = EMS_inputbox_set_text_alignment(EMS_ALIGN_LANG_DEP);
- break;
- case 1:
- emsObjectStatus = EMS_inputbox_set_text_alignment(EMS_ALIGN_LEFT);
- break;
- case 2:
- emsObjectStatus = EMS_inputbox_set_text_alignment(EMS_ALIGN_CENTER);
- break;
- case 3:
- emsObjectStatus = EMS_inputbox_set_text_alignment(EMS_ALIGN_RIGHT);
- break;
- default:
- emsObjectStatus = EMS_inputbox_set_text_alignment(EMS_ALIGN_LANG_DEP);
- break;
- }
- GoBackToHistory(SCR_ID_MSG_WRITE);
- ErrorHandlingWhileInsertingObject(emsObjectStatus); /* check whetehr it is inserted or not. */
- }
- /*****************************************************************************
- * FUNCTION
- * SetFmtTextNewParagraph
- * DESCRIPTION
- * Set text format new paragraph
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void SetFmtTextNewParagraph(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- EMSTATUS emsObjectStatus;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- switch (GetHighlightedItem())
- {
- case 0:
- emsObjectStatus = EMS_inputbox_create_new_paragraph(EMS_ALIGN_LANG_DEP);
- break;
- case 1:
- emsObjectStatus = EMS_inputbox_create_new_paragraph(EMS_ALIGN_LEFT);
- break;
- case 2:
- emsObjectStatus = EMS_inputbox_create_new_paragraph(EMS_ALIGN_CENTER);
- break;
- case 3:
- emsObjectStatus = EMS_inputbox_create_new_paragraph(EMS_ALIGN_RIGHT);
- break;
- default:
- emsObjectStatus = EMS_inputbox_create_new_paragraph(EMS_ALIGN_LANG_DEP);
- break;
- }
- GoBackToHistory(SCR_ID_MSG_WRITE);
- ErrorHandlingWhileInsertingObject(emsObjectStatus); /* check whetehr it is inserted or not. */
- }
- /*****************************************************************************
- * FUNCTION
- * EntryScrFmtTextSizeMenu
- * DESCRIPTION
- * Entry text format size screen
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void EntryScrFmtTextSizeMenu(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U8 index = 0;
- U16 nNumofItem = 0;
- U16 nStrItemListIDs[MAX_SUB_MENUS] = {0, 0, 0};
- U8 *guiBuffer = NULL;
- U8 *nStrItemList[MAX_SUB_MENUS] = {NULL, NULL, NULL};
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- EntryNewScreen(SCR_ID_MSG_TEXT_FORMAT_SIZE, mmi_msg_exit_generic, EntryScrFmtTextSizeMenu, NULL);
- guiBuffer = GetCurrGuiBuffer(SCR_ID_MSG_TEXT_FORMAT_SIZE);
- if (guiBuffer == NULL)
- {
- currObjectListHiliteIndex = GetFmtTextSize();
- }
- SetParentHandler(MENU_EMS_TEXT_SIZE_ID);
- RegisterHighlightHandler(ExecuteCurrHiliteHandler);
- nNumofItem = GetNumOfChild(MENU_EMS_TEXT_SIZE_ID);
- GetSequenceStringIds(MENU_EMS_TEXT_SIZE_ID, nStrItemListIDs);
- for (index = 0; index < nNumofItem; index++)
- {
- nStrItemList[index] = (PU8) GetString((U16) nStrItemListIDs[index]);
- }
- SetMessagesCurrScrnID(SCR_ID_MSG_TEXT_FORMAT_SIZE);
- ShowCategory109Screen(
- STR_EMS_TEXT_SIZE_ID,
- IMG_SMS_ENTRY_SCRN_CAPTION,
- STR_GLOBAL_OK,
- IMG_GLOBAL_OK,
- STR_GLOBAL_BACK,
- IMG_GLOBAL_BACK,
- nNumofItem,
- nStrItemList,
- NULL,
- currObjectListHiliteIndex,
- guiBuffer);
- }
- /*****************************************************************************
- * FUNCTION
- * EntryScrFmtTextStyleMenu
- * DESCRIPTION
- * Entry text format style screen
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void EntryScrFmtTextStyleMenu(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U8 index = 0;
- U16 nNumofItem = 0;
- U16 nStrItemListIDs[MAX_SUB_MENUS] = {0, 0, 0};
- U8 *guiBuffer = NULL;
- U8 *nStrItemList[MAX_SUB_MENUS] = {NULL, NULL, NULL, NULL};
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- EntryNewScreen(SCR_ID_MSG_TEXT_FORMAT_STYLE, mmi_msg_exit_generic, EntryScrFmtTextStyleMenu, NULL);
- guiBuffer = GetCurrGuiBuffer(SCR_ID_MSG_TEXT_FORMAT_STYLE);
- if (guiBuffer == NULL)
- {
- currObjectListHiliteIndex = 0;
- #ifndef __MMI_TEXT_FORMAT_WITHOUT_BOLD__
- EMS_inputbox_get_text_style(
- &emsFmtTextStyleStates[0],
- &emsFmtTextStyleStates[1],
- &emsFmtTextStyleStates[2],
- &emsFmtTextStyleStates[3]);
- #else /* __MMI_TEXT_FORMAT_WITHOUT_BOLD__ */
- EMS_inputbox_get_text_style(
- &emsFmtTextStyleStates[3],
- &emsFmtTextStyleStates[0],
- &emsFmtTextStyleStates[1],
- &emsFmtTextStyleStates[2]);
- #endif /* __MMI_TEXT_FORMAT_WITHOUT_BOLD__ */
- }
- SetParentHandler(MENU_EMS_TEXT_STYLE_ID);
- nNumofItem = GetNumOfChild(MENU_EMS_TEXT_STYLE_ID);
- GetSequenceStringIds(MENU_EMS_TEXT_STYLE_ID, nStrItemListIDs);
- for (index = 0; index < nNumofItem; index++)
- {
- nStrItemList[index] = (PU8) GetString((U16) nStrItemListIDs[index]);
- }
- SetCheckboxToggleRightSoftkeyFunctions(SetFmtTextStyle, GoBackHistory);
- SetMessagesCurrScrnID(SCR_ID_MSG_TEXT_FORMAT_STYLE);
- ShowCategory140Screen(
- STR_EMS_TEXT_STYLE_ID,
- IMG_SMS_ENTRY_SCRN_CAPTION,
- nNumofItem,
- nStrItemList,
- emsFmtTextStyleStates,
- currObjectListHiliteIndex,
- guiBuffer);
- ClearKeyHandler(KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
- }
- /*****************************************************************************
- * FUNCTION
- * EntryScrFmtAlignmentMenu
- * DESCRIPTION
- * Entry text format alignment screen
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void EntryScrFmtAlignmentMenu(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U8 index = 0;
- U16 nNumofItem = 0;
- U16 nStrItemListIDs[MAX_SUB_MENUS] = {0, 0, 0};
- U8 *guiBuffer = NULL;
- U8 *nStrItemList[MAX_SUB_MENUS] = {NULL, NULL, NULL};
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- EntryNewScreen(SCR_ID_MSG_TEXT_FORMAT_ALIGNMENT, mmi_msg_exit_generic, EntryScrFmtAlignmentMenu, NULL);
- guiBuffer = GetCurrGuiBuffer(SCR_ID_MSG_TEXT_FORMAT_ALIGNMENT);
- if (guiBuffer == NULL)
- {
- currObjectListHiliteIndex = GetFmtTextAlignment();
- }
- SetParentHandler(MENU_EMS_ALIGNMENT_ID);
- RegisterHighlightHandler(ExecuteCurrHiliteHandler);
- nNumofItem = GetNumOfChild(MENU_EMS_ALIGNMENT_ID);
- GetSequenceStringIds(MENU_EMS_ALIGNMENT_ID, nStrItemListIDs);
- for (index = 0; index < nNumofItem; index++)
- {
- nStrItemList[index] = (PU8) GetString((U16) nStrItemListIDs[index]);
- }
- SetMessagesCurrScrnID(SCR_ID_MSG_TEXT_FORMAT_ALIGNMENT);
- ShowCategory109Screen(
- STR_EMS_ALIGNMENT_ID,
- IMG_SMS_ENTRY_SCRN_CAPTION,
- STR_GLOBAL_OK,
- IMG_GLOBAL_OK,
- STR_GLOBAL_BACK,
- IMG_GLOBAL_BACK,
- nNumofItem,
- nStrItemList,
- NULL,
- currObjectListHiliteIndex,
- guiBuffer);
- }
- /*****************************************************************************
- * FUNCTION
- * EntryScrFmtNewParagraphMenu
- * DESCRIPTION
- * Entry text format new paragraph screen
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void EntryScrFmtNewParagraphMenu(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U8 index = 0;
- U16 nNumofItem = 0;
- U16 nStrItemListIDs[MAX_SUB_MENUS] = {0, 0, 0};
- U8 *guiBuffer = NULL;
- U8 *nStrItemList[MAX_SUB_MENUS] = {NULL, NULL, NULL};
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- EntryNewScreen(SCR_ID_MSG_TEXT_FORMAT_NEW_PARA, mmi_msg_exit_generic, EntryScrFmtNewParagraphMenu, NULL);
- guiBuffer = GetCurrGuiBuffer(SCR_ID_MSG_TEXT_FORMAT_NEW_PARA);
- if (guiBuffer == NULL)
- {
- currObjectListHiliteIndex = GetFmtTextAlignment();
- }
- SetParentHandler(MENU_EMS_NEW_PARAGRAPH_ID);
- RegisterHighlightHandler(ExecuteCurrHiliteHandler);
- nNumofItem = GetNumOfChild(MENU_EMS_NEW_PARAGRAPH_ID);
- GetSequenceStringIds(MENU_EMS_NEW_PARAGRAPH_ID, nStrItemListIDs);
- for (index = 0; index < nNumofItem; index++)
- {
- nStrItemList[index] = (PU8) GetString((U16) nStrItemListIDs[index]);
- }
- SetMessagesCurrScrnID(SCR_ID_MSG_TEXT_FORMAT_NEW_PARA);
- ShowCategory109Screen(
- STR_EMS_NEW_PARAGRAPH_ID,
- IMG_SMS_ENTRY_SCRN_CAPTION,
- STR_GLOBAL_OK,
- IMG_GLOBAL_OK,
- STR_GLOBAL_BACK,
- IMG_GLOBAL_BACK,
- nNumofItem,
- nStrItemList,
- NULL,
- currObjectListHiliteIndex,
- guiBuffer);
- }
- /*****************************************************************************
- * FUNCTION
- * EntryScrEmsFormatTextMenu
- * DESCRIPTION
- * Entry text format screen
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void EntryScrEmsFormatTextMenu(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U16 numItems = 0;
- PU8 guiBuffer = NULL;
- U16 nStrItemList[MAX_SUB_MENUS];
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- EntryNewScreen(SCR_ID_MSG_TEXT_FORMAT, mmi_msg_exit_generic, EntryScrEmsFormatTextMenu, NULL);
- guiBuffer = GetCurrGuiBuffer(SCR_ID_MSG_TEXT_FORMAT);
- SetParentHandler(MENU_EMS_FORMATING_TEXT_ID);
- RegisterHighlightHandler(ExecuteCurrHiliteHandler);
- numItems = GetNumOfChild(MENU_EMS_FORMATING_TEXT_ID);
- GetSequenceStringIds(MENU_EMS_FORMATING_TEXT_ID, nStrItemList);
- SetMessagesCurrScrnID(SCR_ID_MSG_TEXT_FORMAT);
- ShowCategory52Screen(
- STR_EMS_FORMATING_TEXT_ID,
- 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
- * HighlightEmsFormattingTextHandler
- * DESCRIPTION
- * Highlight text format handler
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void HighlightEmsFormattingTextHandler(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- ChangeLeftSoftkey(STR_GLOBAL_OK, IMG_SMS_COMMON_NOIMAGE);
- ChangeRightSoftkey(STR_GLOBAL_BACK, IMG_SMS_COMMON_NOIMAGE);
- SetLeftSoftkeyFunction(EntryScrEmsFormatTextMenu, KEY_EVENT_UP);
- SetKeyHandler(EntryScrEmsFormatTextMenu, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
- SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
- SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
- }
- /* /////////////////////////////////////////////////////////////////////////////////// */
- /*****************************************************************************
- * FUNCTION
- * InitUserDefinedObjectDataPtrs
- * DESCRIPTION
- * Init user defined object data pointers
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void InitUserDefinedObjectDataPtrs(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U8 index = 0;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- for (index = 0; index < MAX_EMS_OBJECT_LIST_DISPLAY; index++)
- {
- userDefinedObjectDataPtrs[index] = NULL;
- }
- }
- /*****************************************************************************
- * FUNCTION
- * MemsetUserDefinedObjectDataBuff
- * DESCRIPTION
- * Reset user defined object data buffer
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void MemsetUserDefinedObjectDataBuff(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- memset(&userDefinedObjectDataBuff, 0, MAX_CURR_EMS_OBJECT_DATA_BUFF);
- }
- /*****************************************************************************
- * FUNCTION
- * FreeUserEmsObjectNameInputBuff
- * DESCRIPTION
- * Reset user defined object name input buffer
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void FreeUserEmsObjectNameInputBuff(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- memset(&userEmsObjectNameInput, 0, (MAX_EMS_DOWNLOAD_OBJECT_NAME_LEN * ENCODING_LENGTH) + ENCODING_LENGTH);
- }
- /*****************************************************************************
- * FUNCTION
- * MessagesGetString
- * DESCRIPTION
- * Get string in UCS2 format
- * PARAMETERS
- * pathStr [?]
- * RETURNS
- * void
- *****************************************************************************/
- static S8 *MessagesGetString(S8 *pathStr)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- static S8 emsObjectFileNameStaticBuf[(MAX_EMS_DOWNLOAD_OBJECT_NAME_LEN + 1) * ENCODING_LENGTH] = {0, 0};
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- memset(emsObjectFileNameStaticBuf, 0, (MAX_EMS_DOWNLOAD_OBJECT_NAME_LEN + 1) * ENCODING_LENGTH);
- AnsiiToUnicodeString(emsObjectFileNameStaticBuf, pathStr);
- return emsObjectFileNameStaticBuf;
- }
- /*****************************************************************************
- * FUNCTION
- * GetEmsObjectDataSize
- * DESCRIPTION
- * Get object data size
- * PARAMETERS
- * void
- * RETURNS
- * object data size
- *****************************************************************************/
- S32 GetEmsObjectDataSize(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- IsAllowed = FALSE;
- switch (currEmsObjectDisplayListState)
- {
- case EMS_OBJECT_PICTURE_STATE:
- return EMS_check_predefined_picture_data_size(userDefinedObjectDataBuff, &IsAllowed);
- case EMS_OBJECT_MY_PICTURE_STATE:
- return EMS_check_userdefined_picture_size(userDefinedObjectDataBuff, &IsAllowed);
- case EMS_OBJECT_MY_ANIMATION_STATE:
- return EMS_check_userdefined_animation_size(userDefinedObjectDataBuff, &IsAllowed);
- #if defined(__MMI_IMELODY_SUPPORT__)
- case EMS_OBJECT_MELODY_STATE:
- return EMS_check_predefined_melody_data_size(userDefinedObjectDataBuff, &IsAllowed);
- case EMS_OBJECT_MY_MELODY_STATE:
- case EMS_OBJECT_MY_MELODY_DOWNLOAD_APP_STATE:
- return EMS_check_userdefined_melody_size(userDefinedObjectDataBuff, &IsAllowed);
- #endif /* defined(__MMI_IMELODY_SUPPORT__) */
- case EMS_OBJECT_MY_PICTURE_A_ANIMATION_DOWNLOAD_APP_STATE:
- if (currObjectListHiliteIndex < currMaxEmsPictureObjects)
- {
- return EMS_check_userdefined_picture_size(userDefinedObjectDataBuff, &IsAllowed);
- }
- else
- {
- return EMS_check_userdefined_animation_size(userDefinedObjectDataBuff, &IsAllowed);
- }
- default:
- return 0;
- }
- }
- /*****************************************************************************
- * FUNCTION
- * ErrorHandlingWhileSavingObject
- * DESCRIPTION
- * This function is just for template.
- * PARAMETERS
- * emsObjectStatus [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void ErrorHandlingWhileSavingObject(EMSTATUS emsObjectStatus)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- switch (emsObjectStatus)
- {
- case EMS_OK:
- DisplayPopup(
- (PU8) GetString(STR_GLOBAL_SAVED),
- IMG_GLOBAL_ACTIVATED,
- 1,
- MESSAGES_POPUP_TIME_OUT,
- (U8) SAVE_TONE);
- break;
- case EMS_ALREADY_INITIALIZED:
- #if (defined(MMI_ON_HARDWARE_P) && defined(__MMI_FILE_MANAGER__))
- DisplayPopup(
- (PU8) GetString(FMGR_FS_FILE_EXISTS_TEXT),
- IMG_GLOBAL_UNFINISHED,
- 1,
- MESSAGES_POPUP_TIME_OUT,
- (U8) ERROR_TONE);
- #else /* (defined(MMI_ON_HARDWARE_P) && defined(__MMI_FILE_MANAGER__)) */
- DisplayPopup(
- (PU8) GetString(STR_EMS_OBJECT_DUPLICATED_NAME_INPUT_AGAIN),
- IMG_GLOBAL_UNFINISHED,
- 1,
- MESSAGES_POPUP_TIME_OUT,
- (U8) ERROR_TONE);
- #endif /* (defined(MMI_ON_HARDWARE_P) && defined(__MMI_FILE_MANAGER__)) */
- break;
- case EMS_NO_SPACE:
- #if (defined(MMI_ON_HARDWARE_P) && defined(__MMI_FILE_MANAGER__))
- DisplayPopup(
- (PU8) GetString(FMGR_FS_DISK_FULL_TEXT),
- IMG_GLOBAL_UNFINISHED,
- 1,
- MESSAGES_POPUP_TIME_OUT,
- (U8) ERROR_TONE);
- #else /* (defined(MMI_ON_HARDWARE_P) && defined(__MMI_FILE_MANAGER__)) */
- DisplayPopup(
- (PU8) GetString(STR_EMS_OBJECT_STAORAGE_FULL),
- IMG_GLOBAL_UNFINISHED,
- 1,
- MESSAGES_POPUP_TIME_OUT,
- (U8) ERROR_TONE);
- #endif /* (defined(MMI_ON_HARDWARE_P) && defined(__MMI_FILE_MANAGER__)) */
- break;
- case EMS_INVALID_FILE_NAME:
- DisplayPopup(
- (PU8) GetString(GetFileSystemErrorString(FS_INVALID_FILENAME)),
- IMG_GLOBAL_UNFINISHED,
- 1,
- MESSAGES_POPUP_TIME_OUT,
- (U8) ERROR_TONE);
- break;
- default /* EMS_UNSPECIFIED_ERROR */ :
- DisplayPopup(
- (PU8) GetString(STR_GLOBAL_UNFINISHED),
- IMG_GLOBAL_UNFINISHED,
- 1,
- MESSAGES_POPUP_TIME_OUT,
- (U8) ERROR_TONE);
- break;
- }
- }
- /*****************************************************************************
- * FUNCTION
- * WriteDownloadObjectDataIntoFileSystem
- * DESCRIPTION
- * Write object data into file system
- * PARAMETERS
- * void
- * RETURNS
- * write result
- *****************************************************************************/
- EMSTATUS WriteDownloadObjectDataIntoFileSystem(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S32 wByte = 0;
- S32 gOpenError = 0;
- S32 gWriteResult = 0;
- FILE_HANDLE emsObjectFilePtr = 0;
- S8 emsObjectFileNameBuf[(MAX_EMS_DOWNLOAD_OBJECT_FILE_LEN + 1) * ENCODING_LENGTH] = {0, 0};
- #if (defined(MMI_ON_HARDWARE_P) && defined(__MMI_FILE_MANAGER__))
- U16 driveName;
- S8 temp[4];
- UI_character_type dir_ems_root[4];
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- driveName = MMI_PUBLIC_DRV;
- sprintf(temp, "%c:\", (S8) driveName);
- AnsiiToUnicodeString((S8*) dir_ems_root, temp);
- #endif /* (defined(MMI_ON_HARDWARE_P) && defined(__MMI_FILE_MANAGER__)) */
- switch (currEmsObjectDisplayListState)
- {
- case EMS_OBJECT_MY_PICTURE_STATE: /* All Download Objects Only... */
- #if (defined(MMI_ON_HARDWARE_P) && defined(__MMI_FILE_MANAGER__))
- pfnUnicodeStrcpy((S8*) emsObjectFileNameBuf, (S8*) dir_ems_root);
- pfnUnicodeStrcat((S8*) emsObjectFileNameBuf, (S8*) FMGR_DEFAULT_FOLDER_IMAGES);
- #else /* (defined(MMI_ON_HARDWARE_P) && defined(__MMI_FILE_MANAGER__)) */
- pfnUnicodeStrcpy(
- (S8*) emsObjectFileNameBuf,
- (S8*) MessagesGetString((S8*) STR_EMS_PIC_A_ANIM_OBJECT_FILE_NAME_INIT_PATH_ID));
- #endif /* (defined(MMI_ON_HARDWARE_P) && defined(__MMI_FILE_MANAGER__)) */
- pfnUnicodeStrcat((S8*) emsObjectFileNameBuf, (S8*) userEmsObjectNameInput);
- pfnUnicodeStrcat(
- (S8*) emsObjectFileNameBuf,
- (S8*) MessagesGetString((S8*) STR_EMS_PICTURE_OBJECT_FILE_NAME_EXTN_ID));
- break;
- case EMS_OBJECT_MY_ANIMATION_STATE:
- #if (defined(MMI_ON_HARDWARE_P) && defined(__MMI_FILE_MANAGER__))
- pfnUnicodeStrcpy((S8*) emsObjectFileNameBuf, (S8*) dir_ems_root);
- pfnUnicodeStrcat((S8*) emsObjectFileNameBuf, (S8*) FMGR_DEFAULT_FOLDER_IMAGES);
- #else /* (defined(MMI_ON_HARDWARE_P) && defined(__MMI_FILE_MANAGER__)) */
- pfnUnicodeStrcpy(
- (S8*) emsObjectFileNameBuf,
- (S8*) MessagesGetString((S8*) STR_EMS_PIC_A_ANIM_OBJECT_FILE_NAME_INIT_PATH_ID));
- #endif /* (defined(MMI_ON_HARDWARE_P) && defined(__MMI_FILE_MANAGER__)) */
- pfnUnicodeStrcat((S8*) emsObjectFileNameBuf, (S8*) userEmsObjectNameInput);
- pfnUnicodeStrcat(
- (S8*) emsObjectFileNameBuf,
- (S8*) MessagesGetString((S8*) STR_EMS_ANIMATION_OBJECT_FILE_NAME_EXTN_ID));
- break;
- #if defined(__MMI_IMELODY_SUPPORT__)
- case EMS_OBJECT_MY_MELODY_STATE:
- #if (defined(MMI_ON_HARDWARE_P) && defined(__MMI_FILE_MANAGER__))
- pfnUnicodeStrcpy((S8*) emsObjectFileNameBuf, (S8*) dir_ems_root);
- pfnUnicodeStrcat((S8*) emsObjectFileNameBuf, (S8*) FMGR_DEFAULT_FOLDER_AUDIO);
- #else /* (defined(MMI_ON_HARDWARE_P) && defined(__MMI_FILE_MANAGER__)) */
- pfnUnicodeStrcpy(
- (S8*) emsObjectFileNameBuf,
- (S8*) MessagesGetString((S8*) STR_EMS_IMELODY_OBJECT_FILE_NAME_INIT_PATH_ID));
- #endif /* (defined(MMI_ON_HARDWARE_P) && defined(__MMI_FILE_MANAGER__)) */
- pfnUnicodeStrcat((S8*) emsObjectFileNameBuf, (S8*) userEmsObjectNameInput);
- pfnUnicodeStrcat(
- (S8*) emsObjectFileNameBuf,
- (S8*) MessagesGetString((S8*) STR_EMS_IMELODY_OBJECT_FILE_NAME_EXTN_ID));
- break;
- #endif /* defined(__MMI_IMELODY_SUPPORT__) */
- }
- /* duplicated filename */
- emsObjectFilePtr = pfopen(emsObjectFileNameBuf, PFS_READ);
- if (emsObjectFilePtr > 0)
- {
- pfclose(emsObjectFilePtr);
- return EMS_ALREADY_INITIALIZED;
- }
- emsObjectFilePtr = pfopen(emsObjectFileNameBuf, PFS_WRITE);
- PRINT_INFORMATION_2((MMI_TRACE_G6_SMS, "*-------[EmsMiscell.c] fopen result = %d -------*", emsObjectFilePtr));
- gOpenError = pfOpenError(emsObjectFilePtr);
- PRINT_INFORMATION_2((MMI_TRACE_G6_SMS, "*-------[EmsMiscell.c] fopen error = %d -------*", gOpenError));
- if (!gOpenError)
- {
- gWriteResult = pfwrite(userDefinedObjectDataBuff, 1, userDefinedObjectDataSize, emsObjectFilePtr, &wByte);
- PRINT_INFORMATION_2((MMI_TRACE_G6_SMS, "*-------[EmsMiscell.c] fwrite result = %d -------*", gWriteResult));
- /* if(userDefinedObjectDataSize==wByte) success ele failure; */
- pfclose(emsObjectFilePtr);
- if (gWriteResult < 0)
- {
- pfdelete(emsObjectFileNameBuf);
- return EMS_NO_SPACE;
- }
- else
- {
- return EMS_OK;
- }
- }
- if (emsObjectFilePtr == FS_INVALID_FILENAME)
- {
- return EMS_INVALID_FILE_NAME;
- }
- else
- {
- return EMS_UNSPECIFIED_ERROR;
- }
- }
- /*****************************************************************************
- * FUNCTION
- * ReadDownloadObjectDataFromFileSystem
- * DESCRIPTION
- * Read object data from file system
- * PARAMETERS
- * index [IN]
- * RETURNS
- * read result
- *****************************************************************************/
- U8 ReadDownloadObjectDataFromFileSystem(S32 index)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- switch (currEmsObjectDisplayListState)
- {
- case EMS_OBJECT_PICTURE_STATE:
- {
- U8 *imagedata;
- U16 imageindex = IMG_EMS01_PIC + (U16) index;
- U16 imagedatasize;
- MemsetUserDefinedObjectDataBuff();
- imagedata = (U8*) GetImage(imageindex);
- imagedatasize = 9 + (*(imagedata + 7)) | (*(imagedata + 8)) << 8;
- memcpy(userDefinedObjectDataBuff, imagedata, imagedatasize);
- emsObjectNameWhenPreview = (U8*) GetString(ManufacturerPictureStrIDs[index]);
- return TRUE;
- }
- #ifdef __MMI_IMELODY_SUPPORT__
- case EMS_OBJECT_MELODY_STATE:
- {
- U8 userDefinedObjectDataBuffTemp[MAX_CURR_EMS_OBJECT_DATA_BUFF];
- MemsetUserDefinedObjectDataBuff();
- memcpy(userDefinedObjectDataBuff, resource_ems_imelodys[index].data, resource_ems_imelodys[index].len);
- userDefinedObjectDataSize = resource_ems_imelodys[index].len;
- EMS_predefined_melody_attach_header(
- userDefinedObjectDataBuff,
- userDefinedObjectDataBuffTemp,
- &userDefinedObjectDataSize);
- memcpy(userDefinedObjectDataBuff, userDefinedObjectDataBuffTemp, userDefinedObjectDataSize);
- return TRUE;
- }
- #endif /* __MMI_IMELODY_SUPPORT__ */
- }
- return FALSE;
- }
- /*****************************************************************************
- * FUNCTION
- * SetCurrEmsObjectDisplayListState
- * DESCRIPTION
- * Set object state
- * PARAMETERS
- * userDefinedObjectDataType [IN] Object data type
- * RETURNS
- * void
- *****************************************************************************/
- void SetCurrEmsObjectDisplayListState(U8 userDefinedObjectDataType)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- switch (userDefinedObjectDataType)
- {
- case EMS_USERDEFINED_PICTURE:
- currEmsObjectDisplayListState = EMS_OBJECT_MY_PICTURE_STATE;
- break;
- case EMS_USERDEFINED_ANIMATION:
- currEmsObjectDisplayListState = EMS_OBJECT_MY_ANIMATION_STATE;
- break;
- /* MTK Joy added for customization, 1014 */
- #if defined(__MMI_IMELODY_SUPPORT__)
- case EMS_USERDEFINED_MELODY:
- currEmsObjectDisplayListState = EMS_OBJECT_MY_MELODY_STATE;
- break;
- #endif /* defined(__MMI_IMELODY_SUPPORT__) */
- /* MTK end */
- }
- }
- /*****************************************************************************
- * FUNCTION
- * CallBackLoadUserDefinedObjectDataBuffPtr
- * DESCRIPTION
- * Call back to get user defined object data
- * PARAMETERS
- * index [IN] Object index
- * RETURNS
- * data buffer pointer
- *****************************************************************************/
- U8 *CallBackLoadUserDefinedObjectDataBuffPtr(S32 index)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (ReadDownloadObjectDataFromFileSystem(index))
- {
- userDefinedObjectDataSize = GetEmsObjectDataSize();
- #if !defined UI_SMALL_IMAGE_SELECTOR_SCREEN
- if (!whether_no_small_screen())
- {
- ChangeTitleString(emsObjectNameWhenPreview);
- draw_title();
- }
- #endif /* !defined UI_SMALL_IMAGE_SELECTOR_SCREEN */
- return userDefinedObjectDataBuff;
- }
- else
- {
- return NULL;
- }
- }
- /*****************************************************************************
- * FUNCTION
- * GetEmsObjectDataInsertStatus
- * DESCRIPTION
- * Get object insert status
- * PARAMETERS
- * index [IN] Object index
- * RETURNS
- * insert status
- *****************************************************************************/
- U16 GetEmsObjectDataInsertStatus(S32 index)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (ReadDownloadObjectDataFromFileSystem(index))
- {
- userDefinedObjectDataSize = GetEmsObjectDataSize();
- listOfIsAllowedData[index] = IsAllowed;
- }
- else
- {
- IsAllowed = 0;
- listOfIsAllowedData[index] = IsAllowed;
- }
- if (IsAllowed)
- {
- return EMS_CAN_INSERT_OBJECT_ID;
- }
- else
- {
- return EMS_CANNOT_INSERT_OBJECT_ID;
- }
- }
- /*****************************************************************************
- * FUNCTION
- * GetEmsObjectDataSizeHint
- * DESCRIPTION
- * Get object data size hint
- * PARAMETERS
- * index [IN] Object index
- * RETURNS
- * hint data pointer
- *****************************************************************************/
- U8 *GetEmsObjectDataSizeHint(U8 index)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (!IsAllowed)
- {
- U8 emsObjectDataSizeHintBuff[10] = { ' ', ' ' };
- memset(hintData[index], 0, MAX_SUB_MENU_HINT_SIZE);
- AnsiiToUnicodeString((S8*) hintData[index], (S8*) emsObjectDataSizeHintBuff);
- return hintData[index];
- }
- return NULL;
- }
- /*****************************************************************************
- * FUNCTION
- * GetEmsObjectDisplayListDetails
- * DESCRIPTION
- * Get object display list
- * PARAMETERS
- * lskStrID [IN/OUT] LSK string ID
- * strItemListPtr [IN/OUT] String list pointer
- * imgItemListPtr [IN/OUT] Image list pointer
- * popUpList [IN/OUT] Popup list pointer
- * RETURNS
- * void
- *****************************************************************************/
- void GetEmsObjectDisplayListDetails(U16 *lskStrID, U8 **strItemListPtr, U16 *imgItemListPtr, U8 **popUpList)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U8 index = 0;
- #if defined(__MMI_IMELODY_SUPPORT__)