SettingScreenProf.c
资源名称:mmi.rar [点击查看]
上传用户:lqx1163
上传日期:2014-08-13
资源大小:9183k
文件大小:477k
源码类别:
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:
- * ---------
- * SettingScreenProf.c
- *
- * Project:
- * --------
- * MAUI
- *
- * Description:
- * ------------
- * This file is intends for Screens for Profiles application
- *
- * 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!
- *
- * 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)
- */
- /***************** Settings Application implementation *********************/
- /**************************************************************
- FILENAME : SettingScreenProf.c
- PURPOSE : Screens for Profiles application
- REMARKS : nil
- AUTHOR : Ashima Bajaj,Deepali Gupta
- DATE : 5/5/2003
- **************************************************************/
- #include "MMI_features.h"
- #include "StdC.h"
- #include "L4Dr1.h"
- #include "PixtelDataTypes.h"
- #include "MainMenuDef.h"
- #include "settingdefs.h"
- #include "settingprot.h"
- #include "Profiles_prot.h"
- #include "CustDataRes.h"
- #include "EventsGprot.h"
- #include "historyGprot.h"
- #include "CustMenuRes.h"
- #include "wgui_categories.h"
- #include "wgui_categories_popup.h"
- #include "HardwareEvents.h"
- #include "Thrdosinterface.h"
- #include "OSThreadInterfaceGprot.h"
- #include "settinggprots.h"
- #include "QueueGprot.h"
- #include "ProtocolEvents.h"
- #include "Unicodexdcl.h"
- #include "SettingProfile.h"
- #include "ProfilesEnum.h"
- #include "Globaldefs.h"
- #include "ProfilesGdcl.h"
- #include "ProfileGprots.h"
- #include "GpioInc.h"
- #include "NVRAMEnum.h"
- #include "NVRAMProt.h"
- #include "NVRAMType.h"
- #include "DebugInitDef.h"
- #include "VolumeHandler.h"
- #include "wgui_status_icons.h"
- #include "DownloadProtos.h"
- #include "CommonScreens.h"
- #include "IdleAppProt.h"
- #include "KeyBrd.h"
- #include "IdleAppDef.h"
- #include "ATHandlerProt.h"
- /* Leo add for DLT */
- #include "FileSystemDef.h" /* Ritesh */
- /* Leo end */
- #include "FrameworkStruct.h"
- #ifdef __MMI_PROFILE_EXTMELODY_SUPPORT__
- #include "FileMgr.h"
- #include "Conversions.h"
- #include "ProfilesDefs.h"
- #include "ProfileMgr.h" /* Profile Magager General Include file */
- #include "ProfileMgrGProt.h" /* Profile Magager Extern Include file */
- #endif /* __MMI_PROFILE_EXTMELODY_SUPPORT__ */
- #include "phonebookdef.h"
- #include "mdi_datatype.h"
- #include "mdi_audio.h"
- #include "CallManagementGprot.h"
- #ifdef __DRM_SUPPORT__
- #ifdef MMI_ON_HARDWARE_P
- #include "FileMgr.h"
- #include "Fs_errcode.h"
- #include "Drm_gprot.h"
- #endif /* MMI_ON_HARDWARE_P */
- #endif /* __DRM_SUPPORT__ */
- //KP Jerry add on 2007-4-1 for can use "g_phnset_gpio_cntx_p" start
- #ifdef __MMI_PROFILE_POWER_SAVING__
- #include "PhnsetGPIO.h"
- #endif
- //KP Jerry add on 2007-4-1 for can use "g_phnset_gpio_cntx_p" end
- /* Leo add for DLT */
- #include "MMIThemes.h" /* ritesh */
- /* Leo end */
- /* PMT SUKRIT START 20051226 */
- #ifdef __MMI_PROFILES_TWO_LINE_MENUITEM_DISPLAY__
- #include "MessagesExDcl.h"
- S32 default_value_ring_volume;
- S32 default_value_keypad_volume;
- S32 is_level_select_menuitem_displayed_in_volume_screen = 1;
- S32 default_value_ring_volume;
- S32 default_value_keypad_volume;
- S32 ring_volume_index = -1;
- S32 keypad_volume_index = -1;
- #endif /* __MMI_PROFILES_TWO_LINE_MENUITEM_DISPLAY__ */
- /* PMT SUKRIT END 20051226 */
- void (*gfnprofilelsk) (void);
- void (*gfnprofilersk) (void);
- extern void EntryScrSetKeyPadVolumeLevel(void);
- extern void GetRingToneRange(U8 *startId, U8 *totalId);
- extern void GetMidiRange(U8 *startId, U8 *totalId);
- extern void GetToneRange(U8 *startId, U8 *totalId);
- extern S32 volume_level_UI;
- #ifdef __MMI_PROFILE_EXTMELODY_SUPPORT__
- static PRFSET_MELODY_CONF_TYPE prfset_conf_type = 0;
- static U8 g_ext_melody_idx = 0;
- static U8 extMldHlitItem = 0;
- #endif /* __MMI_PROFILE_EXTMELODY_SUPPORT__ */
- //KP Jerry add for changing the style of message tone list on 2007-4-10 start
- #ifdef __MMI_TONE_LIST_STYLE_CHANGED__
- static U8 g_ms_ext_melody_idx = 0;
- static U8 ms_extMldHlitItem = 0;
- static U8 g_pon_off_ext_melody_idx = 0;
- static U8 pon_off_extMldHlitItem = 0;
- #endif
- //KP Jerry add for changing the style of message tone list on 2007-4-10 end
- #if defined(__MMI_PHB_CALLER_RES_SETTING__)
- extern void mmi_phb_caller_ring_forward_to_entry(U16 ringToneId);
- #endif
- #ifdef __MMI_BT_PROFILE__
- void mmi_profiles_bt_open_stream_callback(U8 profile, mdi_result result);
- void mmi_profiles_bt_close_stream_callback(U8 profile, mdi_result result);
- #endif /* __MMI_BT_PROFILE__*/
- static BOOL ring_tone_playing = FALSE;
- static mmi_frm_kbd_tone_state_enum key_tone_state;
- /*****************************************************************************
- * FUNCTION
- * mmi_profiles_set_ring_tone_playing
- * DESCRIPTION
- * set ring tone playing flag
- *
- * used for AudioPlayToneWithCallBackVolPath
- * PARAMETERS
- * is_playing [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_profiles_set_ring_tone_playing(BOOL is_playing)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- ring_tone_playing = is_playing;
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_profiles_is_ring_tone_playing
- * DESCRIPTION
- * check does ring tone is playing
- *
- * used for AudioPlayToneWithCallBackVolPath
- * PARAMETERS
- * void
- * RETURNS
- * BOOL
- *****************************************************************************/
- BOOL mmi_profiles_is_ring_tone_playing(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- return ring_tone_playing;
- }
- #if defined(__DRM_SUPPORT__) && defined(MMI_ON_HARDWARE_P)
- /*****************************************************************************
- * FUNCTION
- * mmi_profiles_check_DRM_content_forwardable
- * DESCRIPTION
- * check does the file is DRM prohibted to forward
- * PARAMETERS
- * filename [IN]
- * RETURNS
- * BOOL
- *****************************************************************************/
- BOOL mmi_profiles_check_DRM_content_forwardable(UI_string_type filename)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- FS_HANDLE handle;
- DRM_RIGHTS_STRUCT *rights;
- U8 fwd_flag = FMGR_DRM_FWD_APP_FWD_OUT;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if ((handle = DRM_open_file(filename, FS_READ_ONLY, DRM_PERMISSION_NONE)) > FS_NO_ERROR)
- {
- if ((rights = DRM_get_rights(handle)) != NULL)
- {
- DRM_CONSTRAINT_STRUCT *cons;
- U8 permission = DRM_PERMISSION_NONE;
- cons = &rights->play;
- permission |= DRM_PERMISSION_PLAY;
- if (rights->method & DRM_METHOD_SEPARATE_DELIVERY)
- {
- if (!(rights->status == DRM_STATUS_RIGHTS_PRESENT && (rights->permission & permission) &&
- cons != NULL && cons->type == DRM_CONSTRAINT_NONE))
- {
- if (rights->method & DRM_METHOD_FORWARD_LOCK)
- {
- fwd_flag = FMGR_DRM_NO_FWD_APP_NO_FWD_OUT; /* can't forward, can't set as ringtine wallpaper */
- }
- else
- {
- fwd_flag = FMGR_DRM_NO_FWD_APP_FWD_OUT; /* can forward, can't set as ringtone wallpaper */
- }
- }
- }
- else if (rights->method & DRM_METHOD_COMBINED_DELIVERY)
- {
- if ((rights->permission & permission) && cons != NULL && cons->type == DRM_CONSTRAINT_NONE)
- {
- fwd_flag = FMGR_DRM_FWD_APP_NO_FWD_OUT; /* can't forward, can set as ringtone wallpaper */
- }
- else
- {
- fwd_flag = FMGR_DRM_NO_FWD_APP_NO_FWD_OUT; /* can't forward, can't set as ringtine wallpaper */
- }
- }
- else
- {
- fwd_flag = FMGR_DRM_FWD_APP_NO_FWD_OUT; /* can't forward, can set as ringtone wallpaper */
- }
- }
- DRM_close_file(handle);
- }
- else
- {
- fwd_flag = FMGR_DRM_NO_FWD_APP_NO_FWD_OUT;
- }
- if (fwd_flag == FMGR_DRM_NO_FWD_APP_NO_FWD_OUT || fwd_flag == FMGR_DRM_NO_FWD_APP_FWD_OUT)
- {
- return FALSE;
- }
- else
- {
- return TRUE;
- }
- }
- #endif /* defined(__DRM_SUPPORT__) && defined(MMI_ON_HARDWARE_P) */
- /*****************************************************************************
- * FUNCTION
- * mmi_profiles_is_device_profile
- * DESCRIPTION
- * check does the selected or activated profile a device profile which can't be activated manually
- * PARAMETERS
- * void
- * BOOL(?) [OUT]
- * RETURNS
- * void
- *****************************************************************************/
- BOOL mmi_profiles_is_device_profile(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- //KP Jerry add on 2007-4-3 start
- #ifdef __MMI_PROFILE_POWER_SAVING__
- #ifdef __MMI_BT_PROFILE__
- if ((gprofileId == MMI_PROFILE_HEADSET) || (gprofileheadset == 1) || (gprofileId == MMI_PROFILE_BT) ||
- (gactivatedprofile == MMI_PROFILE_BT) || (gprofileId == MMI_PROFILE_POWER_SAVING))
- {
- return TRUE;
- }
- #else /* __MMI_BT_PROFILE__ */
- if ((gprofileId == MMI_PROFILE_HEADSET) || (gprofileheadset == 1) || (gprofileId == MMI_PROFILE_POWER_SAVING))
- {
- return TRUE;
- }
- #endif /* __MMI_BT_PROFILE__ */
- #else/*!__MMI_PROFILE_POWER_SAVING__*/
- #ifdef __MMI_BT_PROFILE__
- if ((gprofileId == MMI_PROFILE_HEADSET) || (gprofileheadset == 1) || (gprofileId == MMI_PROFILE_BT) ||
- (gactivatedprofile == MMI_PROFILE_BT))
- {
- return TRUE;
- }
- #else /* __MMI_BT_PROFILE__ */
- if ((gprofileId == MMI_PROFILE_HEADSET) || (gprofileheadset == 1))
- {
- return TRUE;
- }
- #endif /* __MMI_BT_PROFILE__ */
- #endif/*__MMI_PROFILE_POWER_SAVING__*/
- //KP Jerry add on 2007-4-3 end
- return FALSE;
- }
- /*****************************************************************************
- * FUNCTION
- * InitProfileApp
- * DESCRIPTION
- * Initialize Profile Application
- * PARAMETERS
- * void
- * S16(?) [OUT]
- * RETURNS
- * void
- *****************************************************************************/
- S16 InitProfileApp(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (gprofilenvram == 0)
- {
- initializeProfiles();
- ActivatefirstProfile();
- }
- SetHiliteHandler(MAIN_MENU_PROFILES_GENERAL, HighlightGeneralProfile);
- SetHiliteHandler(MAIN_MENU_PROFILES_MEETING, HighlightMeetingProfile);
- SetHiliteHandler(MAIN_MENU_PROFILES_OUTDOOR, HighlightOutdoorProfile);
- SetHiliteHandler(MAIN_MENU_PROFILES_INDOOR, HighlightIndoorProfile);
- SetHiliteHandler(MAIN_MENU_PROFILES_HEADSET, HighlightHeadsetProfile);
- #ifdef __MMI_BT_PROFILE__
- SetHiliteHandler(MAIN_MENU_PROFILES_BT, mmi_profiles_bt_profile_highlight_hdlr);
- #endif
- #ifndef __MMI_PROF_MENU_ACTIVE_SHRINK__
- SetHiliteHandler(MENU_PROFILES_OPTIONS, HighlightProfilesOptions);
- SetHiliteHandler(MENU_PROFILES_CUSTOMIZE, HighlightProfilesCustomize);
- #endif /* __MMI_PROF_MENU_ACTIVE_SHRINK__ */
- SetHiliteHandler(MENU_PROFILES_ACTIVATE, HighlightProfileActivateOptions);
- SetHiliteHandler(MENU_VOLUME_LEVEL, HighlightProfilesVolumeLevel);
- SetHiliteHandler(MENU_MT_CALL_ALERT_TYPE, HighlightProfilesCallAlert);
- SetHiliteHandler(MENU_RING_TYPE, HighlightProfilesRingType);
- SetHiliteHandler(MENU_ANSEWRING_MODE, HighlightProfilesAnsweringMode);
- #ifdef __MMI_STATUS_LED__
- SetHiliteHandler(MENU_LIGHT_STATUS, HighlightProfilesStatus);
- #endif
- //KP Jerry add on 2007-03-31 start
- #ifdef __MMI_PROFILE_POWER_SAVING__
- SetHiliteHandler(MAIN_MENU_PROFILES_POWER_SAVING, HighlightPowerSavingProfile);
- SetHiliteHandler(MENU_LCDBL, HighlightProfilesLCDBL);
- SetHiliteHandler(MENU_KEYBL, HighlightProfilesKEYBL);
- SetHintHandler(MENU_KEYBL, HintProfilesKEYBL);
- #endif
- //KP Jerry add on 2007-03-31 end
- SetHiliteHandler(MENU_TONE_SETUP, HighlightProfilesToneSetup);
- SetHiliteHandler(MENU_TONE_SETUP_RING_TONE, HighlightProfilesRingToneSetup);
- SetHiliteHandler(MENU_TONE_SETUP_POWERON_TONE, HighlightProfilesPoweronToneSetup);
- SetHiliteHandler(MENU_TONE_SETUP_POWEROFF_TONE, HighlightProfilesPoweroffToneSetup);
- /* MTK brian added to wrap cover open/close tone setup, 2003/10/18 */
- #ifdef __MMI_CLAMSHELL__
- SetHiliteHandler(MENU_TONE_SETUP_COVEROPEN_TONE, HighlightProfilesCoverOpenToneSetup);
- SetHiliteHandler(MENU_TONE_SETUP_COVERCLOSE_TONE, HighlightProfilesCoverCloseToneSetup);
- #endif /* __MMI_CLAMSHELL__ */
- /* MTK end */
- SetHiliteHandler(MENU_TONE_SETUP_MESSAGE_TONE, HighlightProfilesMessageToneSetup);
- SetHiliteHandler(MENU_TONE_SETUP_KEYPAD_TONE, HighlightProfilesKeypadToneSetup);
- #ifndef __MMI_ALM_CUSTOMIZE_TONE__
- SetHiliteHandler(MENU_TONE_SETUP_ALARM_TONE, HighlightAlarmToneSetup);
- #endif
- SetHiliteHandler(MENU_EXTRA_TONE, HighlightExtraToneSetup);
- SetHiliteHandler(MENU_RING_VOLUME_LEVEL, HighlightRingToneVolume);
- SetHiliteHandler(MENU_KEYPAD_VOLUME_LEVEL, HighlightKeyToneVolume);
- SetHiliteHandler(MENU_RING, HighlightCallAlertRing);
- SetHiliteHandler(MENU_VIBRATION_ONLY, HighlightCalAlertVibrationOnly);
- SetHiliteHandler(MENU_VIBRATION_AND_RING, HighlightCallAlertVibrationAndRing);
- SetHiliteHandler(MENU_VIBRATION_THEN_RING, HighlightCallAlertVibrationThenRing);
- SetHiliteHandler(MENU_SILENT, HighlightCallAlertSilent);
- SetHiliteHandler(MENU_RING_TYPE_SINGLE, HighlightRingTypeSingle);
- SetHiliteHandler(MENU_RING_TYPE_REPEAT, HighlightRingTypeRepeat);
- SetHiliteHandler(MENU_RING_TYPE_ASCENDING, HighlightRingTypeAscending);
- #ifdef __MMI_CONNECT_NOTICE__
- SetHiliteHandler(MENU_CONNECT_NOTICE, HighlightProfilesConnectNotice);
- SetHiliteHandler(MENU_NOTICE_NONE, HighlightConnectNoticeNone);
- SetHiliteHandler(MENU_NOTICE_TONE_ONLY, HighlightConnectNoticeToneOnly);
- SetHiliteHandler(MENU_NOTICE_VIB_ONLY, HighlightConnectNoticeVibOnly);
- SetHiliteHandler(MENU_NOTICE_TONE_AND_VIB, HighlightConnectNoticeToneAndVib);
- #endif /* __MMI_CONNECT_NOTICE__ */
- SetHiliteHandler(MENU_KEYPAD_TONE_SILENT, HighlightKeyPadToneSilent);
- SetHiliteHandler(MENU_KEYPAD_TONE_CLICK, HighlightKeyPadToneClick);
- SetHiliteHandler(MENU_KEYPAD_TONE_TONE, HighlightKeyPadToneTone);
- #if defined(__MMI_HUMAN_VOICE_KEYPAD_TONE__)
- SetHiliteHandler(MENU_KEYPAD_TONE_HUMAN_VOICE_1, HighlightKeyPadToneHumanVoice1);
- SetHiliteHandler(MENU_KEYPAD_TONE_HUMAN_VOICE_2, HighlightKeyPadToneHumanVoice2);
- SetHiliteHandler(MENU_KEYPAD_TONE_HUMAN_VOICE_3, HighlightKeyPadToneHumanVoice3);
- SetHiliteHandler(MENU_KEYPAD_TONE_HUMAN_VOICE_4, HighlightKeyPadToneHumanVoice4);
- SetHiliteHandler(MENU_KEYPAD_TONE_HUMAN_VOICE_5, HighlightKeyPadToneHumanVoice5);
- SetHiliteHandler(MENU_KEYPAD_TONE_HUMAN_VOICE_6, HighlightKeyPadToneHumanVoice6);
- #endif /* defined(__MMI_HUMAN_VOICE_KEYPAD_TONE__) */
- #if defined(__MMI_CUST_KEYPAD_TONE__)
- SetHiliteHandler(MENU_KEYPAD_TONE_CUST_1, HighlightKeyPadToneCust1);
- SetHiliteHandler(MENU_KEYPAD_TONE_CUST_2, HighlightKeyPadToneCust2);
- SetHiliteHandler(MENU_KEYPAD_TONE_CUST_3, HighlightKeyPadToneCust3);
- SetHiliteHandler(MENU_KEYPAD_TONE_CUST_4, HighlightKeyPadToneCust4);
- SetHiliteHandler(MENU_KEYPAD_TONE_CUST_5, HighlightKeyPadToneCust5);
- SetHiliteHandler(MENU_KEYPAD_TONE_CUST_6, HighlightKeyPadToneCust6);
- #endif /* defined(__MMI_CUST_KEYPAD_TONE__) */
- #if defined(__MMI_INTELLIGENT_CALL_ALERT__)
- SetHiliteHandler(MENU_INTELLIGENT_CALL_ALERT, HighlightHandlerIntelligentCallAlert);
- SetHintHandler(MENU_INTELLIGENT_CALL_ALERT, HintIntelligentCallAlert);
- SetHiliteHandler(MENU_INTELLIGENT_CALL_ALERT_ON, HighlightHandlerIntelligentCallAlertOn);
- SetHiliteHandler(MENU_INTELLIGENT_CALL_ALERT_OFF, HighlightHandlerIntelligentCallAlertOff);
- #endif /* defined(__MMI_INTELLIGENT_CALL_ALERT__) */
- SetHintHandler(MENU_TONE_SETUP_RING_TONE, HintHandlerIncomingCall);
- #ifndef __MMI_ALM_CUSTOMIZE_TONE__
- SetHintHandler(MENU_TONE_SETUP_ALARM_TONE, HintHandlerAlarmTone);
- #endif
- SetHintHandler(MENU_TONE_SETUP_POWERON_TONE, HintHandlerPowerOnTone);
- SetHintHandler(MENU_TONE_SETUP_POWEROFF_TONE, HintHandlerPowerOffTone);
- SetHintHandler(MENU_TONE_SETUP_MESSAGE_TONE, HintHandlerMessgaeTone);
- SetHintHandler(MENU_TONE_SETUP_KEYPAD_TONE, HintHandlerKeypadTone);
- /* MTK brian added to wrap cover open/close tone setup, 2003/10/18 */
- #ifdef __MMI_CLAMSHELL__
- SetHintHandler(MENU_TONE_SETUP_COVEROPEN_TONE, HintHandlerCoverOpenTone);
- SetHintHandler(MENU_TONE_SETUP_COVERCLOSE_TONE, HintHandlerCoverCloseTone);
- #endif /* __MMI_CLAMSHELL__ */
- /* MTK end */
- SetHintHandler(MENU_MT_CALL_ALERT_TYPE, HintHandlerAlertType);
- SetHintHandler(MENU_RING_TYPE, HintHandlerRingType);
- #ifdef __MMI_CONNECT_NOTICE__
- SetHintHandler(MENU_CONNECT_NOTICE, HintHandlerConnectNotice);
- #endif
- SetHintHandler(MENU_RING_VOLUME_LEVEL, HintHandlerRingVolume);
- SetHintHandler(MENU_KEYPAD_VOLUME_LEVEL, HintHandlerKeyVolume);
- #ifdef __MMI_STATUS_LED__
- SetHintHandler(MENU_LIGHT_STATUS, HintHandlerStatusLED);
- #endif
- #ifdef __MMI_BT_PROFILE__
- #ifdef __MMI_HFP_SUPPORT__
- mdi_audio_bt_init(BT_HFP, mmi_profiles_bt_open_stream_callback, mmi_profiles_bt_close_stream_callback);
- #endif
- #if defined(__MMI_BT_BCHS_SUPPORT__) && defined(__MMI_A2DP_SUPPORT__)
- mdi_audio_bt_init(BT_A2DP, mmi_profiles_bt_open_stream_callback, mmi_profiles_bt_close_stream_callback);
- #endif
- #endif /* __MMI_BT_PROFILE__ */
- return 0;
- }
- /*****************************************************************************
- * FUNCTION
- * initnvramprofapp
- * DESCRIPTION
- * Initialize NVRAM for Profile
- * PARAMETERS
- * void
- * S16(?) [OUT]
- * RETURNS
- * void
- *****************************************************************************/
- void initnvramprofapp(void)
- {
- #ifdef USE_NVRAM_FOR_PROFILES
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S16 error;
- U16 j;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- gprofilenvram = 1;
- j = 1;
- ReadRecord(
- NVRAM_EF_PROFILES_LID,
- j,
- &gprofiles[0],
- MAX_ELEMENTS * sizeof(PROFILE) /* NVRAM_PROFILES_RECORD_SIZE */ ,
- &error);
- #ifdef MMI_ON_WIN32
- if (gprofiles[1].toneSetup.ringTone == 65535)
- {
- initializeProfiles();
- glastactivatedprofile = MMI_PROFILE_GENERAL;
- WriteValue(NVRAM_PROFILES_LASTACTIVATED, &glastactivatedprofile, DS_BYTE, &error);
- gactivatedprofile = 0;
- WriteValue(NVRAM_PROFILES_ACTIVATED, &gactivatedprofile, DS_BYTE, &error);
- j = 1;
- if (WriteRecord(
- NVRAM_EF_PROFILES_LID,
- j,
- &gprofiles[0],
- NVRAM_PROFILES_RECORD_SIZE,
- &error) < NVRAM_PROFILES_RECORD_SIZE)
- {
- PRINT_INFORMATION(("## ERROR: InitProfiles: WriteRecord " "to NVRAM failed (ecode%d)n", (int)error));
- }
- }
- #endif /* MMI_ON_WIN32 */
- ReadValue(NVRAM_PROFILES_ACTIVATED, &gactivatedprofile, DS_BYTE, &error);
- ReadValue(NVRAM_PROFILES_LASTACTIVATED, &glastactivatedprofile, DS_BYTE, &error);
- #endif /* USE_NVRAM_FOR_PROFILES */
- if( mmi_gpio_is_earphone_plug_in() )
- mmi_profiles_headset_activate_profile();
- else
- {
- ActivateProfile();
- showAlertStatusIcons(); /* function to show status icon on ilde screen */
- }
- }
- /*****************************************************************************
- * FUNCTION
- * EntryScrProfiles
- * DESCRIPTION
- * Entry fn for main profile screen
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void EntryScrProfiles(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U16 nStrItemList[MAX_SUB_MENUS]; /* Stores the strings id of submenus returned */
- U8 *guiBuffer; /* Buffer holding history data */
- U16 gimagearray2[MAX_SUB_MENUS]; /* array for profilenames */
- U16 nDispAttribute; /* Stores display attribue */
- U8 i = 0, data = 0;
- U16 nNumofItem; /* Stores no of children in the submenu */
- U16 ItemIcons[MAX_SUB_MENUS];
- static U8 prev_data = 0;
- U16 menu_id = 0;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- PRINT_INFORMATION(("<<------- profile list ------->>"));
- /* 1 Call Exit Handler */
- EntryNewScreen(SCR_PROFILES, ExitScrProfiles, EntryScrProfiles, NULL);
- /* 2 Get current screen to gui buffer for history purposes */
- guiBuffer = GetCurrGuiBuffer(SCR_PROFILES);
- /* 3. Retrieve no of child of menu item to be displayed */
- nNumofItem = GetNumOfChild(MAIN_MENU_PROFILES_MENUID);
- /* 5. Get attribute of menu to be displayed */
- nDispAttribute = GetDispAttributeOfItem(MAIN_MENU_PROFILES_MENUID);
- /* 6. Retrieve string ids in sequence of given menu item to be displayed */
- GetSequenceStringIds(MAIN_MENU_PROFILES_MENUID, nStrItemList);
- GetSequenceImageIds(MAIN_MENU_PROFILES_MENUID, ItemIcons);
- SetParentHandler(MAIN_MENU_PROFILES_MENUID);
- for (i = 0; i < nNumofItem; i++)
- {
- gimagearray2[i] = IMG_PROFILES_NO_IMAGE;
- }
- for (i = 0; i < nNumofItem; i++)
- {
- memset((S8*) subMenuDataPtrs[i], 0, MAX_SUB_MENU_SIZE);
- pfnUnicodeStrncpy((S8*) subMenuDataPtrs[i], GetString(nStrItemList[i]), MAX_SUBMENU_CHARACTERS);
- }
- /****** Get the index of activated profile menu ID*****/
- switch (gactivatedprofile)
- {
- case MMI_PROFILE_GENERAL:
- menu_id = MAIN_MENU_PROFILES_GENERAL;
- break;
- case MMI_PROFILE_MEETING:
- menu_id = MAIN_MENU_PROFILES_MEETING;
- break;
- case MMI_PROFILE_OUTDOOR:
- menu_id = MAIN_MENU_PROFILES_OUTDOOR;
- break;
- case MMI_PROFILE_INDOOR:
- menu_id = MAIN_MENU_PROFILES_INDOOR;
- break;
- case MMI_PROFILE_HEADSET:
- menu_id = MAIN_MENU_PROFILES_HEADSET;
- break;
- //KP Jerry add on 2007-03-31 start
- #ifdef __MMI_PROFILE_POWER_SAVING__
- case MMI_PROFILE_POWER_SAVING:
- menu_id = MAIN_MENU_PROFILES_POWER_SAVING;
- break;
- #endif
- //KP Jerry add on 2007-03-31 end
- case MMI_PROFILE_SILENT:
- data = 0;
- break;
- #ifdef __MMI_BT_PROFILE__
- case MMI_PROFILE_BT:
- menu_id = MAIN_MENU_PROFILES_BT;
- break;
- #endif /* __MMI_BT_PROFILE__ */
- default:
- ASSERT(0);
- }
- /* If activated profile is silent then no profile should be seen as activated */
- if (gactivatedprofile != MMI_PROFILE_SILENT)
- {
- data = GetIndexOfStringId(MAIN_MENU_PROFILES_MENUID, menu_id);
- gimagearray2[data] = IMG_PROFILES_ACTIVATED;
- }
- /* ingore guiBuffer when previous activated profile is different thant current profile after back history */
- if (guiBuffer != NULL && prev_data != data)
- {
- guiBuffer = NULL;
- }
- prev_data = data;
- RegisterHighlightHandler(ExecuteCurrHiliteHandler);
- /* MTK Leo add, mini_tab_bar */
- #ifdef __MMI_WGUI_MINI_TAB_BAR__
- wgui_enable_mini_tab_bar(MAIN_MENU_PROFILES_MENUID);
- #endif
- /* MTK Leo end */
- ShowCategory73Screen(
- STR_PROFILE_CAPTION,
- IMG_PROFILES_TITLEE,
- STR_GLOBAL_OPTIONS,
- 0,
- STR_GLOBAL_BACK,
- 0,
- nNumofItem,
- (U8 **) subMenuDataPtrs,
- (U16*) gimagearray2,
- ItemIcons,
- (U16) data,
- guiBuffer,
- 1);
- SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
- SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
- }
- /*****************************************************************************
- * FUNCTION
- * ExitScrProfiles
- * DESCRIPTION
- * Exit profile screen
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void ExitScrProfiles(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- gprofileId = (U8) gcurrHiliteIndexOne;
- /* MTK Leo add, mini_tab_Bar */
- #ifdef __MMI_WGUI_MINI_TAB_BAR__
- wgui_disable_mini_tab_bar();
- #endif
- /* MTK Leo end */
- }
- /*****************************************************************************
- * FUNCTION
- * EntryScrProfilesOptions
- * DESCRIPTION
- * Entry Function of Profiles Options
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void EntryScrProfilesOptions(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U16 nStrItemList[MAX_SUB_MENUS]; /* Stores the strings id of submenus returned */
- U16 nNumofItem; /* Stores no of children in the submenu */
- U16 nDispAttribute; /* Stores display attribue */
- U8 *guiBuffer; /* Buffer holding history data */
- U8 *PopUpList[MAX_SUB_MENUS];
- S8 i = 0;
- U16 ParentId;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- /* 1 Call Exit Handler */
- EntryNewScreen(SCR_PROFILES_OPTIONS, NULL, EntryScrProfilesOptions, NULL);
- /****If headset is connected then options menu should show Customize only*******/
- if (mmi_profiles_is_device_profile())
- {
- ParentId = MENU_PROFILES_OPTIONS_CUSTOMIZE;
- }
- else
- {
- ParentId = MENU_PROFILES_OPTIONS;
- }
- /* 1 Set parent handler */
- SetParentHandler(ParentId);
- /* 2 Get current screen to gui buffer for history purposes */
- guiBuffer = GetCurrGuiBuffer(SCR_PROFILES_OPTIONS);
- /* 3. Retrieve no of child of menu item to be displayed */
- nNumofItem = GetNumOfChild(ParentId);
- /* 4. Get attribute of menu to be displayed */
- nDispAttribute = GetDispAttributeOfItem(ParentId);
- /* 5. Retrieve string ids in sequence of given menu item to be displayed */
- GetSequenceStringIds(ParentId, nStrItemList);
- for (i = 0; i < nNumofItem; i++)
- {
- PopUpList[i] = NULL;
- }
- RegisterHighlightHandler(ExecuteCurrHiliteHandler);
- /* 8 Display Category Screen */
- ShowCategory52Screen(
- STR_PROFILE_OPTION_CAPTION,
- IMG_PROFILES_TITLEE,
- STR_GLOBAL_OK,
- IMG_GLOBAL_OK,
- STR_GLOBAL_BACK,
- IMG_GLOBAL_BACK,
- nNumofItem,
- nStrItemList,
- (PU16) gIndexIconsImageList,
- PopUpList,
- 0,
- 0,
- guiBuffer);
- /* 9.Register function with right softkey */
- SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
- /* 10. Register Exit handler */
- /* SetExitHandler(SCR_PROFILES_OPTIONS, ExitScrProfilesOptions); */
- }
- /*****************************************************************************
- * FUNCTION
- * EntryScrProfilesActivate
- * DESCRIPTION
- * Activates the Highlighted profile
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void EntryScrProfilesActivate(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S16 error = 0;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- /* SetParentHandler(MENU_PROFILES_ACTIVATE); */
- gactivatedprofile = gprofileId;
- DisplayPopup(
- (PU8) GetString(STR_GENERAL_ACTIVATE_MESSAGE),
- IMG_GLOBAL_ACTIVATED,
- 1,
- UI_POPUP_NOTIFYDURATION_TIME,
- SUCCESS_TONE);
- DeleteNHistory(1);
- WriteValue(NVRAM_PROFILES_ACTIVATED, &gactivatedprofile, DS_BYTE, &error);
- ActivateProfile();
- }
- /*****************************************************************************
- * FUNCTION
- * EntryScrProfilesActivateById
- * DESCRIPTION
- * Activates the profileId
- * PARAMETERS
- * profileId [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void EntryScrProfilesActivateById(U8 profileId)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S8 str_activate[100];
- U16 msg_id = 0;
- S16 error = 0;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- switch (profileId)
- {
- case MMI_PROFILE_GENERAL:
- msg_id = STR_PROFILES_GENERAL;
- break;
- case MMI_PROFILE_MEETING:
- msg_id = STR_PROFILES_MEETING;
- break;
- case MMI_PROFILE_OUTDOOR:
- msg_id = STR_PROFILES_OUTDOOR;
- break;
- case MMI_PROFILE_INDOOR:
- msg_id = STR_PROFILES_INDOOR;
- break;
- case MMI_PROFILE_HEADSET:
- msg_id = STR_PROFILES_HEADSET;
- break;
- //KP Jerry add on 2007-03-31 start
- #ifdef __MMI_PROFILE_POWER_SAVING__
- case MMI_PROFILE_POWER_SAVING:
- msg_id = STR_PROFILES_POWER_SAVING;
- break;
- #endif
- //KP Jerry add on 2007-03-31 end
- case MMI_PROFILE_SILENT:
- msg_id = STR_PROFILES_SILENT;
- break;
- #ifdef __MMI_BT_PROFILE__
- case MMI_PROFILE_BT:
- msg_id = STR_PROFILES_BT;
- break;
- #endif /* __MMI_BT_PROFILE__ */
- default:
- MMI_ASSERT(0);
- }
- pfnUnicodeStrcpy(str_activate, GetString(msg_id));
- pfnUnicodeStrcat(str_activate, (S8*) L" ");
- pfnUnicodeStrcat(str_activate, GetString(STR_GENERAL_ACTIVATE_MESSAGE));
- gactivatedprofile = gprofileId = profileId;
- DisplayPopup((U8*) str_activate, IMG_GLOBAL_ACTIVATED, TRUE, UI_POPUP_NOTIFYDURATION_TIME, SUCCESS_TONE);
- WriteValue(NVRAM_PROFILES_ACTIVATED, &gactivatedprofile, DS_BYTE, &error);
- ActivateProfile();
- }
- /*****************************************************************************
- * FUNCTION
- * EntryScrProfilesCustomize
- * DESCRIPTION
- * Showing profile customize screen
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void EntryScrProfilesCustomize(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U16 nStrItemList[MAX_SUB_MENUS]; /* Stores the strings id of submenus returned */
- U16 nNumofItem; /* Stores no of children in the submenu */
- U16 nDispAttribute; /* Stores display attribue */
- U8 *guiBuffer; /* Buffer holding history data */
- U8 *PopUpList[MAX_SUB_MENUS];
- U16 Parentid;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- /* 1 Call Exit Handler */
- /* Shall leave the exit handler for AT command set vibrator mode */
- EntryNewScreen(SCR_PROFILES_CUSTOMIZE, ExitScrProfilesCustomize, NULL, NULL);
- /* chinese no font size */
- if (IsChineseSet())
- {
- #ifdef __MMI_PROF_MENU_ACTIVE_SHRINK__
- if (mmi_profiles_is_device_profile())
- {
- Parentid = MENU_PROFILES_CUSTOMIZE_CHINESE_DEVICE;
- }
- else
- #endif /* __MMI_PROF_MENU_ACTIVE_SHRINK__ */
- Parentid = MENU_PROFILES_CUSTOMIZE_CHINESE;
- }
- else
- {
- #ifdef __MMI_PROF_MENU_ACTIVE_SHRINK__
- if (mmi_profiles_is_device_profile())
- {
- Parentid = MENU_PROFILES_CUSTOMIZE_DEVICE;
- }
- else
- #endif /* __MMI_PROF_MENU_ACTIVE_SHRINK__ */
- Parentid = MENU_PROFILES_CUSTOMIZE;
- }
- /* 2 Get current screen to gui buffer for history purposes */
- guiBuffer = GetCurrGuiBuffer(SCR_PROFILES_CUSTOMIZE);
- /* 3. Retrieve no of child of menu item to be displayed */
- nNumofItem = GetNumOfChild(Parentid);
- /* 4. Get attribute of menu to be displayed */
- nDispAttribute = GetDispAttributeOfItem(Parentid);
- /* 5. Retrieve string ids in sequence of given menu item to be displayed */
- GetSequenceStringIds(Parentid, nStrItemList);
- /* 6 Set current parent id */
- SetParentHandler(Parentid);
- /* 7 Register highlight handler to be called in menu screen */
- RegisterHighlightHandler(ExecuteCurrHiliteHandler);
- ConstructHintsList(Parentid, PopUpList);
- ShowCategory52Screen(
- STR_PROFILE_CUSTOMIZE_CAPTION,
- IMG_PROFILES_TITLEE,
- STR_GLOBAL_OK,
- IMG_GLOBAL_OK,
- STR_GLOBAL_BACK,
- IMG_GLOBAL_BACK,
- nNumofItem,
- nStrItemList,
- (PU16) gIndexIconsImageList,
- PopUpList,
- 0,
- 0,
- guiBuffer);
- gcommonvolumehandler = 0;
- /* 9.Register function with right softkey */
- SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
- /* 10. Register Exit handler */
- /* SetExitHandler(SCR_PROFILES_CUSTOMIZE, ExitScrProfilesCustomize); */
- }
- /*****************************************************************************
- * FUNCTION
- * ExitScrProfilesCustomize
- * DESCRIPTION
- * Exit profile Customize screen
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- /* Shall leave the exit handler for AT command set vibrator mode */
- void ExitScrProfilesCustomize(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- history Scr; /* Variable to hold the history data */
- S16 nHistory = 0;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- Scr.scrnID = SCR_PROFILES_CUSTOMIZE;
- Scr.entryFuncPtr = EntryScrProfilesCustomize;
- pfnUnicodeStrcpy((S8*) Scr.inputBuffer, (S8*) & nHistory);
- GetCategoryHistory(Scr.guiBuffer);
- AddHistory(Scr);
- }
- //PMT NEERAJ START 20050825
- //PMT SUKRIT START 20051226
- #ifdef __MMI_PROFILES_TWO_LINE_MENUITEM_DISPLAY__
- /* PMT SUKRIT END 20051226 */
- /*****************************************************************************
- * FUNCTION
- * ring_volume_set_default_value
- * DESCRIPTION
- * This function returns the default value for ring volume
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void ring_volume_set_default_value(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (gprofiles[gprofileId].ringVolumeLevel > LEVEL7)
- {
- gprofiles[gprofileId].ringVolumeLevel = LEVEL7;
- }
- default_value_ring_volume = gprofiles[gprofileId].ringVolumeLevel;
- }
- /*****************************************************************************
- * FUNCTION
- * ring_volume_two_line_menuitem_get_data_callback
- * DESCRIPTION
- * This function is called when ring volume inline menuitem is displayed
- * PARAMETERS
- * item_index [IN]
- * RETURNS
- * void
- *****************************************************************************/
- pBOOL ring_volume_two_line_menuitem_get_data_callback(S32 item_index)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (item_index > 6)
- {
- return 0;
- }
- default_value_ring_volume = item_index;
- SetRingVolumeLevel((MMI_VOLUME_LEVEL_ENUM) item_index);
- return 1;
- }
- /*****************************************************************************
- * FUNCTION
- * ring_volume_two_line_menuitem_get_default_value_callback
- * DESCRIPTION
- * This callback is called to get the default value for ring volume
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- S32 ring_volume_two_line_menuitem_get_default_value_callback(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- return default_value_ring_volume;
- }
- /*****************************************************************************
- * FUNCTION
- * ring_volume_line_menuitem_display_complete_callback
- * DESCRIPTION
- * This callback is called to when the ring volume menuitem is unhighlighted
- * PARAMETERS
- * item_index [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void ring_volume_line_menuitem_display_complete_callback(S32 item_index)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- mdi_audio_stop_all(); /* use stop all because it might be play file or play id */
- gprofiles[gprofileId].ringVolumeLevel = (U8) item_index;
- SetRingVolumeLevel((MMI_VOLUME_LEVEL_ENUM) item_index);
- }
- /*****************************************************************************
- * FUNCTION
- * keypad_volume_set_default_value
- * DESCRIPTION
- * This function returns the drfault value for key volume
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void keypad_volume_set_default_value(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (gprofiles[gprofileId].keypadVolumeLevel > LEVEL7)
- {
- gprofiles[gprofileId].keypadVolumeLevel = LEVEL7;
- }
- default_value_keypad_volume = gprofiles[gprofileId].keypadVolumeLevel;
- }
- /*****************************************************************************
- * FUNCTION
- * keypad_volume_two_line_menuitem_get_data_callback
- * DESCRIPTION
- * This function is called when keypad volume inline menuitem is displayed
- * PARAMETERS
- * item_index [IN]
- * RETURNS
- * void
- *****************************************************************************/
- pBOOL keypad_volume_two_line_menuitem_get_data_callback(S32 item_index)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (item_index > 6)
- {
- return 0;
- }
- default_value_keypad_volume = item_index;
- SetKeypadVolumeLevel((MMI_VOLUME_LEVEL_ENUM) item_index);
- if (!IsSilentModeActivated())
- #ifdef __MMI_SILENT_MEETING_PROFILE__
- if (!IsMeetingModeActivated())
- #endif
- {
- if (gprofiles[gprofileId].toneSetup.keypadTone == KEYPAD_CLICK)
- {
- AudioPlayReq(TONE_KEY_CLICK, DEVICE_AUDIO_PLAY_ONCE);
- }
- else if (gprofiles[gprofileId].toneSetup.keypadTone != KEYPAD_SILENT)
- {
- AudioPlayReq(TONE_KEY_NORMAL, DEVICE_AUDIO_PLAY_ONCE);
- }
- }
- return 1;
- }
- /*****************************************************************************
- * FUNCTION
- * keypad_volume_two_line_menuitem_get_default_value_callback
- * DESCRIPTION
- * This callback is called to get the default keypad volume
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- S32 keypad_volume_two_line_menuitem_get_default_value_callback(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- return default_value_keypad_volume;
- }
- /*****************************************************************************
- * FUNCTION
- * keypad_volume_line_menuitem_display_complete_callback
- * DESCRIPTION
- * This callback is called when keypad volume menuitem is unhighlighted
- * PARAMETERS
- * item_index [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void keypad_volume_line_menuitem_display_complete_callback(S32 item_index)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- gprofiles[gprofileId].keypadVolumeLevel = (U8) item_index;
- AudioStopReq(gprofiles[gprofileId].toneSetup.keypadTone);
- SetKeypadVolumeLevel((MMI_VOLUME_LEVEL_ENUM) item_index);
- }
- /*****************************************************************************
- * FUNCTION
- * ExitScrProfilesVolumeType
- * DESCRIPTION
- * Exit Screen for Profiles Volume Type Screen
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void ExitScrProfilesVolumeType(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- is_level_select_menuitem_displayed_in_volume_screen = 0;
- //PMT SUKRIT START FT1&2
- /* restore key tone state */
- mmi_frm_kbd_set_tone_state(key_tone_state);
- //PMT SUKRIT END FT1&2
- if (mmi_profiles_is_ring_tone_playing())
- {
- mdi_audio_stop_all(); /* use stop all because it might be play file or play id */
- }
- }
- /*****************************************************************************
- * FUNCTION
- * ContinueRingTone_TwoLine
- * DESCRIPTION
- * Continue Ring tone after message received on ring tone volume two line screen.
- * PARAMETERS
- * info [?]
- * RETURNS
- * void
- *****************************************************************************/
- void ContinueRingTone_TwoLine(void *info)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- SetRingerVolume(default_value_ring_volume);
- if (!IsSilentModeActivated())
- #ifdef __MMI_SILENT_MEETING_PROFILE__
- if (!IsMeetingModeActivated())
- #endif
- {
- AudioPlayToneWithCallBackVolPath(
- gprofiles[gprofileId].toneSetup.ringTone,
- REPEAT,
- INCOMING_CALL_TONE,
- (U8) default_value_ring_volume,
- MDI_DEVICE_SPEAKER2);
- mmi_profiles_set_ring_tone_playing(TRUE);
- }
- }
- /*****************************************************************************
- * FUNCTION
- * set_current_volume_level
- * DESCRIPTION
- * This function is to set the current volume level.
- * PARAMETERS
- * void
- * Input: None(?)
- * RETURNS
- * void
- *****************************************************************************/
- void set_current_volume_level()
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- default_value_ring_volume = gprofiles[gprofileId].ringVolumeLevel;
- default_value_keypad_volume = gprofiles[gprofileId].keypadVolumeLevel;
- }
- /*****************************************************************************
- * FUNCTION
- * ring_volume_two_line_menuitem_complete_callback
- * DESCRIPTION
- * This function is called when ring volume menuitem is unhighlighted
- * PARAMETERS
- * menuitem_index [IN] Menuitem index
- * selected_index [IN] Inline item index
- * RETURNS
- * void
- *****************************************************************************/
- void ring_volume_two_line_menuitem_complete_callback(S32 menuitem_index, S32 selected_index)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- mdi_audio_stop_all();
- }
- /*****************************************************************************
- * FUNCTION
- * ring_volume_two_line_menuitem_set_data
- * DESCRIPTION
- * This function is used to set the ring volume
- * PARAMETERS
- * item_index [IN] Inline item index
- * RETURNS
- * pBOOL
- *****************************************************************************/
- pBOOL ring_volume_two_line_menuitem_set_data(S32 item_index)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (item_index > LEVEL7)
- {
- return 0;
- }
- SetRingVolumeLevel((MMI_VOLUME_LEVEL_ENUM) item_index);
- default_value_ring_volume = item_index;
- return 1;
- }
- /*****************************************************************************
- * FUNCTION
- * keypad_volume_two_line_menuitem_set_data
- * DESCRIPTION
- * This function is used to set the keypad ring volume
- * PARAMETERS
- * item_index [IN] Inline item index
- * RETURNS
- * pBOOL
- *****************************************************************************/
- pBOOL keypad_volume_two_line_menuitem_set_data(S32 item_index)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (item_index > LEVEL7)
- {
- return 0;
- }
- default_value_keypad_volume = item_index;
- SetKeypadVolumeLevel((MMI_VOLUME_LEVEL_ENUM) item_index);
- if (gcurrentprofile.toneSetup.keypadTone == KEYPAD_SILENT)
- {
- if (gprofiles[gprofileId].toneSetup.keypadTone == KEYPAD_CLICK)
- {
- AudioPlayReq(TONE_KEY_CLICK, DEVICE_AUDIO_PLAY_ONCE);
- }
- else
- {
- AudioPlayReq(TONE_KEY_NORMAL, DEVICE_AUDIO_PLAY_ONCE);
- }
- }
- return 1;
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_get_volume_display_style
- * DESCRIPTION
- * This function returns the display style of the volume
- * PARAMETERS
- * index [IN] Menu item index
- * RETURNS
- * U8
- *****************************************************************************/
- U8 mmi_get_volume_display_style(S32 index)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- ring_volume_index = GetChildMenuIDIndexByParentMenuID(MENU_VOLUME_LEVEL, MENU_RING_VOLUME_LEVEL);
- keypad_volume_index = GetChildMenuIDIndexByParentMenuID(MENU_VOLUME_LEVEL, MENU_KEYPAD_VOLUME_LEVEL);
- if (index == ring_volume_index || index == keypad_volume_index)
- {
- return TWO_LINE_MENUITEM_STYLE_DISPLAY_LEVEL_SELECT;
- }
- else
- {
- return 0;
- }
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_volume_get_default_value
- * DESCRIPTION
- * This function returns the default volume level
- * PARAMETERS
- * menuitem_index [IN] Menu item index
- * RETURNS
- * S32
- *****************************************************************************/
- S32 mmi_volume_get_default_value(S32 menuitem_index)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (menuitem_index == ring_volume_index)
- {
- return default_value_ring_volume;
- }
- else if (menuitem_index == keypad_volume_index)
- {
- return default_value_keypad_volume;
- }
- else
- {
- return NULL;
- }
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_volume_get_and_set_level_select_data
- * DESCRIPTION
- * This function sets the volume data for the menu item
- * PARAMETERS
- * menuitem_index [IN] Menu item index
- * item_index [IN] Inline item index
- * RETURNS
- * pBOOL
- *****************************************************************************/
- pBOOL mmi_volume_get_and_set_level_select_data(S32 menuitem_index, S32 item_index)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (menuitem_index == ring_volume_index)
- {
- if (ring_volume_two_line_menuitem_set_data(item_index))
- {
- return 1;
- }
- else
- {
- return 0;
- }
- }
- else if (menuitem_index == keypad_volume_index)
- {
- if (keypad_volume_two_line_menuitem_set_data(item_index))
- {
- return 1;
- }
- else
- {
- return 0;
- }
- }
- else
- {
- return 0;
- }
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_volume_get_menuitem_properties
- * DESCRIPTION
- * This function sets the properties of volume menuitems
- * PARAMETERS
- * index [IN] Menuitem index
- * current_menuitem_properties [?]
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_volume_get_menuitem_properties(int index, wgui_two_line_menuitem_struct *current_menuitem_properties)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (index == ring_volume_index)
- {
- current_menuitem_properties->num_of_items = 7;
- current_menuitem_properties->image_flags = UI_TWO_LINE_MENUITEM_NO_THUMBNAIL;
- current_menuitem_properties->defualt_value_callback = mmi_volume_get_default_value;
- current_menuitem_properties->complete_callback = ring_volume_two_line_menuitem_complete_callback;
- current_menuitem_properties->two_line_data_callback.get_data_for_level_select =
- mmi_volume_get_and_set_level_select_data;
- }
- else if (index == keypad_volume_index)
- {
- //PMT SUKRIT START FT1&2
- /* disable Right & Left Arrow key tone */
- mmi_frm_kbd_set_tone_state(MMI_KEY_RIGHT_LEFT_ARROW_TONE_DISABLED);
- //PMT SUKRIT END FT1&2
- current_menuitem_properties->num_of_items = 7;
- current_menuitem_properties->image_flags = UI_TWO_LINE_MENUITEM_NO_THUMBNAIL;
- current_menuitem_properties->defualt_value_callback = mmi_volume_get_default_value;
- current_menuitem_properties->complete_callback = NULL;
- current_menuitem_properties->two_line_data_callback.get_data_for_level_select =
- mmi_volume_get_and_set_level_select_data;
- }
- }
- #endif /* __MMI_PROFILES_TWO_LINE_MENUITEM_DISPLAY__ */
- /* PMT SUKRIT END 20051226 */
- /*****************************************************************************
- * FUNCTION
- * EntryScrProfilesVolumeType
- * DESCRIPTION
- * Entry function for Volume option
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void EntryScrProfilesVolumeType(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U16 nStrItemList[MAX_SUB_MENUS]; /* Stores the strings id of submenus returned */
- U16 nNumofItem; /* Stores no of children in the submenu */
- U16 nDispAttribute; /* Stores display attribue */
- U8 *guiBuffer; /* Buffer holding history data */
- U8 *PopUpList[MAX_SUB_MENUS];
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- /* PMT SUKRIT START 20051226 */
- #ifdef __MMI_PROFILES_TWO_LINE_MENUITEM_DISPLAY__
- /* PMT SUKRIT END 20051226 */
- is_level_select_menuitem_displayed_in_volume_screen = 1;
- //PMT SUKRIT START FT1&2
- key_tone_state = mmi_frm_kbd_get_key_tone_state();
- //PMT SUKRIT END FT1&2
- EntryNewScreen(SCR_PROFILES_VOLUME_LEVEL, ExitScrProfilesVolumeType, EntryScrProfilesVolumeType, NULL);
- #else /* __MMI_PROFILES_TWO_LINE_MENUITEM_DISPLAY__ */
- /* PMT NEERAJ END 20050825 */
- /* 1 Call Exit Handler */
- EntryNewScreen(SCR_PROFILES_VOLUME_LEVEL, NULL, EntryScrProfilesVolumeType, NULL);
- /* PMT NEERAJ START 20050825 */
- #endif /* __MMI_PROFILES_TWO_LINE_MENUITEM_DISPLAY__ */
- /* 2 Get current screen to gui buffer for history purposes */
- guiBuffer = GetCurrGuiBuffer(SCR_PROFILES_VOLUME_LEVEL);
- /* 3. Retrieve no of child of menu item to be displayed */
- nNumofItem = GetNumOfChild(MENU_VOLUME_LEVEL);
- /* 4. Get attribute of menu to be displayed */
- nDispAttribute = GetDispAttributeOfItem(MENU_VOLUME_LEVEL);
- /* 5. Retrieve string ids in sequence of given menu item to be displayed */
- GetSequenceStringIds(MENU_VOLUME_LEVEL, nStrItemList);
- /* 6 Set current parent id */
- SetParentHandler(MENU_VOLUME_LEVEL);
- /* 7 Register highlight handler to be called in menu screen */
- RegisterHighlightHandler(ExecuteCurrHiliteHandler);
- ConstructHintsList(MENU_VOLUME_LEVEL, PopUpList);
- /* PMT SUKRIT START 20051226 */
- #ifdef __MMI_PROFILES_TWO_LINE_MENUITEM_DISPLAY__
- wgui_set_pfn_to_get_display_style(mmi_get_volume_display_style);
- wgui_set_pfn_to_get_current_menu_item_properties(mmi_volume_get_menuitem_properties);
- if (!guiBuffer)
- {
- set_current_volume_level();
- }
- #endif /* __MMI_PROFILES_TWO_LINE_MENUITEM_DISPLAY__ */
- /* PMT SUKRIT END 20051226 */
- ShowCategory52Screen(
- STR_VOLUME_LEVEL_CAPTION,
- IMG_PROFILES_TITLEE,
- STR_GLOBAL_OK,
- IMG_GLOBAL_OK,
- STR_GLOBAL_BACK,
- IMG_GLOBAL_BACK,
- nNumofItem,
- nStrItemList,
- (PU16) gIndexIconsImageList,
- PopUpList,
- 0,
- gcommonvolumehandler,
- guiBuffer);
- //PMT SUKRIT START FT1&2
- Category52DisablePenMove();
- //PMT SUKRIT END FT1&2
- /* 9.Register function with right softkey */
- /* SetExitHandler(SCR_PROFILES_VOLUME_LEVEL,ExitScrProfilesVolumeType ); */
- }
- /*****************************************************************************
- * FUNCTION
- * EntryScrProfilesCommonVolumeLevel1
- * DESCRIPTION
- * Does all settings before entering into the entry fn of volume screen.
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void EntryScrProfilesCommonVolumeLevel1(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- switch (gcommonvolumehandler)
- {
- case 0:
- gcommonvolumelevel = gprofiles[gprofileId].ringVolumeLevel;
- break;
- case 1:
- gcommonvolumelevel = gprofiles[gprofileId].keypadVolumeLevel;
- break;
- }
- EntryScrProfilesCommonVolumeLevel();
- }
- /* MTK Brian added for play ring tone after MT message, 2003/11/10 */
- /*****************************************************************************
- * FUNCTION
- * ContinueRingTone
- * DESCRIPTION
- * Continue Ring tone after message received on ring tone volume screen.
- * PARAMETERS
- * info [?]
- * RETURNS
- * void
- *****************************************************************************/
- void ContinueRingTone(void *info)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- SetRingerVolume(gcommonvolumelevel);
- if (!IsSilentModeActivated())
- #ifdef __MMI_SILENT_MEETING_PROFILE__
- if (!IsMeetingModeActivated())
- #endif
- {
- AudioPlayToneWithCallBackVolPath(
- gprofiles[gprofileId].toneSetup.ringTone,
- REPEAT,
- INCOMING_CALL_TONE,
- (U8) gcommonvolumelevel,
- MDI_DEVICE_SPEAKER2);
- mmi_profiles_set_ring_tone_playing(TRUE);
- }
- }
- /*****************************************************************************
- * FUNCTION
- * EntryScrProfilesCommonVolumeLevel
- * DESCRIPTION
- * Set all Voulem screen handler functions and call the general entry screen of volume level.
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void EntryScrProfilesCommonVolumeLevel(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- VOLUMEHANDLER_TYPE type;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- /* ExecuteCurrExitHandler(); */
- EntryNewScreen(SCR_PROFILES_COMMON_VOLUME_LEVEL, NULL, NULL, NULL);
- switch (gcommonvolumehandler)
- {
- case 0:
- mdi_audio_suspend_background_play(); /* stop all because it might be play file or play id */
- SetRingerVolume(gcommonvolumelevel);
- type = VOLUMEHANDLER_RING_TONE;
- /*** Set all function handlers volume level screen *****/
- SetVolumeKeyHandlerFunctions(
- VolumeIncreaseDecreaseFunction,
- VolumeIncreaseDecreaseFunction,
- NULL,
- NULL,
- STR_COMMON_VOLUME_LEVEL_RING_CAPTION,
- &gcommonvolumelevel,
- STR_GLOBAL_OK,
- STR_GLOBAL_BACK,
- EntryScrSetCommonVolumeLevel,
- GoBackCommonVolume,
- 0,
- ExitScrProfilesCommonVolumeLevel,
- 1,
- type);
- EntryScrSetKeyPadVolumeLevel();
- if (!IsSilentModeActivated())
- #ifdef __MMI_SILENT_MEETING_PROFILE__
- if (!IsMeetingModeActivated())
- #endif
- {
- AudioPlayToneWithCallBackVolPath(
- gprofiles[gprofileId].toneSetup.ringTone,
- REPEAT,
- INCOMING_CALL_TONE,
- (U8) gcommonvolumelevel,
- MDI_DEVICE_SPEAKER2);
- mmi_profiles_set_ring_tone_playing(TRUE);
- }
- /* MTK Brian added for play ring tone after MT message, 2003/11/10 */
- SetProtocolEventHandler(ContinueRingTone, PRT_EQ_PLAY_AUDIO_FINISH_IND);
- break;
- case 1:
- mdi_audio_suspend_background_play();
- /* disable UP DOWN key tone */
- key_tone_state = mmi_frm_kbd_get_key_tone_state();
- mmi_frm_kbd_set_tone_state(MMI_KEY_VOL_UP_DOWN_TONE_DISABLED);
- SetKeyPadVolume(gcommonvolumelevel);
- type = VOLUMEHANDLER_KEY_TONE;
- /*** Set all function handlers volume level screen *****/
- SetVolumeKeyHandlerFunctions(
- VolumeIncreaseDecreaseFunction,
- VolumeIncreaseDecreaseFunction,
- NULL,
- NULL,
- STR_COMMON_VOLUME_LEVEL_KEY_CAPTION,
- &gcommonvolumelevel,
- STR_GLOBAL_OK,
- STR_GLOBAL_BACK,
- EntryScrSetCommonVolumeLevel,
- GoBackCommonVolume,
- 0,
- ExitScrProfilesCommonVolumeLevel,
- 1,
- type);
- EntryScrSetKeyPadVolumeLevel();
- AudioStopReq((U16) gprofiles[gprofileId].toneSetup.keypadTone);
- break;
- }
- SetKeyHandler(GoIdleScreenCommonVolume, KEY_END, KEY_EVENT_DOWN);
- SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
- }
- /*****************************************************************************
- * FUNCTION
- * VolumeIncreaseDecreaseFunction
- * DESCRIPTION
- * Call Back function for Volume increase and decrease.
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void VolumeIncreaseDecreaseFunction(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (gcommonvolumehandler && !IsSilentModeActivated())
- #ifdef __MMI_SILENT_MEETING_PROFILE__
- if (!IsMeetingModeActivated())
- #endif
- {
- if (gprofiles[gprofileId].toneSetup.keypadTone == KEYPAD_CLICK)
- {
- AudioPlayReq(TONE_KEY_CLICK, DEVICE_AUDIO_PLAY_ONCE);
- }
- else if (gprofiles[gprofileId].toneSetup.keypadTone != KEYPAD_SILENT)
- {
- AudioPlayReq(TONE_KEY_NORMAL, DEVICE_AUDIO_PLAY_ONCE);
- }
- }
- }
- /*****************************************************************************
- * FUNCTION
- * EntryScrSetCommonVolumeLevel
- * DESCRIPTION
- * Set keypad volume level for press of OK on volume level screen
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void EntryScrSetCommonVolumeLevel(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U8 *guiBuffer; /* Buffer holding history data */
- MMI_VOLUME_LEVEL_ENUM ringvolume;
- MMI_VOLUME_LEVEL_ENUM keypadvolume;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- guiBuffer = GetCurrGuiBuffer(SCR_PROFILES_STATUS);
- switch (gcommonvolumehandler)
- {
- case 0:
- {
- gringvol_level = volume_level_UI;
- gprofiles[gprofileId].ringVolumeLevel = (U8) gcommonvolumelevel;
- /*stop ring tone to prevent from ring tone volume change to active profile volume*/
- if (mmi_profiles_is_ring_tone_playing())
- {
- mdi_audio_stop_all();
- }
- switch (gringvol_level)
- {
- case 0:
- ringvolume = LEVEL1;
- SetRingVolumeLevel(ringvolume);
- break;
- case 1:
- ringvolume = LEVEL2;
- SetRingVolumeLevel(ringvolume);
- break;
- case 2:
- ringvolume = LEVEL3;
- SetRingVolumeLevel(ringvolume);
- break;
- case 3:
- ringvolume = LEVEL4;
- SetRingVolumeLevel(ringvolume);
- break;
- case 4:
- ringvolume = LEVEL5;
- SetRingVolumeLevel(ringvolume);
- break;
- case 5:
- ringvolume = LEVEL6;
- SetRingVolumeLevel(ringvolume);
- break;
- case 6:
- ringvolume = LEVEL7;
- SetRingVolumeLevel(ringvolume);
- break;
- }
- }
- break;
- case 1:
- {
- gkeypadvol_level = volume_level_UI;
- gprofiles[gprofileId].keypadVolumeLevel = (U8) gcommonvolumelevel;
- switch (gkeypadvol_level)
- {
- case 0:
- keypadvolume = LEVEL1;
- SetKeypadVolumeLevel(keypadvolume);
- break;
- case 1:
- keypadvolume = LEVEL2;
- SetKeypadVolumeLevel(keypadvolume);
- break;
- case 2:
- keypadvolume = LEVEL3;
- SetKeypadVolumeLevel(keypadvolume);
- break;
- case 3:
- keypadvolume = LEVEL4;
- SetKeypadVolumeLevel(keypadvolume);
- break;
- case 4:
- keypadvolume = LEVEL5;
- SetKeypadVolumeLevel(keypadvolume);
- break;
- case 5:
- keypadvolume = LEVEL6;
- SetKeypadVolumeLevel(keypadvolume);
- break;
- case 6:
- keypadvolume = LEVEL7;
- SetKeypadVolumeLevel(keypadvolume);
- break;
- }
- }
- break;
- }
- GoBackHistory();
- }
- /*****************************************************************************
- * FUNCTION
- * GoBackCommonVolume
- * DESCRIPTION
- * Function for go back in common volume screen
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void GoBackCommonVolume(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- MMI_VOLUME_LEVEL_ENUM ringVolumeLevel, keypadVolumelevel;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- /**** Restore Volume levels on press of BACK key on volume level screen*****/
- switch (gcommonvolumehandler)
- {
- case 0:
- ringVolumeLevel = gprofiles[gactivatedprofile].ringVolumeLevel;
- SetRingerVolume(ringVolumeLevel);
- break;
- case 1:
- keypadVolumelevel = gprofiles[gactivatedprofile].keypadVolumeLevel;
- SetKeyPadVolume(keypadVolumelevel);
- break;
- }
- GoBackHistory();
- }
- /*****************************************************************************
- * FUNCTION
- * GoIdleScreenCommonVolume
- * DESCRIPTION
- * Go back from Volume screen through End Key
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void GoIdleScreenCommonVolume(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- MMI_VOLUME_LEVEL_ENUM ringVolumeLevel, keypadVolumelevel;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- /**** Restore Volume levels on press of END key on volume level screen*****/
- switch (gcommonvolumehandler)
- {
- case 0:
- ringVolumeLevel = gprofiles[gactivatedprofile].ringVolumeLevel;
- SetRingerVolume(ringVolumeLevel);
- break;
- case 1:
- keypadVolumelevel = gprofiles[gactivatedprofile].keypadVolumeLevel;
- SetKeyPadVolume(keypadVolumelevel);
- break;
- }
- DisplayIdleScreen();
- }
- /*****************************************************************************
- * FUNCTION
- * ExitScrProfilesCommonVolumeLevel
- * DESCRIPTION
- * Exit profile Volume Level screen
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void ExitScrProfilesCommonVolumeLevel(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- MMI_VOLUME_LEVEL_ENUM ringVolumeLevel, keypadVolumelevel;
- history Scr; /* Variable to hold the history data */
- S16 nHistory = 0;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- Scr.scrnID = SCR_PROFILES_COMMON_VOLUME_LEVEL;
- Scr.entryFuncPtr = EntryScrProfilesCommonVolumeLevel;
- pfnUnicodeStrcpy((S8*) Scr.inputBuffer, (S8*) & nHistory);
- GetCategoryHistory(Scr.guiBuffer);
- AddHistory(Scr);
- switch (gcommonvolumehandler)
- {
- case 0:
- if (mmi_profiles_is_ring_tone_playing())
- {
- mdi_audio_stop_all(); /* use stop all because it might be play file or play id */
- }
- ringVolumeLevel = gprofiles[gactivatedprofile].ringVolumeLevel;
- SetRingerVolume(ringVolumeLevel);
- mdi_audio_resume_background_play();
- /* MTK Brian added for play ring tone after MT message, 2003/11/10 */
- SetProtocolEventHandler(NULL, PRT_EQ_PLAY_AUDIO_FINISH_IND);
- break;
- case 1:
- AudioStopReq((U16) gprofiles[gprofileId].toneSetup.keypadTone);
- keypadVolumelevel = gprofiles[gactivatedprofile].keypadVolumeLevel;
- SetKeyPadVolume(keypadVolumelevel);
- /* restore key tone state */
- mmi_frm_kbd_set_tone_state(key_tone_state);
- mdi_audio_resume_background_play();
- break;
- }
- }
- /*****************************************************************************
- * FUNCTION
- * EntryScrProfilesCallAlert
- * DESCRIPTION
- * Showing profile Call Alert screen
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void EntryScrProfilesCallAlert(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U16 nStrItemList[MAX_SUB_MENUS]; /* Stores the strings id of submenus returned */
- U16 nNumofItem; /* Stores no of children in the submenu */
- U16 nDispAttribute; /* Stores display attribue */
- U8 *guiBuffer; /* Buffer holding history data */
- S8 i = 0;
- /* U8* PopUpList[MAX_SUB_MENUS]; */
- MMI_ALERT_TYPE data = 0;
- U16 ProfileMenuID[] =
- {
- MENU_RING,
- MENU_VIBRATION_ONLY,
- MENU_VIBRATION_AND_RING,
- MENU_VIBRATION_THEN_RING,
- MENU_SILENT
- };
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- /* 1 Call Exit Handler */
- EntryNewScreen(SCR_PROFILES_CALL_ALERT, NULL, EntryScrProfilesCallAlert, NULL);
- /* 2 Get current screen to gui buffer for history purposes */
- guiBuffer = GetCurrGuiBuffer(SCR_PROFILES_CALL_ALERT);
- /* 3. Retrieve no of child of menu item to be displayed */
- nNumofItem = GetNumOfChild(MENU_MT_CALL_ALERT_TYPE);
- /* 4. Get attribute of menu to be displayed */
- nDispAttribute = GetDispAttributeOfItem(MENU_MT_CALL_ALERT_TYPE);
- /* 5. Retrieve string ids in sequence of given menu item to be displayed */
- GetSequenceStringIds(MENU_MT_CALL_ALERT_TYPE, nStrItemList);
- /* 6 Set current parent id */
- SetParentHandler(MENU_MT_CALL_ALERT_TYPE);
- /* 7 Register highlight handler to be called in menu screen */
- RegisterHighlightHandler(ExecuteCurrHiliteHandler);
- /* MTK Brian modified for showing radio button, 2003/11/15 */
- /****** Get the index of activated alert type menu ID*****/
- i = gprofiles[gprofileId].mtCallAlertTypeEnum;
- data = GetIndexOfStringId(MENU_MT_CALL_ALERT_TYPE, ProfileMenuID[i - 1]);
- /* 8 Display Category Screen */
- ShowCategory11Screen(
- STR_CALL_ALERT_CAPTION,
- IMG_PROFILES_TITLEE,
- STR_GLOBAL_OK,
- IMG_GLOBAL_OK,
- STR_GLOBAL_BACK,
- IMG_GLOBAL_BACK,
- nNumofItem,
- nStrItemList,
- (U16) data,
- guiBuffer);
- /* MTK end */
- /* SetExitHandler(SCR_PROFILES_CALL_ALERT, ExitScrProfilesCallAlert); */
- }
- /*****************************************************************************
- * FUNCTION
- * GuardSilentMode
- * DESCRIPTION
- * GuardSilentMode
- * PARAMETERS
- * void
- * RETURNS
- * U8
- *****************************************************************************/
- U8 GuardSilentMode(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (gprofileId == MMI_PROFILE_SILENT)
- {
- MMI_fixed_list_menu.highlighted_item = GetIndexOfStringId(MENU_MT_CALL_ALERT_TYPE, MENU_VIBRATION_ONLY);
- DisplayPopup(
- (PU8) GetString(STR_PROFILES_CANNOT_CHANGE_SILENT_MODE_SETTING),
- IMG_GLOBAL_WARNING,
- 0,
- 1000,
- (U8) WARNING_TONE);
- return 1;
- }
- return 0;
- }
- /*****************************************************************************
- * FUNCTION
- * SetMtCallAlertRing
- * DESCRIPTION
- * Setting Call Alert type as ring for the current
- * Profile.
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void SetMtCallAlertRing(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (GuardSilentMode())
- {
- return;
- }
- SetMtCallAlertTypeEnum(MMI_RING);
- //MTK Brian modified to skip writing nvram if no change, 2003/11/26
- //SendSetVibrationMode(0);
- DisplayPopup((PU8) GetString(STR_GLOBAL_DONE), IMG_GLOBAL_ACTIVATED, 1, UI_POPUP_NOTIFYDURATION_TIME, SUCCESS_TONE);
- DeleteScreenIfPresent(SCR_PROFILES_CALL_ALERT);
- }
- /*****************************************************************************
- * FUNCTION
- * SetMtCallAlertVibrationOnly
- * DESCRIPTION
- * Setting Call Alert type as ring for the current
- * Profile.
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void SetMtCallAlertVibrationOnly(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- SetMtCallAlertTypeEnum(MMI_VIBRATION_ONLY);
- //MTK Brian modified to skip writing nvram if no change, 2003/11/26
- //SendSetVibrationMode(1);
- DisplayPopup((PU8) GetString(STR_GLOBAL_DONE), IMG_GLOBAL_ACTIVATED, 1, UI_POPUP_NOTIFYDURATION_TIME, SUCCESS_TONE);
- DeleteScreenIfPresent(SCR_PROFILES_CALL_ALERT);
- }
- /*****************************************************************************
- * FUNCTION
- * SetMtCallAlertVibrationAndRing
- * DESCRIPTION
- * Setting Call Alert type as ring for the current
- * Profile.
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void SetMtCallAlertVibrationAndRing(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (GuardSilentMode())
- {
- return;
- }
- SetMtCallAlertTypeEnum(MMI_VIBRATION_AND_RING);
- //MTK Brian modified to skip writing nvram if no change, 2003/11/26
- //SendSetVibrationMode(1);
- DisplayPopup((PU8) GetString(STR_GLOBAL_DONE), IMG_GLOBAL_ACTIVATED, 1, UI_POPUP_NOTIFYDURATION_TIME, SUCCESS_TONE);
- DeleteScreenIfPresent(SCR_PROFILES_CALL_ALERT);
- }
- /*****************************************************************************
- * FUNCTION
- * SetMtCallAlertVibrationThenRing
- * DESCRIPTION
- * Setting Call Alert type as ring for the current
- * Profile.
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void SetMtCallAlertVibrationThenRing(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (GuardSilentMode())
- {
- return;
- }
- SetMtCallAlertTypeEnum(MMI_VIBRATION_THEN_RING);
- //MTK Brian modified to skip writing nvram if no change, 2003/11/26
- //SendSetVibrationMode(1);
- DisplayPopup((PU8) GetString(STR_GLOBAL_DONE), IMG_GLOBAL_ACTIVATED, 1, UI_POPUP_NOTIFYDURATION_TIME, SUCCESS_TONE);
- DeleteScreenIfPresent(SCR_PROFILES_CALL_ALERT);
- }
- /*****************************************************************************
- * FUNCTION
- * SetMtCallAlertSilent
- * DESCRIPTION
- * Setting Call Alert type as ring for the current
- * Profile.
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void SetMtCallAlertSilent(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (GuardSilentMode())
- {
- return;
- }
- SetMtCallAlertTypeEnum(MMI_SILENT);
- //MTK Brian modified to skip writing nvram if no change, 2003/11/26
- //SendSetVibrationMode(0);
- DisplayPopup((PU8) GetString(STR_GLOBAL_DONE), IMG_GLOBAL_ACTIVATED, 1, UI_POPUP_NOTIFYDURATION_TIME, SUCCESS_TONE);
- DeleteScreenIfPresent(SCR_PROFILES_CALL_ALERT);
- }
- /*****************************************************************************
- * FUNCTION
- * EntryScrProfilesRingType
- * DESCRIPTION
- * Showing profile Ring Type screen
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void EntryScrProfilesRingType(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U16 nStrItemList[15]; /* Stores the strings id of submenus returned */
- U16 nNumofItem; /* Stores no of children in the submenu */
- U16 nDispAttribute; /* Stores display attribue */
- U8 *guiBuffer; /* Buffer holding history data */
- U8 i;
- MMI_RING_TYPE_ENUM data = 0;
- U16 ProfileMenuID[] =
- {
- MENU_RING_TYPE_SINGLE,
- MENU_RING_TYPE_REPEAT,
- MENU_RING_TYPE_ASCENDING
- };
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- /* 1 Call Exit Handler */
- EntryNewScreen(SCR_PROFILES_RING_TYPE, NULL, EntryScrProfilesRingType, NULL);
- /* 2 Get current screen to gui buffer for history purposes */
- guiBuffer = GetCurrGuiBuffer(SCR_PROFILES_RING_TYPE);
- /* 3. Retrieve no of child of menu item to be displayed */
- nNumofItem = GetNumOfChild(MENU_RING_TYPE);
- /* 4. Get attribute of menu to be displayed */
- nDispAttribute = GetDispAttributeOfItem(MENU_RING_TYPE);
- /* 5. Retrieve string ids in sequence of given menu item to be displayed */
- GetSequenceStringIds(MENU_RING_TYPE, nStrItemList);
- /* 6 Set current parent id */
- SetParentHandler(MENU_RING_TYPE);
- /* 7 Register highlight handler to be called in menu screen */
- RegisterHighlightHandler(ExecuteCurrHiliteHandler);
- /****** Get the index of activated ring type menu ID*****/
- i = gprofiles[gprofileId].ringTypeEnum;
- data = GetIndexOfStringId(MENU_RING_TYPE, ProfileMenuID[i]);
- /* 8 Display Category Screen */
- ShowCategory11Screen(
- STR_RING_TYPE_CAPTION,
- IMG_PROFILES_TITLEE,
- STR_GLOBAL_OK,
- 0,
- STR_GLOBAL_BACK,
- 0,
- nNumofItem,
- nStrItemList,
- (U16) data,
- guiBuffer);
- /* SetExitHandler(SCR_PROFILES_RING_TYPE, ExitScrProfilesRingType); */
- }
- /*****************************************************************************
- * FUNCTION
- * SetRingTypeAscending
- * DESCRIPTION
- * Set Ring Type as Ascending
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void SetRingTypeAscending(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- SetRingTypeEnum(ASCENDING);
- DisplayPopup((PU8) GetString(STR_GLOBAL_DONE), IMG_GLOBAL_ACTIVATED, 1, UI_POPUP_NOTIFYDURATION_TIME, SUCCESS_TONE);
- DeleteScreenIfPresent(SCR_PROFILES_RING_TYPE);
- }
- /*****************************************************************************
- * FUNCTION
- * SetRingTypeSingle
- * DESCRIPTION
- * Set Ring Type as Single
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void SetRingTypeSingle(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- SetRingTypeEnum(SINGLE);
- DisplayPopup((PU8) GetString(STR_GLOBAL_DONE), IMG_GLOBAL_ACTIVATED, 1, UI_POPUP_NOTIFYDURATION_TIME, SUCCESS_TONE);
- DeleteScreenIfPresent(SCR_PROFILES_RING_TYPE);
- }
- /*****************************************************************************
- * FUNCTION
- * SetRingTypeRepeat
- * DESCRIPTION
- * Set Ring Type as Repeat
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void SetRingTypeRepeat(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- SetRingTypeEnum(REPEAT);
- DisplayPopup((PU8) GetString(STR_GLOBAL_DONE), IMG_GLOBAL_ACTIVATED, 1, UI_POPUP_NOTIFYDURATION_TIME, SUCCESS_TONE);
- DeleteScreenIfPresent(SCR_PROFILES_RING_TYPE);
- }
- #ifdef __MMI_CONNECT_NOTICE__
- /*****************************************************************************
- * FUNCTION
- * EntryScrProfilesConnectNotice
- * DESCRIPTION
- * Showing profile Call Alert screen
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void EntryScrProfilesConnectNotice(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U16 nStrItemList[MAX_SUB_MENUS]; /* Stores the strings id of submenus returned */
- U16 nNumofItem; /* Stores no of children in the submenu */
- U16 nDispAttribute; /* Stores display attribue */
- U8 *guiBuffer; /* Buffer holding history data */
- S8 i = 0;
- MMI_CONNECT_NOTICE_TYPE data = 0;
- U16 ProfileMenuID[] =
- {
- MENU_NOTICE_NONE,
- MENU_NOTICE_TONE_ONLY,
- MENU_NOTICE_VIB_ONLY,
- MENU_NOTICE_TONE_AND_VIB
- };
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- /* 1 Call Exit Handler */
- EntryNewScreen(SCR_PROFILES_CONNECT_NOTICE, NULL, EntryScrProfilesConnectNotice, NULL);
- /* 2 Get current screen to gui buffer for history purposes */
- guiBuffer = GetCurrGuiBuffer(SCR_PROFILES_CONNECT_NOTICE);
- /* 3. Retrieve no of child of menu item to be displayed */
- nNumofItem = GetNumOfChild(MENU_CONNECT_NOTICE);
- /* 4. Get attribute of menu to be displayed */
- nDispAttribute = GetDispAttributeOfItem(MENU_CONNECT_NOTICE);
- /* 5. Retrieve string ids in sequence of given menu item to be displayed */
- GetSequenceStringIds(MENU_CONNECT_NOTICE, nStrItemList);
- /* 6 Set current parent id */
- SetParentHandler(MENU_CONNECT_NOTICE);
- /* 7 Register highlight handler to be called in menu screen */
- RegisterHighlightHandler(ExecuteCurrHiliteHandler);
- /* MTK Brian modified for showing radio button, 2003/11/15 */
- /****** Get the index of activated alert type menu ID*****/
- i = gprofiles[gprofileId].extraTone.connectTone;
- data = GetIndexOfStringId(MENU_CONNECT_NOTICE, ProfileMenuID[i]);
- /* 8 Display Category Screen */
- ShowCategory11Screen(
- STR_CONNECT_NOTICE,
- IMG_PROFILES_TITLEE,
- STR_GLOBAL_OK,
- IMG_GLOBAL_OK,
- STR_GLOBAL_BACK,
- IMG_GLOBAL_BACK,
- nNumofItem,
- nStrItemList,
- (U16) data,
- guiBuffer);
- /* MTK end */
- /* SetExitHandler(SCR_PROFILES_CONNECT_NOTICE, ExitScrProfilesConnectNotice); */
- }
- /*****************************************************************************
- * FUNCTION
- * SetConnectNoticeNone
- * DESCRIPTION
- * Setting Connect Notice type as none for the current
- * Profile.
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void SetConnectNoticeNone(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- SetConnectNotice(MMI_NOTICE_NONE);
- DisplayPopup((PU8) GetString(STR_GLOBAL_DONE), IMG_GLOBAL_ACTIVATED, 1, UI_POPUP_NOTIFYDURATION_TIME, SUCCESS_TONE);
- DeleteScreenIfPresent(SCR_PROFILES_CONNECT_NOTICE);
- }
- /*****************************************************************************
- * FUNCTION
- * SetConnectNoticeToneOnly
- * DESCRIPTION
- * Setting Connect Notice type as tone only for the current
- * Profile.
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void SetConnectNoticeToneOnly(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- SetConnectNotice(MMI_NOTICE_TONE_ONLY);
- DisplayPopup((PU8) GetString(STR_GLOBAL_DONE), IMG_GLOBAL_ACTIVATED, 1, UI_POPUP_NOTIFYDURATION_TIME, SUCCESS_TONE);
- DeleteScreenIfPresent(SCR_PROFILES_CONNECT_NOTICE);
- }
- /*****************************************************************************
- * FUNCTION
- * SetConnectNoticeVibOnly
- * DESCRIPTION
- * Setting Connect Notice type as vib only for the current
- * Profile.
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void SetConnectNoticeVibOnly(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- SetConnectNotice(MMI_NOTICE_VIB_ONLY);
- DisplayPopup((PU8) GetString(STR_GLOBAL_DONE), IMG_GLOBAL_ACTIVATED, 1, UI_POPUP_NOTIFYDURATION_TIME, SUCCESS_TONE);
- DeleteScreenIfPresent(SCR_PROFILES_CONNECT_NOTICE);
- }
- /*****************************************************************************
- * FUNCTION
- * SetConnectNoticeToneAndVib
- * DESCRIPTION
- * Setting Connect Notice type as tone and vib for the current
- * Profile.
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void SetConnectNoticeToneAndVib(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- SetConnectNotice(MMI_NOTICE_TONE_AND_VIB);
- DisplayPopup((PU8) GetString(STR_GLOBAL_DONE), IMG_GLOBAL_ACTIVATED, 1, UI_POPUP_NOTIFYDURATION_TIME, SUCCESS_TONE);
- DeleteScreenIfPresent(SCR_PROFILES_CONNECT_NOTICE);
- }
- #endif /* __MMI_CONNECT_NOTICE__ */
- /*****************************************************************************
- * FUNCTION
- * ProfileGoBack2History
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void ProfileGoBack2History(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- GoBacknHistory(1);
- }
- /*****************************************************************************
- * FUNCTION
- * EntryScrProfilesAnsweringMode
- * DESCRIPTION
- * Showing profile Answering Mode screen
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void EntryScrProfilesAnsweringMode(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U16 nStrItemList[15]; /* Stores the strings id of submenus returned */
- U16 nNumofItem; /* Stores no of children in the submenu */
- U16 nDispAttribute; /* Stores display attribue */
- U8 *guiBuffer; /* Buffer holding history data */
- U16 i;
- U16 ParentId;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- /* 1 Call Exit Handler */
- EntryNewScreen(SCR_PROFILES_ANSWERING_MODE, NULL, EntryScrProfilesAnsweringMode, NULL);
- /***** If earphone is connected then also show auto mode in answering mode list */
- if (gprofileId != MMI_PROFILE_HEADSET)
- {
- ParentId = MENU_ANSEWRING_MODE;
- }
- else
- {
- ParentId = MENU_ANSEWRING_MODE_HEADSET;
- }
- /* 2 Get current screen to gui buffer for history purposes */
- guiBuffer = GetCurrGuiBuffer(SCR_PROFILES_ANSWERING_MODE);
- /* 3. Retrieve no of child of menu item to be displayed */
- nNumofItem = GetNumOfChild(ParentId);
- /* 4. Get attribute of menu to be displayed */
- nDispAttribute = GetDispAttributeOfItem(ParentId);
- /* 5. Retrieve string ids in sequence of given menu item to be displayed */
- GetSequenceStringIds(ParentId, nStrItemList);
- for (i = 0; i < nNumofItem; i++)
- {
- memset((S8*) subMenuDataPtrs[i], 0, MAX_SUB_MENU_SIZE);
- pfnUnicodeStrncpy((S8*) subMenuDataPtrs[i], GetString(nStrItemList[i]), MAX_SUBMENU_CHARACTERS);
- }
- /* 6 Set current parent id */
- SetParentHandler(ParentId);
- /* MTK Brian added for SUBLCD freature, 2003/10/18 */
- #ifdef __MMI_CLAMSHELL__
- fieldStates[0] = (U8) gprofiles[gprofileId].answeringMode.coverAnswer;
- fieldStates[1] = (U8) gprofiles[gprofileId].answeringMode.anyKey;
- fieldStates[2] = (U8) gprofiles[gprofileId].answeringMode.automatic;
- #else /* __MMI_CLAMSHELL__ */
- fieldStates[0] = (U8) gprofiles[gprofileId].answeringMode.anyKey;
- fieldStates[1] = (U8) gprofiles[gprofileId].answeringMode.automatic;
- #endif /* __MMI_CLAMSHELL__ */
- SetCheckboxToggleRightSoftkeyFunctions(ProfilesAnsweringModePopup, GoBackHistory);
- /* 8 Display Category Screen */
- ShowCategory140Screen(
- STR_ANSEWRING_MODE_CAPTION,
- IMG_PROFILES_TITLEE,
- nNumofItem,
- (U8 **) subMenuDataPtrs,
- fieldStates,
- 0,
- guiBuffer);
- SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
- /* SetExitHandler(SCR_PROFILES_ANSWERING_MODE,ExitScrProfilesAnsweringMode); */
- }
- /*****************************************************************************
- * FUNCTION
- * EntryScrSetAnsweringMode
- * DESCRIPTION
- * Set answering mode
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void EntryScrSetAnsweringMode(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- MMI_ANSWERING_MODE answeringmode;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- /* MTK Brian added for SUBLCD freature, 2003/10/18 */
- #ifdef __MMI_CLAMSHELL__
- answeringmode.coverAnswer = gprofiles[gprofileId].answeringMode.coverAnswer = fieldStates[0];
- answeringmode.anyKey = gprofiles[gprofileId].answeringMode.anyKey = fieldStates[1];
- answeringmode.automatic = gprofiles[gprofileId].answeringMode.automatic = fieldStates[2];
- #else /* __MMI_CLAMSHELL__ */
- answeringmode.anyKey = gprofiles[gprofileId].answeringMode.anyKey = fieldStates[0];
- answeringmode.automatic = gprofiles[gprofileId].answeringMode.automatic = fieldStates[1];
- #endif /* __MMI_CLAMSHELL__ */
- SetAnsweringMode(answeringmode);
- /* DisplayPopupCheckBox((PU8)GetString(STR_GLOBAL_DONE) ,IMG_GLOBAL_ACTIVATED, 1,UI_POPUP_NOTIFYDURATION_TIME,SUCCESS_TONE); */
- DisplayPopup((PU8) GetString(STR_GLOBAL_DONE), IMG_GLOBAL_ACTIVATED, 1, UI_POPUP_NOTIFYDURATION_TIME, SUCCESS_TONE);
- DeleteScreenIfPresent(SCR_PROFILES_ANSWERING_MODE);
- }
- /*****************************************************************************
- * FUNCTION
- * ProfilesAnsweringModePopup
- * DESCRIPTION
- * Set call back functions for Answering mode.
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void ProfilesAnsweringModePopup(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- EntryScrProfilesQueryPopup(EntryScrSetAnsweringMode, ProfileGoBack2History);
- }
- #ifdef __MMI_STATUS_LED__
- /*****************************************************************************
- * FUNCTION
- * EntryScrStatusLEDPatterns
- * DESCRIPTION
- * Showing profile Status Screen
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void EntryScrStatusLEDPatterns(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U16 nStrItemList[15]; /* Stores the strings id of submenus returned */
- U16 nNumofItem; /* Stores no of children in the submenu */
- U16 nDispAttribute; /* Stores display attribue */
- U8 *guiBuffer; /* Buffer holding history data */
- MMI_LEDLIGHT_STATUS_ENUM data = 0;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- /* 1 Call Exit Handler */
- EntryNewScreen(SCR_PROFILES_STATUS, ExitScrStatusLEDPatterns, EntryScrStatusLEDPatterns, NULL);
- /* 2 Get current screen to gui buffer for history purposes */
- guiBuffer = GetCurrGuiBuffer(SCR_PROFILES_STATUS);
- /* 3. Retrieve no of child of menu item to be displayed */
- nNumofItem = GetNumOfChild(MENU_LIGHT_STATUS);
- /* 4. Get attribute of menu to be displayed */
- nDispAttribute = GetDispAttributeOfItem(MENU_LIGHT_STATUS);
- /* 5. Retrieve string ids in sequence of given menu item to be displayed */
- GetSequenceStringIds(MENU_LIGHT_STATUS, nStrItemList);
- /* 6 Set current parent id */
- SetParentHandler(MENU_LIGHT_STATUS);
- /* 7 Register highlight handler to be called in menu screen */
- RegisterHighlightHandler(GetCurrScreenHandlerfour);
- data = gprofiles[gprofileId].light.status;
- /* 8 Display Category Screen */
- ShowCategory11Screen(
- STR_LIGHT_STATUS_CAPTION,
- IMG_PROFILES_TITLEE,
- STR_GLOBAL_OK,
- 0,
- STR_GLOBAL_BACK,
- 0,
- nNumofItem,
- nStrItemList,
- (U16) data,
- guiBuffer);
- /* 9.Register function with right softkey */
- SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
- /* 10.Register function with Left softkey */
- SetLeftSoftkeyFunction(EntryScrSetLightColor, KEY_EVENT_UP);
- SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
- /* SetExitHandler(SCR_PROFILES_STATUS,ExitScrStatusLEDPatterns); */
- }
- /*****************************************************************************
- * FUNCTION
- * ExitScrStatusLEDPatterns
- * DESCRIPTION
- * Exit profile LED Status Screen
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void ExitScrStatusLEDPatterns(void)
- {
- #if 0
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- #endif /* 0 */
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- StopColorId();
- }
- /*****************************************************************************
- * FUNCTION
- * EntryScrSetLightColor
- * DESCRIPTION
- * Set Light color
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void EntryScrSetLightColor(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- MMI_LEDLIGHT_STATUS_ENUM lightstaus;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- switch (gcurrHiliteIndexOne)
- {
- case 0:
- lightstaus = NO_COLOR;
- SetLightStatus(lightstaus);
- break;
- case 1:
- lightstaus = COLOR_PATTERN1;
- SetLightStatus(lightstaus);
- break;
- case 2:
- lightstaus = COLOR_PATTERN2;
- SetLightStatus(lightstaus);
- break;
- case 3:
- lightstaus = COLOR_PATTERN3;