Service.c
上传用户:lqx1163
上传日期:2014-08-13
资源大小:9183k
文件大小:16k
源码类别:

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.  * Filename:
  37.  * ---------
  38.  * Service.c
  39.  *
  40.  * Project:
  41.  * --------
  42.  *   MAUI
  43.  *
  44.  * Description:
  45.  * ------------
  46.  *   
  47.  *
  48.  * Author:
  49.  * -------
  50.  * -------
  51.  *
  52.  *==============================================================================
  53.  *             HISTORY
  54.  * Below this line, this part is controlled by PVCS VM. DO NOT MODIFY!! 
  55.  *------------------------------------------------------------------------------
  56.  * removed!
  57.  *
  58.  * removed!
  59.  * removed!
  60.  * removed!
  61.  *
  62.  * removed!
  63.  * removed!
  64.  * removed!
  65.  *
  66.  * removed!
  67.  * removed!
  68.  * removed!
  69.  *
  70.  * removed!
  71.  * removed!
  72.  * removed!
  73.  *
  74.  * removed!
  75.  * removed!
  76.  * removed!
  77.  *
  78.  * removed!
  79.  * removed!
  80.  * removed!
  81.  *
  82.  * removed!
  83.  * removed!
  84.  * removed!
  85.  *
  86.  * removed!
  87.  * removed!
  88.  * removed!
  89.  *
  90.  * removed!
  91.  * removed!
  92.  * removed!
  93.  *
  94.  * removed!
  95.  * removed!
  96.  * removed!
  97.  *
  98.  * removed!
  99.  * removed!
  100.  * removed!
  101.  *
  102.  * removed!
  103.  * removed!
  104.  * removed!
  105.  *
  106.  *------------------------------------------------------------------------------
  107.  * Upper this line, this part is controlled by PVCS VM. DO NOT MODIFY!! 
  108.  *============================================================================== 
  109.  *******************************************************************************/
  110. #include "stdC.h"
  111. #include "L4Dr1.h"
  112. #include "L4Dr.h"
  113. #include "MMI_features.h"
  114. #include "FrameworkStruct.h"
  115. #include "SATDefs.h"
  116. #include "SATStruct.h"
  117. #include "SATGProts.h"
  118. #include "DataAccountGProt.h"
  119. #include "InfoNum.h"
  120. #include "CommonScreens.h"
  121. #include "WapProt.h"
  122. #include "WapType.h"
  123. #include "ServiceDefs.h"
  124. #include "Service.h"
  125. #include "SettingProfile.h"
  126. #ifdef __MMI_POC__
  127. /* micha_PoC */
  128. #include "PoCGProt.h"
  129. #endif /* __MMI_POC__ */ 
  130. //micha1229
  131. //static U8 servicesIndex=0;
  132. extern void goto_mobile_suite_screen(void);
  133. extern SATSETUPMENU gSATMainMenu;
  134. /*****************************************************************************
  135.  * FUNCTION
  136.  *  GoToServicesMenu
  137.  * DESCRIPTION
  138.  *  Displays Services Menu
  139.  * PARAMETERS
  140.  *  void
  141.  * RETURNS
  142.  *  void
  143.  *****************************************************************************/
  144. void GoToServicesMenu(void)
  145. {
  146.     /*----------------------------------------------------------------*/
  147.     /* Local Variables                                                */
  148.     /*----------------------------------------------------------------*/
  149.     U16 nStrItemList[MAX_SUB_MENUS];
  150.     U16 nIconItemList[MAX_SUB_MENUS];
  151.     U8 *Strings[MAX_SUB_MENUS];
  152.     U16 Icons[MAX_SUB_MENUS];
  153.     U16 nNumofItem;
  154.     U8 i = 0, j;
  155.     U8 *guiBuffer;
  156.     /*----------------------------------------------------------------*/
  157.     /* Code Body                                                      */
  158.     /*----------------------------------------------------------------*/
  159.     /* Retrieve no of child of menu item to be displayed */
  160.     nNumofItem = GetNumOfChild_Ext(MAIN_MENU_SERVICES_MENUID);
  161.     /* Retrieve string ids in sequence of given menu item to be displayed */
  162.     GetSequenceStringIds_Ext(MAIN_MENU_SERVICES_MENUID, nStrItemList);
  163.     GetSequenceImageIds_Ext(MAIN_MENU_SERVICES_MENUID, nIconItemList);
  164.     if (IsSATPresent())
  165.     {
  166.         Strings[0] = gSATMainMenu.alphaId;
  167.         Icons[0] = SAT_TITLE_IMAGE_ID;
  168.         i++;
  169.     }
  170.     for (j = 0; j < nNumofItem; j++)
  171.     {
  172.         if (isInfoNumPresent == 0 && nStrItemList[j] == SERVICES_INFO_NUM_STRING_ID)
  173.         {
  174.             continue;
  175.         }
  176.         Strings[i] = (PU8) GetString(nStrItemList[j]);
  177.         Icons[i] = nIconItemList[j];
  178.         i++;
  179.     }
  180.     nNumofItem = i;
  181. #ifdef __MMI_MERGE_SAT_TO_MAINMENU__
  182.     if (nNumofItem == 0)
  183.     {
  184.         DisplayPopup((PU8) GetString(SERVICES_NOT_PROVIDED_STRING_ID), IMG_GLOBAL_ERROR, 0, 1000, ERROR_TONE);
  185.         return;
  186.     }
  187.     else if (nNumofItem == 1 && IsSATPresent())
  188.     {
  189.         GoToSATMainMenu();
  190.         return;
  191.     }
  192. #endif /* __MMI_MERGE_SAT_TO_MAINMENU__ */ 
  193. #ifdef __MMI_SERVICE_MENU_NUMERIC_LIST_ICON__
  194.     EntryNewScreen(SERVICES_MAIN_MENU_SCREEN_ID, wgui_restore_list_menu_slim_style, GoToServicesMenu, NULL);
  195.     wgui_override_list_menu_slim_style(WGUI_LIST_MENU_SLIM_STYLE_NUMBER);
  196. #else /* __MMI_SERVICE_MENU_NUMERIC_LIST_ICON__ */ 
  197.     EntryNewScreen(SERVICES_MAIN_MENU_SCREEN_ID, NULL, GoToServicesMenu, NULL);
  198. #endif /* __MMI_SERVICE_MENU_NUMERIC_LIST_ICON__ */ 
  199.     SetParentHandler(MAIN_MENU_SERVICES_MENUID);
  200.     guiBuffer = GetCurrGuiBuffer(SERVICES_MAIN_MENU_SCREEN_ID);
  201.     RegisterHighlightHandler(ServicesMenuIndex);
  202. #ifdef __MMI_WGUI_MINI_TAB_BAR__
  203.     wgui_enable_mini_tab_bar(MAIN_MENU_SERVICES_MENUID);
  204. #endif 
  205.     ShowCategory84Screen(
  206.         SERVICES_TITLE_STRING_ID,
  207.         GetRootTitleIcon(MAIN_MENU_SERVICES_MENUID),
  208.         STR_GLOBAL_OK,
  209.         IMG_GLOBAL_OK,
  210.         STR_GLOBAL_BACK,
  211.         IMG_GLOBAL_BACK,
  212.         nNumofItem,
  213.         Strings,
  214.         Icons,
  215.         LIST_MENU,
  216.         0,
  217.         guiBuffer);
  218.     if (nNumofItem == 0)
  219.     {
  220.         /* No menu item and no SAT in GSM only project */
  221.         ChangeLeftSoftkey(0, 0);
  222.     }
  223.     SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
  224.     SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
  225. }
  226. /*****************************************************************************
  227.  * FUNCTION
  228.  *  ServicesMenuIndex
  229.  * DESCRIPTION
  230.  *  Hilite Handler for Services Menu
  231.  * PARAMETERS
  232.  *  index       [IN]        Of highlighted item
  233.  * RETURNS
  234.  *  void
  235.  *****************************************************************************/
  236. void ServicesMenuIndex(S32 index)
  237. {
  238.     /*----------------------------------------------------------------*/
  239.     /* Local Variables                                                */
  240.     /*----------------------------------------------------------------*/
  241.     /*----------------------------------------------------------------*/
  242.     /* Code Body                                                      */
  243.     /*----------------------------------------------------------------*/
  244.     if (IsSATPresent())
  245.     {
  246.         if (index == 0)
  247.         {
  248.             SATHiliteHandler();
  249.         }
  250.         else
  251.         {
  252.             ExecuteCurrHiliteHandler(index - 1);
  253.         }
  254.     }
  255.     else
  256.     {
  257.         ExecuteCurrHiliteHandler(index);
  258.     }
  259. }
  260. /*****************************************************************************
  261.  * FUNCTION
  262.  *  SATHiliteHandler
  263.  * DESCRIPTION
  264.  *  Hilite Handler for SAT Sub Menu
  265.  * PARAMETERS
  266.  *  void
  267.  * RETURNS
  268.  *  void
  269.  *****************************************************************************/
  270. void SATHiliteHandler(void)
  271. {
  272.     /*----------------------------------------------------------------*/
  273.     /* Local Variables                                                */
  274.     /*----------------------------------------------------------------*/
  275.     /*----------------------------------------------------------------*/
  276.     /* Code Body                                                      */
  277.     /*----------------------------------------------------------------*/
  278.     SetLeftSoftkeyFunction(GoToSATMainMenu, KEY_EVENT_UP);
  279.     SetKeyHandler(GoToSATMainMenu, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
  280. }
  281. /*****************************************************************************
  282.  * FUNCTION
  283.  *  WapHiliteHandler
  284.  * DESCRIPTION
  285.  *  Hilite Handler for WAP Sub Menu
  286.  * PARAMETERS
  287.  *  void
  288.  * RETURNS
  289.  *  void
  290.  *****************************************************************************/
  291. void WapHiliteHandler(void)
  292. {
  293. #ifdef WAP_SUPPORT
  294.     /*----------------------------------------------------------------*/
  295.     /* Local Variables                                                */
  296.     /*----------------------------------------------------------------*/
  297.     /*----------------------------------------------------------------*/
  298.     /* Code Body                                                      */
  299.     /*----------------------------------------------------------------*/
  300.     SetLeftSoftkeyFunction(goto_mobile_suite_screen, KEY_EVENT_UP);
  301.     SetKeyHandler(goto_mobile_suite_screen, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
  302. #ifdef MMI_ON_WIN32
  303.     SetLeftSoftkeyFunction(PopupNoSupport, KEY_EVENT_UP);
  304.     SetKeyHandler(PopupNoSupport, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
  305. #endif /* MMI_ON_WIN32 */ 
  306. #endif /* WAP_SUPPORT */ 
  307. }
  308. /*****************************************************************************
  309.  * FUNCTION
  310.  *  DataConnectHiliteHandler
  311.  * DESCRIPTION
  312.  *  Hilite Handler for Data Connect Sub Menu
  313.  * PARAMETERS
  314.  *  void
  315.  * RETURNS
  316.  *  void
  317.  *****************************************************************************/
  318. void DataConnectHiliteHandler(void)
  319. {
  320. #ifdef __TCPIP__
  321.     /*----------------------------------------------------------------*/
  322.     /* Local Variables                                                */
  323.     /*----------------------------------------------------------------*/
  324.     /*----------------------------------------------------------------*/
  325.     /* Code Body                                                      */
  326.     /*----------------------------------------------------------------*/
  327.     SetLeftSoftkeyFunction(EntryDTCNTMain, KEY_EVENT_UP);
  328.     SetKeyHandler(EntryDTCNTMain, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
  329. #endif /* __TCPIP__ */ 
  330. }
  331. /*****************************************************************************
  332.  * FUNCTION
  333.  *  InfoNumHiliteHandler
  334.  * DESCRIPTION
  335.  *  Hilite Handler for Information Number Sub Menu
  336.  * PARAMETERS
  337.  *  void
  338.  * RETURNS
  339.  *  void
  340.  *****************************************************************************/
  341. void InfoNumHiliteHandler(void)
  342. {
  343.     /*----------------------------------------------------------------*/
  344.     /* Local Variables                                                */
  345.     /*----------------------------------------------------------------*/
  346.     /*----------------------------------------------------------------*/
  347.     /* Code Body                                                      */
  348.     /*----------------------------------------------------------------*/
  349.     SetLeftSoftkeyFunction(EnterScrInfoNumber, KEY_EVENT_UP);
  350.     SetKeyHandler(EnterScrInfoNumber, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
  351. }
  352. /*****************************************************************************
  353.  * FUNCTION
  354.  *  InitService
  355.  * DESCRIPTION
  356.  *  Initialises variables & Protocol Handlers for SAT
  357.  * PARAMETERS
  358.  *  void
  359.  * RETURNS
  360.  *  void
  361.  *****************************************************************************/
  362. void InitService(void)
  363. {
  364.     /*----------------------------------------------------------------*/
  365.     /* Local Variables                                                */
  366.     /*----------------------------------------------------------------*/
  367.     /*----------------------------------------------------------------*/
  368.     /* Code Body                                                      */
  369.     /*----------------------------------------------------------------*/
  370. #ifdef WAP_SUPPORT
  371.     SetHiliteHandler(SERVICES_WAP_MENU_ID, WapHiliteHandler);
  372. #endif
  373.     SetHiliteHandler(SERVICES_INFO_NUM_MENU_ID, InfoNumHiliteHandler);
  374.     SetHiliteHandler(SERVICES_DATA_CONNECT_MAIN_MENU_ID, DataConnectHiliteHandler);
  375.     SetHiliteHandler(SERVICES_DATA_CONNECT_MENU_ID, DataConnectGSMHiliteHandler);
  376. #ifdef __MMI_GPRS_FEATURES__
  377.     SetHiliteHandler(SERVICES_DATA_CONNECT_GPRS_MENU_ID, DataConnectGPRSHiliteHandler);
  378. #endif /* __MMI_GPRS_FEATURES__ */ 
  379.     /* micha_PoC */
  380. #ifdef __MMI_POC__
  381.     SetHiliteHandler(MENU_ID_POC_MAIN, mmi_poc_highlight_main);
  382. #endif 
  383.     InitSimAppToolkit();
  384. #ifdef __MMI_WLAN_FEATURES__
  385.     mmi_wlan_init_highlight_hdlr();
  386. #endif 
  387. }
  388. /*****************************************************************************
  389.  * FUNCTION
  390.  *  DataConnectGSMHiliteHandler
  391.  * DESCRIPTION
  392.  *  
  393.  * PARAMETERS
  394.  *  void
  395.  * RETURNS
  396.  *  void
  397.  *****************************************************************************/
  398. void DataConnectGSMHiliteHandler(void)
  399. {
  400. #ifdef __TCPIP__
  401.     /*----------------------------------------------------------------*/
  402.     /* Local Variables                                                */
  403.     /*----------------------------------------------------------------*/
  404.     /*----------------------------------------------------------------*/
  405.     /* Code Body                                                      */
  406.     /*----------------------------------------------------------------*/
  407.     SetLeftSoftkeyFunction(InitializeDataAccountRecords, KEY_EVENT_UP);
  408.     SetKeyHandler(InitializeDataAccountRecords, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
  409. #endif /* __TCPIP__ */ 
  410. }
  411. #ifdef __MMI_GPRS_FEATURES__
  412. /*****************************************************************************
  413.  * FUNCTION
  414.  *  DataConnectGPRSHiliteHandler
  415.  * DESCRIPTION
  416.  *  
  417.  * PARAMETERS
  418.  *  void
  419.  * RETURNS
  420.  *  void
  421.  *****************************************************************************/
  422. void DataConnectGPRSHiliteHandler(void)
  423. {
  424. #ifdef __TCPIP__
  425.     /*----------------------------------------------------------------*/
  426.     /* Local Variables                                                */
  427.     /*----------------------------------------------------------------*/
  428.     /*----------------------------------------------------------------*/
  429.     /* Code Body                                                      */
  430.     /*----------------------------------------------------------------*/
  431.     SetLeftSoftkeyFunction(InitializeGPRSDataAccountRecords, KEY_EVENT_UP);
  432.     SetKeyHandler(InitializeGPRSDataAccountRecords, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
  433. #endif /* __TCPIP__ */ 
  434. }
  435. #endif /* __MMI_GPRS_FEATURES__ */