PhnsetDisplay.c
上传用户:dengyu
上传日期:2022-05-01
资源大小:153k
文件大小:111k
源码类别:

MTK

开发平台:

C/C++

  1. /*****************************************************************************
  2. *  Copyright Statement:
  3. *  --------------------
  4. *  This software is protected by Copyright and the information contained
  5. *  herein is confidential. The software may not be copied and the information
  6. *  contained herein may not be used or disclosed except with the written
  7. *  permission of MediaTek Inc. (C) 2005
  8. *
  9. *  BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
  10. *  THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
  11. *  RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
  12. *  AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
  13. *  EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
  14. *  MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
  15. *  NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
  16. *  SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
  17. *  SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
  18. *  THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
  19. *  NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
  20. *  SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
  21. *
  22. *  BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
  23. *  LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
  24. *  AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
  25. *  OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
  26. *  MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE. 
  27. *
  28. *  THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
  29. *  WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
  30. *  LAWS PRINCIPLES.  ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
  31. *  RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
  32. *  THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
  33. *
  34. *****************************************************************************/
  35. /*****************************************************************************
  36.  *
  37.  * Filename:
  38.  * ---------
  39.  *  PhnsetMenuService.c
  40.  *
  41.  * Project:
  42.  * --------
  43.  *  MAUI
  44.  *
  45.  * Description:
  46.  * ------------
  47.  *  This file is intends for phone setup menu service interface
  48.  *
  49.  * Author:
  50.  * -------
  51.  * -------
  52.  *
  53.  *============================================================================
  54.  *             HISTORY
  55.  * Below this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
  56.  *------------------------------------------------------------------------------
  57.  * removed!
  58.  *
  59.  * removed!
  60.  * removed!
  61.  * removed!
  62.  *
  63.  * removed!
  64.  * removed!
  65.  * removed!
  66.  *
  67.  * removed!
  68.  * removed!
  69.  * removed!
  70.  *
  71.   *------------------------------------------------------------------------------
  72.  * Upper this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
  73.  *============================================================================
  74.  ****************************************************************************/
  75. /***************************************************************************** 
  76. * Include
  77. *****************************************************************************/
  78. /*  Include: MMI header file */
  79. #include "MMI_include.h"
  80. #include "SettingMenuService.h"
  81. #include "settingGprots.h"
  82. #include "SettingDefs.h"
  83. #include "PhnsetProt.h"
  84. #include "CommonScreens.h"
  85. #include "MainMenuDef.h"
  86. #include "PhoneSetup.h"
  87. #include "PhoneSetupGprots.h"
  88. #include "IdleHomescreenGprot.h"
  89. /***************************************************************************** 
  90. * Define
  91. *****************************************************************************/
  92. #ifdef __MMI_MOTION_DIAL__
  93. #ifndef PHNSET_MOTION_DIAL_NUM
  94. #define PHNSET_MOTION_DIAL_NUM 2
  95. #endif /* PHNSET_MOTION_DIAL_NUM */
  96. #endif /* __MMI_MOTION_DIAL__ */
  97. #ifdef __MMI_MOTION_MAINMENU__
  98. #ifndef PHNSET_MOTION_MAINMENU_NUM
  99. #define PHNSET_MOTION_MAINMENU_NUM 2
  100. #endif /* PHNSET_MOTION_DIAL_NUM */
  101. #endif /* __MMI_MOTION_MAINMENU__ */
  102. /***************************************************************************** 
  103. * Typedef
  104. *****************************************************************************/
  105. /***************************************************************************** 
  106. * Local Variable
  107. *****************************************************************************/
  108. /***************************************************************************** 
  109. * Global Variable
  110. *****************************************************************************/
  111. extern PHNSET_CNTX *g_phnset_cntx_p;
  112. extern PU8 subMenuDataPtrs[MAX_SUB_MENUS];
  113. /***************************************************************************** 
  114. * External Variable
  115. *****************************************************************************/
  116. /***************************************************************************** 
  117. * Global Function
  118. *****************************************************************************/
  119. /***************************************************************************** 
  120. * External Function
  121. *****************************************************************************/
  122. /*****************************************************************************
  123. * Local Function 
  124. *****************************************************************************/
  125. /* Phone Setup Display */
  126. static void EntryPhnsetIdleScrDisp(void);
  127. static void ExitPhnsetIdleScrDisp(void);
  128. /* Display -> Main Menu Style */
  129. #ifdef __MMI_MAINMENU_STYLE_CHANGE_EN__
  130. static U8 PhnsetMainMenuStyleList(U8** pMainMenuStyleList, U16 total_style);
  131. static void EntryPhnsetMainMenuStyle(void);
  132. static void PhnsetMainMenuStyleSelectLskHdlr(void);
  133. #endif /* __MMI_MAINMENU_STYLE_CHANGE_EN__ */
  134. /* Display -> Dial Style */
  135. #ifdef __MMI_MOTION_DIAL__
  136. static U8 PhnsetDialStyleList(U8** pMainMenuStyleList, U16 total_style);
  137. static void EntryPhnsetDialStyle(void);
  138. static void PhnsetDialStyleSelectLskHdlr(void);
  139. #endif /* __MMI_MOTION_DIAL__ */
  140. /* Display -> VUI HomeScreen */
  141. #ifdef __MMI_VUI_HOMESCREEN__
  142. static void mmi_phnset_set_vui_homescreen_status(void);
  143. static void mmi_entry_phnset_vui_homescreen(void);
  144. #endif /* __MMI_VUI_HOMESCREEN__ */
  145. /* Display -> VUI Main Menu Effect */
  146. #ifdef __MMI_VUI_MAINMENU__
  147. static void mmi_entry_phnset_vui_mainmenu_effect(void);
  148. #endif /* __MMI_VUI_MAINMENU__ */
  149. /* Display -> Calendar In Idle */
  150. #ifdef __MMI_CALENDAR_ON_IDLE_SCREEN__
  151. static void PhnsetToggleShowCalendarIdleScreen(void);
  152. #endif /* __MMI_CALENDAR_ON_IDLE_SCREEN__ */
  153. /* Display -> Dual Clock In Idle */
  154. #ifdef __MMI_DUAL_CLOCK__
  155. static void PhnsetToggleDualClockState(void);
  156. #endif
  157. /* Display -> Operator HomeScreen */
  158. #ifdef __MMI_OP11_HOMESCREEN__
  159. /* under construction !*/
  160. /* under construction !*/
  161. #endif /* __MMI_OP11_HOMESCREEN__ */
  162. /* Display -> Operator ToolBar */
  163. /* Display -> Show Date And Time In Idle */
  164. static void PhnsetToggleShowDtTime(void);
  165. /* Display -> Show Owner Number In Idle */
  166. static void PhnsetToggleShowOwnNo(void);
  167. /* Display -> Show Operator Name In Idle */
  168. #ifdef __MMI_OPERATOR_NAME_MENU__
  169. static void PhnsetToggleShowOPN(void);
  170. #endif
  171. /* Display -> Clock Type In Idle */
  172. #ifdef __MMI_UI_TECHNO_IDLESCREEN_BAR__
  173. static void EntryPhnsetIdleClockType(void);
  174. static void ExitPhnsetIdleClockType(void);
  175. #endif
  176. /* Display -> Screen Switch Effect */
  177. #ifdef __MMI_SCREEN_SWITCH_EFFECT__
  178. static void EntryPhnsetScreenSwitchEffectScreen(void);
  179. #endif
  180. /*****************************************************************************
  181.  * FUNCTION
  182.  *  HighlightPhnsetIdleScrDisp
  183.  * DESCRIPTION
  184.  *  This function is highlight handler for Phone setup-> Display
  185.  * PARAMETERS
  186.  *  void         
  187.  * RETURNS
  188.  *  void
  189.  *****************************************************************************/
  190. void HighlightPhnsetIdleScrDisp(void)
  191. {
  192.     /*----------------------------------------------------------------*/
  193.     /* Local Variables                                                */
  194.     /*----------------------------------------------------------------*/
  195.     /*----------------------------------------------------------------*/
  196.     /* Code Body                                                      */
  197.     /*----------------------------------------------------------------*/
  198.     /* Change right soft key icon and label */
  199.     ChangeRightSoftkey(STR_GLOBAL_BACK, IMG_GLOBAL_BACK);
  200.     ChangeLeftSoftkey(STR_GLOBAL_OK, IMG_GLOBAL_OK);
  201.     /* Register function for left soft key */
  202.     SetLeftSoftkeyFunction(EntryPhnsetIdleScrDisp, KEY_EVENT_UP);
  203.     SetKeyHandler(EntryPhnsetIdleScrDisp, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
  204.     /* Register function for right soft key */
  205.     SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
  206.     SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
  207. }
  208. /*****************************************************************************
  209.  * FUNCTION
  210.  *  EntryPhnsetIdleScrDisp
  211.  * DESCRIPTION
  212.  *  This function is Exit function for Phone setup -> Display
  213.  * PARAMETERS
  214.  *  void           
  215.  * RETURNS
  216.  *  void
  217.  *****************************************************************************/
  218. static void EntryPhnsetIdleScrDisp(void)
  219. {
  220.     /*----------------------------------------------------------------*/
  221.     /* Local Variables                                                */
  222.     /*----------------------------------------------------------------*/
  223. U8 i = 0;
  224.     U16 nStrItemList[MAX_SUB_MENUS];    /* Stores the strings id of submenus returned */
  225.     U16 nNumofItem;                     /* Stores no of children in the submenu */
  226.     U16 nDispAttribute;                 /* Stores display attribute */
  227.     U8 *guiBuffer;                      /* Buffer holding history data */
  228.     U8 *IdleScrDispType[MAX_SUB_MENUS];
  229. #ifdef __MMI_OP11_HOMESCREEN__
  230. /* under construction !*/
  231. #endif
  232.     /*----------------------------------------------------------------*/
  233.     /* Code Body                                                      */
  234.     /*----------------------------------------------------------------*/
  235.     /* Call Exit Handler */
  236.     EntryNewScreen(SCR_IDLE_SCR_DISP, ExitPhnsetIdleScrDisp, EntryPhnsetIdleScrDisp, NULL);
  237.     /* Get current screen to guibuffer  for history purposes */
  238.     guiBuffer = GetCurrGuiBuffer(SCR_IDLE_SCR_DISP);
  239. for (i = 0; mmi_phnset_disp_hide_menu[i].menu_id != 0; i++)
  240. {
  241. if (mmi_phnset_disp_hide_menu[i].is_hide_func())
  242. {
  243. mmi_frm_hide_menu_item(mmi_phnset_disp_hide_menu[i].menu_id);
  244. }
  245. else
  246. {
  247. mmi_frm_unhide_menu_item(mmi_phnset_disp_hide_menu[i].menu_id);
  248. }
  249. }
  250.     #ifdef __R301__
  251.     mmi_frm_hide_menu_item(MENU_SETTING_IDLE_CLOCK_TYPE);
  252.     #endif
  253.     /* Retrieve no of child of menu item to be displayed */
  254.     nNumofItem = GetNumOfChild_Ext(MENU_IDLE_SCR_DISP);
  255.     /* Get attribute of menu to be displayed */
  256.     nDispAttribute = GetDispAttributeOfItem(MENU_IDLE_SCR_DISP);
  257.     /* Retrieve string ids in sequence of given menu item to be displayed */
  258.     GetSequenceStringIds_Ext(MENU_IDLE_SCR_DISP, nStrItemList);
  259.     /* Set current parent id */
  260.     SetParentHandler(MENU_IDLE_SCR_DISP);
  261.     /* Register highlight handler to be called in menu screen */
  262.     RegisterHighlightHandler(ExecuteCurrHiliteHandler);
  263.     /* Constrct Hint for Idle Screen Display */
  264.     ConstructHintsList(MENU_IDLE_SCR_DISP, IdleScrDispType);
  265.     /* Display Category Screen */
  266.     ShowCategory52Screen(
  267.         STR_IDLE_SCR_DISP,
  268.         MAIN_MENU_TITLE_SETTINGS_ICON,
  269.         STR_GLOBAL_OK,
  270.         IMG_GLOBAL_OK,
  271.         STR_GLOBAL_BACK,
  272.         IMG_GLOBAL_BACK,
  273.         nNumofItem,
  274.         nStrItemList,
  275.         (PU16) gIndexIconsImageList,
  276.         IdleScrDispType,
  277.         0,
  278.         0,
  279.         guiBuffer);
  280.     DeleteScreenIfPresent(SCR_IDLE_SCR_DISP);
  281. #ifdef __MMI_OP11_HOMESCREEN__
  282. /* under construction !*/
  283. /* under construction !*/
  284. /* under construction !*/
  285. /* under construction !*/
  286. /* under construction !*/
  287. /* under construction !*/
  288. /* under construction !*/
  289. /* under construction !*/
  290. /* under construction !*/
  291. /* under construction !*/
  292. #endif /* __MMI_OP11_HOMESCREEN__ */
  293.     /* Register function with soft key */
  294.     SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
  295.     SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
  296. }
  297. /*****************************************************************************
  298.  * FUNCTION
  299.  *  ExitPhnsetIdleScrDisp
  300.  * DESCRIPTION
  301.  *  This function is Exit function for Phone setup->Display
  302.  * PARAMETERS
  303.  *  void     
  304.  * RETURNS
  305.  *  void
  306.  *****************************************************************************/
  307. static void ExitPhnsetIdleScrDisp(void)
  308. {
  309.     /*----------------------------------------------------------------*/
  310.     /* Local Variables                                                */
  311.     /*----------------------------------------------------------------*/
  312.     S16 error;
  313.     /*----------------------------------------------------------------*/
  314.     /* Code Body                                                      */
  315.     /*----------------------------------------------------------------*/
  316.     /* Save NVRAM only when value is changed for date time and 
  317.        own type on idle screen */
  318.     if (g_phnset_cntx_p->ShowDtDirtyFlag == TRUE)
  319.     {
  320.         WriteValue(NVRAM_SETTING_STATUS_DT_TIME, &(g_phnset_cntx_p->curShowDtStatus), DS_BYTE, &error);
  321.         g_phnset_cntx_p->ShowDtDirtyFlag = FALSE;
  322.     }
  323.     if (g_phnset_cntx_p->ShowOwnNumDirtyFlag == TRUE)
  324.     {
  325.         WriteValue(NVRAM_SETTING_OWNER_NO, &(g_phnset_cntx_p->curShowOwnNumStatus), DS_BYTE, &error);
  326.         g_phnset_cntx_p->ShowOwnNumDirtyFlag = FALSE;
  327.     }
  328.     /* Lisen 0921-1 */
  329. #if defined(__MMI_OPERATOR_NAME_MENU__)
  330.     if (g_phnset_cntx_p->ShowOPNDirtyFlag == TRUE)
  331.     {
  332.         WriteValue(NVRAM_SETTING_OPN_DISPLAY, &(g_phnset_cntx_p->curShowOPNStatus), DS_BYTE, &error);
  333.         g_phnset_cntx_p->ShowOPNDirtyFlag = FALSE;
  334.     }
  335. #endif /* defined(__MMI_OPERATOR_NAME_MENU__) */ 
  336. #ifdef __MMI_DUAL_CLOCK__
  337.     /* Flag to write NVRAM in Exit Handler */
  338.     if (g_phnset_cntx_p->ShowDualClockDirtyFlag == TRUE)
  339.     {
  340.         WriteValue(NVRAM_SET_DUALCLOCK_IDLESCREEN, &(g_phnset_cntx_p->curDualClockStatus), DS_BYTE, &error);
  341.         g_phnset_cntx_p->ShowDualClockDirtyFlag = FALSE;
  342.     }
  343. #endif /* __MMI_DUAL_CLOCK__ */
  344. #ifdef __MMI_CALENDAR_ON_IDLE_SCREEN__
  345.     if (g_phnset_cntx_p->ShowCalendarIdleSrcDirtyFlag == TRUE)
  346.     {
  347.         if (GetActiveScreenId() != SCR_IDLE_SCR_DISP)
  348.         {
  349.             WriteValue(NVRAM_SET_CALENDAR_IDLESCREEN, &(g_phnset_cntx_p->curCalendarIdleScrStatus), DS_BYTE, &error);
  350.             g_phnset_cntx_p->ShowCalendarIdleSrcDirtyFlag = FALSE;
  351.         }
  352.     }
  353. #endif /* __MMI_CALENDAR_ON_IDLE_SCREEN__ */
  354. }
  355. /* main menu style and motion main menu */
  356. #ifdef __MMI_MAINMENU_STYLE_CHANGE_EN__
  357. /*****************************************************************************
  358.  * FUNCTION
  359.  *  HintPhnsetMainMenuStyle
  360.  * DESCRIPTION
  361.  *  This function is Hint handler for Phone setup-> Display --> Main menu style
  362.  *  Follow functions:
  363.  * PARAMETERS
  364.  *  index       [IN]            
  365.  *  a(?)        [IN/OUT]        
  366.  *  b(?)        [IN]            
  367.  * RETURNS
  368.  *  void
  369.  *****************************************************************************/
  370. void HintPhnsetMainMenuStyle(U16 index)
  371. {
  372.     /*----------------------------------------------------------------*/
  373.     /* Local Variables                                                */
  374.     /*----------------------------------------------------------------*/
  375.     PS8 p = NULL;
  376.     U8 style = PhnsetGetMainMenuStyle();
  377.     /*----------------------------------------------------------------*/
  378.     /* Code Body                                                      */
  379.     /*----------------------------------------------------------------*/
  380.     switch (style)
  381.     {
  382.     #ifdef __MMI_MAINMENU_MATRIX_SUPPORT__  /* 071705 Calvin added */
  383.         case PHNSET_MAINMENU_STYLE_MATRIX:
  384.             p = GetString(STR_MAINMENU_STYLE_MATRIX);
  385.             break;
  386.     #endif /* __MMI_MAINMENU_MATRIX_SUPPORT__ */ 
  387.     #ifdef __MMI_MAINMENU_PAGE_SUPPORT__    /* 071705 Calvin added */
  388.         case PHNSET_MAINMENU_STYLE_PAGE:
  389.             p = GetString(STR_MAINMENU_STYLE_PAGE);
  390.             break;
  391.     #endif /* __MMI_MAINMENU_PAGE_SUPPORT__ */ 
  392.     #ifdef __MMI_MAINMENU_LIST_SUPPORT__    /* 071705 Calvin added */
  393.         case PHNSET_MAINMENU_STYLE_LIST:
  394.             p = GetString(STR_MAINMENU_STYLE_LIST);
  395.             break;
  396.     #endif /* __MMI_MAINMENU_LIST_SUPPORT__ */ 
  397.     #ifdef __MMI_MAINMENU_CIRCULAR_SUPPORT__        /* 071705 Calvin modified */
  398.         case PHNSET_MAINMENU_STYLE_CIRCULE:
  399.             p = GetString(STR_MAINMENU_STYLE_CIRCULAR);
  400.             break;
  401.     #endif /* __MMI_MAINMENU_CIRCULAR_SUPPORT__ */ 
  402.     #ifdef __MMI_MAINMENU_ROTATE_SUPPORT__
  403.         case PHNSET_MAINMENU_STYLE_ROTATE:
  404.             p = GetString(STR_MAINMENU_STYLE_ROTATE);   /* PDG1   Manish */
  405.             break;
  406.     #endif /* __MMI_MAINMENU_ROTATE_SUPPORT__ */ 
  407.     #ifdef __MMI_MOTION_MAINMENU__
  408.         case PHNSET_MAINMENU_STYLE_MOTION:
  409.             {
  410.                 U16 motion_style = 0;
  411.                 
  412.                 motion_style = (U16)(g_phnset_cntx_p->MenuStyle - PHNSET_MAINMENU_STYLE_MOTION);
  413.                 switch(motion_style)
  414.                 {
  415.                 case 0:
  416.                     p = GetString(STR_ID_PHNSET_MOTION_MAINMENU_1);
  417.                     break;
  418.                     
  419.                 case 1:
  420.                     p = GetString(STR_ID_PHNSET_MOTION_MAINMENU_2);
  421.                     break;
  422.                     
  423.                 case 2:
  424.                     p = GetString(STR_ID_PHNSET_MOTION_MAINMENU_3);
  425.                     break;
  426.                     
  427.                 case 3:
  428.                     p = GetString(STR_ID_PHNSET_MOTION_MAINMENU_4);
  429.                     break;
  430.                     
  431.                 case 4:
  432.                     p = GetString(STR_ID_PHNSET_MOTION_MAINMENU_5);
  433.                     break;
  434.                     
  435.                 default:
  436.                     p = GetString(STR_GLOBAL_EMPTY);
  437.                     break;
  438.                 }
  439.             }
  440.             break;
  441.     #endif /* __MMI_MOTION_MAINMENU__ */
  442.         default:
  443.             {
  444.                 p = GetString(STR_GLOBAL_EMPTY);
  445.             }
  446.             break;
  447.     }
  448.     mmi_ucs2cpy((PS8) hintData[index], (PS8) p);
  449. }
  450. /*****************************************************************************
  451.  * FUNCTION
  452.  *  HighlightPhnsetMainMenuStyle
  453.  * DESCRIPTION
  454.  *  This function is Highlight handler for Phonesetup->IdleScreenDisplay --> Mainmenu style
  455.  *  Follow functions: EntryPhnsetMainMenuStyle
  456.  * PARAMETERS
  457.  *  void
  458.  *  a(?)        [IN/OUT]        
  459.  *  b(?)        [IN]            
  460.  * RETURNS
  461.  *  void
  462.  *****************************************************************************/
  463. void HighlightPhnsetMainMenuStyle(void)
  464. {
  465.     /*----------------------------------------------------------------*/
  466.     /* Local Variables                                                */
  467.     /*----------------------------------------------------------------*/
  468.     /*----------------------------------------------------------------*/
  469.     /* Code Body                                                      */
  470.     /*----------------------------------------------------------------*/
  471.     /* Change right soft key icon and label */
  472.     ChangeRightSoftkey(STR_GLOBAL_BACK, IMG_GLOBAL_BACK);
  473.     ChangeLeftSoftkey(STR_GLOBAL_OK, IMG_GLOBAL_OK);
  474.     /* Register function for left soft key */
  475.     SetLeftSoftkeyFunction(EntryPhnsetMainMenuStyle, KEY_EVENT_UP);
  476.     SetKeyHandler(EntryPhnsetMainMenuStyle, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
  477.     /* Register function for right soft key */
  478.     SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
  479.     SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
  480. }
  481. /*****************************************************************************
  482.  * FUNCTION
  483.  *  PhnsetMainMenuStyleList
  484.  * DESCRIPTION
  485.  *  This function is construct string list for Phone setup->IdleScreenDisplay --> Main Menu Style
  486.  * PARAMETERS
  487.  *  void
  488.  *  a(?)        [IN/OUT]        
  489.  *  b(?)        [IN]            
  490.  * RETURNS
  491.  *  void
  492.  *****************************************************************************/
  493. static U8 PhnsetMainMenuStyleList(U8** pMainMenuStyleList, U16 total_style)
  494. {
  495.     /*----------------------------------------------------------------*/
  496.     /* Local Variables                                                */
  497.     /*----------------------------------------------------------------*/
  498.     U8 i;
  499.     U16 comm_style_str_id[12] = {0};
  500.     U8 style_count = 0; /* count of style string */
  501.     /*----------------------------------------------------------------*/
  502.     /* Code Body                                                      */
  503.     /*----------------------------------------------------------------*/
  504. #ifdef __MMI_MAINMENU_MATRIX_SUPPORT__
  505.     comm_style_str_id[0] = STR_MAINMENU_STYLE_MATRIX;
  506. #endif 
  507. #ifdef __MMI_MAINMENU_PAGE_SUPPORT__
  508.     comm_style_str_id[1] = STR_MAINMENU_STYLE_PAGE;
  509. #endif 
  510. #ifdef __MMI_MAINMENU_LIST_SUPPORT__
  511.     comm_style_str_id[2] = STR_MAINMENU_STYLE_LIST;
  512. #endif 
  513. #ifdef __MMI_MAINMENU_CIRCULAR_SUPPORT__
  514.     comm_style_str_id[3] = STR_MAINMENU_STYLE_CIRCULAR;
  515. #endif 
  516. #ifdef __MMI_MAINMENU_ROTATE_SUPPORT__
  517.     comm_style_str_id[4] = STR_MAINMENU_STYLE_ROTATE;
  518. #endif 
  519.     /* set common style string */
  520.     for (i = 0; i < 6; i++)
  521.     {
  522.         if (comm_style_str_id[i] != 0)
  523.         {
  524.             pMainMenuStyleList[style_count] = (U8*)GetString(comm_style_str_id[i]);
  525.             style_count++;
  526.         }
  527.     }
  528. #ifdef __MMI_MOTION_MAINMENU__
  529.     /* set motion style string */
  530.     for (i = 0; i < PHNSET_MOTION_MAINMENU_NUM; i++)
  531.     {
  532.         switch(i)
  533.         {
  534.         case 0:
  535.             pMainMenuStyleList[style_count] = (U8*)GetString(STR_ID_PHNSET_MOTION_MAINMENU_1);
  536.             break;
  537.             
  538.         case 1:
  539.             pMainMenuStyleList[style_count] = (U8*)GetString(STR_ID_PHNSET_MOTION_MAINMENU_2);
  540.             break;
  541.             
  542.         case 2:
  543.             pMainMenuStyleList[style_count] = (U8*)GetString(STR_ID_PHNSET_MOTION_MAINMENU_3);
  544.             break;
  545.             
  546.         case 3:
  547.             pMainMenuStyleList[style_count] = (U8*)GetString(STR_ID_PHNSET_MOTION_MAINMENU_4);
  548.             break;
  549.             
  550.         case 4:
  551.             pMainMenuStyleList[style_count] = (U8*)GetString(STR_ID_PHNSET_MOTION_MAINMENU_5);
  552.             break;
  553.             
  554.         default:
  555.             pMainMenuStyleList[style_count] = (U8*)GetString(STR_GLOBAL_EMPTY);
  556.             break;
  557.         }
  558.         
  559.         style_count++;
  560.     }
  561. #endif /* __MMI_MOTION_MAINMENU__ */
  562.     return style_count;
  563. }
  564. /*****************************************************************************
  565.  * FUNCTION
  566.  *  EntryPhnsetMainMenuStyle
  567.  * DESCRIPTION
  568.  *  This function is Entry function for Phone setup->IdleScreenDisplay --> Main Menu Style
  569.  *  Following functions: HighlightPhnsetMainMenuStyleSelect
  570.  * PARAMETERS
  571.  *  void       
  572.  * RETURNS
  573.  *  void
  574.  *****************************************************************************/
  575. static void EntryPhnsetMainMenuStyle(void)
  576. {
  577.     /*----------------------------------------------------------------*/
  578.     /* Local Variables                                                */
  579.     /*----------------------------------------------------------------*/
  580.     U16 nNumofItem;                     /* Stores no of children in the submenu */
  581.     U16 nDispAttribute;                 /* Stores display attribue */
  582.     U8 *guiBuffer;                      /* Buffer holding history data */
  583.     /*----------------------------------------------------------------*/
  584.     /* Code Body                                                      */
  585.     /*----------------------------------------------------------------*/
  586.     //S16 Err=0;
  587.     //U8 *IdleScrDispType[MAX_SUB_MENUS];
  588.     /* Call Exit Handler */
  589.     EntryNewScreen(SCR_MAINMENU_STYLE, NULL, EntryPhnsetMainMenuStyle, NULL);
  590.     /* Get current screen to gui buffer  for history purposes */
  591.     guiBuffer = GetCurrGuiBuffer(SCR_MAINMENU_STYLE);
  592.     /* Retrieve no of child of menu item to be displayed */
  593. #ifdef __MMI_MOTION_MAINMENU__
  594.     nNumofItem = PHNSET_MAINMENU_STYLE_MOTION + PHNSET_MOTION_MAINMENU_NUM;  /* Yvonne provide this marco */
  595. #else   /* __MMI_MOTION_MAINMENU__ */
  596.     nNumofItem = PHNSET_MAINMENU_STYLE_MAX;
  597. #endif  /* __MMI_MOTION_MAINMENU__ */
  598.     /* Get attribute of menu to be displayed */
  599.     nDispAttribute = GetDispAttributeOfItem(MENU_SETTING_MAINMENU_STYLE);
  600.     /* Retrieve string ids in sequence of given menu item to be displayed */
  601.     PhnsetMainMenuStyleList(subMenuDataPtrs, nNumofItem);
  602.     /* Set current parent id */
  603.     SetParentHandler(MENU_SETTING_MAINMENU_STYLE);
  604.     /* Display Category Screen */
  605.     ShowCategory36Screen(
  606.         STR_MAINMENU_STYLE,
  607.         MAIN_MENU_TITLE_SETTINGS_ICON,
  608.         STR_GLOBAL_OK,
  609.         IMG_GLOBAL_OK,
  610.         STR_GLOBAL_BACK,
  611.         IMG_GLOBAL_BACK,
  612.         nNumofItem,
  613.         subMenuDataPtrs,
  614.         (U16)g_phnset_cntx_p->MenuStyle,
  615.         guiBuffer);
  616.     /* Register function with softkey */
  617.     SetLeftSoftkeyFunction(PhnsetMainMenuStyleSelectLskHdlr, KEY_EVENT_UP);
  618.     SetKeyHandler(NULL, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
  619.     SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
  620.     SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
  621. }
  622. /*****************************************************************************
  623.  * FUNCTION
  624.  *  PhnsetMainMenuStyleSelectLskHdlr
  625.  * DESCRIPTION
  626.  *  This function is left softkey handling function
  627.  *  for Phonesetup->IdleScreenDisplay -> MainMenu style -> Select
  628.  *  Functionality: Save the setting menu style
  629.  * PARAMETERS
  630.  *  void       
  631.  * RETURNS
  632.  *  void
  633.  *****************************************************************************/
  634. static void PhnsetMainMenuStyleSelectLskHdlr(void)
  635. {
  636.     /*----------------------------------------------------------------*/
  637.     /* Local Variables                                                */
  638.     /*----------------------------------------------------------------*/
  639.     U8 HighlightItem = 0;
  640.     S16 Err;
  641.     /*----------------------------------------------------------------*/
  642.     /* Code Body                                                      */
  643.     /*----------------------------------------------------------------*/
  644.     HighlightItem = (U8) GetHighlightedItem();
  645.     if (g_phnset_cntx_p->MenuStyle != HighlightItem)
  646.     {
  647.         g_phnset_cntx_p->MenuStyle = HighlightItem;
  648.         WriteValue(NVRAM_SET_MAINMENU_STYLE, &(g_phnset_cntx_p->MenuStyle), DS_BYTE, &Err);
  649.     }
  650.     mmi_display_popup((UI_string_type) GetString(STR_GLOBAL_DONE), MMI_EVENT_SUCCESS);
  651.     DeleteNScrId(SCR_MAINMENU_STYLE);
  652. }
  653. /*****************************************************************************
  654.  * FUNCTION
  655.  *  PhnsetGetMainMenuStyle
  656.  * DESCRIPTION
  657.  *  This function is to get setting main menu style
  658.  * PARAMETERS
  659.  *  void
  660.  *  a(?)        [IN/OUT]        
  661.  *  b(?)        [IN]            
  662.  * RETURNS
  663.  *  void
  664.  *****************************************************************************/
  665. U8 PhnsetGetMainMenuStyle(void)
  666. {
  667.     /*----------------------------------------------------------------*/
  668.     /* Local Variables                                                */
  669.     /*----------------------------------------------------------------*/
  670.     /*----------------------------------------------------------------*/
  671.     /* Code Body                                                      */
  672.     /*----------------------------------------------------------------*/
  673. #ifdef __MMI_MOTION_MAINMENU__
  674.     if (g_phnset_cntx_p->MenuStyle >= PHNSET_MAINMENU_STYLE_MOTION)
  675.     {
  676.         return PHNSET_MAINMENU_STYLE_MOTION;
  677.     }
  678. #endif  /* __MMI_MOTION_MAINMENU__ */
  679.     return g_phnset_cntx_p->MenuStyle;
  680. }
  681. #ifdef __MMI_MOTION_MAINMENU__
  682. /*****************************************************************************
  683.  * FUNCTION
  684.  *  GetMainMenuMotionStyle
  685.  * DESCRIPTION
  686.  *  This function is to get content id of motion style
  687.  * PARAMETERS
  688.  *  void           
  689.  * RETURNS
  690.  *  U16
  691.  *****************************************************************************/
  692. U16 GetMainMenuMotionStyle(void)
  693. {
  694.     /*----------------------------------------------------------------*/
  695.     /* Local Variables                                                */
  696.     /*----------------------------------------------------------------*/
  697.     
  698.     /*----------------------------------------------------------------*/
  699.     /* Code Body                                                      */
  700.     /*----------------------------------------------------------------*/
  701.     if ((g_phnset_cntx_p->MenuStyle >= PHNSET_MAINMENU_STYLE_MOTION) 
  702.         && ((g_phnset_cntx_p->MenuStyle - PHNSET_MAINMENU_STYLE_MOTION) < PHNSET_MOTION_MAINMENU_NUM))
  703.     {
  704.         U16 motion_img_id;
  705.         motion_img_id = (U16)(g_phnset_cntx_p->MenuStyle - PHNSET_MAINMENU_STYLE_MOTION);
  706.         switch(motion_img_id)
  707.         {
  708.         case 0:
  709.             return IMG_ID_SWFLASH_MAINMENU1;
  710.             break;
  711.         case 1:
  712.             return IMG_ID_SWFLASH_MAINMENU2;
  713.             break;
  714.         case 2:
  715.             return IMG_ID_SWFLASH_MAINMENU3;
  716.             break;
  717.         case 3:
  718.             return IMG_ID_SWFLASH_MAINMENU3;
  719.             break;
  720.         case 4:
  721.             return IMG_ID_SWFLASH_MAINMENU4;
  722.             break;
  723.         default:
  724.             return 0;
  725.             break;
  726.         }
  727.     }
  728.     return 0;
  729. }
  730. #endif /* __MMI_MOTION_MAINMENU__ */
  731. #endif /* __MMI_MAINMENU_STYLE_CHANGE_EN__ */ 
  732. /* main menu style and motion main menu */
  733. /* motion dial style */
  734. #ifdef __MMI_MOTION_DIAL__
  735. /*****************************************************************************
  736.  * FUNCTION
  737.  *  HighlightPhnsetDialStyle
  738.  * DESCRIPTION
  739.  *  This function is Highlight handler for Phone setup->IdleScreenDisplay --> Dial style
  740.  *  Follow functions: EntryPhnsetDialStyle
  741.  * PARAMETERS
  742.  *  void
  743.  *  a(?)        [IN/OUT]        
  744.  *  b(?)        [IN]            
  745.  * RETURNS
  746.  *  void
  747.  *****************************************************************************/
  748. void HighlightPhnsetDialStyle(void)
  749. {
  750.     /*----------------------------------------------------------------*/
  751.     /* Local Variables                                                */
  752.     /*----------------------------------------------------------------*/
  753.     /*----------------------------------------------------------------*/
  754.     /* Code Body                                                      */
  755.     /*----------------------------------------------------------------*/
  756.     /* Change right soft key icon and label */
  757.     ChangeRightSoftkey(STR_GLOBAL_BACK, IMG_GLOBAL_BACK);
  758.     ChangeLeftSoftkey(STR_GLOBAL_OK, IMG_GLOBAL_OK);
  759.     /* Register function for left soft key */
  760.     SetLeftSoftkeyFunction(EntryPhnsetDialStyle, KEY_EVENT_UP);
  761.     SetKeyHandler(EntryPhnsetDialStyle, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
  762.     /* Register function for right soft key */
  763.     SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
  764.     SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
  765. }
  766. /*****************************************************************************
  767.  * FUNCTION
  768.  *  HintPhnsetDialStyle
  769.  * DESCRIPTION
  770.  *  This function is Hint handler for Phone setup->IdleScreenDisplay --> Dial style
  771.  *  Follow functions:
  772.  * PARAMETERS
  773.  *  index       [IN]                      
  774.  * RETURNS
  775.  *  void
  776.  *****************************************************************************/
  777. void HintPhnsetDialStyle(U16 index)
  778. {
  779.     /*----------------------------------------------------------------*/
  780.     /* Local Variables                                                */
  781.     /*----------------------------------------------------------------*/
  782.     S8 *p = NULL;
  783.     /*----------------------------------------------------------------*/
  784.     /* Code Body                                                      */
  785.     /*----------------------------------------------------------------*/
  786.     if (g_phnset_cntx_p->DialStyle < PHNSET_MOTION_DIAL_NUM)
  787.     {
  788.         switch(g_phnset_cntx_p->DialStyle)
  789.         {
  790.         case 0:
  791.             p = GetString(STR_ID_PHNSET_MOTION_DIAL_1);
  792.          break;
  793.         case 1:
  794.             p = GetString(STR_ID_PHNSET_MOTION_DIAL_2);
  795.          break;
  796.         case 2:
  797.             p = GetString(STR_ID_PHNSET_MOTION_DIAL_3);
  798.             break;
  799.         case 3:
  800.             p = GetString(STR_ID_PHNSET_MOTION_DIAL_4);
  801.             break;
  802.         case 4:
  803.             p = GetString(STR_ID_PHNSET_MOTION_DIAL_5);
  804.             break;    
  805.         default:
  806.             p = GetString(STR_GLOBAL_EMPTY);
  807.             break;
  808.         }
  809.     }
  810.     else
  811.     {
  812.         p = GetString(STR_GLOBAL_EMPTY);
  813.     }
  814.     mmi_ucs2cpy((PS8) hintData[index], (PS8) p);
  815. }
  816. /*****************************************************************************
  817.  * FUNCTION
  818.  *  PhnsetDialStyleList
  819.  * DESCRIPTION
  820.  *  This function is construct string list for Phone setup->IdleScreenDisplay --> Dial Style
  821.  * PARAMETERS
  822.  *  void        
  823.  * RETURNS
  824.  *  void
  825.  *****************************************************************************/
  826. static U8 PhnsetDialStyleList(U8** pMainMenuStyleList, U16 total_style)
  827. {
  828.     /*----------------------------------------------------------------*/
  829.     /* Local Variables                                                */
  830.     /*----------------------------------------------------------------*/
  831.     U8 i;
  832.     /*----------------------------------------------------------------*/
  833.     /* Code Body                                                      */
  834.     /*----------------------------------------------------------------*/
  835.     for (i = 0; i < total_style; i++)
  836.     {
  837.         switch(i)
  838.         {
  839.         case 0:
  840.             pMainMenuStyleList[i] = (U8*)GetString(STR_ID_PHNSET_MOTION_DIAL_1);
  841.             break;
  842.             
  843.         case 1:
  844.             pMainMenuStyleList[i] = (U8*)GetString(STR_ID_PHNSET_MOTION_DIAL_2);
  845.             break;
  846.             
  847.         case 2:
  848.             pMainMenuStyleList[i] = (U8*)GetString(STR_ID_PHNSET_MOTION_DIAL_3);
  849.             break;
  850.             
  851.         case 3:
  852.             pMainMenuStyleList[i] = (U8*)GetString(STR_ID_PHNSET_MOTION_DIAL_4);
  853.             break;
  854.             
  855.         case 4:
  856.             pMainMenuStyleList[i] = (U8*)GetString(STR_ID_PHNSET_MOTION_DIAL_5);
  857.             break;    
  858.             
  859.         default:
  860.             pMainMenuStyleList[i] = (U8*)GetString(STR_GLOBAL_EMPTY);
  861.             break;
  862.         }
  863.     }
  864.     return i;
  865. }
  866. /*****************************************************************************
  867.  * FUNCTION
  868.  *  EntryPhnsetDialStyle
  869.  * DESCRIPTION
  870.  *  This function is Entry function for Phone setup->IdleScreenDisplay --> Dial Style
  871.  *  Following functions: HighlightPhnsetDialStyle
  872.  * PARAMETERS
  873.  *  void           
  874.  * RETURNS
  875.  *  void
  876.  *****************************************************************************/
  877. static void EntryPhnsetDialStyle(void)
  878. {
  879.     /*----------------------------------------------------------------*/
  880.     /* Local Variables                                                */
  881.     /*----------------------------------------------------------------*/
  882.     U16 nNumofItem;                     /* Stores no of children in the sub menu */
  883.     U16 nDispAttribute;                 /* Stores display attribute */
  884.     U8 *guiBuffer;                      /* Buffer holding history data */
  885.     /*----------------------------------------------------------------*/
  886.     /* Code Body                                                      */
  887.     /*----------------------------------------------------------------*/
  888.     /* Call Exit Handler */
  889.     EntryNewScreen(SCR_ID_SETTING_DIAL_STYLE, NULL, EntryPhnsetDialStyle, NULL);
  890.     /* Get current screen to GUI buffer for history purposes */
  891.     guiBuffer = GetCurrGuiBuffer(SCR_ID_SETTING_DIAL_STYLE);
  892.     /* Retrieve no of child of menu item to be displayed */
  893.     nNumofItem = PHNSET_MOTION_DIAL_NUM;
  894.     /* Get attribute of menu to be displayed */
  895.     nDispAttribute = GetDispAttributeOfItem(MENU_SETTING_DIAL_STYLE);
  896.     /* Retrieve string ids in sequence of given menu item to be displayed */
  897.     //GetSequenceStringIds(MENU_SETTING_MAINMENU_STYLE, nStrItemList);
  898.     PhnsetDialStyleList(subMenuDataPtrs, nNumofItem);
  899.     /* Set current parent id */
  900.     SetParentHandler(MENU_SETTING_DIAL_STYLE);
  901.     /* Display Category Screen */
  902.     ShowCategory36Screen(
  903.         STR_ID_PHNSET_DIAL_STYLE,
  904.         MAIN_MENU_TITLE_SETTINGS_ICON,
  905.         STR_GLOBAL_OK,
  906.         IMG_GLOBAL_OK,
  907.         STR_GLOBAL_BACK,
  908.         IMG_GLOBAL_BACK,
  909.         nNumofItem,
  910.         subMenuDataPtrs,
  911.         (U16)g_phnset_cntx_p->DialStyle,
  912.         guiBuffer);
  913.     SetLeftSoftkeyFunction(PhnsetDialStyleSelectLskHdlr, KEY_EVENT_UP);
  914.     SetKeyHandler(NULL, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
  915.     /* Register function with soft key */
  916.     SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
  917.     SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
  918. }
  919. /*****************************************************************************
  920.  * FUNCTION
  921.  *  PhnsetDialStyleSelectLskHdlr
  922.  * DESCRIPTION
  923.  *  This function is left soft key handling function
  924.  *  for Phone setup->IdleScreenDisplay -> Dial style -> Select
  925.  *  Functionality: Save the setting dial style
  926.  * PARAMETERS
  927.  *  void           
  928.  * RETURNS
  929.  *  void
  930.  *****************************************************************************/
  931. static void PhnsetDialStyleSelectLskHdlr(void)
  932. {
  933.     /*----------------------------------------------------------------*/
  934.     /* Local Variables                                                */
  935.     /*----------------------------------------------------------------*/
  936.     U8 HighlightItem = 0;
  937.     S16 Err;
  938.     /*----------------------------------------------------------------*/
  939.     /* Code Body                                                      */
  940.     /*----------------------------------------------------------------*/
  941.     HighlightItem = (U8) GetHighlightedItem();
  942.     if (g_phnset_cntx_p->DialStyle != HighlightItem)
  943.     {
  944.         g_phnset_cntx_p->DialStyle = HighlightItem;
  945.         WriteValue(NVRAM_SET_DIAL_STYLE, &(g_phnset_cntx_p->DialStyle), DS_BYTE, &Err);
  946.     }
  947.     mmi_display_popup((UI_string_type) GetString(STR_GLOBAL_DONE), MMI_EVENT_SUCCESS);
  948.     DeleteNScrId(SCR_ID_SETTING_DIAL_STYLE);
  949. }
  950. /*****************************************************************************
  951.  * FUNCTION
  952.  *  PhnsetGetDialStyle
  953.  * DESCRIPTION
  954.  *  This function is to get value of dial motion style
  955.  * PARAMETERS
  956.  *  void           
  957.  * RETURNS
  958.  *  U16
  959.  *****************************************************************************/
  960. U16 PhnsetGetDialStyle(void)
  961. {
  962.     /*----------------------------------------------------------------*/
  963.     /* Local Variables                                                */
  964.     /*----------------------------------------------------------------*/
  965.     
  966.     /*----------------------------------------------------------------*/
  967.     /* Code Body                                                      */
  968.     /*----------------------------------------------------------------*/
  969.     switch(g_phnset_cntx_p->DialStyle)
  970.     {
  971.     case 0:
  972.         return IMG_ID_SWFLASH_DIALER1;
  973.      break;
  974.     case 1:
  975.         return IMG_ID_SWFLASH_DIALER2;
  976.      break;
  977.     case 2:
  978.         return IMG_ID_SWFLASH_DIALER3;
  979.         break;
  980.     case 3:
  981.         return IMG_ID_SWFLASH_DIALER4;
  982.         break;
  983.     case 4:
  984.         return IMG_ID_SWFLASH_DIALER5;
  985.         break;
  986.     default:
  987.         return 0;
  988.         break;
  989.     }
  990.     
  991.     return 0;
  992. }
  993. #endif  /* __MMI_MOTION_DIAL__ */
  994. /* motion dial style */
  995. /* VUI Home screen */
  996. #ifdef __MMI_VUI_HOMESCREEN__
  997. /*****************************************************************************
  998.  * FUNCTION
  999.  *  mmi_phnset_get_vui_homescreen_status
  1000.  * DESCRIPTION
  1001.  *  
  1002.  * PARAMETERS
  1003.  *  void
  1004.  * RETURNS
  1005.  *  void
  1006.  *****************************************************************************/
  1007. U8 mmi_phnset_get_vui_homescreen_status(void)
  1008. {
  1009.     /*----------------------------------------------------------------*/
  1010.     /* Local Variables                                                */
  1011.     /*----------------------------------------------------------------*/
  1012.     /*----------------------------------------------------------------*/
  1013.     /* Code Body                                                      */
  1014.     /*----------------------------------------------------------------*/
  1015. return g_phnset_cntx_p->vui_home_screen;
  1016. }
  1017. /*****************************************************************************
  1018.  * FUNCTION
  1019.  *  mmi_hint_phnset_vui_homescreen
  1020.  * DESCRIPTION
  1021.  *  
  1022.  * PARAMETERS
  1023.  *  index       [IN]        
  1024.  * RETURNS
  1025.  *  void
  1026.  *****************************************************************************/
  1027. void mmi_hint_phnset_vui_homescreen(U16 index)
  1028. {
  1029.     /*----------------------------------------------------------------*/
  1030.     /* Local Variables                                                */
  1031.     /*----------------------------------------------------------------*/
  1032.     /*----------------------------------------------------------------*/
  1033.     /* Code Body                                                      */
  1034.     /*----------------------------------------------------------------*/
  1035.     switch (g_phnset_cntx_p->vui_home_screen)
  1036.     {
  1037.         case 0:
  1038.             mmi_ucs2cpy((PS8) hintData[index], (PS8) GetString(STR_GLOBAL_OFF));
  1039.             break;
  1040.         case 1:
  1041.             mmi_ucs2cpy((PS8) hintData[index], (PS8) GetString(STR_GLOBAL_ON));
  1042.             break;
  1043.         default:
  1044.             MMI_ASSERT(0);
  1045.     }
  1046. }
  1047. /*****************************************************************************
  1048.  * FUNCTION
  1049.  *  mmi_phnset_set_vui_homescreen_status
  1050.  * DESCRIPTION
  1051.  *  
  1052.  * PARAMETERS
  1053.  *  void
  1054.  * RETURNS
  1055.  *  void
  1056.  *****************************************************************************/
  1057. static void mmi_phnset_set_vui_homescreen_status(void)
  1058. {
  1059.     /*----------------------------------------------------------------*/
  1060.     /* Local Variables                                                */
  1061.     /*----------------------------------------------------------------*/
  1062.     S16 error;
  1063.     /*----------------------------------------------------------------*/
  1064.     /* Code Body                                                      */
  1065.     /*----------------------------------------------------------------*/
  1066.     g_phnset_cntx_p->vui_home_screen = (U8)GetHighlightedItem();
  1067.     WriteValue(NVRAM_VUI_PHNSET_HOMESCREEN, &(g_phnset_cntx_p->vui_home_screen), DS_BYTE, &error);
  1068.     mmi_display_popup((UI_string_type) GetString(STR_GLOBAL_DONE), MMI_EVENT_SUCCESS);
  1069.     DeleteScreenIfPresent(SCR_ID_VUI_PHNSET_HOMESCREEN);
  1070. }
  1071. /*****************************************************************************
  1072.  * FUNCTION
  1073.  *  mmi_entry_phnset_vui_homescreen
  1074.  * DESCRIPTION
  1075.  *  
  1076.  * PARAMETERS
  1077.  *  void
  1078.  * RETURNS
  1079.  *  void
  1080.  *****************************************************************************/
  1081. static void mmi_entry_phnset_vui_homescreen(void)
  1082. {
  1083.     /*----------------------------------------------------------------*/
  1084.     /* Local Variables                                                */
  1085.     /*----------------------------------------------------------------*/
  1086.     U8 *gui_buffer;
  1087.     /*----------------------------------------------------------------*/
  1088.     /* Code Body                                                      */
  1089.     /*----------------------------------------------------------------*/
  1090.     EntryNewScreen(SCR_ID_VUI_PHNSET_HOMESCREEN, NULL, mmi_entry_phnset_vui_homescreen, NULL);
  1091.     gui_buffer = GetCurrGuiBuffer(SCR_ID_VUI_PHNSET_HOMESCREEN);
  1092.     subMenuDataPtrs[0] = (PU8) GetString(STR_GLOBAL_OFF);
  1093.     subMenuDataPtrs[1] = (PU8) GetString(STR_GLOBAL_ON);
  1094.     ShowCategory36Screen(
  1095.         STR_ID_VUI_PHNSET_HOMESCREEN,
  1096.         MAIN_MENU_TITLE_SETTINGS_ICON,
  1097.         STR_GLOBAL_OK,
  1098.         IMG_GLOBAL_OK,
  1099.         STR_GLOBAL_BACK,
  1100.         IMG_GLOBAL_BACK,
  1101.         2,
  1102.         (U8 **)subMenuDataPtrs,
  1103.         g_phnset_cntx_p->vui_home_screen,
  1104.         gui_buffer);
  1105.     SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
  1106.     SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
  1107.     SetLeftSoftkeyFunction(mmi_phnset_set_vui_homescreen_status, KEY_EVENT_UP);
  1108.     SetKeyHandler(0, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
  1109. }
  1110. /*****************************************************************************
  1111.  * FUNCTION
  1112.  *  mmi_highlight_phnset_vui_homescreen
  1113.  * DESCRIPTION
  1114.  *  
  1115.  * PARAMETERS
  1116.  *  void
  1117.  * RETURNS
  1118.  *  void
  1119.  *****************************************************************************/
  1120. void mmi_highlight_phnset_vui_homescreen(void)
  1121. {
  1122.     /*----------------------------------------------------------------*/
  1123.     /* Local Variables                                                */
  1124.     /*----------------------------------------------------------------*/
  1125.     /*----------------------------------------------------------------*/
  1126.     /* Code Body                                                      */
  1127.     /*----------------------------------------------------------------*/
  1128.     /* 1 Change left soft key icon and label */
  1129.     ChangeLeftSoftkey(STR_GLOBAL_OK, 0);
  1130.     /* 2 Change right soft key icon and label */
  1131.     ChangeRightSoftkey(STR_GLOBAL_BACK, 0);
  1132.     SetLeftSoftkeyFunction(mmi_entry_phnset_vui_homescreen, KEY_EVENT_UP);
  1133.     SetKeyHandler(mmi_entry_phnset_vui_homescreen, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
  1134.     SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
  1135.     SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
  1136. }
  1137. #endif /* __MMI_VUI_HOMESCREEN__ */
  1138. /* VUI Home screen */
  1139. /* VUI Main menu effect */
  1140. #ifdef __MMI_VUI_MAINMENU__
  1141. /*****************************************************************************
  1142.  * FUNCTION
  1143.  *  mmi_phnset_get_vui_mm_effect_status
  1144.  * DESCRIPTION
  1145.  *  
  1146.  * PARAMETERS
  1147.  *  void
  1148.  * RETURNS
  1149.  *  void
  1150.  *****************************************************************************/
  1151. U8 mmi_phnset_get_vui_mm_effect_status(void)
  1152. {
  1153.     /*----------------------------------------------------------------*/
  1154.     /* Local Variables                                                */
  1155.     /*----------------------------------------------------------------*/
  1156.     /*----------------------------------------------------------------*/
  1157.     /* Code Body                                                      */
  1158.     /*----------------------------------------------------------------*/
  1159. return g_phnset_cntx_p->vui_mm_effect;
  1160. }
  1161. /*****************************************************************************
  1162.  * FUNCTION
  1163.  *  mmi_hint_phnset_vui_mainmenu_effect
  1164.  * DESCRIPTION
  1165.  *  
  1166.  * PARAMETERS
  1167.  *  index       [IN]        
  1168.  * RETURNS
  1169.  *  void
  1170.  *****************************************************************************/
  1171. void mmi_hint_phnset_vui_mainmenu_effect(U16 index)
  1172. {
  1173.     /*----------------------------------------------------------------*/
  1174.     /* Local Variables                                                */
  1175.     /*----------------------------------------------------------------*/
  1176.     /*----------------------------------------------------------------*/
  1177.     /* Code Body                                                      */
  1178.     /*----------------------------------------------------------------*/
  1179.     switch (g_phnset_cntx_p->vui_mm_effect)
  1180.     {
  1181.         case 0:
  1182.             mmi_ucs2cpy((PS8) hintData[index], (PS8) GetString(STR_ID_VUI_PHNSET_MAINMENU_EFFECT1));
  1183.             break;
  1184.         case 1:
  1185.             mmi_ucs2cpy((PS8) hintData[index], (PS8) GetString(STR_ID_VUI_PHNSET_MAINMENU_EFFECT2));
  1186.             break;
  1187.             
  1188.         case 2:
  1189.             mmi_ucs2cpy((PS8) hintData[index], (PS8) GetString(STR_ID_VUI_PHNSET_MAINMENU_EFFECT3));
  1190.             break;
  1191.                 
  1192.         case 3:
  1193.             mmi_ucs2cpy((PS8) hintData[index], (PS8) GetString(STR_ID_VUI_PHNSET_MAINMENU_EFFECT4));
  1194.             break;
  1195.             
  1196. case 4:
  1197. mmi_ucs2cpy((PS8) hintData[index], (PS8) GetString(STR_ID_VUI_PHNSET_MAINMENU_EFFECT5));
  1198.             break;
  1199. case 5:
  1200. mmi_ucs2cpy((PS8) hintData[index], (PS8) GetString(STR_GLOBAL_NONE));
  1201.             break;
  1202.             
  1203.         default:
  1204.             MMI_ASSERT(0);
  1205.     }
  1206. }
  1207. /*****************************************************************************
  1208.  * FUNCTION
  1209.  *  mmi_phnset_set_vui_mainmenu_effect
  1210.  * DESCRIPTION
  1211.  *  
  1212.  * PARAMETERS
  1213.  *  void
  1214.  * RETURNS
  1215.  *  void
  1216.  *****************************************************************************/
  1217. void mmi_phnset_set_vui_mainmenu_effect(void)
  1218. {
  1219.     /*----------------------------------------------------------------*/
  1220.     /* Local Variables                                                */
  1221.     /*----------------------------------------------------------------*/
  1222.     S16 error;
  1223.     /*----------------------------------------------------------------*/
  1224.     /* Code Body                                                      */
  1225.     /*----------------------------------------------------------------*/
  1226.     g_phnset_cntx_p->vui_mm_effect = (U8)GetHighlightedItem();
  1227.     WriteValue(NVRAM_VUI_PHNSET_MAINMENU_EFFECT, &(g_phnset_cntx_p->vui_mm_effect), DS_BYTE, &error);
  1228.     
  1229.     mmi_display_popup((UI_string_type) GetString(STR_GLOBAL_DONE), MMI_EVENT_SUCCESS);
  1230.     
  1231.     DeleteScreenIfPresent(SCR_ID_VUI_PHNSET_MAINMENU_EFFECT);
  1232. }
  1233. /*****************************************************************************
  1234.  * FUNCTION
  1235.  *  mmi_entry_phnset_vui_mainmenu_effect
  1236.  * DESCRIPTION
  1237.  *  
  1238.  * PARAMETERS
  1239.  *  void
  1240.  * RETURNS
  1241.  *  void
  1242.  *****************************************************************************/
  1243. static void mmi_entry_phnset_vui_mainmenu_effect(void)
  1244. {
  1245.     /*----------------------------------------------------------------*/
  1246.     /* Local Variables                                                */
  1247.     /*----------------------------------------------------------------*/
  1248.     U8 *gui_buffer;
  1249.     /*----------------------------------------------------------------*/
  1250.     /* Code Body                                                      */
  1251.     /*----------------------------------------------------------------*/
  1252.     EntryNewScreen(SCR_ID_VUI_PHNSET_MAINMENU_EFFECT, NULL, mmi_entry_phnset_vui_mainmenu_effect, NULL);
  1253.     gui_buffer = GetCurrGuiBuffer(SCR_ID_VUI_PHNSET_MAINMENU_EFFECT);
  1254.     subMenuDataPtrs[0] = (PU8) GetString(STR_ID_VUI_PHNSET_MAINMENU_EFFECT1);
  1255.     subMenuDataPtrs[1] = (PU8) GetString(STR_ID_VUI_PHNSET_MAINMENU_EFFECT2);
  1256.     subMenuDataPtrs[2] = (PU8) GetString(STR_ID_VUI_PHNSET_MAINMENU_EFFECT3);
  1257.     subMenuDataPtrs[3] = (PU8) GetString(STR_ID_VUI_PHNSET_MAINMENU_EFFECT4);
  1258. subMenuDataPtrs[4] = (PU8) GetString(STR_ID_VUI_PHNSET_MAINMENU_EFFECT5);
  1259. subMenuDataPtrs[5] = (PU8) GetString(STR_GLOBAL_NONE);
  1260.     ShowCategory36Screen(
  1261.         STR_ID_VUI_PHNSET_MAINMENU_EFFECT,
  1262.         MAIN_MENU_TITLE_SETTINGS_ICON,
  1263.         STR_GLOBAL_OK,
  1264.         IMG_GLOBAL_OK,
  1265.         STR_GLOBAL_BACK,
  1266.         IMG_GLOBAL_BACK,
  1267.         6,
  1268.         (U8 **)subMenuDataPtrs,
  1269.         g_phnset_cntx_p->vui_mm_effect,
  1270.         gui_buffer);
  1271.     SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
  1272.     SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
  1273.     SetLeftSoftkeyFunction(mmi_phnset_set_vui_mainmenu_effect, KEY_EVENT_UP);
  1274.     SetKeyHandler(0, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
  1275. }
  1276. /*****************************************************************************
  1277.  * FUNCTION
  1278.  *  mmi_highlight_phnset_vui_mainmenu_effect
  1279.  * DESCRIPTION
  1280.  *  
  1281.  * PARAMETERS
  1282.  *  void
  1283.  * RETURNS
  1284.  *  void
  1285.  *****************************************************************************/
  1286. void mmi_highlight_phnset_vui_mainmenu_effect(void)
  1287. {
  1288.     /*----------------------------------------------------------------*/
  1289.     /* Local Variables                                                */
  1290.     /*----------------------------------------------------------------*/
  1291.     /*----------------------------------------------------------------*/
  1292.     /* Code Body                                                      */
  1293.     /*----------------------------------------------------------------*/
  1294.     /* 1 Change left soft key icon and label */
  1295.     ChangeLeftSoftkey(STR_GLOBAL_OK, 0);
  1296.     /* 2 Change right soft key icon and label */
  1297.     ChangeRightSoftkey(STR_GLOBAL_BACK, 0);
  1298.     SetLeftSoftkeyFunction(mmi_entry_phnset_vui_mainmenu_effect, KEY_EVENT_UP);
  1299.     SetKeyHandler(mmi_entry_phnset_vui_mainmenu_effect, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
  1300.     SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
  1301.     SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
  1302. }
  1303. #endif /* __MMI_VUI_MAINMENU__ */
  1304. /* VUI Main menu effect */
  1305. /* calendar in idle screen */
  1306. #ifdef __MMI_CALENDAR_ON_IDLE_SCREEN__
  1307. /*****************************************************************************
  1308.  * FUNCTION
  1309.  *  PhnsetGetCalendarIdleScreen
  1310.  * DESCRIPTION
  1311.  *    
  1312.  * PARAMETERS
  1313.  *  void
  1314.  * RETURNS
  1315.  *  current calendar screen status
  1316.  *****************************************************************************/
  1317. U8 PhnsetGetCalendarIdleScreen(void)
  1318. {
  1319.     /*----------------------------------------------------------------*/
  1320.     /* Local Variables                                                */
  1321.     /*----------------------------------------------------------------*/
  1322.     
  1323.     /*----------------------------------------------------------------*/
  1324.     /* Code Body                                                      */
  1325.     /*----------------------------------------------------------------*/
  1326.     return g_phnset_cntx_p->curCalendarIdleScrStatus;
  1327. }
  1328. /*****************************************************************************
  1329.  * FUNCTION
  1330.  *  PhnsetToggleShowCalendarIdleScreen
  1331.  * DESCRIPTION
  1332.  *  This function is Left soft key handler
  1333.  *  for Phone setup->IdleScreenDisplay-> Show Calendar IdleScreen
  1334.  * PARAMETERS
  1335.  *  void           
  1336.  * RETURNS
  1337.  *  void
  1338.  *****************************************************************************/
  1339. static void PhnsetToggleShowCalendarIdleScreen(void)
  1340. {
  1341.     /*----------------------------------------------------------------*/
  1342.     /* Local Variables                                                */
  1343.     /*----------------------------------------------------------------*/
  1344.     U16 index;
  1345.     /*----------------------------------------------------------------*/
  1346.     /* Code Body                                                      */
  1347.     /*----------------------------------------------------------------*/
  1348.     index = GetCurrHiliteID();
  1349.     /* If Own Number Display if Off then turn it On Pressing LSK */
  1350.     if (g_phnset_cntx_p->curCalendarIdleScrStatus == 0)
  1351.     {
  1352.         g_phnset_cntx_p->curCalendarIdleScrStatus = 1;
  1353.     }
  1354.     else
  1355.     {
  1356.         g_phnset_cntx_p->curCalendarIdleScrStatus = 0;
  1357.     }
  1358.     if (g_phnset_cntx_p->curCalendarIdleScrStatus)
  1359.     {
  1360.         mmi_ucs2cpy((PS8) hintData[index], (PS8) GetString(STR_GLOBAL_ON));
  1361.         Category52ChangeItemDescription(index, hintData[index]);
  1362.         ChangeLeftSoftkey(STR_GLOBAL_OFF, 0);
  1363.     }
  1364.     else
  1365.     {
  1366.         mmi_ucs2cpy((PS8) hintData[index], (PS8) GetString(STR_GLOBAL_OFF));
  1367.         Category52ChangeItemDescription(index, hintData[index]);
  1368.         ChangeLeftSoftkey(STR_GLOBAL_ON, 0);
  1369.     }
  1370.     g_phnset_cntx_p->ShowCalendarIdleSrcDirtyFlag = TRUE;
  1371.     EntryPhnsetIdleScrDisp();
  1372. }
  1373. /*****************************************************************************
  1374.  * FUNCTION
  1375.  *  HighlightPhnsetFontSize
  1376.  * DESCRIPTION
  1377.  *  
  1378.  * PARAMETERS
  1379.  *  void
  1380.  * RETURNS
  1381.  *  void
  1382.  *****************************************************************************/
  1383. void HintPhnsetCalendarIdleScreen(U16 index)
  1384. {
  1385.     /*----------------------------------------------------------------*/
  1386.     /* Local Variables                                                */
  1387.     /*----------------------------------------------------------------*/
  1388.     /*----------------------------------------------------------------*/
  1389.     /* Code Body                                                      */
  1390.     /*----------------------------------------------------------------*/
  1391.     if (PhnsetGetCalendarIdleScreen())
  1392.     {
  1393.         g_phnset_cntx_p->curCalendarIdleScrStatus = 1; 
  1394.         mmi_ucs2cpy((PS8) hintData[index], (PS8) GetString(STR_GLOBAL_ON));
  1395.     }
  1396.     else
  1397.     {
  1398.         g_phnset_cntx_p->curCalendarIdleScrStatus = 0; 
  1399.         mmi_ucs2cpy((PS8) hintData[index], (PS8) GetString(STR_GLOBAL_OFF));
  1400.     }
  1401. }
  1402. /*****************************************************************************
  1403.  * FUNCTION
  1404.  *  HighlightPhnsetCalendarIdleScreen
  1405.  * DESCRIPTION
  1406.  *  
  1407.  * PARAMETERS
  1408.  *  void
  1409.  * RETURNS
  1410.  *  void
  1411.  *****************************************************************************/
  1412. void HighlightPhnsetCalendarIdleScreen(void)
  1413. {
  1414.     /*----------------------------------------------------------------*/
  1415.     /* Local Variables                                                */
  1416.     /*----------------------------------------------------------------*/
  1417.     
  1418.     /*----------------------------------------------------------------*/
  1419.     /* Code Body                                                      */
  1420.     /*----------------------------------------------------------------*/
  1421.     /* If Owner Number Is On Change The LSK to OFF otherwise ON. */
  1422.     if (PhnsetGetCalendarIdleScreen() == 1)
  1423.     {
  1424.         ChangeLeftSoftkey(STR_GLOBAL_OFF, 0);
  1425.     }
  1426.     else
  1427.     {
  1428.         ChangeLeftSoftkey(STR_GLOBAL_ON, 0);
  1429.     }
  1430.     
  1431.     /* Change right soft key icon and label */
  1432.     ChangeRightSoftkey(STR_GLOBAL_BACK, IMG_GLOBAL_BACK);
  1433.     
  1434.     SetLeftSoftkeyFunction(PhnsetToggleShowCalendarIdleScreen, KEY_EVENT_UP);
  1435.     SetKeyHandler(0, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
  1436.     
  1437.     /* Register function for right soft key */
  1438.     SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
  1439.     SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
  1440. }
  1441. #endif /* __MMI_CALENDAR_ON_IDLE_SCREEN__ */
  1442. /* calendar in idle screen */
  1443. /* dual clock in idle */
  1444. #ifdef __MMI_DUAL_CLOCK__
  1445. /*****************************************************************************
  1446.  * FUNCTION
  1447.  *  HighlightPhnsetCalendarIdleScreen
  1448.  * DESCRIPTION
  1449.  *  
  1450.  * PARAMETERS
  1451.  *  void
  1452.  * RETURNS
  1453.  *  void
  1454.  *****************************************************************************/
  1455. void HighlightPhnsetDualClockIdleScreen(void)
  1456. {
  1457.     /*----------------------------------------------------------------*/
  1458.     /* Local Variables                                                */
  1459.     /*----------------------------------------------------------------*/
  1460.     
  1461.     /*----------------------------------------------------------------*/
  1462.     /* Code Body                                                      */
  1463.     /*----------------------------------------------------------------*/    
  1464.     if (PhnsetGetDualClockState() == 1)
  1465.     {
  1466.         ChangeLeftSoftkey(STR_GLOBAL_OFF, 0);
  1467.     }
  1468.     else
  1469.     {
  1470.         ChangeLeftSoftkey(STR_GLOBAL_ON, 0);
  1471.     }
  1472.     
  1473.     /* Change right soft key icon and label */
  1474.     ChangeRightSoftkey(STR_GLOBAL_BACK, IMG_GLOBAL_BACK);
  1475.     
  1476.     SetLeftSoftkeyFunction(PhnsetToggleDualClockState, KEY_EVENT_UP);
  1477.     SetKeyHandler(0, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
  1478.     
  1479.     /* Register function for right soft key */
  1480.     SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
  1481.     SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
  1482. }
  1483. /*****************************************************************************
  1484.  * FUNCTION
  1485.  *  HighlightPhnsetDualClockIdleScreen
  1486.  * DESCRIPTION
  1487.  *  
  1488.  * PARAMETERS
  1489.  *  void
  1490.  * RETURNS
  1491.  *  void
  1492.  *****************************************************************************/
  1493. void HintPhnsetDualClockIdleScreen(U16 index)
  1494. {
  1495.     /*----------------------------------------------------------------*/
  1496.     /* Local Variables                                                */
  1497.     /*----------------------------------------------------------------*/
  1498.     /*----------------------------------------------------------------*/
  1499.     /* Code Body                                                      */
  1500.     /*----------------------------------------------------------------*/
  1501.     if (PhnsetGetDualClockState())
  1502.     {
  1503.         g_phnset_cntx_p->curDualClockStatus = 1; 
  1504.         mmi_ucs2cpy((PS8) hintData[index], (PS8) GetString(STR_GLOBAL_ON));
  1505.     }
  1506.     else
  1507.     {
  1508.         g_phnset_cntx_p->curDualClockStatus = 0; 
  1509.         mmi_ucs2cpy((PS8) hintData[index], (PS8) GetString(STR_GLOBAL_OFF));
  1510.     }
  1511. }
  1512. /*****************************************************************************
  1513.  * FUNCTION
  1514.  *  PhnsetGetDualClockState
  1515.  * DESCRIPTION
  1516.  *    
  1517.  * PARAMETERS
  1518.  *  void
  1519.  * RETURNS
  1520.  *  current calendar screen status
  1521.  *****************************************************************************/
  1522. U8 PhnsetGetDualClockState(void)
  1523. {
  1524.     /*----------------------------------------------------------------*/
  1525.     /* Local Variables                                                */
  1526.     /*----------------------------------------------------------------*/
  1527.     
  1528.     /*----------------------------------------------------------------*/
  1529.     /* Code Body                                                      */
  1530.     /*----------------------------------------------------------------*/
  1531. #ifdef __MMI_WC_TZ_SUPPORT__    
  1532.     return g_phnset_cntx_p->curDualClockStatus;
  1533. #else
  1534. /* if not support world clock time zone user can't set foreign city and dual clock */
  1535.     return 0;
  1536. #endif
  1537. }
  1538. /*****************************************************************************
  1539.  * FUNCTION
  1540.  *  PhnsetToggleDualClockState
  1541.  * DESCRIPTION
  1542.  *  This function is Left soft key handler
  1543.  *  for Phone setup->IdleScreenDisplay-> Show Calendar IdleScreen
  1544.  * PARAMETERS
  1545.  *  void           
  1546.  * RETURNS
  1547.  *  void
  1548.  *****************************************************************************/
  1549. static void PhnsetToggleDualClockState(void)
  1550. {
  1551.     /*----------------------------------------------------------------*/
  1552.     /* Local Variables                                                */
  1553.     /*----------------------------------------------------------------*/
  1554.     U16 index;
  1555.     /*----------------------------------------------------------------*/
  1556.     /* Code Body                                                      */
  1557.     /*----------------------------------------------------------------*/
  1558.     index = (U16)GetCurrHiliteID();
  1559.     /* If Own Number Display if Off then turn it On Pressing LSK */
  1560.     if (PhnsetGetDualClockState() == 0)
  1561.     {
  1562.         g_phnset_cntx_p->curDualClockStatus = 1;
  1563.     }
  1564.     else
  1565.     {
  1566.         g_phnset_cntx_p->curDualClockStatus = 0;
  1567.     }
  1568.     /* Flag to write NVRAM in Exit Handler */
  1569.     g_phnset_cntx_p->ShowDualClockDirtyFlag = TRUE;
  1570.     if (PhnsetGetDualClockState())
  1571.     {
  1572.         mmi_ucs2cpy((PS8) hintData[index], (PS8) GetString(STR_GLOBAL_ON));
  1573.         Category52ChangeItemDescription(index, hintData[index]);
  1574.         ChangeLeftSoftkey(STR_GLOBAL_OFF, 0);
  1575.     }
  1576.     else
  1577.     {
  1578.         mmi_ucs2cpy((PS8) hintData[index], (PS8) GetString(STR_GLOBAL_OFF));
  1579.         Category52ChangeItemDescription(index, hintData[index]);
  1580.         ChangeLeftSoftkey(STR_GLOBAL_ON, 0);
  1581.     }
  1582.     RedrawCategoryFunction();
  1583.     HighlightPhnsetDualClockIdleScreen();
  1584. }
  1585. #endif /* __MMI_DUAL_CLOCK__ */
  1586. /* dual clock in idle */
  1587. /* operator home screen */
  1588. #ifdef __MMI_OP11_HOMESCREEN__
  1589. /* under construction !*/
  1590. /* under construction !*/
  1591. /* under construction !*/
  1592. /* under construction !*/
  1593. /* under construction !*/
  1594. /* under construction !*/
  1595. /* under construction !*/
  1596. /* under construction !*/
  1597. /* under construction !*/
  1598. /* under construction !*/
  1599. /* under construction !*/
  1600. /* under construction !*/
  1601. /* under construction !*/
  1602. /* under construction !*/
  1603. /* under construction !*/
  1604. /* under construction !*/
  1605. /* under construction !*/
  1606. /* under construction !*/
  1607. /* under construction !*/
  1608. /* under construction !*/
  1609. /* under construction !*/
  1610. /* under construction !*/
  1611. /* under construction !*/
  1612. /* under construction !*/
  1613. /* under construction !*/
  1614. /* under construction !*/
  1615. /* under construction !*/
  1616. /* under construction !*/
  1617. /* under construction !*/
  1618. /* under construction !*/
  1619. /* under construction !*/
  1620. /* under construction !*/
  1621. /* under construction !*/
  1622. /* under construction !*/
  1623. /* under construction !*/
  1624. /* under construction !*/
  1625. /* under construction !*/
  1626. /* under construction !*/
  1627. /* under construction !*/
  1628. /* under construction !*/
  1629. /* under construction !*/
  1630. /* under construction !*/
  1631. /* under construction !*/
  1632. /* under construction !*/
  1633. /* under construction !*/
  1634. /* under construction !*/
  1635. /* under construction !*/
  1636. /* under construction !*/
  1637. /* under construction !*/
  1638. /* under construction !*/
  1639. /* under construction !*/
  1640. /* under construction !*/
  1641. /* under construction !*/
  1642. /* under construction !*/
  1643. /* under construction !*/
  1644. /* under construction !*/
  1645. /* under construction !*/
  1646. /* under construction !*/
  1647. /* under construction !*/
  1648. /* under construction !*/
  1649. /* under construction !*/
  1650. /* under construction !*/
  1651. /* under construction !*/
  1652. /* under construction !*/
  1653. /* under construction !*/
  1654. /* under construction !*/
  1655. /* under construction !*/
  1656. /* under construction !*/
  1657. /* under construction !*/
  1658. /* under construction !*/
  1659. /* under construction !*/
  1660. /* under construction !*/
  1661. /* under construction !*/
  1662. /* under construction !*/
  1663. /* under construction !*/
  1664. /* under construction !*/
  1665. /* under construction !*/
  1666. /* under construction !*/
  1667. /* under construction !*/
  1668. /* under construction !*/
  1669. /* under construction !*/
  1670. /* under construction !*/
  1671. /* under construction !*/
  1672. /* under construction !*/
  1673. /* under construction !*/
  1674. /* under construction !*/
  1675. /* under construction !*/
  1676. /* under construction !*/
  1677. /* under construction !*/
  1678. /* under construction !*/
  1679. /* under construction !*/
  1680. /* under construction !*/
  1681. /* under construction !*/
  1682. /* under construction !*/
  1683. /* under construction !*/
  1684. /* under construction !*/
  1685. /* under construction !*/
  1686. /* under construction !*/
  1687. /* under construction !*/
  1688. /* under construction !*/
  1689. /* under construction !*/
  1690. /* under construction !*/
  1691. /* under construction !*/
  1692. /* under construction !*/
  1693. /* under construction !*/
  1694. /* under construction !*/
  1695. /* under construction !*/
  1696. /* under construction !*/
  1697. /* under construction !*/
  1698. /* under construction !*/
  1699. /* under construction !*/
  1700. /* under construction !*/
  1701. /* under construction !*/
  1702. /* under construction !*/
  1703. /* under construction !*/
  1704. /* under construction !*/
  1705. /* under construction !*/
  1706. /* under construction !*/
  1707. /* under construction !*/
  1708. /* under construction !*/
  1709. /* under construction !*/
  1710. /* under construction !*/
  1711. /* under construction !*/
  1712. /* under construction !*/
  1713. /* under construction !*/
  1714. /* under construction !*/
  1715. /* under construction !*/
  1716. /* under construction !*/
  1717. /* under construction !*/
  1718. /* under construction !*/
  1719. /* under construction !*/
  1720. /* under construction !*/
  1721. /* under construction !*/
  1722. /* under construction !*/
  1723. /* under construction !*/
  1724. /* under construction !*/
  1725. /* under construction !*/
  1726. /* under construction !*/
  1727. /* under construction !*/
  1728. /* under construction !*/
  1729. /* under construction !*/
  1730. /* under construction !*/
  1731. /* under construction !*/
  1732. /* under construction !*/
  1733. /* under construction !*/
  1734. /* under construction !*/
  1735. /* under construction !*/
  1736. /* under construction !*/
  1737. /* under construction !*/
  1738. /* under construction !*/
  1739. /* under construction !*/
  1740. /* under construction !*/
  1741. /* under construction !*/
  1742. /* under construction !*/
  1743. /* under construction !*/
  1744. /* under construction !*/
  1745. /* under construction !*/
  1746. /* under construction !*/
  1747. /* under construction !*/
  1748. /* under construction !*/
  1749. /* under construction !*/
  1750. /* under construction !*/
  1751. /* under construction !*/
  1752. /* under construction !*/
  1753. /* under construction !*/
  1754. /* under construction !*/
  1755. /* under construction !*/
  1756. /* under construction !*/
  1757. /* under construction !*/
  1758. /* under construction !*/
  1759. /* under construction !*/
  1760. /* under construction !*/
  1761. /* under construction !*/
  1762. /* under construction !*/
  1763. /* under construction !*/
  1764. /* under construction !*/
  1765. /* under construction !*/
  1766. /* under construction !*/
  1767. /* under construction !*/
  1768. /* under construction !*/
  1769. /* under construction !*/
  1770. /* under construction !*/
  1771. /* under construction !*/
  1772. /* under construction !*/
  1773. /* under construction !*/
  1774. /* under construction !*/
  1775. /* under construction !*/
  1776. /* under construction !*/
  1777. /* under construction !*/
  1778. /* under construction !*/
  1779. /* under construction !*/
  1780. /* under construction !*/
  1781. /* under construction !*/
  1782. /* under construction !*/
  1783. /* under construction !*/
  1784. /* under construction !*/
  1785. /* under construction !*/
  1786. /* under construction !*/
  1787. /* under construction !*/
  1788. /* under construction !*/
  1789. /* under construction !*/
  1790. /* under construction !*/
  1791. #endif /* __MMI_OP11_HOMESCREEN__ */
  1792. /* operator home screen */
  1793. /* operator toolbar */
  1794. #ifdef __MMI_OP12_TOOLBAR__
  1795. /*****************************************************************************
  1796.  * FUNCTION
  1797.  *  HighlightPhnsetToolBarStatus
  1798.  * DESCRIPTION
  1799.  *  high light handler for phone setup tool bar menu item
  1800.  * PARAMETERS
  1801.  *  void
  1802.  * RETURNS
  1803.  *  void
  1804.  *****************************************************************************/
  1805. void HighlightPhnsetToolBarStatus(void)
  1806. {
  1807.     /*----------------------------------------------------------------*/
  1808.     /* Local Variables                                                */
  1809.     /*----------------------------------------------------------------*/
  1810.     
  1811.     /*----------------------------------------------------------------*/
  1812.     /* Code Body                                                      */
  1813.     /*----------------------------------------------------------------*/
  1814.     ChangeLeftSoftkey(STR_GLOBAL_OK, 0);
  1815.     
  1816.     /* Change right soft key icon and label */
  1817.     ChangeRightSoftkey(STR_GLOBAL_BACK, IMG_GLOBAL_BACK);
  1818.     
  1819.     SetLeftSoftkeyFunction(mmi_tb_entry_toolbar_setting, KEY_EVENT_UP);
  1820.     SetKeyHandler(mmi_tb_entry_toolbar_setting, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
  1821.     
  1822.     /* Register function for right soft key */
  1823.     SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
  1824.     SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
  1825. }
  1826. /*****************************************************************************
  1827.  * FUNCTION
  1828.  *  HintPhnsetHomeScreenStatus
  1829.  * DESCRIPTION
  1830.  *  
  1831.  * PARAMETERS
  1832.  *  void
  1833.  * RETURNS
  1834.  *  void
  1835.  *****************************************************************************/
  1836. void HintPhnsetToolBarStatus(U16 index)
  1837. {
  1838.     /*----------------------------------------------------------------*/
  1839.     /* Local Variables                                                */
  1840.     /*----------------------------------------------------------------*/
  1841.     /*----------------------------------------------------------------*/
  1842.     /* Code Body                                                      */
  1843.     /*----------------------------------------------------------------*/
  1844.     if (mmi_tb_is_set_on())
  1845.     { 
  1846.         mmi_ucs2cpy((PS8) hintData[index], (PS8) GetString(STR_GLOBAL_ON));
  1847.     }
  1848.     else
  1849.     {
  1850.         mmi_ucs2cpy((PS8) hintData[index], (PS8) GetString(STR_GLOBAL_OFF));
  1851.     }
  1852. }
  1853. #endif /* __MMI_OP12_TOOLBAR__ */
  1854. /* operator toolbar */
  1855. /* show date and time in idle */
  1856. /*****************************************************************************
  1857.  * FUNCTION
  1858.  *  HighlightPhnsetShowDtTime
  1859.  * DESCRIPTION
  1860.  *  This function is highlight handler for Phonesetup->IdleScreenDisplay-> Show Date and Time
  1861.  *  Follow functions:
  1862.  * PARAMETERS
  1863.  *  void
  1864.  *  a(?)        [IN/OUT]        
  1865.  *  b(?)        [IN]            
  1866.  * RETURNS
  1867.  *  void
  1868.  *****************************************************************************/
  1869. void HighlightPhnsetShowDtTime(void)
  1870. {
  1871.     /*----------------------------------------------------------------*/
  1872.     /* Local Variables                                                */
  1873.     /*----------------------------------------------------------------*/
  1874.     /*----------------------------------------------------------------*/
  1875.     /* Code Body                                                      */
  1876.     /*----------------------------------------------------------------*/
  1877.     /* If Show Date Time if On Show LSK as OFF otherwise On. */
  1878.     if (g_phnset_cntx_p->curShowDtStatus)
  1879.     {
  1880.         ChangeLeftSoftkey(STR_GLOBAL_OFF, 0);
  1881.     }
  1882.     else
  1883.     {
  1884.         ChangeLeftSoftkey(STR_GLOBAL_ON, 0);
  1885.     }
  1886.     ChangeRightSoftkey(STR_GLOBAL_BACK, IMG_GLOBAL_BACK);
  1887.     SetLeftSoftkeyFunction(PhnsetToggleShowDtTime, KEY_EVENT_UP);
  1888.     SetKeyHandler(0, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
  1889.     SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
  1890.     SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
  1891. }
  1892. /*****************************************************************************
  1893.  * FUNCTION
  1894.  *  HintPhnsetShowDateTime
  1895.  * DESCRIPTION
  1896.  *  This function is hint handling function
  1897.  *  for Phonesetup -> Language
  1898.  *  Functionality:
  1899.  * PARAMETERS
  1900.  *  index       [IN]            
  1901.  *  a(?)        [IN/OUT]        
  1902.  *  b(?)        [IN]            
  1903.  * RETURNS
  1904.  *  void
  1905.  *****************************************************************************/
  1906. void HintPhnsetShowDateTime(U16 index)
  1907. {
  1908.     /*----------------------------------------------------------------*/
  1909.     /* Local Variables                                                */
  1910.     /*----------------------------------------------------------------*/
  1911.     /*----------------------------------------------------------------*/
  1912.     /* Code Body                                                      */
  1913.     /*----------------------------------------------------------------*/
  1914.     if (PhnsetGetShowDateTimeStatus())
  1915.     {
  1916.         mmi_ucs2cpy((PS8) hintData[index], (PS8) GetString(STR_GLOBAL_ON));
  1917.     }
  1918.     else
  1919.     {
  1920.         mmi_ucs2cpy((PS8) hintData[index], (PS8) GetString(STR_GLOBAL_OFF));
  1921.     }
  1922. }
  1923. /*****************************************************************************
  1924.  * FUNCTION
  1925.  *  PhnsetToggleShowDtTime
  1926.  * DESCRIPTION
  1927.  *  This function is Left softkey handler
  1928.  *  for Phonesetup->IdleScreenDisplay-> Show Date and Time
  1929.  * PARAMETERS
  1930.  *  void
  1931.  *  a(?)        [IN/OUT]        
  1932.  *  b(?)        [IN]            
  1933.  * RETURNS
  1934.  *  void
  1935.  *****************************************************************************/
  1936. static void PhnsetToggleShowDtTime(void)
  1937. {
  1938.     /*----------------------------------------------------------------*/
  1939.     /* Local Variables                                                */
  1940.     /*----------------------------------------------------------------*/
  1941.     U16 index;
  1942.     /*----------------------------------------------------------------*/
  1943.     /* Code Body                                                      */
  1944.     /*----------------------------------------------------------------*/
  1945.     index = GetCurrHiliteID();
  1946.     /* if show date time is on change it off */
  1947.     if (g_phnset_cntx_p->curShowDtStatus)
  1948.     {
  1949.         g_phnset_cntx_p->curShowDtStatus = 0;
  1950.     }
  1951.     /* else change it on */
  1952.     else
  1953.     {
  1954.         g_phnset_cntx_p->curShowDtStatus = 1;
  1955.     }
  1956.     /* Flag to Indicate Value is changed, will be used on exit Handler of menu */
  1957.     g_phnset_cntx_p->ShowDtDirtyFlag = TRUE;
  1958.     if (g_phnset_cntx_p->curShowDtStatus)
  1959.     {
  1960.         mmi_ucs2cpy((PS8) hintData[index], (PS8) GetString(STR_GLOBAL_ON));
  1961.         Category52ChangeItemDescription(index, hintData[index]);
  1962.         ChangeLeftSoftkey(STR_GLOBAL_OFF, 0);
  1963.     }
  1964.     else
  1965.     {
  1966.         mmi_ucs2cpy((PS8) hintData[index], (PS8) GetString(STR_GLOBAL_OFF));
  1967.         Category52ChangeItemDescription(index, hintData[index]);
  1968.         ChangeLeftSoftkey(STR_GLOBAL_ON, 0);
  1969.     }
  1970.     /* Redraw the Category Screen As Hint Handler and LSK are going to Change */
  1971.     RedrawCategoryFunction();
  1972.     /* After redraw hight the ShowDateTime */
  1973.     HighlightPhnsetShowDtTime();
  1974. }
  1975. /*****************************************************************************
  1976.  * FUNCTION
  1977.  *  PhnsetSetShowDTStatus
  1978.  * DESCRIPTION
  1979.  *  This function is to set show data time statu on/off
  1980.  *  Follow functions:
  1981.  * PARAMETERS
  1982.  *  status      [IN]            
  1983.  *  a(?)        [IN/OUT]        
  1984.  *  b(?)        [IN]            
  1985.  * RETURNS
  1986.  *  void
  1987.  *****************************************************************************/
  1988. void PhnsetSetShowDTStatus(U8 status)
  1989. {
  1990.     /*----------------------------------------------------------------*/
  1991.     /* Local Variables                                                */
  1992.     /*----------------------------------------------------------------*/
  1993.     /*----------------------------------------------------------------*/
  1994.     /* Code Body                                                      */
  1995.     /*----------------------------------------------------------------*/
  1996.     g_phnset_cntx_p->curShowDtStatus = status;
  1997. }
  1998. /*****************************************************************************
  1999.  * FUNCTION
  2000.  *  PhnsetGetShowDateTimeStatus
  2001.  * DESCRIPTION
  2002.  *  This function is to get show date/time on/off status
  2003.  *  Functionality:
  2004.  * PARAMETERS
  2005.  *  void
  2006.  *  a(?)        [IN/OUT]        
  2007.  *  b(?)        [IN]            
  2008.  * RETURNS
  2009.  *  void
  2010.  *****************************************************************************/
  2011. MMI_BOOL PhnsetGetShowDateTimeStatus(void)
  2012. {
  2013.     /*----------------------------------------------------------------*/
  2014.     /* Local Variables                                                */
  2015.     /*----------------------------------------------------------------*/
  2016.     U8 data = 0;
  2017.     S16 error;
  2018.     /*----------------------------------------------------------------*/
  2019.     /* Code Body                                                      */
  2020.     /*----------------------------------------------------------------*/
  2021.     ReadValue(NVRAM_SETTING_STATUS_DT_TIME, &data, DS_BYTE, &error);
  2022.     if (data == 0)
  2023.     {
  2024.         return MMI_FALSE;
  2025.     }
  2026.     else
  2027.     {
  2028.         return MMI_TRUE;
  2029.     }
  2030. }
  2031. /* show date and time in idle */
  2032. /* show owner number in idle */
  2033. /*****************************************************************************
  2034.  * FUNCTION
  2035.  *  HighlightPhnsetShowOwnNo
  2036.  * DESCRIPTION
  2037.  *  This function is highlight handler for Phonesetup->IdleScreenDisplay->Show Owner Number
  2038.  *  Follow functions:
  2039.  * PARAMETERS
  2040.  *  void           
  2041.  * RETURNS
  2042.  *  void
  2043.  *****************************************************************************/
  2044. void HighlightPhnsetShowOwnNo(void)
  2045. {
  2046.     /*----------------------------------------------------------------*/
  2047.     /* Local Variables                                                */
  2048.     /*----------------------------------------------------------------*/
  2049.     /*----------------------------------------------------------------*/
  2050.     /* Code Body                                                      */
  2051.     /*----------------------------------------------------------------*/
  2052.     /* If Owner Number Is On Change The LSK to OFF otherwise ON. */
  2053.     if (g_phnset_cntx_p->curShowOwnNumStatus == 1)
  2054.     {
  2055.         ChangeLeftSoftkey(STR_GLOBAL_OFF, 0);
  2056.     }
  2057.     else
  2058.     {
  2059.         ChangeLeftSoftkey(STR_GLOBAL_ON, 0);
  2060.     }
  2061.     /* Change right soft key icon and label */
  2062.     ChangeRightSoftkey(STR_GLOBAL_BACK, IMG_GLOBAL_BACK);
  2063.     SetLeftSoftkeyFunction(PhnsetToggleShowOwnNo, KEY_EVENT_UP);
  2064.     SetKeyHandler(0, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
  2065.     /* Register function for right soft key */
  2066.     SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
  2067.     SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
  2068. }
  2069. /*****************************************************************************
  2070.  * FUNCTION
  2071.  *  HintPhnsetOwnerNum
  2072.  * DESCRIPTION
  2073.  *  This function is hint handling function
  2074.  *  for Phonesetup -> Language
  2075.  *  Functionality:
  2076.  * PARAMETERS
  2077.  *  index       [IN]            
  2078.  *  a(?)        [IN/OUT]        
  2079.  *  b(?)        [IN]            
  2080.  * RETURNS
  2081.  *  void
  2082.  *****************************************************************************/
  2083. void HintPhnsetOwnerNum(U16 index)
  2084. {
  2085.     /*----------------------------------------------------------------*/
  2086.     /* Local Variables                                                */
  2087.     /*----------------------------------------------------------------*/
  2088.     /*----------------------------------------------------------------*/
  2089.     /* Code Body                                                      */
  2090.     /*----------------------------------------------------------------*/
  2091.     if (PhnsetGetShowOwnerNumStatus())
  2092.     {
  2093.         g_phnset_cntx_p->curShowOwnNumStatus = 1;
  2094.         mmi_ucs2cpy((PS8) hintData[index], (PS8) GetString(STR_GLOBAL_ON));
  2095.     }
  2096.     else
  2097.     {
  2098.         g_phnset_cntx_p->curShowOwnNumStatus = 0;
  2099.         mmi_ucs2cpy((PS8) hintData[index], (PS8) GetString(STR_GLOBAL_OFF));
  2100.     }
  2101. }
  2102. /*****************************************************************************
  2103.  * FUNCTION
  2104.  *  PhnsetToggleShowOwnNo
  2105.  * DESCRIPTION
  2106.  *  This function is Left soft key handler
  2107.  *  for Phone setup-> Display-> Show owner number
  2108.  * PARAMETERS
  2109.  *  void        
  2110.  * RETURNS
  2111.  *  void
  2112.  *****************************************************************************/
  2113. static void PhnsetToggleShowOwnNo(void)
  2114. {
  2115.     /*----------------------------------------------------------------*/
  2116.     /* Local Variables                                                */
  2117.     /*----------------------------------------------------------------*/
  2118.     U16 index;
  2119.     /*----------------------------------------------------------------*/
  2120.     /* Code Body                                                      */
  2121.     /*----------------------------------------------------------------*/
  2122.     index = GetCurrHiliteID();
  2123.     if (g_phnset_cntx_p->curShowOwnNumStatus == 0)
  2124.     {
  2125.         g_phnset_cntx_p->curShowOwnNumStatus = 1;
  2126.     }
  2127.     else
  2128.     {
  2129.         g_phnset_cntx_p->curShowOwnNumStatus = 0;
  2130.     }
  2131.     /* Flag to write NVRAM in Exit Handler */
  2132.     g_phnset_cntx_p->ShowOwnNumDirtyFlag = TRUE;
  2133.     if (g_phnset_cntx_p->curShowOwnNumStatus)
  2134.     {
  2135.         mmi_ucs2cpy((PS8) hintData[index], (PS8) GetString(STR_GLOBAL_ON));
  2136.         Category52ChangeItemDescription(index, hintData[index]);
  2137.         ChangeLeftSoftkey(STR_GLOBAL_OFF, 0);
  2138.     }
  2139.     else
  2140.     {
  2141.         mmi_ucs2cpy((PS8) hintData[index], (PS8) GetString(STR_GLOBAL_OFF));
  2142.         Category52ChangeItemDescription(index, hintData[index]);
  2143.         ChangeLeftSoftkey(STR_GLOBAL_ON, 0);
  2144.     }
  2145.     RedrawCategoryFunction();
  2146.     HighlightPhnsetShowOwnNo();
  2147. }
  2148. /*****************************************************************************
  2149.  * FUNCTION
  2150.  *  PhnsetGetShowOwnerNumStatus
  2151.  * DESCRIPTION
  2152.  *  This function is to get show owner number on/off status
  2153.  *  Functionality:
  2154.  * PARAMETERS
  2155.  *  void
  2156.  *  a(?)        [IN/OUT]        
  2157.  *  b(?)        [IN]            
  2158.  * RETURNS
  2159.  *  void
  2160.  *****************************************************************************/
  2161. MMI_BOOL PhnsetGetShowOwnerNumStatus(void)
  2162. {
  2163.     /*----------------------------------------------------------------*/
  2164.     /* Local Variables                                                */
  2165.     /*----------------------------------------------------------------*/
  2166.     U8 data = 0;
  2167.     S16 error;
  2168.     /*----------------------------------------------------------------*/
  2169.     /* Code Body                                                      */
  2170.     /*----------------------------------------------------------------*/
  2171.     ReadValue(NVRAM_SETTING_OWNER_NO, &data, DS_BYTE, &error);
  2172.     if (data == 1)
  2173.     {
  2174.         return MMI_TRUE;
  2175.     }
  2176.     else
  2177.     {
  2178.         return MMI_FALSE;
  2179.     }
  2180. }
  2181. /* show owner number in idle */
  2182. /* show operator name in idle */
  2183. #ifdef __MMI_OPERATOR_NAME_MENU__
  2184. /*****************************************************************************
  2185.  * FUNCTION
  2186.  *  HighlightPhnsetShowOPN
  2187.  * DESCRIPTION
  2188.  *  This function is highlight handler for Phonesetup->IdleScreenDisplay->Show Operator Name
  2189.  *  Follow functions:
  2190.  * PARAMETERS
  2191.  *  void
  2192.  *  a(?)        [IN/OUT]        
  2193.  *  b(?)        [IN]            
  2194.  * RETURNS
  2195.  *  void
  2196.  *****************************************************************************/
  2197. void HighlightPhnsetShowOPN(void)
  2198. {
  2199.     /*----------------------------------------------------------------*/
  2200.     /* Local Variables                                                */
  2201.     /*----------------------------------------------------------------*/
  2202.     /*----------------------------------------------------------------*/
  2203.     /* Code Body                                                      */
  2204.     /*----------------------------------------------------------------*/
  2205.     if (g_phnset_cntx_p->curShowOPNStatus == 1)
  2206.     {
  2207.         ChangeLeftSoftkey(STR_GLOBAL_OFF, 0);
  2208.     }
  2209.     else
  2210.     {
  2211.         ChangeLeftSoftkey(STR_GLOBAL_ON, 0);
  2212.     }
  2213.     /* Change right soft key icon and label */
  2214.     ChangeRightSoftkey(STR_GLOBAL_BACK, IMG_GLOBAL_BACK);
  2215.     SetLeftSoftkeyFunction(PhnsetToggleShowOPN, KEY_EVENT_UP);
  2216.     SetKeyHandler(0, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
  2217.     /* Register function for right soft key */
  2218.     SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
  2219.     SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
  2220. }
  2221. /*****************************************************************************
  2222.  * FUNCTION
  2223.  *  HintPhnsetOPN
  2224.  * DESCRIPTION
  2225.  *  This function is hint handling function
  2226.  *  for Phonesetup -> Language
  2227.  *  Functionality:
  2228.  * PARAMETERS
  2229.  *  index       [IN]            
  2230.  *  a(?)        [IN/OUT]        
  2231.  *  b(?)        [IN]            
  2232.  * RETURNS
  2233.  *  void
  2234.  *****************************************************************************/
  2235. void HintPhnsetOPN(U16 index)
  2236. {
  2237.     /*----------------------------------------------------------------*/
  2238.     /* Local Variables                                                */
  2239.     /*----------------------------------------------------------------*/
  2240.     /*----------------------------------------------------------------*/
  2241.     /* Code Body                                                      */
  2242.     /*----------------------------------------------------------------*/
  2243.     if (PhnsetGetShowOPNStatus())
  2244.     {
  2245.         g_phnset_cntx_p->curShowOPNStatus = 1;
  2246.         mmi_ucs2cpy((PS8) hintData[index], (PS8) GetString(STR_GLOBAL_ON));
  2247.     }
  2248.     else
  2249.     {
  2250.         g_phnset_cntx_p->curShowOPNStatus = 0;
  2251.         mmi_ucs2cpy((PS8) hintData[index], (PS8) GetString(STR_GLOBAL_OFF));
  2252.     }
  2253. }
  2254. /*****************************************************************************
  2255.  * FUNCTION
  2256.  *  PhnsetToggleShowOPN
  2257.  * DESCRIPTION
  2258.  *  This function is Left softkey handler
  2259.  *  for Phonesetup->IdleScreenDisplay-> Show Operator Name
  2260.  * PARAMETERS
  2261.  *  void
  2262.  *  a(?)        [IN/OUT]        
  2263.  *  b(?)        [IN]            
  2264.  * RETURNS
  2265.  *  void
  2266.  *****************************************************************************/
  2267. static void PhnsetToggleShowOPN(void)
  2268. {
  2269.     /*----------------------------------------------------------------*/
  2270.     /* Local Variables                                                */
  2271.     /*----------------------------------------------------------------*/
  2272.     U16 index;
  2273.     /*----------------------------------------------------------------*/
  2274.     /* Code Body                                                      */
  2275.     /*----------------------------------------------------------------*/
  2276.     index = GetCurrHiliteID();
  2277.     if (g_phnset_cntx_p->curShowOPNStatus == 0)
  2278.     {
  2279.         g_phnset_cntx_p->curShowOPNStatus = 1;
  2280.     }
  2281.     else
  2282.     {
  2283.         g_phnset_cntx_p->curShowOPNStatus = 0;
  2284.     }
  2285.     /* Flag to write NVRAM in Exit Handler */
  2286.     g_phnset_cntx_p->ShowOPNDirtyFlag = TRUE;
  2287.     if (g_phnset_cntx_p->curShowOPNStatus)
  2288.     {
  2289.         mmi_ucs2cpy((PS8) hintData[index], (PS8) GetString(STR_GLOBAL_ON));
  2290.         Category52ChangeItemDescription(index, hintData[index]);
  2291.         ChangeLeftSoftkey(STR_GLOBAL_OFF, 0);
  2292.     }
  2293.     else
  2294.     {
  2295.         mmi_ucs2cpy((PS8) hintData[index], (PS8) GetString(STR_GLOBAL_OFF));
  2296.         Category52ChangeItemDescription(index, hintData[index]);
  2297.         ChangeLeftSoftkey(STR_GLOBAL_ON, 0);
  2298.     }
  2299.     RedrawCategoryFunction();
  2300.     HighlightPhnsetShowOPN();
  2301. }
  2302. /*****************************************************************************
  2303.  * FUNCTION
  2304.  *  PhnsetGetShowOPNStatus
  2305.  * DESCRIPTION
  2306.  *  This function is to get show owner number on/off status
  2307.  *  Functionality:
  2308.  * PARAMETERS
  2309.  *  void
  2310.  *  a(?)        [IN/OUT]        
  2311.  *  b(?)        [IN]            
  2312.  * RETURNS
  2313.  *  void
  2314.  *****************************************************************************/
  2315. MMI_BOOL PhnsetGetShowOPNStatus(void)
  2316. {
  2317.     /*----------------------------------------------------------------*/
  2318.     /* Local Variables                                                */
  2319.     /*----------------------------------------------------------------*/
  2320.     U8 data = 0;
  2321.     S16 error;
  2322.     /*----------------------------------------------------------------*/
  2323.     /* Code Body                                                      */
  2324.     /*----------------------------------------------------------------*/
  2325.     ReadValue(NVRAM_SETTING_OPN_DISPLAY, &data, DS_BYTE, &error);
  2326.     if (data == 0)
  2327.     {
  2328.         return MMI_FALSE;
  2329.     }
  2330.     else
  2331.     {
  2332.         return MMI_TRUE;
  2333.     }
  2334. }
  2335. #endif /* __MMI_OPERATOR_NAME_MENU__ */ 
  2336. /* show operator name in idle */
  2337. /* clock type in idle */
  2338. #ifdef __MMI_UI_TECHNO_IDLESCREEN_BAR__
  2339. /*****************************************************************************
  2340.  * FUNCTION
  2341.  *  PhnsetReadIdleClockType
  2342.  * DESCRIPTION
  2343.  *  
  2344.  * PARAMETERS
  2345.  *  void
  2346.  * RETURNS
  2347.  *  void
  2348.  *****************************************************************************/
  2349. void PhnsetReadIdleClockType(void)
  2350. {
  2351.     /*----------------------------------------------------------------*/
  2352.     /* Local Variables                                                */
  2353.     /*----------------------------------------------------------------*/
  2354.     S16 error;
  2355.     /*----------------------------------------------------------------*/
  2356.     /* Code Body                                                      */
  2357.     /*----------------------------------------------------------------*/
  2358.     ReadValue(NVRAM_PHNSET_IDLE_CLOCK_TYPE, &(g_phnset_cntx_p->curtCLKType), DS_BYTE, &error);
  2359.     if (g_phnset_cntx_p->curtCLKType > 1)
  2360.     {
  2361.      /* different default value for HVGA Main LCD modify */
  2362. #ifdef __MMI_MAINLCD_320X480__ 
  2363.         g_phnset_cntx_p->curtCLKType = 1; 
  2364. #else
  2365.         g_phnset_cntx_p->curtCLKType = 1;       // 0;       modified by licjd
  2366. #endif /* __MMI_MAINLCD_320X480__ */
  2367.         WriteValue(NVRAM_PHNSET_IDLE_CLOCK_TYPE, &(g_phnset_cntx_p->curtCLKType), DS_BYTE, &error);
  2368.     }
  2369.     wgui_set_clock_type((U8) g_phnset_cntx_p->curtCLKType);
  2370. }
  2371. /*****************************************************************************
  2372.  * FUNCTION
  2373.  *  HintPhnsetIdleClockType
  2374.  * DESCRIPTION
  2375.  *  
  2376.  * PARAMETERS
  2377.  *  index       [IN]        
  2378.  * RETURNS
  2379.  *  void
  2380.  *****************************************************************************/
  2381. void HintPhnsetIdleClockType(U16 index)
  2382. {
  2383.     /*----------------------------------------------------------------*/
  2384.     /* Local Variables                                                */
  2385.     /*----------------------------------------------------------------*/
  2386.     /*----------------------------------------------------------------*/
  2387.     /* Code Body                                                      */
  2388.     /*----------------------------------------------------------------*/
  2389.     switch (g_phnset_cntx_p->curtCLKType)
  2390.     {
  2391.             /* 
  2392.              * case MMI_PHNSET_IDLECLKTYPE_NONE:
  2393.              * mmi_ucs2cpy((PS8)hintData[index],(PS8)GetString(STR_GLOBAL_NONE));
  2394.              * break;            
  2395.              */
  2396.         case MMI_PHNSET_IDLECLKTYPE_DIGITAL:
  2397.             mmi_ucs2cpy((PS8) hintData[index], (PS8) GetString(STR_ID_PHNSET_DISPCHAR_DIGITAL));
  2398.             break;
  2399.         case MMI_PHNSET_IDLECLKTYPE_ANALOG:
  2400.             mmi_ucs2cpy((PS8) hintData[index], (PS8) GetString(STR_ID_PHNSET_DISPCHAR_ANALOG));
  2401.             break;
  2402.         default:
  2403.             MMI_ASSERT(0);
  2404.     }
  2405. }
  2406. /*****************************************************************************
  2407.  * FUNCTION
  2408.  *  PhnsetIdleClockType
  2409.  * DESCRIPTION
  2410.  *  
  2411.  * PARAMETERS
  2412.  *  void
  2413.  * RETURNS
  2414.  *  void
  2415.  *****************************************************************************/
  2416. void PhnsetIdleClockType(void)
  2417. {
  2418.     /*----------------------------------------------------------------*/
  2419.     /* Local Variables                                                */
  2420.     /*----------------------------------------------------------------*/
  2421.     S16 error;
  2422.     /*----------------------------------------------------------------*/
  2423.     /* Code Body                                                      */
  2424.     /*----------------------------------------------------------------*/
  2425.     g_phnset_cntx_p->curtCLKType = (U8)GetHighlightedItem();
  2426.     WriteValue(NVRAM_PHNSET_IDLE_CLOCK_TYPE, &(g_phnset_cntx_p->curtCLKType), DS_BYTE, &error);
  2427.     wgui_set_clock_type((U8) g_phnset_cntx_p->curtCLKType);
  2428.     g_phnset_cntx_p->isCorrectSet = 1;
  2429.     mmi_display_popup((UI_string_type) GetString(STR_GLOBAL_DONE), MMI_EVENT_SUCCESS);
  2430. }
  2431. /*****************************************************************************
  2432.  * FUNCTION
  2433.  *  ExitPhnsetIdleClockType
  2434.  * DESCRIPTION
  2435.  *  
  2436.  * PARAMETERS
  2437.  *  void
  2438.  * RETURNS
  2439.  *  void
  2440.  *****************************************************************************/
  2441. static void ExitPhnsetIdleClockType(void)
  2442. {
  2443.     /*----------------------------------------------------------------*/
  2444.     /* Local Variables                                                */
  2445.     /*----------------------------------------------------------------*/
  2446.     /*----------------------------------------------------------------*/
  2447.     /* Code Body                                                      */
  2448.     /*----------------------------------------------------------------*/
  2449.     if (g_phnset_cntx_p->isCorrectSet)
  2450.     {
  2451.         DeleteUptoScrID(SCR_IDLE_SCR_DISP);
  2452.     }
  2453. }
  2454. /*****************************************************************************
  2455.  * FUNCTION
  2456.  *  EntryPhnsetIdleClockType
  2457.  * DESCRIPTION
  2458.  *  
  2459.  * PARAMETERS
  2460.  *  void
  2461.  * RETURNS
  2462.  *  void
  2463.  *****************************************************************************/
  2464. static void EntryPhnsetIdleClockType(void)
  2465. {
  2466.     /*----------------------------------------------------------------*/
  2467.     /* Local Variables                                                */
  2468.     /*----------------------------------------------------------------*/
  2469.     U8 *pGuiBuffer;
  2470.     /*----------------------------------------------------------------*/
  2471.     /* Code Body                                                      */
  2472.     /*----------------------------------------------------------------*/
  2473.     EntryNewScreen(SCR_ID_PHNSET_IDLE_CLOCK_TYPE, ExitPhnsetIdleClockType, EntryPhnsetIdleClockType, NULL);
  2474.     g_phnset_cntx_p->isCorrectSet = 0;
  2475.     pGuiBuffer = GetCurrGuiBuffer(SCR_ID_PHNSET_IDLE_CLOCK_TYPE);
  2476.     /*
  2477.      * subMenuDataPtrs[MMI_PHNSET_IDLECLKTYPE_NONE] = (PU8)GetString( STR_GLOBAL_NONE );;
  2478.      */
  2479.     subMenuDataPtrs[MMI_PHNSET_IDLECLKTYPE_ANALOG] = (PU8) GetString(STR_ID_PHNSET_DISPCHAR_ANALOG);
  2480.     subMenuDataPtrs[MMI_PHNSET_IDLECLKTYPE_DIGITAL] = (PU8) GetString(STR_ID_PHNSET_DISPCHAR_DIGITAL);
  2481.     if (g_phnset_cntx_p->curtCLKType > 1)
  2482.     {
  2483.         PhnsetReadIdleClockType();  /* __USB_IN_NORMAL_MODE__ */
  2484.     }
  2485.     ShowCategory36Screen(
  2486.         STR_ID_IDLE_CLOCK_TYPE,
  2487.         MAIN_MENU_TITLE_SETTINGS_ICON,
  2488.         STR_GLOBAL_OK,
  2489.         IMG_GLOBAL_OK,
  2490.         STR_GLOBAL_BACK,
  2491.         IMG_GLOBAL_BACK,
  2492.         MMI_PHNSET_IDLECLKTYPE_MAX,
  2493.         (U8 **) subMenuDataPtrs,
  2494.         g_phnset_cntx_p->curtCLKType,
  2495.         pGuiBuffer);
  2496.     SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
  2497.     SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
  2498.     SetLeftSoftkeyFunction(PhnsetIdleClockType, KEY_EVENT_UP);
  2499.     SetKeyHandler(0, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
  2500. }
  2501. /*****************************************************************************
  2502.  * FUNCTION
  2503.  *  HighlightPhnsetIdleClockType
  2504.  * DESCRIPTION
  2505.  *  
  2506.  * PARAMETERS
  2507.  *  void
  2508.  * RETURNS
  2509.  *  void
  2510.  *****************************************************************************/
  2511. void HighlightPhnsetIdleClockType(void)
  2512. {
  2513.     /*----------------------------------------------------------------*/
  2514.     /* Local Variables                                                */
  2515.     /*----------------------------------------------------------------*/
  2516.     /*----------------------------------------------------------------*/
  2517.     /* Code Body                                                      */
  2518.     /*----------------------------------------------------------------*/
  2519.     ChangeLeftSoftkey(STR_GLOBAL_OK, 0);
  2520.     ChangeRightSoftkey(STR_GLOBAL_BACK, 0);
  2521.     SetLeftSoftkeyFunction(EntryPhnsetIdleClockType, KEY_EVENT_UP);
  2522.     SetKeyHandler(EntryPhnsetIdleClockType, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
  2523.     SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
  2524.     SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
  2525. }
  2526. #endif /* defined(__MMI_UI_TECHNO_IDLESCREEN_BAR__) */ 
  2527. /* clock type in idle */
  2528. /* screen switch effect */
  2529. #ifdef __MMI_SCREEN_SWITCH_EFFECT__
  2530. /*****************************************************************************
  2531.  * FUNCTION
  2532.  *  HighlightPhnsetScreenSwitchEffectStatus
  2533.  * DESCRIPTION
  2534.  *  
  2535.  * PARAMETERS
  2536.  *  void
  2537.  * RETURNS
  2538.  *  void
  2539.  *****************************************************************************/
  2540. void HighlightPhnsetScreenSwitchEffectStatus(void)
  2541. {
  2542.     /*----------------------------------------------------------------*/
  2543.     /* Local Variables                                                */
  2544.     /*----------------------------------------------------------------*/
  2545.     
  2546.     /*----------------------------------------------------------------*/
  2547.     /* Code Body                                                      */
  2548.     /*----------------------------------------------------------------*/    
  2549.     ChangeLeftSoftkey(STR_GLOBAL_OK, IMG_GLOBAL_OK);
  2550.     ChangeRightSoftkey(STR_GLOBAL_BACK, IMG_GLOBAL_BACK);
  2551.     SetLeftSoftkeyFunction(EntryPhnsetScreenSwitchEffectScreen, KEY_EVENT_UP);
  2552.     SetKeyHandler(EntryPhnsetScreenSwitchEffectScreen, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
  2553.     SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
  2554.     SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
  2555. }
  2556. /*****************************************************************************
  2557.  * FUNCTION
  2558.  *  HintPhnsetScreenSwitchEffectStatus
  2559.  * DESCRIPTION
  2560.  *  
  2561.  * PARAMETERS
  2562.  *  void
  2563.  * RETURNS
  2564.  *  void
  2565.  *****************************************************************************/
  2566. void HintPhnsetScreenSwitchEffectStatus(U16 index)
  2567. {
  2568.     /*----------------------------------------------------------------*/
  2569.     /* Local Variables                                                */
  2570.     /*----------------------------------------------------------------*/
  2571. mmi_phnset_sse_status_enum ss_status = 0;
  2572.     /*----------------------------------------------------------------*/
  2573.     /* Code Body                                                      */
  2574.     /*----------------------------------------------------------------*/
  2575.     ss_status = PhnsetGetScreenSwitchEffectStatus();
  2576. switch(ss_status)
  2577. {
  2578. case MMI_PHNSET_SSE_NONE:
  2579. mmi_ucs2cpy((PS8) hintData[index], (PS8) GetString(STR_GLOBAL_NONE));
  2580. break;
  2581. case MMI_PHNSET_SSE_SIMPLE:
  2582. mmi_ucs2cpy((PS8) hintData[index], (PS8) GetString(STR_ID_PHNSET_SSE_SIMPLE));
  2583. break;
  2584. case MMI_PHNSET_SSE_FULL:
  2585. mmi_ucs2cpy((PS8) hintData[index], (PS8) GetString(STR_ID_PHNSET_SSE_FULL));
  2586.     break;
  2587. default:
  2588.     break;
  2589. }
  2590.     
  2591. }
  2592. /*****************************************************************************
  2593.  * FUNCTION
  2594.  *  PhnsetGetScreenSwitchEffectStatus
  2595.  * DESCRIPTION
  2596.  *    
  2597.  * PARAMETERS
  2598.  *  void
  2599.  * RETURNS
  2600.  *  current screen switch effect status
  2601.  *****************************************************************************/
  2602. mmi_phnset_sse_status_enum PhnsetGetScreenSwitchEffectStatus(void)
  2603. {
  2604.     /*----------------------------------------------------------------*/
  2605.     /* Local Variables                                                */
  2606.     /*----------------------------------------------------------------*/
  2607.     /*----------------------------------------------------------------*/
  2608.     /* Code Body                                                      */
  2609.     /*----------------------------------------------------------------*/
  2610. return g_phnset_cntx_p->curScrSwitchEffect;
  2611. }
  2612. /*****************************************************************************
  2613.  * FUNCTION
  2614.  *  PhnsetScreenSwitchEffectHandler
  2615.  * DESCRIPTION
  2616.  *  set LSK of screen switch effect screen
  2617.  * PARAMETERS
  2618.  *  void
  2619.  * RETURNS
  2620.  *  void
  2621.  *****************************************************************************/
  2622. static void PhnsetScreenSwitchEffectHandler(void)
  2623. {
  2624.     /*----------------------------------------------------------------*/
  2625.     /* Local Variables                                                */
  2626.     /*----------------------------------------------------------------*/
  2627. mmi_phnset_sse_status_enum status = 0;
  2628.     /*----------------------------------------------------------------*/
  2629.     /* Code Body                                                      */
  2630.     /*----------------------------------------------------------------*/
  2631. status = (mmi_phnset_sse_status_enum)GetHighlightedItem();
  2632. PhnsetSetScreenSwitchEffectStatus(status);
  2633. mmi_display_popup((UI_string_type) GetString(STR_GLOBAL_DONE), MMI_EVENT_SUCCESS);
  2634. DeleteScreenIfPresent(SCR_ID_PHNSET_SCREENSWITCH_SCREEN);
  2635. }
  2636. /*****************************************************************************
  2637.  * FUNCTION
  2638.  *  EntryPhnsetScreenSwitchEffectScreen
  2639.  * DESCRIPTION
  2640.  *  This function is Left soft key handler for Phone setup->IdleScreenDisplay-> Screen Switch Effect
  2641.  * PARAMETERS
  2642.  *  void           
  2643.  * RETURNS
  2644.  *  void
  2645.  *****************************************************************************/
  2646. static void EntryPhnsetScreenSwitchEffectScreen(void)
  2647. {
  2648.     /*----------------------------------------------------------------*/
  2649.     /* Local Variables                                                */
  2650.     /*----------------------------------------------------------------*/
  2651.     U8 *guiBuffer;                      /* Buffer holding history data */
  2652. U16 nStrItemList[3] = {STR_GLOBAL_NONE, STR_ID_PHNSET_SSE_SIMPLE, STR_ID_PHNSET_SSE_FULL};
  2653.     /*----------------------------------------------------------------*/
  2654.     /* Code Body                                                      */
  2655.     /*----------------------------------------------------------------*/
  2656.     EntryNewScreen(SCR_ID_PHNSET_SCREENSWITCH_SCREEN, NULL, EntryPhnsetScreenSwitchEffectScreen, NULL);
  2657.     guiBuffer = GetCurrGuiBuffer(SCR_ID_PHNSET_SCREENSWITCH_SCREEN);
  2658. SetParentHandler(MENU_ID_PHNSET_SCRSWITCH_EFFECT);
  2659.     ShowCategory11Screen(STR_ID_PHNSET_SCREEN_SWITCH_EFFECT,
  2660. MAIN_MENU_TITLE_SETTINGS_ICON,
  2661. STR_GLOBAL_OK, 
  2662. IMG_GLOBAL_OK, 
  2663. STR_GLOBAL_BACK, 
  2664. IMG_GLOBAL_BACK, 
  2665. MMI_PHNSET_SSE_NUM, 
  2666. nStrItemList,
  2667. (U16)g_phnset_cntx_p->curScrSwitchEffect,
  2668. guiBuffer);
  2669.     /* 10.Register function with soft key */
  2670.     SetLeftSoftkeyFunction(PhnsetScreenSwitchEffectHandler, KEY_EVENT_UP);
  2671.     SetKeyHandler(NULL, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
  2672.     SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
  2673.     SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
  2674. }
  2675. /*****************************************************************************
  2676.  * FUNCTION
  2677.  *  PhnsetSetScreenSwitchEffectStatus
  2678.  * DESCRIPTION
  2679.  *  Set current ScreenSwitchEffect Status
  2680.  * PARAMETERS
  2681.  *  MMI_BOOL
  2682.  * RETURNS
  2683.  *  void
  2684.  *****************************************************************************/
  2685. void PhnsetSetScreenSwitchEffectStatus(mmi_phnset_sse_status_enum status)
  2686. {
  2687.     /*----------------------------------------------------------------*/
  2688.     /* Local Variables                                                */
  2689.     /*----------------------------------------------------------------*/
  2690.     S16 error;
  2691.     /*----------------------------------------------------------------*/
  2692.     /* Code Body                                                      */
  2693.     /*----------------------------------------------------------------*/
  2694.     g_phnset_cntx_p->curScrSwitchEffect = status;
  2695.     WriteValue(NVRAM_SET_SCREFFECT_STYLE, &(g_phnset_cntx_p->curScrSwitchEffect), DS_BYTE, &error);
  2696. }
  2697. #endif /* __MMI_SCREEN_SWITCH_EFFECT__ */
  2698. /* screen switch effect */
  2699. #ifdef __MMI_FREETYPE_SETTING_SUPPORT__
  2700. extern void gui_freetype_set_size(U8 size);
  2701. extern MMI_theme **MMI_themes;
  2702. mmi_phnset_freetype_status_enum PhnsetGetFreeTypeSetting(void)
  2703. {
  2704.     /*----------------------------------------------------------------*/
  2705.     /* Local Variables                                                */
  2706.     /*----------------------------------------------------------------*/
  2707.     U8 data = 0;
  2708.     S16 error;
  2709.     /*----------------------------------------------------------------*/
  2710.     /* Code Body                                                      */
  2711.     /*----------------------------------------------------------------*/
  2712.     ReadValue(NVRAM_FREETYPE_SETTING, &data, DS_BYTE, &error);
  2713.     if (data == 0xff)
  2714.     {
  2715.         data = 1;
  2716.         WriteValue(NVRAM_FREETYPE_SETTING, &data, DS_BYTE, &error);
  2717.     }
  2718.     return (mmi_phnset_freetype_status_enum) (data);
  2719. }
  2720. static void PhnsetFreeTypeSettingHandler(void)
  2721. {
  2722.     /*----------------------------------------------------------------*/
  2723.     /* Local Variables                                                */
  2724.     /*----------------------------------------------------------------*/
  2725.     mmi_phnset_freetype_status_enum status = 0;
  2726.     S16 error;
  2727.     /*----------------------------------------------------------------*/
  2728.     /* Code Body                                                      */
  2729.     /*----------------------------------------------------------------*/
  2730.     status = (mmi_phnset_freetype_status_enum)GetHighlightedItem();
  2731.     gui_freetype_set_size(status);
  2732.     WriteValue(NVRAM_FREETYPE_SETTING, &status, DS_BYTE, &error);
  2733.     
  2734.     wgui_softkey_reset_theme(MMI_LEFT_SOFTKEY);
  2735.     wgui_softkey_reset_theme(MMI_RIGHT_SOFTKEY);
  2736.     
  2737.     set_MMI_theme((MMI_theme*) MMI_themes[0]);
  2738.     
  2739.     DisplayPopup((PU8) GetString(STR_GLOBAL_PLEASE_WAIT), 
  2740.                         IMG_GLOBAL_UNFINISHED, 
  2741.                         1, 
  2742.                         ST_NOTIFYDURATION, 
  2743.                         0 
  2744.                         );
  2745.     DeleteScreenIfPresent(SCR_ID_PHNSET_FREETYPE_SETTING);
  2746. }
  2747. static void EntryFreeTypeSetting(void)
  2748. {
  2749.     /*----------------------------------------------------------------*/
  2750.     /* Local Variables                                                */
  2751.     /*----------------------------------------------------------------*/
  2752.     U16 nStrItemList[MAX_SUB_MENUS];    /* Stores the strings id of submenus returned */
  2753.     U16 nNumofItem;                     /* Stores no of children in the submenu */
  2754.     U8 *guiBuffer;              /* Buffer holding history data */
  2755.     U8 data1 = 0;
  2756.     S16 error1 = 0;
  2757.     /*----------------------------------------------------------------*/
  2758.     /* Code Body                                                      */
  2759.     /*----------------------------------------------------------------*/
  2760.     EntryNewScreen(SCR_ID_PHNSET_FREETYPE_SETTING, NULL, EntryFreeTypeSetting, NULL);
  2761.     /* 2 Get current screen to gui buffer for history purposes */
  2762.     guiBuffer = GetCurrGuiBuffer(SCR_ID_PHNSET_FREETYPE_SETTING);
  2763.     /* 3 Retrieve no of child of menu item to be displayed */
  2764.     nNumofItem = GetNumOfChild(MENU_ID_PHNSET_FREETYPE_SETTING);
  2765.     /* 4 Retrieve string ids in sequence of given menu item to be displayed */
  2766.     GetSequenceStringIds(MENU_ID_PHNSET_FREETYPE_SETTING, nStrItemList);
  2767.     /* 5 Set current parent id */
  2768.     SetParentHandler(MENU_ID_PHNSET_FREETYPE_SETTING);
  2769.     /* 6 Register highlight handler to be called in menu screen */
  2770.     //RegisterHighlightHandler(AutoKeyPadLockTimeHandler);
  2771.     data1 = PhnsetGetFreeTypeSetting();
  2772.     /* 8 Display Category11 Screen */
  2773.     ShowCategory11Screen(
  2774.         STR_ID_PHNSET_FREETYPE_SETTING,
  2775.         MAIN_MENU_TITLE_SETTINGS_ICON,
  2776.         STR_GLOBAL_OK,
  2777.         0,
  2778.         STR_GLOBAL_BACK,
  2779.         0,
  2780.         nNumofItem,
  2781.         nStrItemList,
  2782.         (U16) data1,
  2783.         guiBuffer);
  2784.     /* 9 Register function with right softkey */
  2785.     SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
  2786.     SetLeftSoftkeyFunction(PhnsetFreeTypeSettingHandler, KEY_EVENT_UP);
  2787.     SetKeyHandler(0, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
  2788.     SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
  2789. }
  2790. void HighlightFreeTypeSetting(void)
  2791. {
  2792.     /*----------------------------------------------------------------*/
  2793.     /* Local Variables                                                */
  2794.     /*----------------------------------------------------------------*/
  2795.     /*----------------------------------------------------------------*/
  2796.     /* Code Body                                                      */
  2797.     /*----------------------------------------------------------------*/
  2798.     /* 1 Change left soft key icon and label */
  2799.     ChangeLeftSoftkey(STR_GLOBAL_OK, 0);
  2800.     /* 2 Change right soft key icon and label */
  2801.     ChangeRightSoftkey(STR_GLOBAL_BACK, 0);
  2802.     /* 3 Register function for left soft key */
  2803.     SetLeftSoftkeyFunction(EntryFreeTypeSetting, KEY_EVENT_UP);
  2804.     SetKeyHandler(EntryFreeTypeSetting, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
  2805.     /* 4 Register function for right soft key */
  2806.     SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
  2807.     SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
  2808. }
  2809. void HintFreeTypeSetting(U16 index)
  2810. {
  2811.     /*----------------------------------------------------------------*/
  2812.     /* Local Variables                                                */
  2813.     /*----------------------------------------------------------------*/
  2814.     mmi_phnset_freetype_status_enum freetype_status = 0;
  2815.     /*----------------------------------------------------------------*/
  2816.     /* Code Body                                                      */
  2817.     /*----------------------------------------------------------------*/
  2818.     freetype_status = PhnsetGetFreeTypeSetting();
  2819.     memset((S8*) hintData[(index)], 0, MAX_SUB_MENU_SIZE);
  2820.     
  2821.     switch(freetype_status)
  2822.     {
  2823.     case MMI_PHNSET_FREETYPE_SMALL:
  2824.      mmi_ucs2cpy((PS8) hintData[index], (PS8) GetString(STR_ID_PHNSET_FREETYPE_SMALL));
  2825.      break;
  2826.     case MMI_PHNSET_FREETYPE_MEDIUM:
  2827.      mmi_ucs2cpy((PS8) hintData[index], (PS8) GetString(STR_ID_PHNSET_FREETYPE_MEDIUM));
  2828.      break;
  2829.     case MMI_PHNSET_FREETYPE_LARGE:
  2830.      mmi_ucs2cpy((PS8) hintData[index], (PS8) GetString(STR_ID_PHNSET_FREETYPE_LARGE));
  2831.         break;
  2832.     default:
  2833.         break;
  2834.     }
  2835.     
  2836. }
  2837. #endif