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

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.  *  PreferedInputMethodSetting.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.  *------------------------------------------------------------------------------
  91.  * Upper this line, this part is controlled by PVCS VM. DO NOT MODIFY!! 
  92.  *==============================================================================
  93.  *******************************************************************************/
  94. /***************** Settings Application implementation *********************/
  95. /**************************************************************
  96.     FILENAME    : PreferedInputMethodSetting.c
  97.     PURPOSE     : PreferedInputMethod application
  98.     REMARKS     : Elvis
  99.     AUTHOR      : Elvis
  100.     DATE        : 21 Oct 2003 (Taipei)
  101. **************************************************************/
  102. #include "MMI_features.h"
  103. #ifdef __MMI_PREFER_INPUT_METHOD__
  104. #include "PixtelDataTypes.h"
  105. #include "EventsGprot.h"
  106. #include "historyGprot.h"
  107. #include "ProtocolEvents.h"
  108. #include "Globaldefs.h"
  109. #include "wgui_categories.h"
  110. #include "wgui_categories_inputs.h"
  111. #include "Unicodexdcl.h"
  112. #include "HardwareEvents.h"
  113. #include "Thrdosinterface.h"
  114. #include "NVRAMType.h"
  115. #include "NVRAMProt.h"
  116. #include "NVRAMEnum.h"
  117. #include "OSThreadInterfaceGprot.h"
  118. #include "MainMenuDef.h"
  119. #include "settinggprots.h"
  120. #include "SettingsGexdcl.h"
  121. #include "SettingProfile.h"
  122. #include "SettingProt.h"
  123. #include "SettingDefs.h"
  124. #include "PreferedInputMethodProt.h"
  125. #include "PhoneSetupGprots.h"
  126. #include "EventsGprot.h"
  127. #include "CommonScreens.h"
  128. /* __CUSTPACK_MULTIBIN     Terry   BEGIN */
  129. #include "IMERes.h"
  130. extern const sIMEModeDetails *gIMEModeArray;
  131. U16 MMI_all_prefered_input_mode_set[INPUT_MODE_MAX_NUM] = {0xffff};
  132. U8 *inputMethodList[INPUT_MODE_MAX_NUM];
  133. /* W05.34 Fix Compile Warning */
  134. static U16 gnInputMethods = 0;
  135. U16 currInputMethodIndex = 0;
  136. extern S16 MMI_prefered_input_type;
  137. /* __CUSTPACK_MULTIBIN     Terry   END */
  138. extern PS8(*pfnUnicodeStrcpy) (S8 *strDestination, const S8 *strSource);
  139. //extern void DisplayPopup(U8 * string, U16 imageId, U8 imageOnBottom, U32 popupDuration, U8 toneId);
  140. // __CUSTPACK_MULTIBIN     Terry   BEGIN
  141. /*****************************************************************************
  142.  * FUNCTION
  143.  *  InitPreferedInputMethod
  144.  * DESCRIPTION
  145.  *  initialization function for input method screen
  146.  * NA
  147.  *  
  148.  * PARAMETERS
  149.  *  void
  150.  * RETURNS
  151.  *  void
  152.  *****************************************************************************/
  153. void InitPreferedInputMethod(void)
  154. {
  155.     /*----------------------------------------------------------------*/
  156.     /* Local Variables                                                */
  157.     /*----------------------------------------------------------------*/
  158.     U16 i = 0;
  159.     /*----------------------------------------------------------------*/
  160.     /* Code Body                                                      */
  161.     /*----------------------------------------------------------------*/
  162.     for (;;)
  163.     {
  164.         if (((0xff) != gIMEModeArray[i].IME_Mode_ID) && (0 != gIMEModeArray[i].Prefered_IMEStringID))
  165.         {
  166.             inputMethodList[i] = (U8*) GetString(gIMEModeArray[i].Prefered_IMEStringID);
  167.             i++;
  168.         }
  169.         else
  170.         {
  171.             break;
  172.         }
  173.     }
  174.     gnInputMethods = i;
  175.     return;
  176. }
  177. /*****************************************************************************
  178.  * FUNCTION
  179.  *  HighlightInputMehtodSetting
  180.  * DESCRIPTION
  181.  *  highlight handler for input method selection
  182.  * NA
  183.  *  
  184.  * PARAMETERS
  185.  *  void
  186.  * RETURNS
  187.  *  void
  188.  *****************************************************************************/
  189. void HighlightInputMehtodSetting(void)
  190. {
  191.     /*----------------------------------------------------------------*/
  192.     /* Local Variables                                                */
  193.     /*----------------------------------------------------------------*/
  194.     /*----------------------------------------------------------------*/
  195.     /* Code Body                                                      */
  196.     /*----------------------------------------------------------------*/
  197.     /* 1 Change left soft key icon and label */
  198.     ChangeLeftSoftkey(STR_GLOBAL_OK, 0);
  199.     /* 2 Change right soft key icon and label */
  200.     ChangeRightSoftkey(STR_GLOBAL_BACK, 0);
  201.     /* set the left/right soft key functions handlers */
  202.     SetLeftSoftkeyFunction(EntryScrPreferedInputMethodList, KEY_EVENT_UP);
  203.     SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
  204.     /* set the left/right arrow key function handlers */
  205.     SetKeyHandler(EntryScrPreferedInputMethodList, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
  206.     SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
  207.     return;
  208. }
  209. /*****************************************************************************
  210.  * FUNCTION
  211.  *  EntryScrPreferedInputMethodList
  212.  * DESCRIPTION
  213.  *  Entry function for input method screen
  214.  * NA
  215.  *  
  216.  * PARAMETERS
  217.  *  void
  218.  * RETURNS
  219.  *  void
  220.  *****************************************************************************/
  221. void EntryScrPreferedInputMethodList(void)
  222. {
  223.     /*----------------------------------------------------------------*/
  224.     /* Local Variables                                                */
  225.     /*----------------------------------------------------------------*/
  226.     U8 *pGuiBuffer;
  227.     U8 i;
  228.     /*----------------------------------------------------------------*/
  229.     /* Code Body                                                      */
  230.     /*----------------------------------------------------------------*/
  231.     InitPreferedInputMethod();
  232. #if !defined(__MMI_PHNSET_TWO_LINE_MENUITEM_DISPLAY__)
  233.     i = 0;
  234.     while (MMI_all_prefered_input_mode_set[i] != MMI_prefered_input_type)
  235.     {
  236.         if (MMI_all_prefered_input_mode_set[i] == 0xffff)
  237.         {
  238.             i = 0;
  239.             break;
  240.         }
  241.         else
  242.         {
  243.             i++;
  244.         }
  245.     }
  246.     currInputMethodIndex = i;
  247. #endif /* !defined(__MMI_PHNSET_TWO_LINE_MENUITEM_DISPLAY__) */ 
  248.     /* Call Exit Handler */
  249.     /* ExecuteCurrExitHandler(); */
  250.     EntryNewScreen(SCR_INPUT_METHOD_SELECTION, ExitInputMethodSelectScreen, NULL, NULL);
  251.     /* Get current screen info into gui buffer  for history purposes */
  252.     pGuiBuffer = GetCurrGuiBuffer(SCR_INPUT_METHOD_SELECTION);
  253.     /* Register highlight handler to be called in menu screen */
  254.     RegisterHighlightHandler(HighlightCurrentInputMethod);
  255.     /* Display Screen */
  256.     ShowCategory36Screen(
  257.         STR_MENU_INPUT_METHOD,
  258.         MAIN_MENU_TITLE_SETTINGS_ICON,
  259.         STR_GLOBAL_OK,
  260.         IMG_GLOBAL_OK,
  261.         STR_GLOBAL_BACK,
  262.         IMG_GLOBAL_BACK,
  263.         gnInputMethods,
  264.         (U8 **) inputMethodList,
  265.         currInputMethodIndex,
  266.         pGuiBuffer);
  267.     /* Register function with left/right softkey */
  268.     SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
  269.     SetLeftSoftkeyFunction(SelectInputMethodHandler, KEY_EVENT_UP);
  270.     /* Register function with left/right arrow key */
  271.     SetKeyHandler(0, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
  272.     SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
  273.     /* Register Exit handler */
  274.     /* SetExitHandler(SCR_INPUT_METHOD_SELECTION, ExitInputMethodSelectScreen); */
  275.     return;
  276. }
  277. /* __CUSTPACK_MULTIBIN     Terry   END */
  278. /*****************************************************************************
  279.  * FUNCTION
  280.  *  HighlightCurrentInputMethod
  281.  * DESCRIPTION
  282.  *  upate selected index
  283.  * NA
  284.  *  
  285.  * PARAMETERS
  286.  *  index       [IN]        
  287.  * RETURNS
  288.  *  void
  289.  *****************************************************************************/
  290. void HighlightCurrentInputMethod(S32 index)
  291. {
  292.     /*----------------------------------------------------------------*/
  293.     /* Local Variables                                                */
  294.     /*----------------------------------------------------------------*/
  295.     /*----------------------------------------------------------------*/
  296.     /* Code Body                                                      */
  297.     /*----------------------------------------------------------------*/
  298.     /* upate selected index */
  299.     currInputMethodIndex = (U8) index;
  300.     return;
  301. }
  302. /*****************************************************************************
  303.  * FUNCTION
  304.  *  SelectInputMethodHandler
  305.  * DESCRIPTION
  306.  *  Exit function for input method screen
  307.  * NA
  308.  *  
  309.  * PARAMETERS
  310.  *  void
  311.  * RETURNS
  312.  *  void
  313.  *****************************************************************************/
  314. void SelectInputMethodHandler(void)
  315. {
  316.     /*----------------------------------------------------------------*/
  317.     /* Local Variables                                                */
  318.     /*----------------------------------------------------------------*/
  319.     U16 data;
  320.     S16 error;
  321.     U16 index;
  322.     /*----------------------------------------------------------------*/
  323.     /* Code Body                                                      */
  324.     /*----------------------------------------------------------------*/
  325.     index = GetCurrHiliteID();
  326.     SetInputMethod(currInputMethodIndex);
  327.     data = MMI_prefered_input_type;
  328.     WriteValue(NVRAM_SETTING_PREFER_INPUT_METHOD, &data, DS_SHORT, &error);
  329.     pfnUnicodeStrcpy((PS8) hintData[index], (PS8) inputMethodList[currInputMethodIndex]);
  330.     Category52ChangeItemDescription(index, hintData[index]);
  331. #if defined(__MMI_PHNSET_TWO_LINE_MENUITEM_DISPLAY__)
  332.     if (mmi_phnset_2line_is_exist())
  333.     {
  334.         DisplayPopup((PU8) GetString(STR_GLOBAL_DONE), IMG_GLOBAL_ACTIVATED, 1, ST_NOTIFYDURATION, SUCCESS_TONE);
  335.     }
  336.     else
  337. #endif /* defined(__MMI_PHNSET_TWO_LINE_MENUITEM_DISPLAY__) */ 
  338.     {
  339.         RedrawCategoryFunction();
  340.         DisplayPopup((PU8) GetString(STR_GLOBAL_DONE), IMG_GLOBAL_ACTIVATED, 1, ST_NOTIFYDURATION, SUCCESS_TONE);
  341.         DeleteNHistory(1);
  342.     }
  343.     return;
  344. }
  345. /*****************************************************************************
  346.  * FUNCTION
  347.  *  ExitInputMethodSelectScreen
  348.  * DESCRIPTION
  349.  *  Exit function for input method screen
  350.  * NA
  351.  *  
  352.  * PARAMETERS
  353.  *  void
  354.  * RETURNS
  355.  *  void
  356.  *****************************************************************************/
  357. void ExitInputMethodSelectScreen(void)
  358. {
  359.     /*----------------------------------------------------------------*/
  360.     /* Local Variables                                                */
  361.     /*----------------------------------------------------------------*/
  362.     history Scr;    /* Variable to hold the history data */
  363.     S16 nHistory = 0;
  364.     /*----------------------------------------------------------------*/
  365.     /* Code Body                                                      */
  366.     /*----------------------------------------------------------------*/
  367.     /* getting details of the current screen (to be added to history) */
  368.     Scr.scrnID = SCR_INPUT_METHOD_SELECTION;
  369.     Scr.entryFuncPtr = EntryScrPreferedInputMethodList;
  370.     pfnUnicodeStrcpy((S8*) Scr.inputBuffer, (S8*) & nHistory);
  371.     GetCategoryHistory(Scr.guiBuffer);
  372.     /* add the screen to history */
  373.     AddHistory(Scr);
  374.     return;
  375. }
  376. /* __CUSTPACK_MULTIBIN     Terry   BEGIN */
  377. /*****************************************************************************
  378.  * FUNCTION
  379.  *  SetInputMethod
  380.  * DESCRIPTION
  381.  *  Set input method
  382.  * NA
  383.  *  
  384.  * PARAMETERS
  385.  *  index       [IN]        
  386.  * RETURNS
  387.  *  void
  388.  *****************************************************************************/
  389. void SetInputMethod(U16 index)
  390. {
  391.     /*----------------------------------------------------------------*/
  392.     /* Local Variables                                                */
  393.     /*----------------------------------------------------------------*/
  394.     /*----------------------------------------------------------------*/
  395.     /* Code Body                                                      */
  396.     /*----------------------------------------------------------------*/
  397.     if (index < INPUT_MODE_MAX_NUM)
  398.     {
  399.         MMI_prefered_input_type = MMI_all_prefered_input_mode_set[index];
  400.     }
  401.     else
  402.     {
  403.         MMI_prefered_input_type = INPUT_TYPE_ALPHANUMERIC_UPPERCASE;
  404.     }
  405.     return;
  406. }
  407. /*****************************************************************************
  408.  * FUNCTION
  409.  *  SetInputMethodFromNVRAM
  410.  * DESCRIPTION
  411.  *  Retrive input method type from nvram and set.
  412.  * NA
  413.  *  
  414.  * PARAMETERS
  415.  *  void
  416.  * RETURNS
  417.  *  void
  418.  *****************************************************************************/
  419. void SetInputMethodFromNVRAM(void)
  420. {
  421.     /*----------------------------------------------------------------*/
  422.     /* Local Variables                                                */
  423.     /*----------------------------------------------------------------*/
  424.     S16 error;
  425.     U16 data = 0;
  426.     U8 i;
  427.     /*----------------------------------------------------------------*/
  428.     /* Code Body                                                      */
  429.     /*----------------------------------------------------------------*/
  430.     /* retrive input method type from nvram */
  431.     ReadValue(NVRAM_SETTING_PREFER_INPUT_METHOD, &data, DS_SHORT, &error);
  432.     if (data == 0xFF || error != NVRAM_READ_SUCCESS)
  433.     {
  434.         data = INPUT_TYPE_ALPHANUMERIC_LOWERCASE;
  435.         WriteValue(NVRAM_SETTING_PREFER_INPUT_METHOD, &data, DS_SHORT, &error);
  436.     }
  437.     /* check the input type */
  438.     i = 0;
  439.     while (MMI_all_prefered_input_mode_set[i] != data)
  440.     {
  441.         if (MMI_all_prefered_input_mode_set[i] == 0xffff)
  442.         {
  443.             i = 0;
  444.             break;
  445.         }
  446.         else
  447.         {
  448.             i++;
  449.         }
  450.     }
  451.     currInputMethodIndex = i;
  452.     /* set input method with current input method */
  453.     SetInputMethod(currInputMethodIndex);
  454.     return;
  455. }
  456. /*****************************************************************************
  457.  * FUNCTION
  458.  *  SetInputMethodType
  459.  * DESCRIPTION
  460.  *  Entry function for call barring result screen
  461.  * NA
  462.  *  
  463.  * PARAMETERS
  464.  *  inputType       [IN]        
  465.  * RETURNS
  466.  *  void
  467.  *****************************************************************************/
  468. void SetInputMethodType(U16 inputType)
  469. {
  470.     /*----------------------------------------------------------------*/
  471.     /* Local Variables                                                */
  472.     /*----------------------------------------------------------------*/
  473.     U8 i;
  474.     /*----------------------------------------------------------------*/
  475.     /* Code Body                                                      */
  476.     /*----------------------------------------------------------------*/
  477.     i = 0;
  478.     while (MMI_all_prefered_input_mode_set[i] != inputType)
  479.     {
  480.         if (MMI_all_prefered_input_mode_set[i] == 0xffff)
  481.         {
  482.             i = 0;
  483.             break;
  484.         }
  485.         else
  486.         {
  487.             i++;
  488.         }
  489.     }
  490.     currInputMethodIndex = i;
  491.     SetInputMethod(currInputMethodIndex);
  492.     return;
  493. }
  494. /*****************************************************************************
  495.  * FUNCTION
  496.  *  GetInputMethodIndex
  497.  * DESCRIPTION
  498.  *  function that return input method index
  499.  * NA
  500.  *  
  501.  * PARAMETERS
  502.  *  inputType       [IN]        
  503.  * RETURNS
  504.  *  U16
  505.  *****************************************************************************/
  506. U16 GetInputMethodIndex(U16 inputType)
  507. {
  508.     /*----------------------------------------------------------------*/
  509.     /* Local Variables                                                */
  510.     /*----------------------------------------------------------------*/
  511.     U8 i;
  512.     /*----------------------------------------------------------------*/
  513.     /* Code Body                                                      */
  514.     /*----------------------------------------------------------------*/
  515.     i = 0;
  516.     while (MMI_all_prefered_input_mode_set[i] != inputType)
  517.     {
  518.         if (MMI_all_prefered_input_mode_set[i] == 0xffff)
  519.         {
  520.             i = 0;
  521.             break;
  522.         }
  523.         else
  524.         {
  525.             i++;
  526.         }
  527.     }
  528.     return i;
  529. }
  530. #ifdef __MMI_PHNSET_TWO_LINE_MENUITEM_DISPLAY__
  531. /*****************************************************************************
  532.  * FUNCTION
  533.  *  mmi_phnset_get_current_preferr_input
  534.  * DESCRIPTION
  535.  *  This function returns the number of prefered input items
  536.  * PARAMETERS
  537.  *  void
  538.  * RETURNS
  539.  *  S32
  540.  *****************************************************************************/
  541. S32 mmi_phnset_get_current_preferr_input(void)
  542. {
  543.     /*----------------------------------------------------------------*/
  544.     /* Local Variables                                                */
  545.     /*----------------------------------------------------------------*/
  546.     /*----------------------------------------------------------------*/
  547.     /* Code Body                                                      */
  548.     /*----------------------------------------------------------------*/
  549.     return currInputMethodIndex;
  550. }
  551. /*****************************************************************************
  552.  * FUNCTION
  553.  *  mmi_phnset_2line_prfr_input_get_total_items
  554.  * DESCRIPTION
  555.  *  This function returns the number of prefered input items
  556.  * PARAMETERS
  557.  *  set_default_value       [IN]        
  558.  * RETURNS
  559.  *  S32
  560.  *****************************************************************************/
  561. S32 mmi_phnset_2line_prfr_input_get_total_items(S32 set_default_value)
  562. {
  563.     /*----------------------------------------------------------------*/
  564.     /* Local Variables                                                */
  565.     /*----------------------------------------------------------------*/
  566.     S32 i = 0;
  567.     /*----------------------------------------------------------------*/
  568.     /* Code Body                                                      */
  569.     /*----------------------------------------------------------------*/
  570.     InitPreferedInputMethod();
  571.     while (MMI_all_prefered_input_mode_set[i] != MMI_prefered_input_type)
  572.     {
  573.         if (MMI_all_prefered_input_mode_set[i] == 0xffff)
  574.         {
  575.             i = 0;
  576.             break;
  577.         }
  578.         else
  579.         {
  580.             i++;
  581.         }
  582.     }
  583.     if (set_default_value)
  584.     {
  585.         currInputMethodIndex = i;
  586.     }
  587.     return gnInputMethods;
  588. }
  589. /*****************************************************************************
  590.  * FUNCTION
  591.  *  mmi_phnset_2line_prfr_input_get_data
  592.  * DESCRIPTION
  593.  *  This function is called when prefered input menuitem is highlighted
  594.  * PARAMETERS
  595.  *  item_index      [IN]        Index of the inline item to be shown
  596.  *  str_buff        [IN]        Preferred input type string to be shown
  597.  *  img_buff_p      [IN]        Image to be shown with the inline item
  598.  * RETURNS
  599.  *  pBOOL
  600.  *****************************************************************************/
  601. pBOOL mmi_phnset_2line_prfr_input_get_data(S32 item_index, UI_string_type str_buff, PU8 *img_buff_p)
  602. {
  603.     /*----------------------------------------------------------------*/
  604.     /* Local Variables                                                */
  605.     /*----------------------------------------------------------------*/
  606.     /*----------------------------------------------------------------*/
  607.     /* Code Body                                                      */
  608.     /*----------------------------------------------------------------*/
  609.     currInputMethodIndex = (U8) item_index;
  610.     pfnUnicodeStrcpy((PS8) str_buff, (PS8) inputMethodList[item_index]);
  611.     if (item_index < IMG_GLOBAL_LEND - IMG_GLOBAL_LSTART - 1)
  612.     {
  613.         *img_buff_p = get_image((U16) (IMG_GLOBAL_LSTART + item_index + 1));
  614.     }
  615.     else
  616.     {
  617.         *img_buff_p = NULL;
  618.     }
  619.     return 1;
  620. }
  621. /*****************************************************************************
  622.  * FUNCTION
  623.  *  mmi_phnset_2line_prfr_input_complete_callback
  624.  * DESCRIPTION
  625.  *  This function is called when prefered input menuitem is unhighlighted
  626.  * PARAMETERS
  627.  *  item_index          [IN]        Menuitem index
  628.  *  selected_index      [IN]        Inline item index
  629.  * RETURNS
  630.  *  void
  631.  *****************************************************************************/
  632. void mmi_phnset_2line_prfr_input_complete_callback(S32 item_index, S32 selected_index)
  633. {
  634.     /*----------------------------------------------------------------*/
  635.     /* Local Variables                                                */
  636.     /*----------------------------------------------------------------*/
  637.     S32 i = 0;
  638.     /*----------------------------------------------------------------*/
  639.     /* Code Body                                                      */
  640.     /*----------------------------------------------------------------*/
  641.     while (MMI_all_prefered_input_mode_set[i] != MMI_prefered_input_type)
  642.     {
  643.         if (MMI_all_prefered_input_mode_set[i] == 0xffff)
  644.         {
  645.             i = 0;
  646.             break;
  647.         }
  648.         else
  649.         {
  650.             i++;
  651.         }
  652.     }
  653.     currInputMethodIndex = i;
  654. }
  655. /*****************************************************************************
  656.  * FUNCTION
  657.  *  mmi_phnset_2line_prfr_input_get_default
  658.  * DESCRIPTION
  659.  *  This function is called to get the default value for prefered input menuitem
  660.  * PARAMETERS
  661.  *  item_index      [IN]        Menuitem index
  662.  * RETURNS
  663.  *  void
  664.  *****************************************************************************/
  665. S32 mmi_phnset_2line_prfr_input_get_default(S32 item_index)
  666. {
  667.     /*----------------------------------------------------------------*/
  668.     /* Local Variables                                                */
  669.     /*----------------------------------------------------------------*/
  670.     /*----------------------------------------------------------------*/
  671.     /* Code Body                                                      */
  672.     /*----------------------------------------------------------------*/
  673.     return currInputMethodIndex;
  674. }
  675. /*****************************************************************************
  676.  * FUNCTION
  677.  *  mmi_phnset_2line_prfr_input_set_default
  678.  * DESCRIPTION
  679.  *  This function is called to set the value
  680.  * PARAMETERS
  681.  *  void
  682.  * RETURNS
  683.  *  void
  684.  *****************************************************************************/
  685. void mmi_phnset_2line_prfr_input_set_default(void)
  686. {
  687.     /*----------------------------------------------------------------*/
  688.     /* Local Variables                                                */
  689.     /*----------------------------------------------------------------*/
  690.     S32 i = 0;
  691.     /*----------------------------------------------------------------*/
  692.     /* Code Body                                                      */
  693.     /*----------------------------------------------------------------*/
  694.     while (MMI_all_prefered_input_mode_set[i] != MMI_prefered_input_type)
  695.     {
  696.         if (MMI_all_prefered_input_mode_set[i] == 0xffff)
  697.         {
  698.             i = 0;
  699.             break;
  700.         }
  701.         else
  702.         {
  703.             i++;
  704.         }
  705.     }
  706.     currInputMethodIndex = i;
  707. }
  708. #endif /* __MMI_PHNSET_TWO_LINE_MENUITEM_DISPLAY__ */ 
  709. /* __CUSTPACK_MULTIBIN     Terry   END */
  710. #endif /* __MMI_PREFER_INPUT_METHOD__ */ 
  711. /*********************************************END OF FILE *************************************/