PhoneSetup.c
资源名称:mmi.rar [点击查看]
上传用户:lqx1163
上传日期:2014-08-13
资源大小:9183k
文件大小:298k
源码类别:
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:
- * ---------
- * PhoneSetup.c
- *
- * Project:
- * --------
- * MAUI
- *
- * Description:
- * ------------
- * This file is intends for phone setup 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!
- *
- * 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!
- *
- * 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!!
- *============================================================================
- ****************************************************************************/
- /*****************************************************************************
- * Include
- *****************************************************************************/
- /* Include: MMI header file */
- #include "MMI_features.h"
- #include "stdC.h"
- #include "L4Dr1.h"
- #include "PixtelDataTypes.h"
- #include "wgui_categories.h"
- #include "wgui_categories_inputs.h"
- #include "wgui_categories_popup.h"
- #include "CustDataRes.h"
- #include "CustMenuRes.h"
- #include "EventsGProt.h"
- #include "DebugInitDef.h"
- #include "HistoryGprot.h"
- #include "ProtocolEvents.h"
- #include "CommonScreens.h"
- #include "Globaldefs.h"
- #include "Unicodexdcl.h"
- #include "NVRAMType.h"
- #include "NVRAMProt.h"
- #include "NVRAMEnum.h"
- #include "SettingsGexdcl.h"
- #include "settingGprots.h"
- #include "SettingDefs.h"
- #include "PhnsetProt.h"
- #include "WPSSProtos.h"
- #include "ATHandlerProt.h" /* SendATSetGreeting() */
- #include "MainMenuDef.h" /* MAIN_MENU_TITLE_SETTINGS_ICON */
- #include "QueueGProt.h" /* Osl Send Message */
- #include "settingprot.h" /* PhoneSetup Prototype */
- #include "CSP.h" /* CSP_VALUE_ADDED_SERVICES_SERVICE_GROUP, CSP_Language */
- #include "SettingProfile.h" /* WARNING_TONE */
- #include "ProfileGprots.h" /* playRequestedTone() */
- #include "MessagesExDcl.h" /* GetChildMenuIDIndexByParentMenuID() */
- #include "ScheduledPowerOnOffGProt.h"
- #include "ScreenSaverDefs.h"
- #include "WallpaperDefs.h"
- #include "DownloadDefs.h"
- #include "PhoneSetup.h"
- #include "PhoneSetupGprots.h"
- #include "Conversions.h"
- #include "GpioInc.h" /* Backlight */
- #include "SimDetectionDef.h" /* for g_pwr_context */
- #include "SimDetectionGprot.h"
- //KP Jerry add on 2007-3-28 start
- #ifdef __DUAL_SIM_SUPPORT__
- #include "gpio_hw.h"
- #include "CallSetUp.h"
- #include "CallmanagementIdDef.h"
- #include "CallSetUpEnum.h"
- #include "CallForwarding.h"
- #include "AlarmFrameworkProt.h"
- #endif
- //KP Jerry add on 2007-3-28 end
- #if defined(__MMI_TOUCH_SCREEN__) || defined(__MMI_HANDWRITING_PAD__)
- #include "TouchScreenGprot.h"
- #ifdef __MTK_TARGET__
- #include "Touch_Panel.h"
- #endif
- #ifdef __MMI_HANDWRITING_PAD__
- #include "touch_panel_custom.h"
- #endif
- #endif /* defined(__MMI_TOUCH_SCREEN__) || defined(__MMI_HANDWRITING_PAD__) */
- #ifdef __MMI_UI_TECHNO_IDLESCREEN_BAR__
- #include "wgui_datetime.h"
- #endif
- #ifdef __MMI_AUTO_LANG_EN__
- #include "CustResDef.h"
- #include "SSCStringHandle.h"
- #endif /* __MMI_AUTO_LANG_EN__ */
- #if defined(__MMI_DEDICATED_KEY_SHORTCUTS__)
- #include "ShortcutsProts.h"
- #endif
- #ifdef __MMI_PREFER_INPUT_METHOD__
- #include "PreferedInputMethodProt.h" /* GetInputMethodIndex(), InitPreferedInputMethod() */
- #endif
- /* Include: PS header file */
- #ifdef MMI_ON_HARDWARE_P
- #include "L4Dr.h"
- #include "lcd_if.h"
- #include "lcd_sw.h"
- #include "lcd_sw_inc.h"
- #include "sublcd.h"
- #endif /* MMI_ON_HARDWARE_P */
- #ifdef __MMI_TVOUT__
- #include "med_api.h" /* media task */
- #include "mdi_tv.h"
- #endif /* __MMI_TVOUT__ */
- extern S16 MMI_current_input_ext_type; //KP Jerry add for can use "MMI_current_input_ext_type" on 2007-4-3
- /*****************************************************************************
- * Define
- *****************************************************************************/
- #ifdef __MMI_AUTO_LANG_EN__
- #define MMI_NUM_OF_AUTOLANG_ELEM (sizeof(auto_lang_struct) / sizeof(auto_lang_struct[0]))
- #endif
- #if defined(__MMI_TOUCH_SCREEN__) || defined(__MMI_HANDWRITING_PAD__)
- /* Handwriting setting */
- #define MAX_PEN_SPEED 3
- #define MAX_PEN_COLORS 8
- #define DEFAULT_PEN_SPEED 1
- #define DEFAULT_PEN_COLOR 1
- /* Calibration */
- #define NUM_CALIBRATION_POINTS 3
- #endif /* defined(__MMI_TOUCH_SCREEN__) || defined(__MMI_HANDWRITING_PAD__) */
- #ifdef __MMI_PHNSET_TWO_LINE_MENUITEM_DISPLAY__
- #define phone_setup_language GetChildMenuIDIndexByParentMenuID(MENU9102_INITIAL_SETUP,MENU_SETTING_LANGUAGE)
- #define phone_setup_preferred_input_method GetChildMenuIDIndexByParentMenuID(MENU9102_INITIAL_SETUP,MENU_SETTING_PREFERED_INPUT_METHOD)
- #ifdef __MMI_SET_DEF_ENCODING_TYPE__
- #define phone_setup_encoding_type GetChildMenuIDIndexByParentMenuID(MENU9102_INITIAL_SETUP,MENU_SETTING_DEF_ENCODING_TYPE)
- #define encoding_type_big2 GetChildMenuIDIndexByParentMenuID(MENU_SETTING_DEF_ENCODING_TYPE,MENU_SETTING_DEF_ENCODING_BIG2)
- #define encoding_type_gb2312 GetChildMenuIDIndexByParentMenuID(MENU_SETTING_DEF_ENCODING_TYPE,MENU_SETTING_DEF_ENCODING_GB2312)
- #define encoding_type_ucs2 GetChildMenuIDIndexByParentMenuID(MENU_SETTING_DEF_ENCODING_TYPE,MENU_SETTING_DEF_ENCODING_UCS2)
- #endif /* __MMI_SET_DEF_ENCODING_TYPE__ */
- #endif /* __MMI_PHNSET_TWO_LINE_MENUITEM_DISPLAY__ */
- /*****************************************************************************
- * Typedef
- *****************************************************************************/
- typedef struct _AutoLang
- {
- l4c_cbs_language_enum LanType;
- S8 *LanSSC;
- } StructAutoLang;
- /*****************************************************************************
- * Local Variable
- *****************************************************************************/
- static U8 *greet_text_on_off[2];
- #ifdef __MMI_AUTO_LANG_EN__
- static StructAutoLang auto_lang_struct[] =
- {
- /* ISO 639 2-alphabet Language Codes */
- {CBS2_ZH, SSC_SCHINESE},
- {CBS2_TW, SSC_TCHINESE},
- {CBS0_ENGLISH, SSC_ENGLISH},
- {CBS0_SPANISH, SSC_SPANISH},
- {CBS2_TH, SSC_THAI},
- {CBS0_FRENCH, SSC_FRENCH},
- {CBS0_GERMAN, SSC_GERMAN},
- {CBS0_ITALIAN, SSC_ITALIAN},
- {CBS0_PORTUGUESE, SSC_PORTUGUESE},
- {CBS1_RUSSIAN, SSC_RUSSIAN},
- {CBS2_BG, SSC_BULGARIAN},
- {CBS0_TURKISH, SSC_TURKISH},
- {CBS2_VI, SSC_VIETNAMESE},
- {CBS2_ID, SSC_INDONESIAN},
- {CBS2_MS, SSC_MALAY},
- {CBS1_ARABIC, SSC_ARABIC},
- {CBS2_FA, SSC_PERSIAN},
- {CBS2_SK, SSC_SLOVAK},
- {CBS2_NL, SSC_DUTCH},
- {CBS1_FINNISH, SSC_FINNISH},
- {CBS2_SV, SSC_SWEDISH},
- {CBS2_HR, SSC_CROATIAN},
- {CBS2_RO, SSC_ROMANIAN},
- {CBS2_SL, SSC_SLOVENIAN},
- {CBS2_EL, SSC_GREEK},
- {CBS2_CS, SSC_CZECH},
- {CBS0_LANG_UNSPECIFIED, NULL /* Language UnSpecificed */ },
- {CBS_INVALID, NULL /* Language UnSpecificed */ }
- };
- #endif /* __MMI_AUTO_LANG_EN__ */
- #if defined(__MMI_TOUCH_SCREEN__) || defined(__MMI_HANDWRITING_PAD__)
- /* Handwriting setting */
- static S32 gInlinePenSpeed;
- static S32 gInlinePenColorIndex;
- static U8 *g_pen_speed_str_list[MAX_PEN_SPEED];
- static const color g_pen_color_list[MAX_PEN_COLORS] =
- {
- {0, 255, 255},
- {255, 0, 0},
- {0, 255, 0},
- {255, 255, 0},
- {255, 0, 255},
- {255, 128, 0},
- {0, 0, 128},
- {0, 0, 0}
- };
- /* Current state of calibration screen */
- typedef struct
- {
- /* Calibration point */
- mmi_pen_point_struct points[NUM_CALIBRATION_POINTS];
- /* Flag to check whether calibration has finished or not */
- BOOL finished;
- /* Sasve to factory default or user calibration data */
- BOOL save_to_factory_default;
- /* Original calibration setting before entring Calibration Application */
- mmi_pen_calibration_struct backup_data;
- /* Finish callback */
- void (*finish_callback) (void);
- } mmi_phnset_calibration_struct;
- static PHNSET_CALIBRATION_STATE_ENUM g_phnset_calibration_screen_state = CALIBRATION_NULL_STATE;
- static mmi_phnset_calibration_struct *g_phnset_calibration_cntx_p;
- #endif /* defined(__MMI_TOUCH_SCREEN__) || defined(__MMI_HANDWRITING_PAD__) */
- #ifdef __MMI_PHNSET_TWO_LINE_MENUITEM_DISPLAY__
- static S32 languages_default_item;
- static S32 is_inline_menu_exist = 0;
- #ifdef __MMI_SET_DEF_ENCODING_TYPE__
- static S32 default_encoding_type;
- #endif
- #endif /* __MMI_PHNSET_TWO_LINE_MENUITEM_DISPLAY__ */
- /*****************************************************************************
- * Global Variable
- *****************************************************************************/
- PHNSET_CNTX g_phnset_cntx;
- PHNSET_CNTX *g_phnset_cntx_p = &g_phnset_cntx;
- extern U8 g_dst;
- //KP Jerry add on 2007-3-30 start
- #ifdef __DUAL_SIM_SUPPORT__
- S8 unicode_buf1[SIM_NUM_LENGTH*ENCODING_LENGTH];
- S8 unicode_buf2[SIM_NUM_LENGTH*ENCODING_LENGTH];
- S8 unreachable_num[45*ENCODING_LENGTH];
- S8 unreachablestates;
- S8 isSearchFinished;
- #endif
- //KP Jerry add on 2007-3-30 end
- /*****************************************************************************
- * External Variable
- *****************************************************************************/
- /* Lagnuage */
- extern sLanguageDetails *gLanguageArray;
- extern U16 gCurrLangIndex;
- extern U8 *ItemType[8];
- extern U8 gPLMN[];
- extern PU8 subMenuDataPtrs[MAX_SUB_MENUS];
- #ifdef __MMI_PREFER_INPUT_METHOD__
- extern U8 *inputMethodList[9];
- extern U16 currInputMethodIndex;
- #endif /* __MMI_PREFER_INPUT_METHOD__ */
- /*****************************************************************************
- * Global Function
- *****************************************************************************/
- #ifdef __MMI_TVOUT__
- void mmi_phnset_tvout_event_hdlr(MDI_RESULT result);
- #endif
- /*****************************************************************************
- * External Function
- *****************************************************************************/
- extern void SetProfileSettingCustomFuns(void);
- extern void RefreshNwProviderName(U8 *UpdatePlmn);
- #ifdef __MMI_PREFER_INPUT_METHOD__
- extern U16 GetInputMethodIndex(U16 inputType);
- #endif
- /*****************************************************************************
- * Local Function
- *****************************************************************************/
- #ifdef __MMI_TVOUT__
- static void mmi_phnset_highlight_tvout(void);
- static void mmi_phnset_entry_tvout_screen(void);
- static void mmi_phnset_highlight_tvout_setting(void);
- static void mmi_phnset_highlight_tvout_adjust(void);
- static void mmi_phnset_tvout_set_adjust(void);
- static void mmi_phnset_tvout_cancel_adjust(void);
- static void mmi_phnset_entry_tvout_setting_screen(void);
- static void mmi_phnset_exit_tvout_setting_screen(void);
- static void mmi_phnset_entry_tvout_adjust_screen(void);
- static void mmi_phnset_tvout_adjust_y_gamma_callback(S32 value);
- static void mmi_phnset_tvout_adjust_u_callback(S32 value);
- static void mmi_phnset_tvout_adjust_v_callback(S32 value);
- #endif /* __MMI_TVOUT__ */
- /*****************************************************************************
- * FUNCTION
- * InitPhoneSetupCntx
- * DESCRIPTION
- * This function is to initialize phone setup context
- * PARAMETERS
- * void
- * a(?) [IN/OUT]
- * b(?) [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void InitPhoneSetupCntx(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S16 Err = 0;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- /* Common */
- g_phnset_cntx_p->curHightlightItem = 0;
- g_phnset_cntx_p->ScrAnchor = IDLE_SCREEN_ID;
- /* Set Time and Date */
- g_phnset_cntx_p->currentCity = 0;
- g_phnset_cntx_p->CurHomeCityStrID = 0;
- g_phnset_cntx_p->CurHomeCityStrPtr = 0;
- g_phnset_cntx_p->CurTimeFmt = 0;
- g_phnset_cntx_p->CurDateFmt = 0;
- g_phnset_cntx_p->AM_PM_flag = NULL;
- ReadValue(NVRAM_SETTING_DT_DST, &(g_phnset_cntx_p->currentDST), DS_BYTE, &Err);
- if (g_phnset_cntx_p->currentDST == 0xff)
- {
- g_phnset_cntx_p->currentDST = 0;
- WriteValue(NVRAM_SETTING_DT_DST, &g_phnset_cntx_p->currentDST, DS_BYTE, &Err);
- g_dst = g_phnset_cntx_p->currentDST;
- }
- memset(&(g_phnset_cntx_p->settime), 0, sizeof(PHNSET_DATETIME_STRUCT));
- /* NITZ */
- g_phnset_cntx_p->NITZDirtyFlag = MMI_FALSE;
- g_phnset_cntx_p->curNITZStatus = 0;
- /* Phone Setup */
- g_phnset_cntx_p->ShowOwnNumDirtyFlag = MMI_FALSE;
- g_phnset_cntx_p->ShowDtDirtyFlag = MMI_FALSE;
- g_phnset_cntx_p->curShowDtStatus = 0;
- g_phnset_cntx_p->curShowOwnNumStatus = 0;
- /* Lisen 0921-1 */
- #if defined(__MMI_OPERATOR_NAME_MENU__)
- g_phnset_cntx_p->curShowOPNStatus = 0;
- #endif
- #ifdef __MMI_MAINMENU_STYLE_CHANGE_EN__
- g_phnset_cntx_p->MenuStyle = 0;
- #endif
- /* Language */
- g_phnset_cntx_p->ppLang = NULL;
- g_phnset_cntx_p->UsrLangIdx = 0;
- g_phnset_cntx_p->LP = CBS0_LANG_UNSPECIFIED;
- /* Wallpaper & Screen Saver */
- g_phnset_cntx_p->curtWpID = 0;
- #ifdef __MMI_SUB_WALLPAPER__
- g_phnset_cntx_p->curtSubWpID = 0;
- #endif
- g_phnset_cntx_p->WPSSPreviewScrFlag = 1;
- g_phnset_cntx_p->WPFctyImgNum = 0;
- g_phnset_cntx_p->SSFctyImgNum = 0;
- g_phnset_cntx_p->WPDwnlImgNum = 0;
- g_phnset_cntx_p->SSDwnlImgNum = 0;
- g_phnset_cntx_p->curSSStatus = 0;
- g_phnset_cntx_p->curSSWaitTime = 0;
- g_phnset_cntx_p->SSStatusInlineHilite = 0;
- g_phnset_cntx_p->SSWaitStatusInlineHilite = 2;
- g_phnset_cntx_p->wpss_type = MMI_PHNSET_TYPE_WP;
- memset(g_phnset_cntx_p->SysWPSSList, 0, sizeof(g_phnset_cntx_p->SysWPSSList));
- memset(g_phnset_cntx_p->DwnlWPSSList, 0, sizeof(g_phnset_cntx_p->DwnlWPSSList));
- #ifdef __MMI_SET_DEF_ENCODING_TYPE__
- SetHiliteHandler(MENU_SETTING_DEF_ENCODING_TYPE, HighlightPhnsetDefEncoding);
- SetHintHandler(MENU_SETTING_DEF_ENCODING_TYPE, HintPhnsetDefEncoding);
- ReadValue(NVRAM_SETTING_DEF_ENCODING, &(g_phnset_cntx_p->EncodingType), DS_BYTE, &Err);
- if (g_phnset_cntx_p->EncodingType == 0xFF || Err != NVRAM_READ_SUCCESS)
- {
- //KP Jerry modify on 2006-12-6 start
- #if (defined(__MMI_CHSET_BIG5__) && !defined(__MMI_CHSET_GB2312__))
- g_phnset_cntx_p->EncodingType = PHNSET_ENCOD_BIG5;
- #elif (defined(__MMI_CHSET_GB2312__) && !defined(__MMI_CHSET_BIG5__))
- g_phnset_cntx_p->EncodingType = PHNSET_ENCOD_GB2312;
- #elif (defined(__MMI_CHSET_GB2312__) && defined(__MMI_CHSET_BIG5__))
- #if defined __MMI_DEFAULT_LANG_TR_CHINESE__
- g_phnset_cntx_p->EncodingType = PHNSET_ENCOD_BIG5;
- #elif defined __MMI_DEFAULT_LANG_SM_CHINESE__
- g_phnset_cntx_p->EncodingType = PHNSET_ENCOD_GB2312;
- #else
- g_phnset_cntx_p->EncodingType = PHNSET_ENCOD_BIG5;
- #endif
- #else
- g_phnset_cntx_p->EncodingType = PHNSET_ENCOD_UCS2;
- #endif
- //KP Jerry modify on 2006-12-6 end
- }
- switch (g_phnset_cntx_p->EncodingType)
- {
- case PHNSET_ENCOD_BIG5:
- #ifdef __MMI_CHSET_BIG5__
- g_chset_text_encoding = MMI_CHSET_BIG5;
- #else
- ASSERT(0); /* Encoding type not support */
- #endif
- break;
- case PHNSET_ENCOD_GB2312:
- #ifdef __MMI_CHSET_GB2312__
- g_chset_text_encoding = MMI_CHSET_GB2312;
- #else
- ASSERT(0); /* Encoding type not support */
- #endif
- break;
- }
- #endif /* __MMI_SET_DEF_ENCODING_TYPE__ */
- #ifdef __MMI_MAINMENU_STYLE_CHANGE_EN__
- ReadValue(NVRAM_SET_MAINMENU_STYLE, &(g_phnset_cntx_p->MenuStyle), DS_BYTE, &Err);
- if (g_phnset_cntx_p->MenuStyle == 0xFF || g_phnset_cntx_p->MenuStyle >= PHNSET_MAINMENU_STYLE_MAX)
- {
- g_phnset_cntx_p->MenuStyle = 0;
- }
- #endif /* __MMI_MAINMENU_STYLE_CHANGE_EN__ */
- #if defined(__MMI_TOUCH_SCREEN__) || defined(__MMI_HANDWRITING_PAD__)
- ReadValue(NVRAM_PEN_SPEED, &(g_phnset_cntx_p->pen_speed), DS_BYTE, &Err);
- if (g_phnset_cntx_p->pen_speed == 0xFF || Err != NVRAM_READ_SUCCESS || g_phnset_cntx_p->pen_speed >= MAX_PEN_SPEED)
- {
- g_phnset_cntx_p->pen_speed = DEFAULT_PEN_SPEED;
- }
- ReadValue(NVRAM_PEN_COLOR, &(g_phnset_cntx_p->pen_color), DS_BYTE, &Err);
- if (g_phnset_cntx_p->pen_color == 0xFF || Err != NVRAM_READ_SUCCESS || g_phnset_cntx_p->pen_color >= MAX_PEN_COLORS)
- {
- g_phnset_cntx_p->pen_color = DEFAULT_PEN_COLOR;
- }
- #endif /* defined(__MMI_TOUCH_SCREEN__) || defined(__MMI_HANDWRITING_PAD__) */
- }
- /*****************************************************************************
- * FUNCTION
- * InitPhoneSetupApp
- * DESCRIPTION
- * This function is to register highlight handler for Phonesetup
- * PARAMETERS
- * void
- * a(?) [IN/OUT]
- * b(?) [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void InitPhoneSetupApp(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- PRINT_INFORMATION(("File: [%s] Line: [%d] <<InitNetworkSetupApp.>n", __FILE__, __LINE__));
- /* Robin 0603: G12C request -- Add Display Setup menu */
- #ifdef __MMI_DISP_SETUP_LEVEL_UP__
- SetHiliteHandler(MENU_DISP_SETUP, HighlightDispSetup);
- #endif
- // SetHiliteHandler(MENU_SETTING_SPEED_DIAL, HighlightPhbSpeedDial); /* Move to SpeedDial.c */
- #if !defined(__MMI_NO_CONTRAST_LEVEL__)
- SetHiliteHandler(MENU_SETTING_CONTRAST_LEVEL, HighlightPhnsetContrastLevel);
- #endif
- SetHiliteHandler(MENU_SETTING_SCHEDULE_POWER, HighlightSPOF);
- SetHiliteHandler(MENU_IDLE_SCR_DISP, HighlightPhnsetIdleScrDisp);
- SetHiliteHandler(MENU_SETTING_SHOW_OWN_NUMBER, HighlightPhnsetShowOwnNo);
- /* Lisen 0921-1 */
- #if defined(__MMI_OPERATOR_NAME_MENU__)
- SetHiliteHandler(MENU_SETTING_SHOW_OPN, HighlightPhnsetShowOPN);
- #endif
- SetHiliteHandler(MENU_SETTING_SHOW_DT_TIME, HighlightPhnsetShowDtTime);
- //SetHiliteHandler(MITEM113_PBOOK_SPEED_DIAL,HighlightPhbSpeedDialSetNum); /* Move to SpeedDial.c */
- //SetHiliteHandler(MENU_SETTING_SPEED_STATUS,HighlightPhbSpeedDialStatus); /* Move to SpeedDial.c */
- SetHiliteHandler(MENU_SETTING_LANGUAGE, HighlightPhnsetLang);
- SetHiliteHandler(MENU9146_WELCOME_TEXT, HighlightPhnsetWelcomeText);
- SetHiliteHandler(MENU_SETTING_SCR_SVR, HighlightPhnsetScreenSaver);
- SetHiliteHandler(MENU_SETTING_WALLPAPER, HighlightPhnsetMainWallpaper);
- #ifdef __MMI_SUB_WALLPAPER__
- SetHiliteHandler(MENU_SETTING_WALLPAPER_SUB, HighlightPhnsetSubWallpaper);
- #endif
- #ifdef __MMI_MAINMENU_STYLE_CHANGE_EN__
- SetHintHandler(MENU_SETTING_MAINMENU_STYLE, HintPhnsetMainMenuStyle);
- SetHiliteHandler(MENU_SETTING_MAINMENU_STYLE, HighlightPhnsetMainMenuStyle);
- SetHiliteHandler(MENU_SETTING_MAINMENU_STYLE_MATRIX, HighlightPhnsetMainMenuStyleSelect);
- SetHiliteHandler(MENU_SETTING_MAINMENU_STYLE_PAGE, HighlightPhnsetMainMenuStyleSelect);
- SetHiliteHandler(MENU_SETTING_MAINMENU_STYLE_CIRCULAR, HighlightPhnsetMainMenuStyleSelect);
- SetHiliteHandler(MENU_SETTING_MAINMENU_STYLE_ROTATE, HighlightPhnsetMainMenuStyleSelect); /* PDG1 Manish */
- SetHiliteHandler(MENU_SETTING_MAINMENU_STYLE_LIST, HighlightPhnsetMainMenuStyleSelect);
- #endif /* __MMI_MAINMENU_STYLE_CHANGE_EN__ */
- #if defined(__MMI_UI_TECHNO_IDLESCREEN_BAR__)
- SetHintHandler(MENU_SETTING_IDLE_CLOCK_TYPE, HintPhnsetIdleClockType);
- SetHiliteHandler(MENU_SETTING_IDLE_CLOCK_TYPE, HighlightPhnsetIdleClockType);
- #endif /* defined(__MMI_UI_TECHNO_IDLESCREEN_BAR__) */
- #ifndef __MMI_HIDE_HOMECITY__
- SetHiliteHandler(MENU9142_SETHOMECITY, HighlightPhnsetSetHomeCity);
- #endif
- #ifndef __MMI_SEPARATE_DT_SETTING__
- SetHiliteHandler(MENU9143_SETTIMEANDDATE, HighlightPhnsetSetDT);
- SetHiliteHandler(MENU9144_SETTIMEANDDATEFORMAT, HighlightPhnsetSetFormat);
- #else /* __MMI_SEPARATE_DT_SETTING__ */
- SetHiliteHandler(MENU_ID_SETTING_DATEANDFORMAT, HighlightPhnsetSetDateAndFormat);
- SetHiliteHandler(MENU_ID_SETTING_TIMEANDFORMAT, HighlightPhnsetSetTimeAndFormat);
- #endif /* __MMI_SEPARATE_DT_SETTING__ */
- /* diamond, 2005/07/05 Flight mode */
- #ifdef __FLIGHT_MODE_SUPPORT__
- SetHiliteHandler(MENU_SETTING_FLIGHT_MODE, HighlightPhnsetFlightMode);
- #endif
- /* end, diamond */
- #ifndef __MMI_HIDE_HOMECITY__
- SetHintHandler((U16) MENU9142_SETHOMECITY, HintPhnsetTimeAndDate);
- #endif
- SetHintHandler(MENU9146_WELCOME_TEXT, HintPhnsetWelcomeText);
- SetHintHandler(MENU_SETTING_LANGUAGE, HintPhnsetLanguage);
- SetHintHandler(MENU_SETTING_SHOW_OWN_NUMBER, HintPhnsetOwnerNum);
- /* Lisen 0921-1 */
- #if defined(__MMI_OPERATOR_NAME_MENU__)
- SetHintHandler(MENU_SETTING_SHOW_OPN, HintPhnsetOPN);
- #endif
- SetHintHandler(MENU_SETTING_SHOW_DT_TIME, HintPhnsetShowDateTime);
- SetHintHandler(MENU_SETTING_WALLPAPER, HintPhnsetWallpaper);
- #ifdef __MMI_SUB_WALLPAPER__
- SetHintHandler(MENU_SETTING_WALLPAPER_SUB, HintPhnsetSubWallpaper);
- #endif
- SetHintHandler(MENU_SETTING_SCR_SVR, HintPhnsetScreenSaver);
- #ifdef __DAILY_WALLPAPER__
- SetHiliteHandler(MENU_SETTING_WALLPAPER_FIX, HighlightPhnsetWallpaperFix);
- SetHintHandler(MENU_SETTING_WALLPAPER_ROTATE, HintPhnsetWallpaperRotate);
- #endif /* __DAILY_WALLPAPER__ */
- #ifdef __MMI_NITZ__
- #ifdef __MMI_AUTOTIMEZONE_IN_DATEANDTIME__
- SetHintHandler(MENU9145_SETTIMEANDDATENITZ, HintPhnsetNITZ);
- SetHiliteHandler(MENU9145_SETTIMEANDDATENITZ, HighlightPhnsetNITZ);
- #else /* __MMI_AUTOTIMEZONE_IN_DATEANDTIME__ */
- SetHintHandler(MENU_SETTING_MENU_TREE, HintPhnsetNITZ);
- SetHiliteHandler(MENU_SETTING_MENU_TREE, HighlightPhnsetNITZ);
- #endif /* __MMI_AUTOTIMEZONE_IN_DATEANDTIME__ */
- #endif /* __MMI_NITZ__ */
- #ifdef __MMI_PREFER_INPUT_METHOD__
- SetHintHandler(MENU_SETTING_PREFERED_INPUT_METHOD, HintPhnsetPreferedInputMethod);
- #endif
- #if defined(__MMI_DEDICATED_KEY_SHORTCUTS__) && !defined(__DISABLE_SHORTCUTS_IMPL__)
- SetHiliteHandler(MENU_SETTING_DEDICATED_KEYS, HighlightDedicatedKeys);
- #endif
- #if defined(__MMI_TOUCH_SCREEN__) || defined(__MMI_HANDWRITING_PAD__)
- SetHiliteHandler(MENU_SETTING_HANDWRITING, HighlightHandwritingSetting);
- SetHiliteHandler(MENU_SETTING_CALIBRATION, HighlightCalibrationSetting);
- #endif /* defined(__MMI_TOUCH_SCREEN__) || defined(__MMI_HANDWRITING_PAD__) */
- #ifdef __MMI_POWER_ON_OFF_DISPLAY__
- SetHiliteHandler(MENU_SETTING_POWER_ON_DISPLAY, HighlightPhnsetPowerOn);
- SetHintHandler(MENU_SETTING_POWER_ON_DISPLAY, HintPhnsetPwrOnDisplay);
- SetHiliteHandler(MENU_SETTING_POWER_OFF_DISPLAY, HighlightPhnsetPowerOff);
- SetHintHandler(MENU_SETTING_POWER_OFF_DISPLAY, HintPhnsetPwrOffDisplay);
- #endif /* __MMI_POWER_ON_OFF_DISPLAY__ */
- /* Cylen 2005/08/23 GPIO Setting */
- #ifdef __MMI_CHANGABLE_FONT__
- SetHiliteHandler(MENU_ID_PHNSET_FONT_SIZE, HighlightPhnsetFontSize);
- SetHintHandler(MENU_ID_PHNSET_FONT_SIZE, HintPhnsetFontSize);
- PhnsetReadFontSize(); /* __USB_IN_NORMAL_MODE__ */
- #endif /* __MMI_CHANGABLE_FONT__ */
- SetHiliteHandler(MENU_ID_PHNSET_GPIO_SETTING, HighlightPhnsetGPIOSetting);
- SetHiliteHandler(MENU_ID_PHNSET_GPIO_LED, HighlightPhnsetGPIOLED);
- SetHiliteHandler(MENU_ID_PHNSET_GPIO_BACKLITE, HighlightPhnsetGPIOBackLite);
- //KP Jerry add on 2007-2-15 start
- #ifdef __DUAL_SIM_SUPPORT__
- SetHiliteHandler(MENU_SIM_SWCH, HighlightSIMSwitch);
- SetHiliteHandler(MENU_SIM_SWCH_NUM_EDTT, HighlightSIMNumEdit);
- SetHiliteHandler(MENU_SIM_SWCH_UNREACHABLE_AUTO_ON_OFF, HighlightAutoUnReachableForward);
- SetHiliteHandler(MENU_SIM_SWCH_ON_OFF, HighlightSIMCardSwitch);
- #ifdef __DUAL_SIM_QUICK_SWITCH__
- SetHiliteHandler(MENU_SIM_SWCH_QUICK_ON_OFF, HighlightSIMCardQuickSwitch);
- #endif
- #endif
- //KP Jerry add on 2007-2-15 end
- #ifdef __MMI_COVER_SETTING__
- SetHiliteHandler(MENU_ID_PHNSET_GPIO_COVER_CLOSE, HighlightPhnsetGPIOCover);
- #endif
- SetHintHandler(MENU_ID_PHNSET_GPIO_LED, HintPhnsetGPIOLED);
- //KP Jerry add on 2007-2-15 start
- #ifdef __DUAL_SIM_SUPPORT__
- SetHintHandler(MENU_SIM_SWCH, HintSIMSwitch);
- SetHintHandler(MENU_SIM_SWCH_ON_OFF, HintSwitching);
- #ifdef __DUAL_SIM_QUICK_SWITCH__
- SetHintHandler(MENU_SIM_SWCH_QUICK_ON_OFF, HintSwitching);
- #endif
- SetHintHandler(MENU_SIM_SWCH_UNREACHABLE_AUTO_ON_OFF, HintUnReachable);
- #endif
- //KP Jerry add on 2007-2-15 end
- /* diamond, 2005/07/05 Flight mode */
- #ifdef __FLIGHT_MODE_SUPPORT__
- SetHintHandler(MENU_SETTING_FLIGHT_MODE, HintPhnsetFlightMode);
- #endif
- /* end, diamond */
- #ifdef __MMI_TVOUT__
- SetHiliteHandler(MENU_ID_SETTING_TVOUT, mmi_phnset_highlight_tvout);
- SetHiliteHandler(MENU_ID_SETTING_TVOUT_SETTING, mmi_phnset_highlight_tvout_setting);
- SetHiliteHandler(MENU_ID_SETTING_TVOUT_ADJUST, mmi_phnset_highlight_tvout_adjust);
- #endif /* __MMI_TVOUT__ */
- }
- //KP Jerry add on 2007-3-23 start
- #ifdef __DUAL_SIM_SUPPORT__
- void GoBackSIMSwitchScreen(void)
- {
- GoBackToHistory(SCR_ID_PHNSET_SIM_SWITCH);
- }
- void MakeSIMSwitch(void)
- {
- isSearchFinished = SEARCH_SUCCESS;
- // Switching SIM Card
- SIMSwitchAndResetRequest();
- }
- void MakeSetTimerSIMSwitch(void)
- {
- StopTimer(POPUP_TIMER);
- StartTimer(POPUP_TIMER, UI_POPUP_NOTIFYDURATION_TIME*2, MakeSIMSwitch);
- }
- void MakeOnUnReachableSuccess(void)
- {
- DisplayPopup(
- (PU8) (g_callset_context.SSDisplayBuffer),
- IMG_GLOBAL_ACTIVATED,
- MMI_TRUE,
- UI_POPUP_NOTIFYDURATION_TIME,
- WARNING_TONE);
- ClearAllKeyHandler();
- MakeSetTimerSIMSwitch();
- }
- void MakeOffUnReachableSuccess(void)
- {
- DisplayPopup(
- (PU8) (g_callset_context.SSDisplayBuffer),
- IMG_GLOBAL_ACTIVATED,
- MMI_TRUE,
- UI_POPUP_NOTIFYDURATION_TIME,
- WARNING_TONE);
- ClearAllKeyHandler();
- MakeSetTimerSIMSwitch();
- }
- void NetWorkNotProviedServiceLeftKeyProcess(void)
- {
- S16 error;
- if (g_phnset_cntx.AutoUnReachableStates == AUTO_UNREACHABLE_ON)
- {
- g_phnset_cntx.AutoUnReachableStates = AUTO_UNREACHABLE_OFF;
- WriteValue(NVRAM_SIM_SWITCH_ID, &(g_phnset_cntx.AutoUnReachableStates), DS_BYTE, &error);
- DisplayPopup(
- (PU8) GetString(STR_GLOBAL_DETACTIVATE),
- IMG_GLOBAL_ACTIVATED,
- MMI_TRUE,
- UI_POPUP_NOTIFYDURATION_TIME,
- WARNING_TONE);
- ClearAllKeyHandler();
- }
- MakeSetTimerSIMSwitch();
- }
- void NetWorkNotProviedServiceRightKeyProcess(void)
- {
- MakeSIMSwitch();
- }
- void MakeNetWorkNotProviedService(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S16 error;
- S8 short_string[2];
- S8 TempShortString[2];
- S8 *TempBuff1;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- ReadValue(NVRAM_SIM_SWITCH_ID, &(g_phnset_cntx.AutoUnReachableStates), DS_BYTE, &error);
- TempBuff1 = (S8*) OslMalloc(MAX_DISP_UCS2);
- memset(TempBuff1, 0, MAX_DISP_UCS2);
- memset(short_string, 0, 2);
- memset(TempShortString, 0, 2);
- pfnUnicodeStrcpy((PS8) TempBuff1, (PS8) (g_callset_context.SSDisplayBuffer));
- if (g_phnset_cntx.AutoUnReachableStates == AUTO_UNREACHABLE_ON)
- {
- sprintf(short_string, "n");
- AnsiiToUnicodeString((PS8) TempShortString, (PS8) short_string);
- pfnUnicodeStrcat((S8*) TempBuff1, (S8*) GetString(STR_SIM_SWITCH_UNREACHABLE_AUTO_ON_OFF));
- pfnUnicodeStrcat((S8*) TempBuff1, (S8*) TempShortString);
- pfnUnicodeStrcat((S8*) TempBuff1, (S8*) GetString(STR_SIM_SWITCH_SHUT_DOWN));
- }
- DisplayConfirm(STR_GLOBAL_YES, IMG_GLOBAL_YES,
- STR_GLOBAL_NO, IMG_GLOBAL_NO,
- (PU16) TempBuff1,IMG_GLOBAL_QUESTION, WARNING_TONE);
- SetLeftSoftkeyFunction(NetWorkNotProviedServiceLeftKeyProcess,KEY_EVENT_UP);
- SetRightSoftkeyFunction(NetWorkNotProviedServiceRightKeyProcess,KEY_EVENT_UP);
- OslMfree(TempBuff1);
- }
- void EntrySIMSwitchProcessResut(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S8 FindSubStr;
- S8 len_unreachable, len_sim_num;
- S16 Error;
- S8 unreachable_ansii_num[45];
- U8 SIM1Num[SIM_NUM_LENGTH];
- U8 SIM2Num[SIM_NUM_LENGTH];
- U8 AutoUnReachableStates; // Auto on-off
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- memset(unicode_buf1, 0, SIM_NUM_LENGTH*ENCODING_LENGTH);
- memset(unicode_buf2, 0, SIM_NUM_LENGTH*ENCODING_LENGTH);
- memset(SIM1Num, 0, SIM_NUM_LENGTH);
- memset(SIM2Num, 0, SIM_NUM_LENGTH);
- memset(unreachable_ansii_num, 0, 45);
- // Read NVRAM SIM1 and SIM2 Number.
- ReadRecord(NVRAM_EF_SIM_SWITCH_LID, 1, SIM1Num, NVRAM_EF_SIM_SWITCH_SIZE, &Error);
- ReadRecord(NVRAM_EF_SIM_SWITCH_LID, 2, SIM2Num, NVRAM_EF_SIM_SWITCH_SIZE, &Error);
- AnsiiToUnicodeString((S8*)unicode_buf1, (S8*)SIM1Num);
- AnsiiToUnicodeString((S8*)unicode_buf2, (S8*)SIM2Num);
- UnicodeToAnsii((S8*)unreachable_ansii_num, (S8*)unreachable_num);
- ReadValue(NVRAM_SIM_SWITCH_ID, &AutoUnReachableStates, DS_BYTE, &Error);
- if (AutoUnReachableStates == AUTO_UNREACHABLE_ON) /* The Auto UnReachable Service is Already On. */
- {
- if (unreachablestates == UNREACHABLE_ON) /* The UnReachable Service is Already On. */
- {
- ReadValue( NVRAM_SIM_ID, &(g_phnset_cntx.SIMID), DS_BYTE , &Error);
- if(g_phnset_cntx.SIMID == SIM1)
- {
- len_unreachable = strlen((char *)unreachable_ansii_num);
- len_sim_num = strlen((char *)SIM2Num);
- if (len_unreachable < 7)
- {
- if (len_unreachable >= len_sim_num)
- {
- FindSubStr = strcmp((const char *)(unreachable_ansii_num + len_unreachable - len_sim_num), (const char *) SIM2Num);
- }
- else
- FindSubStr = 1;
- }
- else
- {
- if (len_sim_num < 7)
- FindSubStr = strcmp((const char *)(unreachable_ansii_num + len_unreachable - len_sim_num), (const char *) SIM2Num);
- else
- FindSubStr = strcmp((const char *)(unreachable_ansii_num + len_unreachable - 7), (const char *)(SIM2Num + len_sim_num - 7));
- }
- if (FindSubStr != 0)
- {
- // The UnReachable Service of Current SIM Card is Cancel.
- g_callset_context.SSCFType = FORWARD_CANCEL_ALL;
- EnterPhnSetUnReachableOffReq();
- }
- else
- {
- // Hint User UnReachable Service is Already On
- MakeOnUnReachableSuccess();
- }
- }
- else if (g_phnset_cntx.SIMID == SIM2)
- {
- len_unreachable = strlen((char *)unreachable_ansii_num);
- len_sim_num = strlen((char *)SIM1Num);
- if (len_unreachable < 7)
- {
- if (len_unreachable >= len_sim_num)
- {
- FindSubStr = strcmp((const char *)(unreachable_ansii_num + len_unreachable - len_sim_num), (const char *) SIM1Num);
- }
- else
- FindSubStr = 1;
- }
- else
- {
- if (len_sim_num < 7)
- FindSubStr = strcmp((const char *)(unreachable_ansii_num + len_unreachable - len_sim_num), (const char *) SIM1Num);
- else
- FindSubStr = strcmp((const char *)(unreachable_ansii_num + len_unreachable - 7), (const char *)(SIM1Num + len_sim_num - 7));
- }
- if (FindSubStr != 0)
- {
- // The UnReachable Service of Current SIM Card is Cancel.
- g_callset_context.SSCFType = FORWARD_CANCEL_ALL;
- EnterPhnSetUnReachableOffReq();
- }
- else
- {
- // Hint User UnReachable Service is Already On
- MakeOnUnReachableSuccess();
- }
- }
- }
- else if (unreachablestates == UNREACHABLE_OFF) /* The UnReachable Service is Already Off */
- {
- EnterPhnSetUnReachableOnReq();
- }
- else if (unreachablestates == UNREACHABLE_NOT_PROVIDED)
- {
- MakeNetWorkNotProviedService();
- }
- }
- else /* The Auto UnReachable Service is Already Off. */
- {
- if (unreachablestates == UNREACHABLE_ON) /* The UnReachable Service is Already On. */
- {
- ReadValue( NVRAM_SIM_ID, &(g_phnset_cntx.SIMID), DS_BYTE , &Error);
- if(g_phnset_cntx.SIMID == SIM1)
- {
- len_unreachable = strlen((char *)unreachable_ansii_num);
- len_sim_num = strlen((char *)SIM2Num);
- if (len_unreachable < 7)
- {
- if (len_unreachable >= len_sim_num)
- {
- FindSubStr = strcmp((const char *)(unreachable_ansii_num + len_unreachable - len_sim_num), (const char *) SIM2Num);
- }
- else
- FindSubStr = 1;
- }
- else
- {
- if (len_sim_num < 7)
- FindSubStr = strcmp((const char *)(unreachable_ansii_num + len_unreachable - len_sim_num), (const char *) SIM2Num);
- else
- FindSubStr = strcmp((const char *)(unreachable_ansii_num + len_unreachable - 7), (const char *)(SIM2Num + len_sim_num - 7));
- }
- if (FindSubStr != 0)
- {
- // Hint User UnReachable Service of Current SIM Card is Already On, But isn't setting number.
- mmi_phbset_sim_switch_off_confirm();
- }
- else
- {
- g_callset_context.SSCFType = FORWARD_CANCEL_ALL;
- EnterPhnSetUnReachableOffReq();
- }
- }
- else if (g_phnset_cntx.SIMID == SIM2)
- {
- len_unreachable = strlen((char *)unreachable_ansii_num);
- len_sim_num = strlen((char *)SIM1Num);
- if (len_unreachable < 7)
- {
- if (len_unreachable >= len_sim_num)
- {
- FindSubStr = strcmp((const char *)(unreachable_ansii_num + len_unreachable - len_sim_num), (const char *) SIM1Num);
- }
- else
- FindSubStr = 1;
- }
- else
- {
- if (len_sim_num < 7)
- FindSubStr = strcmp((const char *)(unreachable_ansii_num + len_unreachable - len_sim_num), (const char *) SIM1Num);
- else
- FindSubStr = strcmp((const char *)(unreachable_ansii_num + len_unreachable - 7), (const char *)(SIM1Num + len_sim_num - 7));
- }
- if (FindSubStr != 0)
- {
- // Hint User UnReachable Service of Current SIM Card is Already On, But isn't setting number.
- mmi_phbset_sim_switch_off_confirm();
- }
- else
- {
- g_callset_context.SSCFType = FORWARD_CANCEL_ALL;
- EnterPhnSetUnReachableOffReq();
- }
- }
- }
- else if (unreachablestates == UNREACHABLE_OFF)
- {
- // Hint User Current SIM Card UnReachable Service is Already off.
- MakeOffUnReachableSuccess();
- }
- else if (unreachablestates == UNREACHABLE_NOT_PROVIDED)
- {
- MakeNetWorkNotProviedService();
- }
- }
- }
- void EntrySIMSwitchProcess(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if ((!isIncomingCall()) || (GetActiveScreenId() == SCR_CM_REQUESTINGUSSD))
- {
- RemoveSSReqScr();
- EntrySIMSwitchProcessResut();
- }
- else
- {
- HistoryReplace(SCR_CM_REQUESTINGUSSD, SCR_ID_CALLSET_GENERAL_SS_RESULT, EntrySIMSwitchProcessResut);
- }
- }
- void SIMSwitchForwardRsp(void *info)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S8 short_string[45];
- U8 bs_index;
- S8 TempShortString[90];
- S8 TempBuff[250];
- S8 *TempBuff1;
- mmi_ss_call_forward_rsp_struct *pMsgFwdQueryrsp = (mmi_ss_call_forward_rsp_struct*) info;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- TempBuff1 = (S8*) OslMalloc(MAX_DISP_UCS2);
- memset(TempBuff1, 0, MAX_DISP_UCS2);
- DeleteScreenIfPresent(SCR_ID_CALLSET_FORWARD_OPTIONS);
- DeleteScreenIfPresent(SCR_ID_CALLSET_FORWARD_NUMBER);
- DeleteScreenIfPresent(SCR_ID_CALLSET_FORWARD_NO_ANS_TIME);
- if (pMsgFwdQueryrsp->result.flag == L4C_OK)
- {
- pfnUnicodeStrcpy((PS8) TempBuff1, (PS8) GetString(STR_L4_CFNRC));
- if (pMsgFwdQueryrsp->count == 0)
- {
- unreachablestates = UNREACHABLE_OFF;
- pfnUnicodeStrcat((PS8) TempBuff1, (PS8) GetString(STR_DEACTIVATED));
- }
- for (bs_index = 0; bs_index < pMsgFwdQueryrsp->count; bs_index++)
- {
- memset(TempBuff, 0, sizeof(TempBuff));
- if (pMsgFwdQueryrsp->list[bs_index].ss_status & SS_ABIT)
- {
- unreachablestates = UNREACHABLE_ON;
- pfnUnicodeStrcat((PS8) TempBuff, (PS8) GetString(STR_ACTIVATED));
- }
- else if (pMsgFwdQueryrsp->opcode == SS_OP_INTERROGATESS)
- {
- if (pMsgFwdQueryrsp->list[bs_index].ss_status & SS_PBIT)
- {
- unreachablestates = UNREACHABLE_OFF;
- pfnUnicodeStrcat((PS8) TempBuff1, (PS8) GetString(STR_DEACTIVATED));
- }
- else
- {
- unreachablestates = UNREACHABLE_NOT_PROVIDED;
- pfnUnicodeStrcat((PS8) TempBuff, (PS8) GetString(STR_NOT_PROVIDED));
- }
- }
- else
- {
- unreachablestates = UNREACHABLE_OFF;
- pfnUnicodeStrcat((PS8) TempBuff1, (PS8) GetString(STR_DEACTIVATED));
- }
- if (pMsgFwdQueryrsp->list[bs_index].no_reply_timer != 0)
- {
- sprintf(short_string, "%d ", (U8) pMsgFwdQueryrsp->list[bs_index].no_reply_timer);
- AnsiiToUnicodeString((PS8) TempShortString, (PS8) short_string);
- pfnUnicodeStrcat((S8*) TempBuff, (S8*) TempShortString);
- pfnUnicodeStrcat((PS8) TempBuff, (PS8) GetString(STR_SECONDS));
- }
- AppendBScodeString(pMsgFwdQueryrsp->list[bs_index].bs_code, TempBuff);
- memset(unreachable_num, 0, sizeof(unreachable_num));
- if (strlen(pMsgFwdQueryrsp->list[bs_index].address) != 0)
- {
- memset(short_string, 0, sizeof(short_string));
- memset(TempShortString, 0, sizeof(TempShortString));
- strncpy((PS8) short_string, (PS8) pMsgFwdQueryrsp->list[bs_index].address, sizeof(short_string) - 5);
- AnsiiToUnicodeString((PS8) unreachable_num, (PS8) short_string);
- strcat((PS8) short_string, " ");
- AnsiiToUnicodeString((PS8) TempShortString, (PS8) short_string);
- pfnUnicodeStrcat((S8*) TempBuff, (S8*) TempShortString);
- }
- if ((pfnUnicodeStrlen((PS8) TempBuff) + pfnUnicodeStrlen((PS8) TempBuff1))
- < MAX_DISP_UCS2 / ENCODING_LENGTH)
- {
- pfnUnicodeStrcat((S8*) TempBuff1, (S8*) TempBuff);
- }
- }
- sprintf(short_string, "n");
- AnsiiToUnicodeString((PS8) TempShortString, (PS8) short_string);
- pfnUnicodeStrcat((S8*) TempBuff1, (S8*) TempShortString);
- if (isSearchFinished == SEARCH_FAIL)
- {
- switch (g_callset_context.SSCFCondQueryStage)
- {
- case CF_COND_STAGE_NONE:
- pfnUnicodeStrcpy((S8*) g_callset_context.SSDisplayBuffer, (S8*) TempBuff1);
- DeleteScreenIfPresent(SCR_ID_CALLSET_GENERAL_SS_RESULT);
- EntrySIMSwitchProcess();
- break;
- case CF_COND_STAGE_UNREACH:
- pfnUnicodeStrcpy((S8*) g_callset_context.SSDisplayBuffer, (S8*) TempBuff1);
- g_callset_context.SSCFType = FORWARD_ALLCOND;
- EnterPhnSetUnReachableQueryReq();
- break;
- default:
- ASSERT(0);
- break;
- }
- }
- if (TempBuff1 != NULL)
- OslMfree(TempBuff1);
- TempBuff1 = NULL;
- }
- else
- {
- ResetCFCondStage();
- #ifdef __MMI_SS_SHOW_CAUSE__
- ShowCauseString(pMsgFwdQueryrsp->result.cause, g_callset_context.SSDisplayBuffer);
- DeleteScreenIfPresent(SCR_ID_CALLSET_GENERAL_SS_RESULT);
- EntrySIMSwitchProcess();
- #else /* __MMI_SS_SHOW_CAUSE__ */
- DisplayPopup((PU8) GetString(STR_GLOBAL_NOT_DONE), IMG_GLOBAL_UNFINISHED, 0, CS_NOTIFYDURATION, ERROR_TONE);
- RemoveSSReqScr();
- if (TempBuff1 != NULL)
- OslMfree(TempBuff1);
- TempBuff1 = NULL;
- MakeSetTimerSIMSwitch();
- #endif /* __MMI_SS_SHOW_CAUSE__ */
- }
- }
- void EnterPhnSetUnReachableOnReq(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S8 input_string[MAX_DIGITS_USSD * ENCODING_LENGTH];
- S8 string_code[50];
- PS8 hash_string = NULL;
- U8 i;
- S16 Error;
- U8 SIM1Num[SIM_NUM_LENGTH];
- U8 SIM2Num[SIM_NUM_LENGTH];
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- // Read NVRAM SIM1 and SIM2 Number
- ReadRecord(NVRAM_EF_SIM_SWITCH_LID, 1, SIM1Num, NVRAM_EF_SIM_SWITCH_SIZE, &Error);
- ReadRecord(NVRAM_EF_SIM_SWITCH_LID, 2, SIM2Num, NVRAM_EF_SIM_SWITCH_SIZE, &Error);
- AnsiiToUnicodeString((S8*)unicode_buf1, (S8*)SIM1Num);
- AnsiiToUnicodeString((S8*)unicode_buf2, (S8*)SIM2Num);
- memset(g_callset_context.SSCFNum, 0, (MAX_CC_ADDR_LEN *ENCODING_LENGTH) + 2);
- if(g_phnset_cntx.SIMID == SIM1)
- {
- pfnUnicodeStrcpy((S8*)(g_callset_context.SSCFNum), (S8*)unicode_buf2);
- }
- else if (g_phnset_cntx.SIMID == SIM2)
- {
- pfnUnicodeStrcpy((S8*)(g_callset_context.SSCFNum), (S8*)unicode_buf1);
- }
- for (i = 0; i < pfnUnicodeStrlen((S8*) g_callset_context.SSCFNum); i++)
- {
- if ((g_callset_context.SSCFNum[i * 2] == 'p') || (g_callset_context.SSCFNum[i * 2] == 'w'))
- {
- DisplayPopup((PU8) GetString(STR_GLOBAL_NOT_DONE), IMG_GLOBAL_UNFINISHED, 0, CS_NOTIFYDURATION, ERROR_TONE);
- return;
- }
- }
- /* format the string for the ss string handling */
- memset(input_string, 0, (MAX_DIGITS_USSD * ENCODING_LENGTH));
- memset(string_code, 0, 50);
- hash_string = (PS8) GetString(STR_SIM_SWITCH_HASH_VALUE);
- strcpy((S8*) string_code, "**62*");
- AnsiiToUnicodeString((PS8) input_string, (PS8) string_code);
- pfnUnicodeStrcat((PS8) input_string, (PS8) g_callset_context.SSCFNum);
- pfnUnicodeStrcat((PS8) input_string, (PS8) hash_string);
- /* set protocol event handler for the call fwd response */
- SetProtocolEventHandler(SIMSwitchForwardRsp, PRT_MMI_SS_CALL_FORWARD_RSP);
- /* make a corresponding ss string for call fwd option */
- MakeCall((PS8) input_string);
- return;
- }
- void EnterPhnSetUnReachableOffReq(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S8 input_string[MAX_DIGITS_USSD * ENCODING_LENGTH];
- S8 string_out[20];
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- //micha1229
- // PS8 hash_string = NULL ;
- /* format the string for the ss string handling */
- memset(input_string, 0, (MAX_DIGITS_USSD * ENCODING_LENGTH));
- memset(string_out, 0, 20);
- /* hash_string = (PS8) GetString(STR_HASH_VALUE); */
- strcpy((S8*) string_out, "##62#");
- AnsiiToUnicodeString((PS8) input_string, (PS8) string_out);
- /* set protocol event handler for the call fwd response */
- SetProtocolEventHandler(SIMSwitchForwardRsp, PRT_MMI_SS_CALL_FORWARD_RSP);
- /* make a corresponding ss string for call fwd option */
- MakeCall((PS8) input_string);
- return;
- }
- void EnterPhnSetUnReachableQueryReq(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S8 input_string[MAX_DIGITS_USSD * ENCODING_LENGTH];
- S8 string_out[20];
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- //micha1229
- // PS8 hash_string = NULL ;
- /* format the string for the ss string handling */
- memset(input_string, 0, (MAX_DIGITS_USSD * ENCODING_LENGTH));
- memset(string_out, 0, 20);
- /* hash_string = (PS8) GetString(STR_HASH_VALUE); */
- switch (g_callset_context.SSCFType)
- {
- /* if the menu item is selected is voice call fwd when un reachable */
- case FORWARD_UNREACHABLE:
- strcpy((S8*) string_out, "*#62#");
- AnsiiToUnicodeString((PS8) input_string, (PS8) string_out);
- break;
- /* if the menu item is selected is voice call fwd when no answer */
- case FORWARD_NOANSWER:
- strcpy((S8*) string_out, "*#61#");
- AnsiiToUnicodeString((PS8) input_string, (PS8) string_out);
- break;
- /* if the menu item is selected is voice call fwd when all conditional */
- case FORWARD_BUSY:
- strcpy((S8*) string_out, "*#67#");
- AnsiiToUnicodeString((PS8) input_string, (PS8) string_out);
- break;
- /* if the menu item is selected all voice call fwd */
- case FORWARD_ALLCOND:
- switch (g_callset_context.SSCFCondQueryStage)
- {
- case CF_COND_STAGE_NONE:
- g_callset_context.SSCFCondQueryStage = CF_COND_STAGE_UNREACH;
- strcpy((S8*) string_out, "*#62#");
- AnsiiToUnicodeString((PS8) input_string, (PS8) string_out);
- break;
- case CF_COND_STAGE_UNREACH:
- g_callset_context.SSCFCondQueryStage = CF_COND_STAGE_NOANS;
- strcpy((S8*) string_out, "*#61#");
- AnsiiToUnicodeString((PS8) input_string, (PS8) string_out);
- break;
- case CF_COND_STAGE_NOANS:
- g_callset_context.SSCFCondQueryStage = CF_COND_STAGE_BUSY;
- strcpy((S8*) string_out, "*#67#");
- AnsiiToUnicodeString((PS8) input_string, (PS8) string_out);
- break;
- default:
- ASSERT(0);
- break;
- }
- break;
- /* if the menu item is selected is voice call fwd when busy */
- case FORWARD_ALLVOICE:
- strcpy((S8*) string_out, "*#21**11#");
- AnsiiToUnicodeString((PS8) input_string, (PS8) string_out);
- break;
- /* if the menu item is selected is data call fwd */
- case FORWARD_DATA:
- strcpy((S8*) string_out, "*#21**20#");
- AnsiiToUnicodeString((PS8) input_string, (PS8) string_out);
- break;
- }
- /* set protocol event handler for the call fwd response */
- SetProtocolEventHandler(SIMSwitchForwardRsp, PRT_MMI_SS_CALL_FORWARD_RSP);
- /* make a corresponding ss string for call fwd option */
- MakeCall((PS8) input_string);
- return;
- }
- void MakeSIMSwitchConfirmOff(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- EnterPhnSetUnReachableOffReq();
- MakeSetTimerSIMSwitch();
- }
- /**************************************************************
- FUNCTION NAME : MakeAutoUnReachableSel(void)
- PURPOSE : Handler Select Auto UnReachable ON/OFF.
- INPUT PARAMETERS : nil
- OUTPUT PARAMETERS : nil
- RETURNS : void
- REMARKS : NA
- **************************************************************/
- void MakeAutoUnReachableSel(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S16 error;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (g_phnset_cntx.AutoUnReachableStates > AUTO_UNREACHABLE_ON || g_phnset_cntx.AutoUnReachableStates < AUTO_UNREACHABLE_OFF)
- {
- ReadValue(NVRAM_SIM_SWITCH_ID, &(g_phnset_cntx.AutoUnReachableStates), DS_BYTE, &error);
- }
- if (g_phnset_cntx.AutoUnReachableStates == AUTO_UNREACHABLE_OFF)
- {
- g_phnset_cntx.AutoUnReachableStates = AUTO_UNREACHABLE_ON;
- WriteValue(NVRAM_SIM_SWITCH_ID, &(g_phnset_cntx.AutoUnReachableStates), DS_BYTE, &error);
- pfnUnicodeStrcpy((S8*)hintData[1],(PS8)GetString(STR_GLOBAL_ON));
- Category52ChangeItemDescription(1, (U8*) GetString(STR_GLOBAL_ON));
- ChangeLeftSoftkey(STR_GLOBAL_OFF, 0);
- }
- else if (g_phnset_cntx.AutoUnReachableStates == AUTO_UNREACHABLE_ON)
- {
- g_phnset_cntx.AutoUnReachableStates = AUTO_UNREACHABLE_OFF;
- WriteValue(NVRAM_SIM_SWITCH_ID, &(g_phnset_cntx.AutoUnReachableStates), DS_BYTE, &error);
- pfnUnicodeStrcpy((S8*)hintData[1],(PS8)GetString(STR_GLOBAL_OFF));
- Category52ChangeItemDescription(1, (U8*) GetString(STR_GLOBAL_OFF));
- ChangeLeftSoftkey(STR_GLOBAL_ON, 0);
- }
- RedrawCategoryFunction();
- }
- /**************************************************************
- FUNCTION NAME : MakeSIMSwitchSel(void)
- PURPOSE : Handler SIM Switch.
- INPUT PARAMETERS : nil
- OUTPUT PARAMETERS : nil
- RETURNS : void
- REMARKS : NA
- **************************************************************/
- void MakeSIMSwitchSel(void )
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S16 Error;
- S16 SIM1Num[SIM_NUM_LENGTH];
- S16 SIM2Num[SIM_NUM_LENGTH];
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- memset(unicode_buf1, 0, SIM_NUM_LENGTH*ENCODING_LENGTH);
- memset(unicode_buf2, 0, SIM_NUM_LENGTH*ENCODING_LENGTH);
- memset(SIM1Num, 0, SIM_NUM_LENGTH);
- memset(SIM2Num, 0, SIM_NUM_LENGTH);
- ReadRecord(NVRAM_EF_SIM_SWITCH_LID, 1, SIM1Num, NVRAM_EF_SIM_SWITCH_SIZE, &Error);
- ReadRecord(NVRAM_EF_SIM_SWITCH_LID, 2, SIM2Num, NVRAM_EF_SIM_SWITCH_SIZE, &Error);
- AnsiiToUnicodeString((S8*)unicode_buf1, (S8*)SIM1Num);
- AnsiiToUnicodeString((S8*)unicode_buf2, (S8*)SIM2Num);
- if (!pfnUnicodeStrlen((const S8*)unicode_buf1) || !pfnUnicodeStrlen((const S8*)unicode_buf2))
- {
- // Hint User input all data
- StopTimer(POPUP_TIMER);
- DisplayPopup((PU8)GetString(STR_SIM_SWITCH_SETTING_SIM_NUM), IMG_GLOBAL_WARNING, MMI_TRUE, UI_POPUP_NOTIFYDURATION_TIME, WARNING_TONE);
- ClearAllKeyHandler();
- StartTimer(POPUP_TIMER, UI_POPUP_NOTIFYDURATION_TIME, mmi_phnset_entry_sim_num_edit);
- return;
- }
- else if (!pfnUnicodeStrcmp((const S8*)unicode_buf1,(const S8*)unicode_buf2))
- {
- // SIM1 And SIM2 number can not equal
- StopTimer(POPUP_TIMER);
- DisplayPopup((PU8)GetString(STR_SIM_SWITCH_ERROR_SAME_NUM), IMG_GLOBAL_WARNING, MMI_TRUE, UI_POPUP_NOTIFYDURATION_TIME, WARNING_TONE);
- ClearAllKeyHandler();
- StartTimer(POPUP_TIMER, UI_POPUP_NOTIFYDURATION_TIME, mmi_phnset_entry_sim_num_edit);
- return;
- }
- isSearchFinished = SEARCH_FAIL;
- g_callset_context.SSCFType = FORWARD_UNREACHABLE;
- EnterPhnSetUnReachableQueryReq();
- }
- void SIMSwitchAndResetRequest(void)
- {
- #if !defined(__MTK_TARGET__)
- S8 str_buf[] = "Press Yes to restore and shutdown";
- UI_string_type unicode_buf[sizeof(str_buf)];
- AnsiiToUnicodeString((PS8)unicode_buf, (PS8)str_buf);
- DisplayConfirm(STR_GLOBAL_YES, IMG_GLOBAL_YES,
- STR_GLOBAL_NO, IMG_GLOBAL_NO,
- (PU16)unicode_buf,IMG_GLOBAL_QUESTION, WARNING_TONE);
- #else
- DisplayConfirm(STR_GLOBAL_YES, IMG_GLOBAL_YES,
- STR_GLOBAL_NO, IMG_GLOBAL_NO,
- (PU16)GetString(STR_SETTING_SIM_SWITCH_CONFIRM),IMG_GLOBAL_QUESTION, WARNING_TONE);
- #endif
- /* Register function with left/right softkey */
- SetRightSoftkeyFunction(GoBackSIMSwitchScreen,KEY_EVENT_UP);
- SetLeftSoftkeyFunction(SIMSwitchAndReset,KEY_EVENT_UP);
- }
- static void SIMSwitchRequestRacDetach()
- {
- #ifdef MMI_ON_HARDWARE_P
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- MYQUEUE Message;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- Message.oslSrcId = MOD_MMI;
- Message.oslDestId = MOD_L4C;
- Message.oslMsgId = MSG_ID_MMI_NW_PWROFF_DETACH_REQ;
- Message.oslDataPtr = (oslParaType*) NULL;
- Message.oslPeerBuffPtr = NULL;
- OslMsgSendExtQueue(&Message);
- #endif /* MMI_ON_HARDWARE_P */
- }
- void SIMSwitchAndReset(void)
- {
- S16 error;
- if(g_phnset_cntx.SIMID == 0)
- {
- g_phnset_cntx.SIMID = 1;
- }
- else
- {
- g_phnset_cntx.SIMID = 0;
- }
- WriteValue( NVRAM_SIM_ID, &(g_phnset_cntx.SIMID), DS_BYTE , &error);
- SIMSwitchRequestRacDetach();
- kal_sleep_task(200); /* sleep for 200 ticks, about 1s */
- AlmATPowerReset(MMI_FALSE, 10); // shutdown system and reboot in 10 seconds.
- }
- void LoadandSetSIMID(void)
- {
- #ifdef MMI_ON_HARDWARE_P
- S16 error;
- ReadValue( NVRAM_SIM_ID, &(g_phnset_cntx.SIMID), DS_BYTE , &error);
- if(g_phnset_cntx.SIMID<0 || g_phnset_cntx.SIMID>1)
- {
- g_phnset_cntx.SIMID = 0;
- WriteValue( NVRAM_SIM_ID, &(g_phnset_cntx.SIMID), DS_BYTE , &error);
- }
- if(g_phnset_cntx.SIMID == 0)
- {
- GPIO_InitIO(1, SIM_SWITCH_PIN);
- GPIO_ModeSetup(SIM_SWITCH_PIN, 0);
- GPIO_WriteIO(1, SIM_SWITCH_PIN);
- }
- else
- {
- GPIO_InitIO(1, SIM_SWITCH_PIN);
- GPIO_ModeSetup(SIM_SWITCH_PIN, 0);
- GPIO_WriteIO(0, SIM_SWITCH_PIN);
- }
- #endif/*MMI_ON_HARDWARE_P*/
- }
- /**************************************************************
- FUNCTION NAME : LoadSIMSwitchAllData(void)
- PURPOSE : Init data.
- INPUT PARAMETERS : nil
- OUTPUT PARAMETERS : nil
- RETURNS : void
- REMARKS : NA
- **************************************************************/
- void LoadSIMSwitchAllData(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S16 Error;
- S16 SIM1Num[SIM_NUM_LENGTH];
- S16 SIM2Num[SIM_NUM_LENGTH];
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- memset(SIM1Num, 0, SIM_NUM_LENGTH);
- memset(SIM2Num, 0, SIM_NUM_LENGTH);
- LoadandSetSIMID();
- ReadValue(NVRAM_SIM_SWITCH_ID, &(g_phnset_cntx.AutoUnReachableStates), DS_BYTE, &Error);
- if (g_phnset_cntx.AutoUnReachableStates < AUTO_UNREACHABLE_OFF || g_phnset_cntx.AutoUnReachableStates > AUTO_UNREACHABLE_ON)
- {
- g_phnset_cntx.AutoUnReachableStates = AUTO_UNREACHABLE_ON;
- WriteValue(NVRAM_SIM_SWITCH_ID, &(g_phnset_cntx.AutoUnReachableStates), DS_BYTE, &Error);
- WriteRecord(NVRAM_EF_SIM_SWITCH_LID, 1, SIM1Num, NVRAM_EF_SIM_SWITCH_SIZE, &Error);
- WriteRecord(NVRAM_EF_SIM_SWITCH_LID, 2, SIM2Num, NVRAM_EF_SIM_SWITCH_SIZE, &Error);
- }
- }
- /**************************************************************
- FUNCTION NAME : mmi_phnset_entry_sim_switch(void)
- PURPOSE : handler Entry SIM Switch Edit Screen.
- INPUT PARAMETERS : nil
- OUTPUT PARAMETERS : nil
- RETURNS : void
- REMARKS : NA
- **************************************************************/
- void mmi_phnset_entry_sim_switch(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U16 nStrItemList[3]; /* Stores the strings id of submenus returned */
- U16 nNumofItem; /* Stores no of children in the submenu */
- U8 *guiBuffer; /* Buffer holding history data */
- U8 index;
- U8 *popUpList[MAX_SUB_MENUS];
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- EntryNewScreen(SCR_ID_PHNSET_SIM_SWITCH, NULL, mmi_phnset_entry_sim_switch, NULL);
- guiBuffer = GetCurrGuiBuffer(SCR_ID_PHNSET_SIM_SWITCH);
- nNumofItem = GetNumOfChild(MENU_SIM_SWCH);
- GetSequenceStringIds(MENU_SIM_SWCH, nStrItemList);
- SetParentHandler(MENU_SIM_SWCH);
- ConstructHintsList(MENU_SIM_SWCH, popUpList);
- RegisterHighlightHandler(ExecuteCurrHiliteHandler);
- ShowCategory52Screen(
- STR_SIM_SWITCH,
- MAIN_MENU_TITLE_SETTINGS_ICON,
- STR_GLOBAL_OK,
- IMG_GLOBAL_OK,
- STR_GLOBAL_BACK,
- IMG_GLOBAL_BACK,
- nNumofItem,
- nStrItemList,
- (U16*) gIndexIconsImageList,
- (U8 **) popUpList,
- LIST_MENU,
- 0,
- guiBuffer);
- SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
- }
- /**************************************************************
- FUNCTION NAME : mmi_phnset_sim_switch_write_to_nvram(void)
- PURPOSE : handler Save Number of SIM1 and SIM2 Card to NVRAM.
- INPUT PARAMETERS : nil
- OUTPUT PARAMETERS : nil
- RETURNS : void
- REMARKS : NA
- **************************************************************/
- void mmi_phnset_sim_switch_save_to_nvram(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S8 i;
- S16 Error;
- S16 SIM1Num[SIM_NUM_LENGTH];
- S16 SIM2Num[SIM_NUM_LENGTH];
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- memset(SIM1Num, 0, SIM_NUM_LENGTH);
- memset(SIM2Num, 0, SIM_NUM_LENGTH);
- UnicodeToAnsii((S8*)SIM1Num, (S8*)unicode_buf1);
- UnicodeToAnsii((S8*)SIM2Num, (S8*)unicode_buf2);
- for (i = 0; i < pfnUnicodeStrlen((const S8*) unicode_buf1); i++)
- {
- if ((unicode_buf1[i * 2] == 'p') || (unicode_buf1[i * 2] == 'w'))
- {
- ClearAllKeyHandler();
- DisplayPopup((PU8) GetString(STR_SIM_SWITCH_ERROR_CHAR), IMG_GLOBAL_ERROR, MMI_TRUE, CS_NOTIFYDURATION, ERROR_TONE);
- return;
- }
- }
- for (i = 0; i < pfnUnicodeStrlen((const S8*) unicode_buf2); i++)
- {
- if ((unicode_buf2[i * 2] == 'p') || (unicode_buf2[i * 2] == 'w'))
- {
- ClearAllKeyHandler();
- DisplayPopup((PU8) GetString(STR_SIM_SWITCH_ERROR_CHAR), IMG_GLOBAL_ERROR, MMI_TRUE, CS_NOTIFYDURATION, ERROR_TONE);
- return;
- }
- }
- WriteRecord(NVRAM_EF_SIM_SWITCH_LID, 1, SIM1Num, NVRAM_EF_SIM_SWITCH_SIZE, &Error);
- WriteRecord(NVRAM_EF_SIM_SWITCH_LID, 2, SIM2Num, NVRAM_EF_SIM_SWITCH_SIZE, &Error);
- GoBackSIMSwitchScreen();
- }
- /**************************************************************
- FUNCTION NAME : mmi_phnset_sim_switch_write_to_nvram(void)
- PURPOSE : handler Judged is or not Save Number of SIM1 and SIM2 Card to NVRAM.
- INPUT PARAMETERS : nil
- OUTPUT PARAMETERS : nil
- RETURNS : void
- REMARKS : NA
- **************************************************************/
- void mmi_phnset_sim_switch_write_to_nvram(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- DisplayConfirm(STR_GLOBAL_YES, IMG_GLOBAL_YES,
- STR_GLOBAL_NO, IMG_GLOBAL_NO,
- (PU16)GetString(STR_GLOBAL_SAVE),IMG_GLOBAL_QUESTION, WARNING_TONE);
- SetLeftSoftkeyFunction(mmi_phnset_sim_switch_save_to_nvram,KEY_EVENT_UP);
- SetRightSoftkeyFunction(GoBackSIMSwitchScreen,KEY_EVENT_UP);
- }
- void mmi_phbset_sim_switch_off_confirm(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S8 *TempBuff1;
- S8 short_string[2];
- S8 TempShortString[2];
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- TempBuff1 = (S8*) OslMalloc(MAX_DISP_UCS2);
- memset(TempBuff1, 0, MAX_DISP_UCS2);
- memset(short_string, 0, 2);
- memset(TempShortString, 0, 2);
- pfnUnicodeStrcpy((PS8) TempBuff1, (PS8) GetString(STR_L4_CFNRC));
- sprintf(short_string, "n");
- AnsiiToUnicodeString((PS8) TempShortString, (PS8) short_string);
- pfnUnicodeStrcat((S8*) TempBuff1, (S8*) TempShortString);
- pfnUnicodeStrcat((S8*) TempBuff1, (S8*) unreachable_num);
- pfnUnicodeStrcat((S8*) TempBuff1, (S8*) TempShortString);
- pfnUnicodeStrcat((S8*) TempBuff1, (S8*) GetString(STR_SIM_SWITCH_SHUT_DOWN));
- DisplayConfirm(STR_GLOBAL_YES, IMG_GLOBAL_YES,
- STR_GLOBAL_NO, IMG_GLOBAL_NO,
- (PU16) TempBuff1,IMG_GLOBAL_QUESTION, WARNING_TONE);
- OslMfree(TempBuff1);
- /* Register function with left/right softkey */
- SetLeftSoftkeyFunction(MakeSIMSwitchConfirmOff,KEY_EVENT_UP);
- SetRightSoftkeyFunction(MakeSIMSwitch,KEY_EVENT_UP);
- }
- void ExitSIMNumEditScreen(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- MMI_current_input_ext_type &= ~INPUT_TYPE_EXT_SIM_NUMERIC; //KP Jerry add for enable "p, w" button when exit from current screen on 2007-4-3
- CloseCategory57Screen();
- }
- void mmi_phnset_sim_num_edit_highlighthandler(S32 index)
- {
- switch(index)
- {
- case 0:
- ChangeTitle(0, (PU8) GetString(STR_SIM_SWITCH_SIM1_NUM));
- break;
- case 1:
- ChangeTitle(0, (PU8) GetString(STR_SIM_SWITCH_SIM2_NUM));
- break;
- default:
- break;
- }
- draw_title();
- }
- /**************************************************************
- FUNCTION NAME : mmi_phnset_entry_sim_num_edit(void)
- PURPOSE : handler Edit for Number of SIM1 and SIM2 Card
- INPUT PARAMETERS : nil
- OUTPUT PARAMETERS : nil
- RETURNS : void
- REMARKS : NA
- **************************************************************/
- extern void StarKeyHandler (void); //KP Jerry add for modify '*' multitap candidate to '+' only on 2007-4-3
- void HashKeyHandler(void)
- {
- }
- void mmi_phnset_entry_sim_num_edit(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U8 *guiBuffer; /* Buffer holding history data */
- U16 ImageList[2];
- S16 Error;
- S16 SIM1Num[SIM_NUM_LENGTH];
- S16 SIM2Num[SIM_NUM_LENGTH];
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- EntryNewScreen(SCR_ID_PHNSET_SIM_NUM_EDIT, ExitSIMNumEditScreen, mmi_phnset_entry_sim_num_edit, NULL);
- InitializeCategory57Screen();
- #ifdef MMI_ON_HARDWARE_P
- #ifdef __MMI_UI_INLINE_EDIT_DEFAULT_TEXT_EFFECT__
- EnableInlineItemDefaultText();
- #endif
- #endif
- RegisterHighlightHandler(mmi_phnset_sim_num_edit_highlighthandler);
- guiBuffer = GetCurrGuiBuffer(SCR_ID_PHNSET_SIM_NUM_EDIT);
- memset(unicode_buf1, 0, SIM_NUM_LENGTH*ENCODING_LENGTH);
- memset(unicode_buf2, 0, SIM_NUM_LENGTH*ENCODING_LENGTH);
- memset(SIM1Num, 0, SIM_NUM_LENGTH);
- memset(SIM2Num, 0, SIM_NUM_LENGTH);
- ReadRecord(NVRAM_EF_SIM_SWITCH_LID, 1, SIM1Num, NVRAM_EF_SIM_SWITCH_SIZE, &Error);
- ReadRecord(NVRAM_EF_SIM_SWITCH_LID, 2, SIM2Num, NVRAM_EF_SIM_SWITCH_SIZE, &Error);
- AnsiiToUnicodeString((S8*)unicode_buf1, (S8*)SIM1Num);
- AnsiiToUnicodeString((S8*)unicode_buf2, (S8*)SIM2Num);
- MMI_current_input_ext_type |= INPUT_TYPE_EXT_SIM_NUMERIC; //KP Jerry add for disable "p, w" button on 2007-4-3
- SetInlineItemActivation(&wgui_inline_items[0], INLINE_ITEM_ACTIVATE_WITHOUT_KEY_EVENT, 0);
- SetInlineItemTextEdit(&wgui_inline_items[0], (PU8)unicode_buf1, SIM_NUM_LENGTH, INPUT_TYPE_PHONE_NUMBER);
- ImageList[0] = IMG_GLOBAL_L1;
- SetInlineItemActivation(&wgui_inline_items[1], INLINE_ITEM_ACTIVATE_WITHOUT_KEY_EVENT, 0);
- SetInlineItemTextEdit(&wgui_inline_items[1], (PU8)unicode_buf2, SIM_NUM_LENGTH, INPUT_TYPE_PHONE_NUMBER);
- ImageList[1] = IMG_GLOBAL_L2;
- /*
- #ifdef MMI_ON_HARDWARE_P
- #ifdef __MMI_UI_INLINE_EDIT_DEFAULT_TEXT_EFFECT__
- SetInlineItemTextEditDefaultItemNameIfEmpty(&wgui_inline_items[0], (U16)STR_SSW_SIM1);
- SetInlineItemTextEditDefaultItemNameIfEmpty(&wgui_inline_items[1], (U16)STR_SSW_SIM2);
- #endif
- #endif
- */
- DisableCategory57ScreenDone();
- ShowCategory57Screen(STR_SIM_SWITCH, 0,
- STR_GLOBAL_OK,
- IMG_GLOBAL_OK,
- STR_GLOBAL_BACK,
- IMG_GLOBAL_BACK,
- 2, ImageList, wgui_inline_items, 0, guiBuffer);
- SetCategory57RightSoftkeyFunctions( mmi_phnset_sim_switch_write_to_nvram, GoBackHistory );
- }
- void HintSwitching(U16 index)
- {
- S16 error;
- memset((S8 *)hintData[(index)],0,MAX_SUB_MENU_SIZE);
- if(g_phnset_cntx.SIMID<0 || g_phnset_cntx.SIMID>1)
- {
- ReadValue( NVRAM_SIM_ID, &(g_phnset_cntx.SIMID), DS_BYTE , &error);
- }
- if(g_phnset_cntx.SIMID == SIM1)
- {
- pfnUnicodeStrcpy((S8*)g_phnset_cntx.SIMInfo, ( S8*)GetString(STR_SSW_SIM1));
- }
- else if(g_phnset_cntx.SIMID == SIM2)
- {
- pfnUnicodeStrcpy((S8*)g_phnset_cntx.SIMInfo, ( S8*)GetString(STR_SSW_SIM2));
- }
- pfnUnicodeStrcpy((S8*)hintData[index],(PS8)g_phnset_cntx.SIMInfo);
- }
- void HintSIMSwitch(U16 index)
- {
- S16 error;
- memset((S8 *)hintData[(index)],0,MAX_SUB_MENU_SIZE);
- if(g_phnset_cntx.SIMID<0 || g_phnset_cntx.SIMID>1)
- {
- ReadValue( NVRAM_SIM_ID, &(g_phnset_cntx.SIMID), DS_BYTE , &error);
- }
- if(g_phnset_cntx.SIMID == SIM1)
- {
- pfnUnicodeStrcpy((S8*)g_phnset_cntx.SIMInfo, ( S8*)GetString(STR_SSW_SIM1));
- }
- else if(g_phnset_cntx.SIMID == SIM2)
- {
- pfnUnicodeStrcpy((S8*)g_phnset_cntx.SIMInfo, ( S8*)GetString(STR_SSW_SIM2));
- }
- pfnUnicodeStrcpy((S8*)hintData[index],(PS8)g_phnset_cntx.SIMInfo);
- }
- void HintUnReachable(U16 index)
- {
- S16 error;
- memset((S8 *)hintData[(index)],0,MAX_SUB_MENU_SIZE);
- if (g_phnset_cntx.AutoUnReachableStates > AUTO_UNREACHABLE_ON || g_phnset_cntx.AutoUnReachableStates < AUTO_UNREACHABLE_OFF)
- {
- ReadValue(NVRAM_SIM_SWITCH_ID, &(g_phnset_cntx.AutoUnReachableStates), DS_BYTE, &error);
- }
- if(g_phnset_cntx.AutoUnReachableStates == AUTO_UNREACHABLE_OFF)
- {
- pfnUnicodeStrcpy((S8*)hintData[index],(PS8)GetString(STR_GLOBAL_OFF));
- }
- else if(g_phnset_cntx.AutoUnReachableStates == AUTO_UNREACHABLE_ON)
- {
- pfnUnicodeStrcpy((S8*)hintData[index],(PS8)GetString(STR_GLOBAL_ON));
- }
- }
- /**************************************************************
- FUNCTION NAME : HighlightSIMNumEdit(void)
- PURPOSE : hilite handler Edit for Number of SIM1 and SIM2 Card
- INPUT PARAMETERS : nil
- OUTPUT PARAMETERS : nil
- RETURNS : void
- REMARKS : NA
- **************************************************************/
- void HighlightSIMNumEdit(void)
- {
- ChangeLeftSoftkey(STR_GLOBAL_EDIT, 0);
- SetLeftSoftkeyFunction(mmi_phnset_entry_sim_num_edit,KEY_EVENT_UP);
- SetKeyHandler(mmi_phnset_entry_sim_num_edit, KEY_RIGHT_ARROW,KEY_EVENT_DOWN);
- SetRightSoftkeyFunction(GoBackHistory,KEY_EVENT_UP);
- /* set the left/right arrow key function handlers */
- SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
- return;
- }
- /**************************************************************
- FUNCTION NAME : HighlightAutoUnReachableForward(void)
- PURPOSE : hilite handler for Auto UnReachable Forward On/Off
- INPUT PARAMETERS : nil
- OUTPUT PARAMETERS : nil
- RETURNS : void
- REMARKS : NA
- **************************************************************/
- void HighlightAutoUnReachableForward(void)
- {
- if(g_phnset_cntx.AutoUnReachableStates == AUTO_UNREACHABLE_OFF)
- {
- ChangeLeftSoftkey(STR_GLOBAL_ON, 0);
- }
- else if(g_phnset_cntx.AutoUnReachableStates == AUTO_UNREACHABLE_ON)
- {
- ChangeLeftSoftkey(STR_GLOBAL_OFF, 0);
- }
- SetLeftSoftkeyFunction(MakeAutoUnReachableSel, KEY_EVENT_UP);
- SetKeyHandler(0, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
- }
- /**************************************************************
- FUNCTION NAME : HighlightSIMCardSwitch(void)
- PURPOSE : hilite handler for SIM Switch
- INPUT PARAMETERS : nil
- OUTPUT PARAMETERS : nil
- RETURNS : void
- REMARKS : NA
- **************************************************************/
- void HighlightSIMCardSwitch(void)
- {
- ChangeLeftSoftkey(STR_GLOBAL_OK, 0);
- SetLeftSoftkeyFunction(MakeSIMSwitchSel, KEY_EVENT_UP);
- SetKeyHandler(0, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
- }
- #ifdef __DUAL_SIM_QUICK_SWITCH__
- /**************************************************************
- FUNCTION NAME : HighlightSIMCardQuickSwitch(void)
- PURPOSE : hilite handler for SIM Switch
- INPUT PARAMETERS : nil
- OUTPUT PARAMETERS : nil
- RETURNS : void
- REMARKS : NA
- **************************************************************/
- void HighlightSIMCardQuickSwitch(void)
- {
- ChangeLeftSoftkey(STR_GLOBAL_OK, 0);
- SetLeftSoftkeyFunction(SIMSwitchAndResetRequest, KEY_EVENT_UP);
- SetKeyHandler(0, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
- }
- #endif
- /**************************************************************
- FUNCTION NAME : HighlightSIMSwitch(void)
- PURPOSE : hilite handler for SIM Switch Main Menu
- INPUT PARAMETERS : nil
- OUTPUT PARAMETERS : nil
- RETURNS : void
- REMARKS : NA
- **************************************************************/
- void HighlightSIMSwitch(void)
- {
- SetLeftSoftkeyFunction(mmi_phnset_entry_sim_switch,KEY_EVENT_UP);
- SetKeyHandler(mmi_phnset_entry_sim_switch, KEY_RIGHT_ARROW,KEY_EVENT_DOWN);
- SetRightSoftkeyFunction(GoBackHistory,KEY_EVENT_UP);
- /* set the left/right arrow key function handlers */
- SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
- return;
- }
- #endif
- //KP Jerry add on 2007-3-23 end
- #ifdef __MMI_PHNSET_TWO_LINE_MENUITEM_DISPLAY__
- /*****************************************************************************
- * FUNCTION
- * mmi_phnset_2line_is_exist
- * DESCRIPTION
- * To check the the existence of two line display
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- S32 mmi_phnset_2line_is_exist(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- return is_inline_menu_exist;
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_phnset_2line_lang_get_data
- * DESCRIPTION
- * This function is to get the language data for the two line item
- * PARAMETERS
- * inline_item_index [IN] Index of the inline item to be shown
- * str_buff [IN] Language to be shown
- * img_buff_p [?] Image to be shown with the inline item
- * RETURNS
- * void
- *****************************************************************************/
- static void mmi_phnset_2line_lang_get_data(S32 inline_item_index, UI_string_type str_buff, PU8 *img_buff_p)
- {
- #ifdef __MMI_AUTO_LANG_EN__
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (index == 0)
- {
- pfnUnicodeStrcpy((PS8) str_buff, (PS8) GetString(STR_LANGUAGESCR_AUTO));
- }
- else
- {
- pfnUnicodeStrcpy((PS8) str_buff, (PS8) g_phnset_cntx_p->ppLang[inline_item_index - 1]);
- }
- #else /* __MMI_AUTO_LANG_EN__ */
- pfnUnicodeStrcpy((PS8) str_buff, (PS8) g_phnset_cntx_p->ppLang[inline_item_index]);
- #endif /* __MMI_AUTO_LANG_EN__ */
- if (inline_item_index < IMG_GLOBAL_LEND - IMG_GLOBAL_LSTART - 1)
- {
- *img_buff_p = get_image((U16) (IMG_GLOBAL_LSTART + inline_item_index + 1));
- }
- else
- {
- *img_buff_p = NULL;
- }
- g_phnset_cntx_p->curHightlightItem = inline_item_index;
- languages_default_item = inline_item_index;
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_phnset_2line_encod_get_data
- * DESCRIPTION
- * This function is to get the encoding type for the two line item
- * PARAMETERS
- * inline_item_index [IN] Index of the inline item to be shown
- * str_buff [IN] Encoding type string to be shown
- * img_buff_p [?] Image to be shown with the inline item
- * RETURNS
- * void
- *****************************************************************************/
- #ifdef __MMI_SET_DEF_ENCODING_TYPE__
- static void mmi_phnset_2line_encod_get_data(S32 inline_item_index, UI_string_type str_buff, PU8 *img_buff_p)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (inline_item_index == encoding_type_big2)
- {
- pfnUnicodeStrcpy((PS8) str_buff, (PS8) GetString(STR_DEF_ENCODING_TYPE_BIG5));
- }
- else if (inline_item_index == encoding_type_gb2312)
- {
- pfnUnicodeStrcpy((PS8) str_buff, (PS8) GetString(STR_DEF_ENCODING_TYPE_GB2312));
- }
- else if (inline_item_index == encoding_type_ucs2)
- {
- pfnUnicodeStrcpy((PS8) str_buff, (PS8) GetString(STR_DEF_ENCODING_TYPE_UCS2));
- }
- if (inline_item_index < IMG_GLOBAL_LEND - IMG_GLOBAL_LSTART - 1)
- {
- *img_buff_p = get_image((U16) (IMG_GLOBAL_LSTART + inline_item_index + 1));
- }
- else
- {
- *img_buff_p = NULL;
- }
- g_phnset_cntx_p->curHightlightItem = inline_item_index;
- default_encoding_type = inline_item_index;
- }
- #endif /* __MMI_SET_DEF_ENCODING_TYPE__ */
- /*****************************************************************************
- * FUNCTION
- * mmi_phnset_2line_read_setting
- * DESCRIPTION
- * This function is to set the current values of the inline items
- * PARAMETERS
- * void
- * Input: None(?)
- * RETURNS
- * void
- *****************************************************************************/
- static void mmi_phnset_2line_read_setting()
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- languages_default_item = gCurrLangIndex;
- #ifdef __MMI_SET_DEF_ENCODING_TYPE__
- default_encoding_type = g_phnset_cntx_p->EncodingType;
- #endif
- mmi_phnset_2line_prfr_input_set_default();
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_phnset_2line_lang_complete_callback
- * DESCRIPTION
- * This function is called when language menu item is unhighlighted
- * PARAMETERS
- * menuitem_index [IN] Menuitem index
- * selected_index [IN] Inline item index
- * RETURNS
- * void
- *****************************************************************************/
- static void mmi_phnset_2line_lang_complete_callback(S32 menuitem_index, S32 selected_index)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- g_phnset_cntx_p->curHightlightItem = gCurrLangIndex;
- languages_default_item = gCurrLangIndex;
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_phnset_2line_encod_complete_callback
- * DESCRIPTION
- * This function is called when encoding type menu item is unhighlighted
- * PARAMETERS
- * menuitem_index [IN] Menuitem index
- * selected_index [IN] Inline item index
- * RETURNS
- * void
- *****************************************************************************/
- #ifdef __MMI_SET_DEF_ENCODING_TYPE__
- static void mmi_phnset_2line_encod_complete_callback(S32 menuitem_index, S32 selected_index)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- default_encoding_type = g_phnset_cntx_p->EncodingType;
- }
- #endif /* __MMI_SET_DEF_ENCODING_TYPE__ */
- /*****************************************************************************
- * FUNCTION
- * mmi_phnset_2line_get_current
- * DESCRIPTION
- * This function returns the default value to be shown with the two line menu item for phone setup
- * PARAMETERS
- * item_index [IN] Menuitem index
- * RETURNS
- * S32
- *****************************************************************************/
- static S32 mmi_phnset_2line_get_current(S32 item_index)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S32 current_value = 0;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (item_index == phone_setup_language)
- {
- current_value = (S32) gCurrLangIndex;
- }
- else if (item_index == phone_setup_preferred_input_method)
- {
- current_value = mmi_phnset_get_current_preferr_input();
- }
- #ifdef __MMI_SET_DEF_ENCODING_TYPE__
- else if (item_index == phone_setup_encoding_type)
- {
- current_value = (S32) g_phnset_cntx_p->EncodingType;
- }
- #endif /* __MMI_SET_DEF_ENCODING_TYPE__ */
- else
- {
- return 0;
- }
- return current_value;
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_phnset_2line_select_data
- * DESCRIPTION
- * This function used to get the two line menu item data for phone setup
- * PARAMETERS
- * item_index [IN] Menuitem index
- * inline_item_index [IN] Inline item index
- * str_buff [IN] Inline Item String to be shown
- * img_buff_p [?] Image to be shown with the inline item
- * thumbnail [?] Thumbnail picture to be shown with the inline item
- * RETURNS
- * pBOOL
- *****************************************************************************/
- static pBOOL mmi_phnset_2line_select_data(
- S32 item_index,
- S32 inline_item_index,
- UI_string_type str_buff,
- PU8 *img_buff_p,
- wgui_thumbnail_image_union *thumbnail)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (item_index == phone_setup_language)
- {
- mmi_phnset_2line_lang_get_data(inline_item_index, str_buff, img_buff_p);
- }
- else if (item_index == phone_setup_preferred_input_method)
- {
- mmi_phnset_2line_prfr_input_get_data(inline_item_index, str_buff, img_buff_p);
- }
- #ifdef __MMI_SET_DEF_ENCODING_TYPE__
- else if (item_index == phone_setup_encoding_type)
- {
- mmi_phnset_2line_encod_get_data(inline_item_index, str_buff, img_buff_p);
- }
- #endif /* __MMI_SET_DEF_ENCODING_TYPE__ */
- else
- {
- return FALSE;
- }
- return TRUE;
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_phnset_2line_get_display_style
- * DESCRIPTION
- * This function used to get the two line menu item display style
- * whether TWO_LINE_MENUITEM_STYLE_DISPLAY_HORIZONTAL_SELECT or TWO_LINE_MENUITEM_STYLE_DISPLAY_LEVEL_SELECT
- * PARAMETERS
- * index [IN] Menuitem index
- * RETURNS
- * U8
- *****************************************************************************/
- U8 mmi_phnset_2line_get_display_style(S32 index)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (index == phone_setup_language || index == phone_setup_preferred_input_method
- #ifdef __MMI_SET_DEF_ENCODING_TYPE__
- || index == phone_setup_encoding_type
- #endif
- )
- return TWO_LINE_MENUITEM_STYLE_DISPLAY_HORIZONTAL_SELECT;
- else
- {
- return 0; /* TWO_LINE_MENUITEM_STYLE_DISPLAY_LEVEL_SELECT? */
- }
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_phnset_2line_get_menuitem_properties
- * DESCRIPTION
- * This function is used to get the properties of the selected menu item
- * PARAMETERS
- * index [IN] Menu item index
- * current_menuitem_properties [?] Structure to be filled for menuitem properties
- * RETURNS
- * U8(?)
- *****************************************************************************/
- static void mmi_phnset_2line_get_menuitem_properties(
- int index,
- wgui_two_line_menuitem_struct *current_menuitem_properties)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (index == phone_setup_language)
- {
- current_menuitem_properties->num_of_items = (S32) GetLanguages(&(g_phnset_cntx_p->ppLang));
- current_menuitem_properties->image_flags = UI_TWO_LINE_MENUITEM_NO_THUMBNAIL;
- current_menuitem_properties->defualt_value_callback = mmi_phnset_2line_get_current;
- current_menuitem_properties->complete_callback = mmi_phnset_2line_lang_complete_callback;
- current_menuitem_properties->two_line_data_callback.get_data_for_horizontal_select =
- mmi_phnset_2line_select_data;
- }
- else if (index == phone_setup_preferred_input_method)
- {
- current_menuitem_properties->num_of_items = mmi_phnset_2line_prfr_input_get_total_items(index);
- current_menuitem_properties->image_flags = UI_TWO_LINE_MENUITEM_NO_THUMBNAIL;
- current_menuitem_properties->defualt_value_callback = mmi_phnset_2line_prfr_input_get_default;
- current_menuitem_properties->complete_callback = mmi_phnset_2line_prfr_input_complete_callback;
- current_menuitem_properties->two_line_data_callback.get_data_for_horizontal_select =
- mmi_phnset_2line_select_data;
- }
- #ifdef __MMI_SET_DEF_ENCODING_TYPE__
- else if (index == phone_setup_encoding_type)
- {
- current_menuitem_properties->num_of_items = (S32) GetNumOfChild(MENU_SETTING_DEF_ENCODING_TYPE);
- current_menuitem_properties->image_flags = UI_TWO_LINE_MENUITEM_NO_THUMBNAIL;
- current_menuitem_properties->defualt_value_callback = mmi_phnset_2line_get_current;
- current_menuitem_properties->complete_callback = mmi_phnset_2line_encod_complete_callback;
- current_menuitem_properties->two_line_data_callback.get_data_for_horizontal_select =
- mmi_phnset_2line_select_data;
- }
- #endif /* __MMI_SET_DEF_ENCODING_TYPE__ */
- }
- #endif /* __MMI_PHNSET_TWO_LINE_MENUITEM_DISPLAY__ */
- /*****************************************************************************
- * FUNCTION
- * EntryPhnsetScr
- * DESCRIPTION
- * This function is Entry function for Phonesetup
- * Following functions: HintPhnsetTimeAndDate
- * HighlighPhnsettSPOF
- * HighlightPhnsetLang
- * HintPhnsetPreferedInputMethod
- * HighlightPhnsetContrastLevel
- * HighlightPhnsetWelcomeText
- * HighlightPhbSpeedDial
- * HighlightPhnsetNITZ
- * PARAMETERS
- * void
- * a(?) [IN/OUT]
- * b(?) [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void EntryPhnsetScr(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 *ItemType[MAX_SUB_MENUS];
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- /* U32 maskingByte=-1;