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

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.  * DictionaryMain.c
  40.  *
  41.  * Project:
  42.  * --------
  43.  *   MAUI
  44.  *
  45.  * Description:
  46.  * ------------
  47.  *   This file is intends for Dictionary UI implementation
  48.  *
  49.  * Author:
  50.  * Rajbir Singh
  51.  * -------
  52.  *
  53.  
  54.  *------------------------------------------------------------------------------
  55.  * Upper this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
  56.  *============================================================================
  57.  ****************************************************************************/
  58. #include "MMI_features.h"
  59. #if defined(__MMI_DICTIONARY__)
  60. #if defined(MMI_ON_HARDWARE_P)  /* Not support in PC Simulator */
  61. #include "stdC.h"
  62. #include "L4Dr1.h"
  63. #include "PixtelDataTypes.h"
  64. #include "GlobalConstants.h"
  65. #include "DebugInitDef.h"
  66. #include "wgui_categories.h"
  67. #include "wgui_categories_inputs.h"
  68. #include "HistoryGprot.h"
  69. #include "Unicodexdcl.h"
  70. #include "GlobalDefs.h"
  71. #include "CommonScreens.h"
  72. #include "SettingProfile.h"
  73. #include "DictionaryMain.h"
  74. #if defined(__MMI_DICT_GV__)
  75. #include "DictionaryCoreGV.h"
  76. #elif defined(__MMI_DICT_MOTECH__ )
  77. #include "DictionaryCoreMOTECH.h"
  78. #elif defined(__MMI_DICT_TRILOGY__ )
  79. #include "DictionaryCoreTRILOGY.h"
  80. #endif 
  81. /*
  82.  * Local Variable
  83.  */
  84. pBOOL g_dictionary_last_item = FALSE;
  85. U8 g_mmi_dictionary_prev_input_mode;
  86. S32 g_dictionary_prev_index;
  87. S32 g_dictionary_highlighted_item;
  88. #if defined(__MMI_DICT_GV__) || defined(__MMI_DICT_MOTECH__)
  89. U8 g_dictionary_result_buffer[(1024) * 7];              /* result buffer that contains all data to show to user */
  90. #elif defined(__MMI_DICT_TRILOGY__)
  91. U8 g_dictionary_result_buffer[(1024) * 3];              /* result buffer that contains all data to show to user */
  92. #endif 
  93. U8 g_dictionary_input_buffer[(DICTIONARY_INPUT_LENGTH + 1) * ENCODING_LENGTH];  /* Input buffer on main dictionary screen */
  94. U8 g_dictionary_wildcard_exact_buffer[(DICTIONARY_INPUT_LENGTH + 1) * ENCODING_LENGTH]; /* input buffer for wildcard,exact and chinese string search */
  95. U8 g_dictionary_input[(MMI_DICT_CORE_WORD_MAX + 1) * ENCODING_LENGTH];
  96. U8 g_dictionary_last_word[(MMI_DICT_CORE_WORD_MAX + 1) * ENCODING_LENGTH];
  97. U8 g_dictionary_first_displayed_buffer[(MMI_DICT_CORE_WORD_MAX + 1) * ENCODING_LENGTH];
  98. mmi_dictionary_search_type g_dictionary_search_type;    /* Search enum : can be Browse, Exact, Wildcard search */
  99. mmi_dictionary_cntx g_dictionary_cntx;                  /* context stucture to hold various global flags */
  100. S16 *g_dictionary_input_mode;   /* Input mode for dictionary screen */
  101. S16 g_dictionary_input_mode_Chinese_set[] = 
  102. {
  103.     INPUT_MODE_MULTITAP_UPPERCASE_ABC,
  104.     INPUT_MODE_MULTITAP_LOWERCASE_ABC,
  105.     INPUT_MODE_TR_MULTITAP_BOPOMO,
  106.     INPUT_MODE_SM_MULTITAP_PINYIN,
  107. #if !defined(__MMI_TOUCH_SCREEN__)
  108.     INPUT_MODE_TR_BOPOMO,
  109.     INPUT_MODE_SM_PINYIN,
  110.     INPUT_MODE_TR_STROKE,
  111.     INPUT_MODE_SM_STROKE,
  112. #endif /* !defined(__MMI_TOUCH_SCREEN__) */ 
  113.     -1
  114. };
  115. /*
  116.  * Global Variable
  117.  */
  118. extern pBOOL GetUCS2Flag(PS8);
  119. extern U8 MMI_current_input_mode;   /* Global variable to get the input method */
  120. extern U8 wgui_multiline_inputbox_input_type;
  121. /* Adaptation layer structures */
  122. mmi_dict_id_str_struct g_dict_wildcard_ids[MMI_DICT_ID_FETCH_MAX + 1], ID,
  123.     g_dict_chinese_ids[MMI_DICT_ID_FETCH_MAX + 1];
  124. mmi_dict_result_struct g_dict_fetchresult;
  125. MMI_DICTIONARY_LANGUAGE g_dict_current_language, g_dictionary_language_main_screen;
  126. /*
  127.  * Global Function
  128.  */
  129. /*****************************************************************************
  130.  * FUNCTION
  131.  *  mmi_dictionary_init
  132.  * DESCRIPTION
  133.  *  Initialize Dictionary database. Set highlight handlers
  134.  * PARAMETERS
  135.  *  void
  136.  * RETURNS
  137.  *  void
  138.  *****************************************************************************/
  139. void mmi_dictionary_init(void)
  140. {
  141.     /*----------------------------------------------------------------*/
  142.     /* Local Variables                                                */
  143.     /*----------------------------------------------------------------*/
  144.     /*----------------------------------------------------------------*/
  145.     /* Code Body                                                      */
  146.     /*----------------------------------------------------------------*/
  147.     SetHiliteHandler(EXTRA_DICTIONARY_MENU, mmi_dictionary_main_menu_highlight_hdlr);
  148.     SetHiliteHandler(DICTIONARY_OPTION_SHOW_MEANING_MENU, mmi_dictionary_show_meaning_highlight_hdlr);
  149. #ifdef __MMI_DICTIONARY_WILDCARD_SEARCH__
  150.     SetHiliteHandler(DICTIONARY_OPTION_WILDCARD_SEARCH_MENU, mmi_dictionary_wildcard_highlight_hdlr);
  151. #endif 
  152.     SetHiliteHandler(DICTIONARY_OPTION_EXACT_SEARCH_MENU, mmi_dictionary_exact_highlight_hdlr);
  153. #ifndef __MMI_DICTIONARY_SMALL_SCREEN__
  154.     SetHiliteHandler(DICTIONARY_OPTION_INPUT_METHOD, mmi_dictionary_input_method_highlight_hdlr);
  155. #endif 
  156.     SetHiliteHandler(DICTIONARY_EDITOR_OPTION_SEARCH_MENU, mmi_dictionary_editor_option_search_highlight_hdlr);
  157.     SetHiliteHandler(
  158.         DICTIONARY_EDITOR_OPTION_INPUT_METHOD_MENU,
  159.         mmi_dictionary_editor_option_input_method_highlight_hdlr);
  160.     /* Assign input mode for the dictionary */
  161.     g_dictionary_input_mode = g_dictionary_input_mode_Chinese_set;
  162. }
  163. /*
  164.  * Local Function
  165.  */
  166. /*****************************************************************************
  167.  * FUNCTION
  168.  *  mmi_dictionary_main_menu_highlight_hdlr
  169.  * DESCRIPTION
  170.  *  Highlight handler for the Dictionary menu in Extra menu list
  171.  * PARAMETERS
  172.  *  void
  173.  * RETURNS
  174.  *  void
  175.  *****************************************************************************/
  176. void mmi_dictionary_main_menu_highlight_hdlr(void)
  177. {
  178.     /*----------------------------------------------------------------*/
  179.     /* Local Variables                                                */
  180.     /*----------------------------------------------------------------*/
  181.     /*----------------------------------------------------------------*/
  182.     /* Code Body                                                      */
  183.     /*----------------------------------------------------------------*/
  184.     ChangeLeftSoftkey(STR_GLOBAL_OK, IMG_GLOBAL_OK);
  185.     ChangeRightSoftkey(STR_GLOBAL_BACK, IMG_GLOBAL_BACK);
  186.     SetLeftSoftkeyFunction(mmi_dictionary_entry_welcome_screen, KEY_EVENT_UP);
  187.     SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
  188.     SetKeyHandler(mmi_dictionary_entry_welcome_screen, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
  189.     SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
  190. }
  191. /*****************************************************************************
  192.  * FUNCTION
  193.  *  mmi_dictionary_show_meaning_highlight_hdlr
  194.  * DESCRIPTION
  195.  *  Highlight handler for the Show Meaning in Dictionary option menu list
  196.  * PARAMETERS
  197.  *  void
  198.  * RETURNS
  199.  *  void
  200.  *****************************************************************************/
  201. void mmi_dictionary_show_meaning_highlight_hdlr(void)
  202. {
  203.     /*----------------------------------------------------------------*/
  204.     /* Local Variables                                                */
  205.     /*----------------------------------------------------------------*/
  206.     /*----------------------------------------------------------------*/
  207.     /* Code Body                                                      */
  208.     /*----------------------------------------------------------------*/
  209.     ChangeLeftSoftkey(STR_GLOBAL_OK, IMG_GLOBAL_OK);
  210.     ChangeRightSoftkey(STR_GLOBAL_BACK, IMG_GLOBAL_BACK);
  211.     g_dictionary_search_type = DICTIONARY_BROWSE;
  212. #ifdef __MMI_DICTIONARY_SMALL_SCREEN__
  213.     g_dict_current_language = DICTIONARY_ENGLISH;
  214. #else 
  215.     g_dict_current_language = g_dictionary_language_main_screen;
  216. #endif 
  217.     SetLeftSoftkeyFunction(mmi_dictionary_entry_result_screen, KEY_EVENT_UP);
  218.     SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
  219.     SetKeyHandler(mmi_dictionary_entry_result_screen, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
  220.     SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
  221. }
  222. /*****************************************************************************
  223.  * FUNCTION
  224.  *  mmi_dictionary_wildcard_highlight_hdlr
  225.  * DESCRIPTION
  226.  *  Highlight handler for the Wildcard Search menu in Dictionary option menu list
  227.  * PARAMETERS
  228.  *  void
  229.  * RETURNS
  230.  *  void
  231.  *****************************************************************************/
  232. void mmi_dictionary_wildcard_highlight_hdlr(void)
  233. {
  234.     /*----------------------------------------------------------------*/
  235.     /* Local Variables                                                */
  236.     /*----------------------------------------------------------------*/
  237.     /*----------------------------------------------------------------*/
  238.     /* Code Body                                                      */
  239.     /*----------------------------------------------------------------*/
  240.     ChangeLeftSoftkey(STR_GLOBAL_OK, IMG_GLOBAL_OK);
  241.     ChangeRightSoftkey(STR_GLOBAL_BACK, IMG_GLOBAL_BACK);
  242.     g_dictionary_search_type = DICTIONARY_WILDCARD_SEARCH;
  243.     memset(g_dictionary_wildcard_exact_buffer, 0, ENCODING_LENGTH);
  244.     SetLeftSoftkeyFunction(mmi_dictionary_entry_wildcard_exact_editor_screen, KEY_EVENT_UP);
  245.     SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
  246.     SetKeyHandler(mmi_dictionary_entry_wildcard_exact_editor_screen, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
  247.     SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
  248. }
  249. /*****************************************************************************
  250.  * FUNCTION
  251.  *  mmi_dictionary_exact_highlight_hdlr
  252.  * DESCRIPTION
  253.  *  Highlight handler for the Exact Search menu in Dictionary option menu list
  254.  * PARAMETERS
  255.  *  void
  256.  * RETURNS
  257.  *  void
  258.  *****************************************************************************/
  259. void mmi_dictionary_exact_highlight_hdlr(void)
  260. {
  261.     /*----------------------------------------------------------------*/
  262.     /* Local Variables                                                */
  263.     /*----------------------------------------------------------------*/
  264.     /*----------------------------------------------------------------*/
  265.     /* Code Body                                                      */
  266.     /*----------------------------------------------------------------*/
  267.     ChangeLeftSoftkey(STR_GLOBAL_OK, IMG_GLOBAL_OK);
  268.     ChangeRightSoftkey(STR_GLOBAL_BACK, IMG_GLOBAL_BACK);
  269.     g_dictionary_search_type = DICTIONARY_EXACT_SEARCH;
  270.     memset(g_dictionary_wildcard_exact_buffer, 0, ENCODING_LENGTH);
  271.     SetLeftSoftkeyFunction(mmi_dictionary_entry_wildcard_exact_editor_screen, KEY_EVENT_UP);
  272.     SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
  273.     SetKeyHandler(mmi_dictionary_entry_wildcard_exact_editor_screen, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
  274.     SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
  275. }
  276. /*****************************************************************************
  277.  * FUNCTION
  278.  *  mmi_dictionary_input_method_highlight_hdlr
  279.  * DESCRIPTION
  280.  *  Highlight handler for the input method menu in Dictionary option menu list
  281.  * PARAMETERS
  282.  *  void
  283.  * RETURNS
  284.  *  void
  285.  *****************************************************************************/
  286. void mmi_dictionary_input_method_highlight_hdlr(void)
  287. {
  288.     /*----------------------------------------------------------------*/
  289.     /* Local Variables                                                */
  290.     /*----------------------------------------------------------------*/
  291.     /*----------------------------------------------------------------*/
  292.     /* Code Body                                                      */
  293.     /*----------------------------------------------------------------*/
  294.     ChangeLeftSoftkey(STR_GLOBAL_OK, IMG_GLOBAL_OK);
  295.     ChangeRightSoftkey(STR_GLOBAL_BACK, IMG_GLOBAL_BACK);
  296.     SetLeftSoftkeyFunction(EntryAPRequiredInputMethodScreen, KEY_EVENT_UP);
  297.     SetKeyHandler(EntryAPRequiredInputMethodScreen, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
  298.     RegisterInputMethodScreenCloseFunction(DictionaryGoBackMainScreen);
  299. }
  300. /*****************************************************************************
  301.  * FUNCTION
  302.  *  mmi_dictionary_editor_option_search_highlight_hdlr
  303.  * DESCRIPTION
  304.  *  Highlight handler for the search menu in Dictionary editor option menu list
  305.  * PARAMETERS
  306.  *  void
  307.  * RETURNS
  308.  *  void
  309.  *****************************************************************************/
  310. void mmi_dictionary_editor_option_search_highlight_hdlr(void)
  311. {
  312.     /*----------------------------------------------------------------*/
  313.     /* Local Variables                                                */
  314.     /*----------------------------------------------------------------*/
  315.     /*----------------------------------------------------------------*/
  316.     /* Code Body                                                      */
  317.     /*----------------------------------------------------------------*/
  318.     ChangeLeftSoftkey(STR_GLOBAL_OK, IMG_GLOBAL_OK);
  319.     ChangeRightSoftkey(STR_GLOBAL_BACK, IMG_GLOBAL_BACK);
  320.     SetLeftSoftkeyFunction(mmi_dictionary_entry_search, KEY_EVENT_UP);
  321.     SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
  322.     SetKeyHandler(mmi_dictionary_entry_search, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
  323.     SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
  324. }
  325. /*****************************************************************************
  326.  * FUNCTION
  327.  *  mmi_dictionary_editor_option_input_method_highlight_hdlr
  328.  * DESCRIPTION
  329.  *  Highlight handler for the input method menu in Dictionary option menu list
  330.  * PARAMETERS
  331.  *  void
  332.  * RETURNS
  333.  *  void
  334.  *****************************************************************************/
  335. void mmi_dictionary_editor_option_input_method_highlight_hdlr(void)
  336. {
  337.     /*----------------------------------------------------------------*/
  338.     /* Local Variables                                                */
  339.     /*----------------------------------------------------------------*/
  340.     /*----------------------------------------------------------------*/
  341.     /* Code Body                                                      */
  342.     /*----------------------------------------------------------------*/
  343.     ChangeLeftSoftkey(STR_GLOBAL_OK, IMG_GLOBAL_OK);
  344.     ChangeRightSoftkey(STR_GLOBAL_BACK, IMG_GLOBAL_BACK);
  345.     SetLeftSoftkeyFunction(EntryAPRequiredInputMethodScreen, KEY_EVENT_UP);
  346.     SetKeyHandler(EntryAPRequiredInputMethodScreen, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
  347.     RegisterInputMethodScreenCloseFunction(DictionaryGoBackEditorScreen);
  348. }
  349. /*****************************************************************************
  350.  * FUNCTION
  351.  *  DictionaryGoBackMainScreen
  352.  * DESCRIPTION
  353.  *  Go back to Main dictionary screen.
  354.  * PARAMETERS
  355.  *  void
  356.  * RETURNS
  357.  *  void
  358.  *****************************************************************************/
  359. void DictionaryGoBackMainScreen(void)
  360. {
  361.     /*----------------------------------------------------------------*/
  362.     /* Local Variables                                                */
  363.     /*----------------------------------------------------------------*/
  364.     /*----------------------------------------------------------------*/
  365.     /* Code Body                                                      */
  366.     /*----------------------------------------------------------------*/
  367.     GoBackToHistory(SCR_DICTIONARY_MAIN);
  368. }
  369. /*****************************************************************************
  370.  * FUNCTION
  371.  *  DictionaryGoBackEditorScreen
  372.  * DESCRIPTION
  373.  *  Go back to  dictionary editor screen(exact/wildcard).
  374.  * PARAMETERS
  375.  *  void
  376.  * RETURNS
  377.  *  void
  378.  *****************************************************************************/
  379. void DictionaryGoBackEditorScreen(void)
  380. {
  381.     /*----------------------------------------------------------------*/
  382.     /* Local Variables                                                */
  383.     /*----------------------------------------------------------------*/
  384.     /*----------------------------------------------------------------*/
  385.     /* Code Body                                                      */
  386.     /*----------------------------------------------------------------*/
  387.     GoBackToHistory(SCR_DICTIONARY_WILDCARD_EXACT_EDITOR);
  388. }
  389. /*****************************************************************************
  390.  * FUNCTION
  391.  *  mmi_dictionary_entry_welcome_screen
  392.  * DESCRIPTION
  393.  *  Welcome screen, when user enter first time in this screen,a customer logo is shown.
  394.  * PARAMETERS
  395.  *  void
  396.  * RETURNS
  397.  *  void
  398.  *****************************************************************************/
  399. void mmi_dictionary_entry_welcome_screen(void)
  400. {
  401. #ifdef __MMI_DICTIONARY_WELCOME_SCREEN__
  402.     /*----------------------------------------------------------------*/
  403.     /* Local Variables                                                */
  404.     /*----------------------------------------------------------------*/
  405.     U8 *guiBuffer;
  406.     /*----------------------------------------------------------------*/
  407.     /* Code Body                                                      */
  408.     /*----------------------------------------------------------------*/
  409.     guiBuffer = GetCurrGuiBuffer(SCR_DICTIONARY_WELCOME_SCREEN);
  410.     EntryNewScreen(SCR_DICTIONARY_WELCOME_SCREEN, NULL, mmi_dictionary_entry_welcome_screen, NULL);
  411.     ShowCategory129Screen(
  412.         (U8*) get_string(STR_DICTIONARY_TITLE),
  413.         GetRootTitleIcon(EXTRA_DICTIONARY_MENU),
  414.         STR_GLOBAL_OK,
  415.         IMG_GLOBAL_OK,
  416.         STR_GLOBAL_BACK,
  417.         IMG_GLOBAL_BACK,
  418.         IMG_DICTIONARY_LOGO,
  419.         guiBuffer);
  420.     SetLeftSoftkeyFunction(mmi_dictionary_pre_entry_main_screen, KEY_EVENT_UP);
  421.     SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
  422. #else /* __MMI_DICTIONARY_WELCOME_SCREEN__ */ 
  423.     mmi_dictionary_pre_entry_main_screen();
  424. #endif /* __MMI_DICTIONARY_WELCOME_SCREEN__ */ 
  425. }
  426. /*****************************************************************************
  427.  * FUNCTION
  428.  *  mmi_dictionary_pre_entry_main_screen
  429.  * DESCRIPTION
  430.  *  initialize dictionary database
  431.  * PARAMETERS
  432.  *  void
  433.  * RETURNS
  434.  *  void
  435.  *****************************************************************************/
  436. void mmi_dictionary_pre_entry_main_screen(void)
  437. {
  438.     /*----------------------------------------------------------------*/
  439.     /* Local Variables                                                */
  440.     /*----------------------------------------------------------------*/
  441.     pBOOL dictResult;
  442.     /*----------------------------------------------------------------*/
  443.     /* Code Body                                                      */
  444.     /*----------------------------------------------------------------*/
  445.     dictResult = mmi_dict_init();
  446.     if (dictResult == FALSE)
  447.     {
  448.         PRINT_INFORMATION(("---[DictionaryMain.c] Failed to initialize Dictionary n"));
  449.         return;
  450.     }
  451.     mmi_dictionary_entry_main_screen();
  452. }
  453. /*****************************************************************************
  454.  * FUNCTION
  455.  *  mmi_dictionary_entry_main_screen
  456.  * DESCRIPTION
  457.  *  Entry function for main dictionary screen
  458.  * PARAMETERS
  459.  *  void
  460.  * RETURNS
  461.  *  void
  462.  *****************************************************************************/
  463. void mmi_dictionary_entry_main_screen(void)
  464. {
  465.     /*----------------------------------------------------------------*/
  466.     /* Local Variables                                                */
  467.     /*----------------------------------------------------------------*/
  468.     U8 *guiBuffer;
  469.     S32 cnt;
  470.     MMI_DICTIONARY_LANGUAGE currentLanguage;
  471.     /*----------------------------------------------------------------*/
  472.     /* Code Body                                                      */
  473.     /*----------------------------------------------------------------*/
  474.     g_dictionary_search_type = DICTIONARY_BROWSE;
  475.     g_dict_current_language = g_dictionary_language_main_screen;
  476.     g_dictionary_prev_index = -1;
  477.     EntryNewScreen(SCR_DICTIONARY_MAIN, mmi_dictionary_exit_main_screen, mmi_dictionary_entry_main_screen, NULL);
  478.     guiBuffer = GetCurrGuiBuffer(SCR_DICTIONARY_MAIN);
  479.     RegisterCat200SearchFunction(mmi_dictionary_find_entry);
  480.     RegisterHighlightHandler(mmi_dictionary_word_hdlr);
  481.     if (guiBuffer == NULL)
  482.     {
  483.         memset(g_dict_chinese_ids, 0, sizeof(mmi_dict_id_str_struct) * (MMI_DICT_ID_FETCH_MAX + 1));
  484.         g_dictionary_cntx.current_selected_index = 0;
  485.         wgui_multiline_inputbox_input_type = 0;
  486.         /* Default language is English for first time entry */
  487.         g_dict_current_language = DICTIONARY_ENGLISH;
  488.         memset(g_dictionary_input_buffer, 0, ENCODING_LENGTH);
  489.         if (g_dict_current_language == DICTIONARY_ENGLISH)
  490.         {
  491.             AnsiiToUnicodeString((S8*) g_dictionary_input, (S8*) "a");
  492.             cnt = mmi_dict_exact_search_id(
  493.                     (PS8) g_dictionary_input,
  494.                     (U8) g_dict_current_language,
  495.                     (U8) ! g_dict_current_language);
  496.             g_dictionary_cntx.total_browse_entry = (S32) mmi_dict_get_total_num((PS8) g_dictionary_input);
  497.             g_dictionary_cntx.starting_index = cnt;
  498.         }
  499.         else if (g_dict_current_language == DICTIONARY_CHINESE)
  500.         {
  501.             g_dictionary_cntx.total_browse_entry = 0;
  502.             g_dictionary_cntx.starting_index = 0;
  503.         }
  504.         ClearKeyHandler(KEY_UP_ARROW, KEY_EVENT_DOWN);
  505.     }
  506.     else
  507.     {
  508.         memset(g_dictionary_last_word, 0, ENCODING_LENGTH);
  509.         /*
  510.          *  Previous input method is just set to any member of previous family. Here Family is important to know.
  511.          *  the assigned mode can be any mode from a family
  512.          */
  513.         switch (g_dict_current_language)
  514.         {
  515.             case DICTIONARY_ENGLISH:
  516.                 g_mmi_dictionary_prev_input_mode = INPUT_MODE_MULTITAP_LOWERCASE_ABC;
  517.                 break;
  518.             case DICTIONARY_CHINESE:
  519.                 g_mmi_dictionary_prev_input_mode = INPUT_MODE_TR_MULTITAP_BOPOMO;
  520.                 break;
  521.             default:
  522.                 g_mmi_dictionary_prev_input_mode = INPUT_MODE_MULTITAP_LOWERCASE_ABC;
  523.         }
  524.         /* 
  525.          *  wgui_multiline_inputbox_input_type =0 means set to none.
  526.          *  wgui_multiline_inputbox_input_type is set when input method is changed from "input method" option.
  527.          */
  528.         if (wgui_multiline_inputbox_input_type != 0)
  529.         {
  530.             currentLanguage = mmi_dictionary_check_input_family((U8) wgui_multiline_inputbox_input_type);
  531.             if (currentLanguage != g_dict_current_language)
  532.             {
  533.                 switch (currentLanguage)
  534.                 {
  535.                     case DICTIONARY_ENGLISH:
  536.                         AnsiiToUnicodeString((S8*) g_dictionary_input, (S8*) "a");
  537.                         cnt = mmi_dict_exact_search_id(
  538.                                 (PS8) g_dictionary_input,
  539.                                 (U8) g_dict_current_language,
  540.                                 (U8) ! g_dict_current_language);
  541.                         g_dictionary_cntx.total_browse_entry = (S32) mmi_dict_get_total_num((PS8) g_dictionary_input);
  542.                         g_dictionary_cntx.starting_index = cnt;
  543.                         break;
  544.                     case DICTIONARY_CHINESE:
  545.                         g_dictionary_cntx.total_browse_entry = 0;
  546.                         g_dictionary_cntx.starting_index = 0;
  547.                         break;
  548.                     default:
  549.                         g_dictionary_cntx.total_browse_entry = 0;
  550.                         g_dictionary_cntx.starting_index = 0;
  551.                 }
  552.             }
  553.         }
  554.     }
  555. #ifdef __MMI_UI_HINTS_IN_MENUITEM__
  556.     set_force_icon_on_highlight_only_in_menuitem();
  557. #endif 
  558.     Register_pound_key_buffer_flush_test_function(mmi_dictionary_flush_editor_buffer);
  559.     Register_appl_present_function(isFromDictionary);
  560. #ifdef __MMI_DICTIONARY_SMALL_SCREEN__
  561.     ShowCategory200Screen(
  562.         STR_DICTIONARY_TITLE,
  563.         GetRootTitleIcon(EXTRA_DICTIONARY_MENU),
  564.         STR_GLOBAL_OPTIONS,
  565.         IMG_GLOBAL_OPTIONS,
  566.         STR_GLOBAL_BACK,
  567.         IMG_GLOBAL_BACK,
  568.         g_dictionary_cntx.total_browse_entry,
  569.         mmi_dictionary_list_get_item,
  570.         NULL,
  571.         0,
  572.         IMG_DICTIONARY_SEARCH,
  573.         (U8*) g_dictionary_input_buffer,
  574.         DICTIONARY_INPUT_LENGTH + 1,
  575.         guiBuffer);
  576.     SetCategory200RightSoftkeyFunction(mmi_dictionary_exit_engine, KEY_EVENT_UP);
  577. #else /* __MMI_DICTIONARY_SMALL_SCREEN__ */ 
  578.     wgui_set_e_dictionary_test_clear_inputbox_buffer_funcptr(dictionary_dummy_function);
  579.     cat201_register_language_changed_indicator(IsDictionaryLanguageChanged);
  580.     ShowCategory201Screen(
  581.         STR_DICTIONARY_TITLE,
  582.         GetRootTitleIcon(EXTRA_DICTIONARY_MENU),
  583.         STR_GLOBAL_OPTIONS,
  584.         IMG_GLOBAL_OPTIONS,
  585.         STR_GLOBAL_BACK,
  586.         IMG_GLOBAL_BACK,
  587.         g_dictionary_cntx.total_browse_entry,
  588.         mmi_dictionary_list_get_item,
  589.         NULL,
  590.         0,
  591.         IMG_DICTIONARY_SEARCH,
  592.         (U8*) g_dictionary_input_buffer,
  593.         DICTIONARY_INPUT_LENGTH + 1,
  594.         INPUT_TYPE_ALPHANUMERIC_UPPERCASE,
  595.         guiBuffer,
  596.         g_dictionary_input_mode);
  597.     SetCategory201RightSoftkeyFunction(mmi_dictionary_exit_engine, KEY_EVENT_UP);
  598. #endif /* __MMI_DICTIONARY_SMALL_SCREEN__ */ 
  599.     g_mmi_dictionary_prev_input_mode = MMI_current_input_mode;
  600.     SetKeyHandler(mmi_dictionary_entry_result_screen, KEY_ENTER, KEY_EVENT_DOWN);
  601.     SetCategory200LeftSoftkeyFunction(mmi_dictionary_entry_main_option_screen, KEY_EVENT_UP);
  602.     SetLeftSoftkeyFunction(mmi_dictionary_entry_main_option_screen, KEY_EVENT_UP);
  603. }
  604. /*****************************************************************************
  605.  * FUNCTION
  606.  *  mmi_dictionary_exit_main_screen
  607.  * DESCRIPTION
  608.  *  Exit function for main screen
  609.  * PARAMETERS
  610.  *  void
  611.  * RETURNS
  612.  *  void
  613.  *****************************************************************************/
  614. void mmi_dictionary_exit_main_screen(void)
  615. {
  616.     /*----------------------------------------------------------------*/
  617.     /* Local Variables                                                */
  618.     /*----------------------------------------------------------------*/
  619.     /*----------------------------------------------------------------*/
  620.     /* Code Body                                                      */
  621.     /*----------------------------------------------------------------*/
  622.     memset(g_dictionary_last_word, 0, ENCODING_LENGTH);
  623.     memset(g_dictionary_first_displayed_buffer, 0, ENCODING_LENGTH);
  624.     g_dictionary_language_main_screen = g_dict_current_language;
  625.     g_dictionary_highlighted_item = DynamicListGetHighlightedItem((U8*) g_dictionary_last_word);
  626.     DynamicGetFirstDisplayedItem((U8*) g_dictionary_first_displayed_buffer);
  627.     g_dictionary_prev_index = -1;
  628. }
  629. /*****************************************************************************
  630.  * FUNCTION
  631.  *  dictionary_dummy_function
  632.  * DESCRIPTION
  633.  *  dummy function assigned
  634.  * PARAMETERS
  635.  *  void
  636.  * RETURNS
  637.  *  void
  638.  *****************************************************************************/
  639. pBOOL dictionary_dummy_function(void)
  640. {
  641.     /*----------------------------------------------------------------*/
  642.     /* Local Variables                                                */
  643.     /*----------------------------------------------------------------*/
  644.     /*----------------------------------------------------------------*/
  645.     /* Code Body                                                      */
  646.     /*----------------------------------------------------------------*/
  647.     return FALSE;
  648. }
  649. /*****************************************************************************
  650.  * FUNCTION
  651.  *  IsDictionaryLanguageChanged
  652.  * DESCRIPTION
  653.  *  This function tell the GUI layer if language has been changes while coming back from history
  654.  * PARAMETERS
  655.  *  input_type      [IN]        changed input type
  656.  * RETURNS
  657.  *  BOOL TRUE : language has been changed.
  658.  *  FALSE : language is not changed
  659.  *****************************************************************************/
  660. BOOL IsDictionaryLanguageChanged(U8 input_type)
  661. {
  662.     /*----------------------------------------------------------------*/
  663.     /* Local Variables                                                */
  664.     /*----------------------------------------------------------------*/
  665.     MMI_DICTIONARY_LANGUAGE currentLanguage;
  666.     pBOOL languageChanged = MMI_FALSE;
  667.     /*----------------------------------------------------------------*/
  668.     /* Code Body                                                      */
  669.     /*----------------------------------------------------------------*/
  670.     currentLanguage = mmi_dictionary_check_input_family((U8) input_type);
  671.     if (g_dict_current_language != currentLanguage)
  672.     {
  673.         languageChanged = MMI_TRUE;
  674.         memset(g_dictionary_input_buffer, 0, ENCODING_LENGTH);
  675.     }
  676.     else
  677.     {
  678.         languageChanged = MMI_FALSE;
  679.     }
  680.     switch (currentLanguage)
  681.     {
  682.         case DICTIONARY_ENGLISH:
  683.             g_dict_current_language = DICTIONARY_ENGLISH;
  684.             break;
  685.         case DICTIONARY_CHINESE:
  686.             g_dict_current_language = DICTIONARY_CHINESE;
  687.             break;
  688.         default:
  689.             g_dict_current_language = DICTIONARY_NONE;
  690.     }
  691.     return languageChanged;
  692. }
  693. /*****************************************************************************
  694.  * FUNCTION
  695.  *  mmi_dictionary_exit_engine
  696.  * DESCRIPTION
  697.  *  Exit function dictionary. Deinitilize dictionary memory
  698.  * PARAMETERS
  699.  *  void
  700.  * RETURNS
  701.  *  void
  702.  *****************************************************************************/
  703. void mmi_dictionary_exit_engine(void)
  704. {
  705.     /*----------------------------------------------------------------*/
  706.     /* Local Variables                                                */
  707.     /*----------------------------------------------------------------*/
  708.     pBOOL result;
  709.     /*----------------------------------------------------------------*/
  710.     /* Code Body                                                      */
  711.     /*----------------------------------------------------------------*/
  712.     result = mmi_dict_exit();
  713.     if (result == FALSE)
  714.     {
  715.         PRINT_INFORMATION(("---[DictionaryMain.c] Failed to De-initialize Dictionary n"));
  716.         /* return; */
  717.     }
  718.     GoBackHistory();
  719. }
  720. /*****************************************************************************
  721.  * FUNCTION
  722.  *  mmi_dictionary_word_hdlr
  723.  * DESCRIPTION
  724.  *  General highlight handler for word list in main dictionary screen
  725.  * PARAMETERS
  726.  *  index       [IN]        UI index of current selected word.
  727.  * RETURNS
  728.  *  void
  729.  *****************************************************************************/
  730. void mmi_dictionary_word_hdlr(S32 index)
  731. {
  732.     /*----------------------------------------------------------------*/
  733.     /* Local Variables                                                */
  734.     /*----------------------------------------------------------------*/
  735.     pBOOL result;
  736.     S32 dynamicItems;
  737.     U8 g_dictionary_output[(MMI_DICT_CORE_WORD_MAX + 1) * ENCODING_LENGTH];
  738.     /*----------------------------------------------------------------*/
  739.     /* Code Body                                                      */
  740.     /*----------------------------------------------------------------*/
  741.     g_dictionary_cntx.current_selected_index = index;
  742.     g_dictionary_prev_index = index;
  743.     DynamicListGetHighlightedItem((U8*) g_dictionary_last_word);
  744.     dynamicItems = DynamicListGetItems(NULL, 0);
  745.     if (index <= 0)
  746.     {
  747.         ClearKeyHandler(KEY_UP_ARROW, KEY_EVENT_DOWN);
  748.         ClearKeyHandler(KEY_VOL_UP, KEY_EVENT_DOWN);
  749.         return;
  750.     }
  751.     else
  752.     {
  753.         SetKeyHandler(dynamic_list_goto_previous_item, KEY_UP_ARROW, KEY_EVENT_DOWN);
  754.         SetKeyHandler(dynamic_list_goto_previous_item, KEY_VOL_UP, KEY_EVENT_DOWN);
  755.     }
  756.     if (g_dict_current_language == DICTIONARY_ENGLISH)
  757.     {
  758.         if (g_dictionary_last_item || dynamicItems < 6)
  759.         {
  760.             return;
  761.         }
  762.         if (index >= (S32) (dynamicItems - 1))
  763.         {
  764.             /* this function is called to find out :whether further words exist in the word list */
  765.             result = mmi_dict_get_word_by_indx(
  766.                         (U8) g_dict_current_language,
  767.                         (U16) (g_dictionary_cntx.starting_index + index + 1),
  768.                         (S8*) g_dictionary_output);
  769.             if (result == TRUE)
  770.             {
  771.                 g_dictionary_last_item = FALSE;
  772.             }
  773.             else
  774.             {
  775.                 g_dictionary_last_item = TRUE;
  776.             }
  777.             g_dictionary_cntx.total_browse_entry++;
  778.             DynamicListIncreaseItem((S16) 1);
  779.         }
  780.     }
  781. }
  782. /*****************************************************************************
  783.  * FUNCTION
  784.  *  mmi_dictionary_list_get_item
  785.  * DESCRIPTION
  786.  *  Fill the UI list for display, on request from UI.
  787.  *  mmi_dict_exact_search_id/mmi_dict_exact_search_prev_id/mmi_dict_exact_search_next_id : set the focus to the word,
  788.  *  mmi_dict_get_word_by_indx : get the focused word
  789.  * PARAMETERS
  790.  *  item_index          [IN]        
  791.  *  str_buff            [IN]        
  792.  *  img_buff_p          [?]         
  793.  *  str_img_mask        [IN]        
  794.  * RETURNS
  795.  *  void
  796.  *****************************************************************************/
  797. pBOOL mmi_dictionary_list_get_item(S32 item_index, UI_string_type str_buff, PU8 *img_buff_p, U8 str_img_mask)
  798. {
  799.     /*----------------------------------------------------------------*/
  800.     /* Local Variables                                                */
  801.     /*----------------------------------------------------------------*/
  802.     U8 g_dictionary_output[(MMI_DICT_CORE_WORD_MAX + 1) * ENCODING_LENGTH];
  803.     pBOOL result, bufferCheck;
  804.     S32 index = 0;
  805.     S32 steps;
  806.     U8 *guiBuffer;
  807.     /*----------------------------------------------------------------*/
  808.     /* Code Body                                                      */
  809.     /*----------------------------------------------------------------*/
  810.     guiBuffer = GetCurrGuiBuffer(SCR_DICTIONARY_MAIN);
  811.     memset(g_dictionary_input, 0, ENCODING_LENGTH);
  812.     if (g_dict_current_language == DICTIONARY_ENGLISH)
  813.     {
  814.         /* there is no need to give first 32 elements while coming to history ,when highlighted item is > 35 */
  815.         if (guiBuffer && (g_dictionary_highlighted_item >= 35) && (item_index <= 31))
  816.         {
  817.             index = mmi_dict_exact_search_id(
  818.                         (PS8) g_dictionary_input,
  819.                         (U8) g_dict_current_language,
  820.                         (U8) ! g_dict_current_language);
  821.             str_buff = NULL;
  822.             *img_buff_p = get_image(IMG_DICTIONARY_WORD_LIST_SCREEN);
  823.             return TRUE;
  824.         }
  825.         /* While coming back from history, and UI gets the items to display */
  826.         if (guiBuffer && (item_index > 31))
  827.         {
  828.             steps = DynamicGetFirstDisplayedItem(NULL) - item_index;
  829.             pfnUnicodeStrcpy((S8*) g_dictionary_input, (S8*) g_dictionary_first_displayed_buffer);
  830.             if (steps > 0)
  831.             {
  832.                 index = mmi_dict_exact_search_prev_id(
  833.                             (PS8) g_dictionary_input,
  834.                             (steps),
  835.                             (U8) g_dict_current_language,
  836.                             (U8) ! g_dict_current_language);
  837.             }
  838.             else
  839.             {
  840.                 index = mmi_dict_exact_search_next_id(
  841.                             (PS8) g_dictionary_input,
  842.                             (-steps),
  843.                             (U8) g_dict_current_language,
  844.                             (U8) ! g_dict_current_language);
  845.             }
  846.         }
  847.         else if (item_index == 0)
  848.         {
  849.             pfnUnicodeStrcpy((S8*) g_dictionary_input, (S8*) g_dictionary_input_buffer);
  850.             bufferCheck = mmi_dictionary_check_input_buffer((U8*) g_dictionary_input, (U8) g_dict_current_language);
  851.             if (bufferCheck == TRUE)
  852.             {
  853.                 index = mmi_dict_exact_search_id(
  854.                             (PS8) g_dictionary_input,
  855.                             (U8) g_dict_current_language,
  856.                             (U8) ! g_dict_current_language);
  857.                 g_dictionary_cntx.starting_index = index;
  858.             }
  859.             else
  860.             {
  861.                 memset(g_dictionary_input, 0, ENCODING_LENGTH);
  862.                 AnsiiToUnicodeString((S8*) g_dictionary_input, "a");
  863.                 index = mmi_dict_exact_search_id(
  864.                             (PS8) g_dictionary_input,
  865.                             (U8) g_dict_current_language,
  866.                             (U8) ! g_dict_current_language);
  867.                 g_dictionary_cntx.starting_index = index;
  868.             }
  869.         }
  870.         else if (g_dictionary_prev_index > item_index)
  871.         {
  872.             memset(g_dictionary_input, 0, ENCODING_LENGTH);
  873.             /* get the dynamic element from UI. */
  874.             DynamicListGetItems((U8*) g_dictionary_input, (U16) (item_index + 1));
  875.             index = mmi_dict_exact_search_prev_id(
  876.                         (PS8) g_dictionary_input,
  877.                         1,
  878.                         (U8) g_dict_current_language,
  879.                         (U8) ! g_dict_current_language);
  880.         }
  881.         else if (g_dictionary_prev_index < item_index)
  882.         {
  883.             memset(g_dictionary_input, 0, ENCODING_LENGTH);
  884.             /* get the dynamic element from UI. */
  885.             DynamicListGetItems((U8*) g_dictionary_input, (U16) (item_index - 1));
  886.             index = mmi_dict_exact_search_next_id(
  887.                         (PS8) g_dictionary_input,
  888.                         1,
  889.                         (U8) g_dict_current_language,
  890.                         (U8) ! g_dict_current_language);
  891.         }
  892.         memset(g_dictionary_output, 0, ENCODING_LENGTH);
  893.         result = mmi_dict_get_word_by_indx((U8) g_dict_current_language, (U16) (index), (S8*) g_dictionary_output);
  894.         pfnUnicodeStrcpy((S8*) str_buff, (S8*) g_dictionary_output);
  895.         *img_buff_p = get_image(IMG_DICTIONARY_WORD_LIST_SCREEN);
  896.         g_dictionary_prev_index = item_index;
  897.         return TRUE;
  898.     }
  899. #ifndef __MMI_DICTIONARY_SMALL_SCREEN__
  900.     if (g_dict_current_language == DICTIONARY_CHINESE)
  901.     {
  902.         if (item_index < g_dictionary_cntx.total_browse_entry)
  903.         {
  904.             pfnUnicodeStrcpy((S8*) str_buff, (S8*) g_dict_chinese_ids[item_index].dict_word);
  905.             *img_buff_p = get_image(IMG_DICTIONARY_WORD_LIST_SCREEN);
  906.             return TRUE;
  907.         }
  908.         return FALSE;
  909.     }
  910. #endif /* __MMI_DICTIONARY_SMALL_SCREEN__ */ 
  911.     return FALSE;
  912. }
  913. /*****************************************************************************
  914.  * FUNCTION
  915.  *  mmi_dictionary_find_entry
  916.  * DESCRIPTION
  917.  *  Find the entries in dictionary based upon the input buffer.
  918.  * PARAMETERS
  919.  *  keyword     [?]     
  920.  * RETURNS
  921.  *  void
  922.  *****************************************************************************/
  923. S32 mmi_dictionary_find_entry(U8 *keyword)
  924. {
  925.     /*----------------------------------------------------------------*/
  926.     /* Local Variables                                                */
  927.     /*----------------------------------------------------------------*/
  928.     S32 stringLength, cnt = 0;
  929.     pBOOL bufferCheck;
  930. #ifndef __MMI_DICTIONARY_SMALL_SCREEN__
  931.     U16 resultCount;
  932. #endif 
  933.     /*----------------------------------------------------------------*/
  934.     /* Code Body                                                      */
  935.     /*----------------------------------------------------------------*/
  936.     g_dictionary_last_item = FALSE;
  937.     g_dictionary_prev_index = 0;
  938.     switch (MMI_current_input_mode)
  939.     {
  940.     #ifndef __MMI_DICTIONARY_SMALL_SCREEN__
  941.         case INPUT_MODE_MULTITAP_LOWERCASE_ABC:
  942.         case INPUT_MODE_MULTITAP_UPPERCASE_ABC:
  943.         case INPUT_MODE_SMART_UPPERCASE_ABC:
  944.         case INPUT_MODE_SMART_LOWERCASE_ABC:
  945.         case INPUT_MODE_MMI_LOWERCASE_ABC:
  946.     #else /* __MMI_DICTIONARY_SMALL_SCREEN__ */ 
  947.         case INPUT_MODE_MMI_LOWERCASE_ABC:
  948.     #endif /* __MMI_DICTIONARY_SMALL_SCREEN__ */ 
  949.         {
  950.             stringLength = pfnUnicodeStrlen((S8*) keyword);
  951.             g_dict_current_language = DICTIONARY_ENGLISH;
  952.             memset(g_dictionary_input, 0, ENCODING_LENGTH);
  953.             if (stringLength > 0)
  954.             {
  955.                 pfnUnicodeStrcpy((S8*) g_dictionary_input, (S8*) keyword);
  956.                 bufferCheck = mmi_dictionary_check_input_buffer(g_dictionary_input, (U8) g_dict_current_language);
  957.                 if (bufferCheck == FALSE)
  958.                 {
  959.                     /* First character  is not alphabet */
  960.                     memset(g_dictionary_input, 0, ENCODING_LENGTH);
  961.                     g_dictionary_cntx.starting_index = 0;
  962.                     AnsiiToUnicodeString((S8*) g_dictionary_input, "a");
  963.                     cnt = mmi_dict_exact_search_id(
  964.                             (PS8) g_dictionary_input,
  965.                             (U8) g_dict_current_language,
  966.                             (U8) ! g_dict_current_language);
  967.                     g_dictionary_cntx.total_browse_entry = mmi_dict_get_total_num((S8*) g_dictionary_input);
  968.                     break;
  969.                 }
  970.                 cnt = mmi_dict_exact_search_id(
  971.                         (PS8) g_dictionary_input,
  972.                         (U8) g_dict_current_language,
  973.                         (U8) ! g_dict_current_language);
  974.                 g_dictionary_cntx.starting_index = cnt;
  975.                 g_dictionary_cntx.total_browse_entry = mmi_dict_get_total_num((PS8) g_dictionary_input);
  976.                 break;
  977.             }
  978.             else
  979.             {
  980.                 g_dict_current_language = DICTIONARY_ENGLISH;
  981.                 memset(g_dictionary_input, 0, ENCODING_LENGTH);
  982.                 AnsiiToUnicodeString((S8*) g_dictionary_input, "a");
  983.                 cnt = mmi_dict_exact_search_id(
  984.                         (PS8) g_dictionary_input,
  985.                         (U8) g_dict_current_language,
  986.                         (U8) ! g_dict_current_language);
  987.                 g_dictionary_cntx.starting_index = cnt;
  988.                 g_dictionary_cntx.total_browse_entry = mmi_dict_get_total_num((PS8) g_dictionary_input);
  989.                 break;
  990.             }
  991.             break;
  992.         }
  993.     #ifndef __MMI_DICTIONARY_SMALL_SCREEN__
  994.         case INPUT_MODE_TR_MULTITAP_BOPOMO:
  995.         case INPUT_MODE_TR_STROKE:
  996.         case INPUT_MODE_SM_MULTITAP_PINYIN:
  997.         case INPUT_MODE_SM_STROKE:
  998.         case INPUT_MODE_SM_PINYIN:
  999.         case INPUT_MODE_TR_BOPOMO:
  1000.             g_dict_current_language = DICTIONARY_CHINESE;
  1001.             stringLength = pfnUnicodeStrlen((S8*) keyword);
  1002.             memset(g_dictionary_input, 0, ENCODING_LENGTH);
  1003.             memset(g_dict_chinese_ids, 0, sizeof(mmi_dict_id_str_struct) * (MMI_DICT_ID_FETCH_MAX + 1));
  1004.             g_dictionary_cntx.current_selected_index = 0;
  1005.             if (stringLength != 0)
  1006.             {
  1007.                 pfnUnicodeStrcpy((S8*) g_dictionary_input, (S8*) keyword);
  1008.                 bufferCheck = mmi_dictionary_check_input_buffer(g_dictionary_input, (U8) g_dict_current_language);
  1009.                 if (bufferCheck == FALSE)
  1010.                 {
  1011.                     /* First character  is not chinese character */
  1012.                     g_dictionary_cntx.starting_index = 0;
  1013.                     g_dictionary_cntx.total_browse_entry = 0;
  1014.                     break;
  1015.                 }
  1016.                 resultCount = mmi_dict_wild_search(
  1017.                                 (U8) g_dict_current_language,
  1018.                                 (S8*) g_dictionary_input,
  1019.                                 0,
  1020.                                 MMI_DICT_ID_FETCH_MAX,
  1021.                                 (void*)g_dict_chinese_ids);
  1022.                 g_dictionary_cntx.starting_index = 0;
  1023.                 g_dictionary_cntx.total_browse_entry = resultCount;
  1024.                 break;
  1025.             }
  1026.             else
  1027.             {
  1028.                 memset(g_dict_chinese_ids, 0, sizeof(mmi_dict_id_str_struct) * (MMI_DICT_ID_FETCH_MAX + 1));
  1029.                 g_dictionary_cntx.starting_index = 0;
  1030.                 g_dictionary_cntx.total_browse_entry = 0;
  1031.                 break;
  1032.             }
  1033.             break;
  1034.     #endif /* __MMI_DICTIONARY_SMALL_SCREEN__ */ /* ifndef  __MMI_DICTIONARY_SMALL_SCREEN__ */
  1035.         default:
  1036.             g_dict_current_language = DICTIONARY_NONE;
  1037.             g_dictionary_cntx.starting_index = 0;
  1038.             g_dictionary_cntx.total_browse_entry = 0;
  1039.             break;
  1040.     }
  1041.     return g_dictionary_cntx.total_browse_entry;
  1042. }
  1043. /*****************************************************************************
  1044.  * FUNCTION
  1045.  *  mmi_dictionary_entry_result_screen
  1046.  * DESCRIPTION
  1047.  *  Entry screen for result screen. Shows the meaning of word to the user.
  1048.  * PARAMETERS
  1049.  *  void
  1050.  * RETURNS
  1051.  *  void
  1052.  *****************************************************************************/
  1053. void mmi_dictionary_entry_result_screen(void)
  1054. {
  1055.     /*----------------------------------------------------------------*/
  1056.     /* Local Variables                                                */
  1057.     /*----------------------------------------------------------------*/
  1058.     S8 tempBuf[MMI_DICT_CORE_WORD_MAX * ENCODING_LENGTH];
  1059.     BOOL result = FALSE;
  1060.     /*----------------------------------------------------------------*/
  1061.     /* Code Body                                                      */
  1062.     /*----------------------------------------------------------------*/
  1063.     EntryNewScreen(SCR_DICTIONARY_RESULT, NULL, mmi_dictionary_entry_result_screen, NULL);
  1064.     memset(g_dictionary_result_buffer, 0, ENCODING_LENGTH);
  1065.     memset(&g_dict_fetchresult, 0, sizeof(mmi_dict_result_struct));
  1066.     DeleteScreenIfPresent(SCR_DICTIONARY_EDITOR_OPTION_SCREEN);
  1067.     switch (g_dictionary_search_type)
  1068.     {
  1069.         case DICTIONARY_BROWSE:
  1070.             if (g_dict_current_language == DICTIONARY_ENGLISH)
  1071.             {
  1072.                 result = mmi_dict_exact_search(
  1073.                             (S8*) g_dictionary_last_word,
  1074.                             (U8) g_dict_current_language,
  1075.                             (U8) (!g_dict_current_language),
  1076.                             MMI_DICT_SYNO | MMI_DICT_ANTO | MMI_DICT_SENTS,
  1077.                             &g_dict_fetchresult);
  1078.             }
  1079.             else if (g_dict_current_language == DICTIONARY_CHINESE)
  1080.             {
  1081.                 if (pfnUnicodeStrlen((S8*) g_dict_chinese_ids[g_dictionary_cntx.current_selected_index].dict_word))
  1082.                 {
  1083.                     result = mmi_dict_exact_search(
  1084.                                 (S8*) g_dict_chinese_ids[g_dictionary_cntx.current_selected_index]. dict_word,
  1085.                                 (U8) g_dict_current_language,
  1086.                                 (U8) (!g_dict_current_language),
  1087.                                 MMI_DICT_SYNO | MMI_DICT_ANTO | MMI_DICT_SENTS,
  1088.                                 &g_dict_fetchresult);
  1089.                 }
  1090.                 else
  1091.                 {
  1092.                     result = FALSE;
  1093.                 }
  1094.             }
  1095.             else
  1096.             {
  1097.                 result = FALSE;
  1098.             }
  1099.             break;
  1100.         case DICTIONARY_WILDCARD_SEARCH:
  1101.             result = mmi_dict_exact_search(
  1102.                         (S8*) g_dict_wildcard_ids[g_dictionary_cntx.current_wildcard_search_index]. dict_word,
  1103.                         (U8) g_dict_current_language,
  1104.                         (U8) (!g_dict_current_language),
  1105.                         MMI_DICT_SYNO | MMI_DICT_ANTO | MMI_DICT_SENTS,
  1106.                         &g_dict_fetchresult);
  1107.             break;
  1108.         case DICTIONARY_EXACT_SEARCH:
  1109.             result = mmi_dict_exact_search(
  1110.                         (S8*) g_dictionary_input,
  1111.                         (U8) g_dict_current_language,
  1112.                         (U8) (!g_dict_current_language),
  1113.                         MMI_DICT_SYNO | MMI_DICT_ANTO | MMI_DICT_SENTS,
  1114.                         &g_dict_fetchresult);
  1115.             break;
  1116.     }
  1117.     if (result == FALSE)
  1118.     {
  1119.         DisplayPopup(
  1120.             (PU8) GetString(STR_DICTIONARY_NO_MATCH_FOUND),
  1121.             IMG_GLOBAL_WARNING,
  1122.             FALSE,
  1123.             UI_POPUP_NOTIFYDURATION_TIME_2000,
  1124.             WARNING_TONE);
  1125.         DeleteNScrId(SCR_DICTIONARY_RESULT);
  1126.         return;
  1127.     }
  1128.     if (pfnUnicodeStrlen((S8*) g_dict_fetchresult.dict_word))
  1129.     {
  1130.         pfnUnicodeStrcat((S8*) g_dictionary_result_buffer, (S8*) g_dict_fetchresult.dict_word);
  1131.         pfnUnicodeStrcat((PS8) g_dictionary_result_buffer, (S8*) L"n");
  1132.     }
  1133.     pfnUnicodeStrcat((S8*) g_dictionary_result_buffer, (S8*) g_dict_fetchresult.dict_meaning);
  1134.     if (g_dict_current_language == DICTIONARY_ENGLISH)
  1135.     {
  1136.         if (g_dict_fetchresult.dict_synonym[0] != 0 || g_dict_fetchresult.dict_synonym[1] != 0)
  1137.         {
  1138.             pfnUnicodeStrcpy((S8*) tempBuf, (S8*) L"nn[");
  1139.             pfnUnicodeStrcat((S8*) tempBuf, (S8*) GetString(STR_DICTIONARY_SYNONYMS));
  1140.             pfnUnicodeStrcat((S8*) tempBuf, (S8*) L"]n");
  1141.             pfnUnicodeStrcat((S8*) g_dictionary_result_buffer, (S8*) tempBuf);
  1142.             pfnUnicodeStrcat((S8*) g_dictionary_result_buffer, (S8*) & g_dict_fetchresult.dict_synonym[2]);
  1143.         }
  1144.         if (g_dict_fetchresult.dict_antonym[0] != 0 || g_dict_fetchresult.dict_antonym[1] != 0)
  1145.         {
  1146.             pfnUnicodeStrcpy((S8*) tempBuf, (S8*) L"nn[");
  1147.             pfnUnicodeStrcat((S8*) tempBuf, (S8*) GetString(STR_DICTIONARY_ANTONYMS));
  1148.             pfnUnicodeStrcat((S8*) tempBuf, (S8*) L"]n");
  1149.             pfnUnicodeStrcat((S8*) g_dictionary_result_buffer, (S8*) tempBuf);
  1150.             pfnUnicodeStrcat((S8*) g_dictionary_result_buffer, (S8*) & g_dict_fetchresult.dict_antonym[2]);
  1151.         }
  1152.         if (g_dict_fetchresult.dict_example_sentence[0] != 0 || g_dict_fetchresult.dict_example_sentence[1] != 0)
  1153.         {
  1154.             pfnUnicodeStrcpy((S8*) tempBuf, (S8*) L"nn[");
  1155.             pfnUnicodeStrcat((S8*) tempBuf, (S8*) GetString(STR_DICTIONARY_EXAMPLE_SENTENCE));
  1156.             pfnUnicodeStrcat((S8*) tempBuf, (S8*) L"]n");
  1157.             pfnUnicodeStrcat((S8*) g_dictionary_result_buffer, (S8*) tempBuf);
  1158.             pfnUnicodeStrcat((S8*) g_dictionary_result_buffer, (S8*) & g_dict_fetchresult.dict_example_sentence[2]);
  1159.         }
  1160.     }
  1161.     ShowCategory78Screen(
  1162.         STR_DICTIONARY_TITLE,
  1163.         GetRootTitleIcon(EXTRA_DICTIONARY_MENU),
  1164.         0,
  1165.         0,
  1166.         STR_GLOBAL_BACK,
  1167.         IMG_GLOBAL_BACK,
  1168.         NULL,
  1169.         (U8*) g_dictionary_result_buffer,
  1170.         pfnUnicodeStrlen((S8*) g_dictionary_result_buffer),
  1171.         NULL /* guiBuffer */ );
  1172.     SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
  1173.     SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
  1174. }
  1175. /*****************************************************************************
  1176.  * FUNCTION
  1177.  *  mmi_dictionary_entry_main_option_screen
  1178.  * DESCRIPTION
  1179.  *  Entry screen for dictionary option  screen.
  1180.  * PARAMETERS
  1181.  *  void
  1182.  * RETURNS
  1183.  *  void
  1184.  *****************************************************************************/
  1185. void mmi_dictionary_entry_main_option_screen(void)
  1186. {
  1187.     /*----------------------------------------------------------------*/
  1188.     /* Local Variables                                                */
  1189.     /*----------------------------------------------------------------*/
  1190.     U8 *guiBuffer;
  1191.     U16 nStrItemList[4];    /* Need Expansion when has more options. */
  1192.     U16 nNumofItem;
  1193.     /*----------------------------------------------------------------*/
  1194.     /* Code Body                                                      */
  1195.     /*----------------------------------------------------------------*/
  1196.     EntryNewScreen(SCR_DICTIONARY_OPTION, NULL, mmi_dictionary_entry_main_option_screen, NULL);
  1197.     guiBuffer = GetCurrGuiBuffer(SCR_DICTIONARY_OPTION);
  1198.     nNumofItem = GetNumOfChild(DICTIONARY_OPTION_MENU);
  1199.     GetSequenceStringIds(DICTIONARY_OPTION_MENU, nStrItemList);
  1200.     SetParentHandler(DICTIONARY_OPTION_MENU);
  1201.     RegisterHighlightHandler(ExecuteCurrHiliteHandler);
  1202.     ShowCategory15Screen(
  1203.         STR_GLOBAL_OPTIONS,
  1204.         GetRootTitleIcon(EXTRA_DICTIONARY_MENU),
  1205.         STR_GLOBAL_OK,
  1206.         IMG_GLOBAL_OK,
  1207.         STR_GLOBAL_BACK,
  1208.         IMG_GLOBAL_BACK,
  1209.         nNumofItem,
  1210.         nStrItemList,
  1211.         (U16*) gIndexIconsImageList,
  1212.         LIST_MENU,
  1213.         0,
  1214.         guiBuffer);
  1215.     SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
  1216.     SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
  1217. }
  1218. /*****************************************************************************
  1219.  * FUNCTION
  1220.  *  mmi_dictionary_entry_wildcard_exact_editor_screen
  1221.  * DESCRIPTION
  1222.  *  Entry screen for wildcard, exact and chinese string search
  1223.  * PARAMETERS
  1224.  *  void
  1225.  * RETURNS
  1226.  *  void
  1227.  *****************************************************************************/
  1228. void mmi_dictionary_entry_wildcard_exact_editor_screen(void)
  1229. {
  1230.     /*----------------------------------------------------------------*/
  1231.     /* Local Variables                                                */
  1232.     /*----------------------------------------------------------------*/
  1233.     U8 *guiBuffer;
  1234.     U16 strID = 0;
  1235.     /*----------------------------------------------------------------*/
  1236.     /* Code Body                                                      */
  1237.     /*----------------------------------------------------------------*/
  1238.     EntryNewScreen(
  1239.         SCR_DICTIONARY_WILDCARD_EXACT_EDITOR,
  1240.         mmi_dictionary_exit_wildcard_exact_editor_screen,
  1241.         mmi_dictionary_entry_wildcard_exact_editor_screen,
  1242.         NULL);
  1243.     guiBuffer = GetCurrGuiBuffer(SCR_DICTIONARY_WILDCARD_EXACT_EDITOR);
  1244.     switch (g_dictionary_search_type)
  1245.     {
  1246.         case DICTIONARY_WILDCARD_SEARCH:
  1247.     #ifdef __MMI_DICT_GV__
  1248.             strID = STR_DICTIONARY_WILDCARD_SEARCH;
  1249.     #else 
  1250.             strID = STR_DICTIONARY_CHINESE_STRING;
  1251.     #endif 
  1252.             break;
  1253.         case DICTIONARY_EXACT_SEARCH:
  1254.             strID = STR_DICTIONARY_EXACT_SEARCH;
  1255.             break;
  1256.     }
  1257.     Register_cat5_editor_buffer_need_flush(mmi_dictionary_flush_exact_wild_editor_buffer);
  1258.     ShowCategory5Screen_ext(
  1259.         strID,
  1260.         GetRootTitleIcon(EXTRA_DICTIONARY_MENU),
  1261.         STR_GLOBAL_OPTIONS,
  1262.         IMG_GLOBAL_OPTIONS,
  1263.         STR_GLOBAL_BACK,
  1264.         IMG_GLOBAL_BACK,
  1265.         INPUT_TYPE_ALPHANUMERIC_UPPERCASE,
  1266.         (PU8) g_dictionary_wildcard_exact_buffer,
  1267.         DICTIONARY_INPUT_LENGTH + 1,
  1268.         guiBuffer,
  1269.         0,
  1270.         g_dictionary_input_mode,
  1271.         NULL);
  1272.     SetLeftSoftkeyFunction(mmi_dictionary_entry_editor_option_screen, KEY_EVENT_UP);
  1273.     SetKeyHandler(mmi_dictionary_entry_editor_option_screen, KEY_SEND, KEY_EVENT_UP);
  1274.     SetCategory5RightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
  1275.     g_mmi_dictionary_prev_input_mode = MMI_current_input_mode;
  1276. }
  1277. /*****************************************************************************
  1278.  * FUNCTION
  1279.  *  mmi_dictionary_exit_wildcard_exact_editor_screen
  1280.  * DESCRIPTION
  1281.  *  Exit function for exact/wildcard buffer
  1282.  * PARAMETERS
  1283.  *  void
  1284.  * RETURNS
  1285.  *  void
  1286.  *****************************************************************************/
  1287. void mmi_dictionary_exit_wildcard_exact_editor_screen(void)
  1288. {
  1289.     /*----------------------------------------------------------------*/
  1290.     /* Local Variables                                                */
  1291.     /*----------------------------------------------------------------*/
  1292.     /*----------------------------------------------------------------*/
  1293.     /* Code Body                                                      */
  1294.     /*----------------------------------------------------------------*/
  1295.     wgui_multiline_inputbox_input_type = 0;
  1296. }
  1297. /*****************************************************************************
  1298.  * FUNCTION
  1299.  *  mmi_dictionary_entry_editor_option_screen
  1300.  * DESCRIPTION
  1301.  *  Entry function for editor option screen
  1302.  * PARAMETERS
  1303.  *  void
  1304.  * RETURNS
  1305.  *  void
  1306.  *****************************************************************************/
  1307. void mmi_dictionary_entry_editor_option_screen(void)
  1308. {
  1309.     /*----------------------------------------------------------------*/
  1310.     /* Local Variables                                                */
  1311.     /*----------------------------------------------------------------*/
  1312.     U16 nStrItemList[2];    /* Stores the strings id of submenus returned */
  1313.     U16 nNumofItem;         /* Stores no of children in the submenu */
  1314.     U8 *guiBuffer;          /* Buffer holding history data */
  1315.     /*----------------------------------------------------------------*/
  1316.     /* Code Body                                                      */
  1317.     /*----------------------------------------------------------------*/
  1318.     EntryNewScreen(SCR_DICTIONARY_EDITOR_OPTION_SCREEN, NULL, mmi_dictionary_entry_editor_option_screen, NULL);
  1319.     guiBuffer = GetCurrGuiBuffer(SCR_DICTIONARY_EDITOR_OPTION_SCREEN);
  1320.     nNumofItem = GetNumOfChild(DICTIONARY_EDITOR_OPTION_MENU);
  1321.     GetSequenceStringIds(DICTIONARY_EDITOR_OPTION_MENU, nStrItemList);
  1322.     SetParentHandler(DICTIONARY_EDITOR_OPTION_MENU);
  1323.     RegisterHighlightHandler(ExecuteCurrHiliteHandler);
  1324.     ShowCategory15Screen(
  1325.         STR_GLOBAL_OPTIONS,
  1326.         GetRootTitleIcon(EXTRA_DICTIONARY_MENU),
  1327.         STR_GLOBAL_OK,
  1328.         IMG_GLOBAL_OK,
  1329.         STR_GLOBAL_BACK,
  1330.         IMG_GLOBAL_BACK,
  1331.         nNumofItem,
  1332.         nStrItemList,
  1333.         (U16*) gIndexIconsImageList,
  1334.         LIST_MENU,
  1335.         0,
  1336.         guiBuffer);
  1337.     SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
  1338.     SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
  1339. }
  1340. /*****************************************************************************
  1341.  * FUNCTION
  1342.  *  mmi_dictionary_entry_search
  1343.  * DESCRIPTION
  1344.  *  This function search the database according to input in wildcard/exact search buffer
  1345.  * PARAMETERS
  1346.  *  void
  1347.  * RETURNS
  1348.  *  void
  1349.  *****************************************************************************/
  1350. void mmi_dictionary_entry_search(void)
  1351. {
  1352.     /*----------------------------------------------------------------*/
  1353.     /* Local Variables                                                */
  1354.     /*----------------------------------------------------------------*/
  1355.     S32 cnt = 0, resultCount = 0;
  1356.     U8 length;
  1357.     pBOOL result = TRUE;
  1358.     /*----------------------------------------------------------------*/
  1359.     /* Code Body                                                      */
  1360.     /*----------------------------------------------------------------*/
  1361.     length = pfnUnicodeStrlen((S8*) g_dictionary_wildcard_exact_buffer);
  1362.     length = length * 2;
  1363.     if (length == 0)
  1364.     {
  1365.         DisplayPopup(
  1366.             (PU8) GetString(STR_DICTIONARY_NO_MATCH_FOUND),
  1367.             IMG_GLOBAL_WARNING,
  1368.             FALSE,
  1369.             UI_POPUP_NOTIFYDURATION_TIME_2000,
  1370.             WARNING_TONE);
  1371.         DeleteNScrId(SCR_DICTIONARY_EDITOR_OPTION_SCREEN);
  1372.         return;
  1373.     }
  1374.     pfnUnicodeStrcpy((S8*) g_dictionary_input, (S8*) g_dictionary_wildcard_exact_buffer);
  1375.     if (g_dictionary_search_type == DICTIONARY_WILDCARD_SEARCH)
  1376.     {
  1377.         switch (MMI_current_input_mode)
  1378.         {
  1379.             case INPUT_MODE_MULTITAP_LOWERCASE_ABC:
  1380.             case INPUT_MODE_MULTITAP_UPPERCASE_ABC:
  1381.             case INPUT_MODE_SMART_UPPERCASE_ABC:
  1382.             case INPUT_MODE_SMART_LOWERCASE_ABC:
  1383.                 /* clean the string .check: for english string only */
  1384.                 g_dict_current_language = DICTIONARY_ENGLISH;
  1385.                 result = mmi_dictionary_check_input_buffer(g_dictionary_input, (U8) g_dict_current_language);
  1386.                 if (result == FALSE)
  1387.                 {
  1388.                     break;
  1389.                 }
  1390.                 memset(g_dict_wildcard_ids, 0, sizeof(mmi_dict_id_str_struct) * (MMI_DICT_ID_FETCH_MAX + 1));
  1391.                 /* DictionaryWaitingPopup(IMG_DICTIONARY_WAIT); */
  1392.                 resultCount = mmi_dict_wild_search(
  1393.                                 (U8) g_dict_current_language,
  1394.                                 (S8*) g_dictionary_input,
  1395.                                 0,
  1396.                                 MMI_DICT_ID_FETCH_MAX,
  1397.                                 (void*)g_dict_wildcard_ids);
  1398.                 if (resultCount != 0)
  1399.                 {
  1400.                     g_dictionary_cntx.wildcard_results = resultCount;
  1401.                     mmi_dictionary_entry_wildcard_result_list_screen();
  1402.                 }
  1403.                 break;
  1404.             case INPUT_MODE_TR_MULTITAP_BOPOMO:
  1405.             case INPUT_MODE_TR_STROKE:
  1406.             case INPUT_MODE_SM_MULTITAP_PINYIN:
  1407.             case INPUT_MODE_SM_STROKE:
  1408.             case INPUT_MODE_SM_PINYIN:
  1409.             case INPUT_MODE_TR_BOPOMO:
  1410.                 /* clean the string .check: for chinese string only  */
  1411.                 g_dict_current_language = DICTIONARY_CHINESE;
  1412.                 result = mmi_dictionary_check_input_buffer(g_dictionary_input, (U8) g_dict_current_language);
  1413.                 if (result == FALSE)
  1414.                 {
  1415.                     break;
  1416.                 }
  1417.                 memset(g_dict_wildcard_ids, 0, sizeof(mmi_dict_id_str_struct) * (MMI_DICT_ID_FETCH_MAX + 1));
  1418.                 /* DictionaryWaitingPopup(IMG_DICTIONARY_WAIT); */
  1419.                 resultCount = mmi_dict_wild_search(
  1420.                                 (U8) g_dict_current_language,
  1421.                                 (S8*) g_dictionary_input,
  1422.                                 0,
  1423.                                 MMI_DICT_ID_FETCH_MAX,
  1424.                                 (void*) /* g_dict_chinese_ids */ g_dict_wildcard_ids);
  1425.                 if (resultCount != 0)
  1426.                 {
  1427.                     g_dictionary_cntx.wildcard_results = resultCount;
  1428.                     mmi_dictionary_entry_wildcard_result_list_screen();
  1429.                 }
  1430.                 break;
  1431.             default:
  1432.                 DisplayPopup(
  1433.                     (PU8) GetString(STR_DICTIONARY_LANGUAGE_NOT_SUPPORTED),
  1434.                     IMG_GLOBAL_WARNING,
  1435.                     FALSE,
  1436.                     UI_POPUP_NOTIFYDURATION_TIME_2000,
  1437.                     WARNING_TONE);
  1438.                 DeleteNScrId(SCR_DICTIONARY_EDITOR_OPTION_SCREEN);
  1439.                 break;
  1440.         }
  1441.         if (resultCount == 0)
  1442.         {
  1443.             DisplayPopup(
  1444.                 (PU8) GetString(STR_DICTIONARY_NO_MATCH_FOUND),
  1445.                 IMG_GLOBAL_WARNING,
  1446.                 FALSE,
  1447.                 UI_POPUP_NOTIFYDURATION_TIME_2000,
  1448.                 WARNING_TONE);
  1449.             DeleteNScrId(SCR_DICTIONARY_EDITOR_OPTION_SCREEN);
  1450.         }
  1451.     }
  1452.     else if (g_dictionary_search_type == DICTIONARY_EXACT_SEARCH)
  1453.     {
  1454.         switch (MMI_current_input_mode)
  1455.         {
  1456.             case INPUT_MODE_MULTITAP_LOWERCASE_ABC:
  1457.             case INPUT_MODE_MULTITAP_UPPERCASE_ABC:
  1458.             case INPUT_MODE_SMART_UPPERCASE_ABC:
  1459.             case INPUT_MODE_SMART_LOWERCASE_ABC:
  1460.                 /* clean the string  */
  1461.                 g_dict_current_language = DICTIONARY_ENGLISH;
  1462.                 result = mmi_dictionary_check_input_buffer(g_dictionary_input, (U8) g_dict_current_language);
  1463.                 if (result == FALSE)
  1464.                 {
  1465.                     break;
  1466.                 }
  1467.                 /* DictionaryWaitingPopup(IMG_DICTIONARY_WAIT); */
  1468.                 mmi_dictionary_entry_result_screen();
  1469.                 break;
  1470.             case INPUT_MODE_TR_MULTITAP_BOPOMO:
  1471.             case INPUT_MODE_TR_STROKE:
  1472.             case INPUT_MODE_SM_MULTITAP_PINYIN:
  1473.             case INPUT_MODE_SM_STROKE:
  1474.             case INPUT_MODE_SM_PINYIN:
  1475.             case INPUT_MODE_TR_BOPOMO:
  1476.                 /* clean the string */
  1477.                 g_dict_current_language = DICTIONARY_CHINESE;
  1478.                 result = mmi_dictionary_check_input_buffer(g_dictionary_input, (U8) g_dict_current_language);
  1479.                 if (result == FALSE)
  1480.                 {
  1481.                     break;
  1482.                 }
  1483.                 /* DictionaryWaitingPopup(IMG_DICTIONARY_WAIT); */
  1484.                 mmi_dictionary_entry_result_screen();
  1485.                 break;
  1486.             default:
  1487.                 DisplayPopup(
  1488.                     (PU8) GetString(STR_DICTIONARY_LANGUAGE_NOT_SUPPORTED),
  1489.                     IMG_GLOBAL_WARNING,
  1490.                     FALSE,
  1491.                     UI_POPUP_NOTIFYDURATION_TIME_2000,
  1492.                     WARNING_TONE);
  1493.                 DeleteNScrId(SCR_DICTIONARY_EDITOR_OPTION_SCREEN);
  1494.                 break;
  1495.         }
  1496.     }
  1497.     /* result popup */
  1498.     if (result == FALSE)
  1499.     {
  1500.         DisplayPopup(
  1501.             (PU8) GetString(STR_DICTIONARY_NO_MATCH_FOUND),
  1502.             IMG_GLOBAL_WARNING,
  1503.             FALSE,
  1504.             UI_POPUP_NOTIFYDURATION_TIME_2000,
  1505.             WARNING_TONE);
  1506.         DeleteNScrId(SCR_DICTIONARY_EDITOR_OPTION_SCREEN);
  1507.     }
  1508.     return;
  1509. }
  1510. /*****************************************************************************
  1511.  * FUNCTION
  1512.  *  mmi_dictionary_check_input_buffer
  1513.  * DESCRIPTION
  1514.  *  This function check the input buffer according to language passed
  1515.  * PARAMETERS
  1516.  *  inputBuffer     [?]         
  1517.  *  language        [IN]        
  1518.  * RETURNS
  1519.  *  void
  1520.  *****************************************************************************/
  1521. pBOOL mmi_dictionary_check_input_buffer(U8 *inputBuffer, U8 language)
  1522. {
  1523.     /*----------------------------------------------------------------*/
  1524.     /* Local Variables                                                */
  1525.     /*----------------------------------------------------------------*/
  1526.     U8 length, cnt = 0;
  1527.     S16 end_cnt;
  1528.     U8 tempBuf[(MMI_DICT_CORE_WORD_MAX + 1) * ENCODING_LENGTH];
  1529.     U16 chineseCode;
  1530.     /*----------------------------------------------------------------*/
  1531.     /* Code Body                                                      */
  1532.     /*----------------------------------------------------------------*/
  1533.     /* filter out any space in the beginning */
  1534.     pfnUnicodeStrcpy((S8*) tempBuf, (S8*) inputBuffer);
  1535.     length = pfnUnicodeStrlen((S8*) inputBuffer);
  1536.     length = length * ENCODING_LENGTH;
  1537.     while (length > cnt)
  1538.     {
  1539.         if ((tempBuf[cnt] == 0x20) && (tempBuf[cnt + 1] == 0x00))       /* if first character is space */
  1540.         {
  1541.             cnt = cnt + 2;
  1542.             continue;
  1543.         }
  1544.         else
  1545.         {
  1546.             break;
  1547.         }
  1548.     }
  1549.     if (cnt == length)
  1550.     {
  1551.         /* user has entered only spaces in editor screen */
  1552.         return FALSE;
  1553.     }
  1554.     /* filter out any space in the end */
  1555.     end_cnt = length - 1;
  1556.     while (end_cnt > 0)
  1557.     {
  1558.         if ((tempBuf[end_cnt - 1] == 0x20) && (tempBuf[end_cnt] == 0x00))
  1559.         {
  1560.             end_cnt = end_cnt - 2;
  1561.         }
  1562.         else
  1563.         {
  1564.             break;
  1565.         }
  1566.     }
  1567.     memset(&tempBuf[end_cnt + 1], 0, 2);
  1568.     if (cnt != length)
  1569.     {
  1570.         pfnUnicodeStrcpy((S8*) inputBuffer, (S8*) & tempBuf[cnt]);    /* copy after intitial space */
  1571.         switch (language)
  1572.         {
  1573.             case DICTIONARY_ENGLISH:
  1574.                 /* first char have to be  english alphabet only */
  1575.                 if (!((inputBuffer[0] >= 65) && (inputBuffer[0] <= 90))
  1576.                     && !((inputBuffer[0] >= 97) && (inputBuffer[0] <= 122)))
  1577.                 {
  1578.                     return FALSE;
  1579.                 }
  1580.                 /* there should not be any chinese character in english string */
  1581.                 if (GetUCS2Flag((S8*) inputBuffer))
  1582.                 {
  1583.                     return FALSE;
  1584.                 }
  1585.                 break;
  1586.             case DICTIONARY_CHINESE:
  1587.                 memcpy(&chineseCode, &inputBuffer[0], 2);
  1588.                 if ((chineseCode < 0x4e00) || (chineseCode > 0x9fa5))
  1589.                 {
  1590.                     /* First character  is not chinese character */
  1591.                     return FALSE;
  1592.                 }
  1593.                 break;
  1594.         }
  1595.     }
  1596.     return TRUE;
  1597. }
  1598. /*****************************************************************************
  1599.  * FUNCTION
  1600.  *  mmi_dictionary_entry_wildcard_result_list_screen
  1601.  * DESCRIPTION
  1602.  *  This function shows the search result of wildcard and chinese search strings
  1603.  * PARAMETERS
  1604.  *  void
  1605.  * RETURNS
  1606.  *  void
  1607.  *****************************************************************************/
  1608. void mmi_dictionary_entry_wildcard_result_list_screen(void)
  1609. {
  1610.     /*----------------------------------------------------------------*/
  1611.     /* Local Variables                                                */
  1612.     /*----------------------------------------------------------------*/
  1613.     U8 *guiBuffer;
  1614.     /*----------------------------------------------------------------*/
  1615.     /* Code Body                                                      */
  1616.     /*----------------------------------------------------------------*/
  1617.     EntryNewScreen(SCR_DICTIONARY_WILDCARD_RESULT_LIST, NULL, mmi_dictionary_entry_wildcard_result_list_screen, NULL);
  1618.     guiBuffer = GetCurrGuiBuffer(SCR_DICTIONARY_WILDCARD_RESULT_LIST);
  1619.     RegisterHighlightHandler(mmi_dictionary_wildcard_word_list_hdlr);
  1620.     DeleteScreenIfPresent(SCR_DICTIONARY_EDITOR_OPTION_SCREEN);
  1621.     ShowCategory184Screen(
  1622. #ifdef __MMI_DICT_GV__
  1623.                              STR_DICTIONARY_WILDCARD_SEARCH,
  1624. #else 
  1625.                              STR_DICTIONARY_CHINESE_STRING,
  1626. #endif 
  1627.                              GetRootTitleIcon(EXTRA_DICTIONARY_MENU),
  1628.                              STR_GLOBAL_OK,
  1629.                              IMG_GLOBAL_OK,
  1630.                              STR_GLOBAL_BACK,
  1631.                              IMG_GLOBAL_BACK, g_dictionary_cntx.wildcard_results, mmi_dictionary_wildcard_list_get_item,
  1632.                              /* HintPtr */ 0,
  1633.                              0, guiBuffer);
  1634.     SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
  1635.     SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
  1636.     SetLeftSoftkeyFunction(mmi_dictionary_entry_result_screen, KEY_EVENT_UP);
  1637.     SetKeyHandler(mmi_dictionary_entry_result_screen, KEY_ENTER, KEY_EVENT_DOWN);
  1638. }
  1639. /*****************************************************************************
  1640.  * FUNCTION
  1641.  *  mmi_dictionary_wildcard_list_get_item
  1642.  * DESCRIPTION
  1643.  *  This function is to pass the wildcard and chinese strings to the UI to display
  1644.  * PARAMETERS
  1645.  *  item_index          [IN]        
  1646.  *  str_buff            [IN]        
  1647.  *  img_buff_p          [?]         
  1648.  *  str_img_mask        [IN]        
  1649.  * RETURNS
  1650.  *  void
  1651.  *****************************************************************************/
  1652. pBOOL mmi_dictionary_wildcard_list_get_item(S32 item_index, UI_string_type str_buff, PU8 *img_buff_p, U8 str_img_mask)
  1653. {
  1654.     /*----------------------------------------------------------------*/
  1655.     /* Local Variables                                                */
  1656.     /*----------------------------------------------------------------*/
  1657.     /*----------------------------------------------------------------*/
  1658.     /* Code Body                                                      */
  1659.     /*----------------------------------------------------------------*/
  1660.     if (item_index < g_dictionary_cntx.wildcard_results)
  1661.     {
  1662.         pfnUnicodeStrcpy((S8*) str_buff, (S8*) g_dict_wildcard_ids[item_index].dict_word);
  1663.         *img_buff_p = get_image(IMG_DICTIONARY_WORD_LIST_SCREEN);
  1664.         return TRUE;
  1665.     }
  1666.     else
  1667.     {
  1668.         return FALSE;
  1669.     }
  1670. }
  1671. /*****************************************************************************
  1672.  * FUNCTION
  1673.  *  mmi_dictionary_wildcard_word_list_hdlr
  1674.  * DESCRIPTION
  1675.  *  This function is the highlight handler for words in wildcard and chinese search list
  1676.  * PARAMETERS
  1677.  *  index       [IN]        
  1678.  * RETURNS
  1679.  *  void
  1680.  *****************************************************************************/
  1681. void mmi_dictionary_wildcard_word_list_hdlr(S32 index)
  1682. {
  1683.     /*----------------------------------------------------------------*/
  1684.     /* Local Variables                                                */
  1685.     /*----------------------------------------------------------------*/
  1686.     /*----------------------------------------------------------------*/
  1687.     /* Code Body                                                      */
  1688.     /*----------------------------------------------------------------*/
  1689.     g_dictionary_cntx.current_wildcard_search_index = index;
  1690.     return;
  1691. }
  1692. /*****************************************************************************
  1693.  * FUNCTION
  1694.  *  isFromDictionary
  1695.  * DESCRIPTION
  1696.  *  This function returns to the UI whether control has come from dictionary or not
  1697.  *  vice versa
  1698.  * PARAMETERS
  1699.  *  max_number      [?]     
  1700.  * RETURNS
  1701.  *  pBOOL : TRUE :From dictionary
  1702.  *  FALSE : Not from the dictionary
  1703.  *****************************************************************************/
  1704. BOOL isFromDictionary(S32 *max_number)
  1705. {
  1706.     /*----------------------------------------------------------------*/
  1707.     /* Local Variables                                                */
  1708.     /*----------------------------------------------------------------*/
  1709.     U16 scrID;
  1710.     BOOL scrPresent;
  1711.     /*----------------------------------------------------------------*/
  1712.     /* Code Body                                                      */
  1713.     /*----------------------------------------------------------------*/
  1714.     scrID = GetActiveScreenId();
  1715.     scrPresent = IsScreenPresent(SCR_DICTIONARY_MAIN);
  1716.     if (scrID == SCR_DICTIONARY_MAIN || scrPresent)
  1717.     {
  1718.         *max_number = DICTIONARY_MAX_WORDS;
  1719.         return MMI_TRUE;
  1720.     }
  1721.     else
  1722.     {
  1723.         *max_number = 0;
  1724.         return MMI_FALSE;
  1725.     }
  1726. }
  1727. /*****************************************************************************
  1728.  * FUNCTION
  1729.  *  mmi_dictionary_flush_editor_buffer
  1730.  * DESCRIPTION
  1731.  *  This function is  to flush buffer when user change input method, from english family to chinese
  1732.  *  vice versa
  1733.  * PARAMETERS
  1734.  *  void
  1735.  * RETURNS
  1736.  *  pBOOL : TRUE :Family has been changed. Flush the buffer
  1737.  *  FALSE : Need to flush the output.
  1738.  *****************************************************************************/
  1739. BOOL mmi_dictionary_flush_editor_buffer()
  1740. {
  1741.     /*----------------------------------------------------------------*/
  1742.     /* Local Variables                                                */
  1743.     /*----------------------------------------------------------------*/
  1744.     BOOL isOldFamily, scrPresent;
  1745.     U16 activeScrID;
  1746.     /*----------------------------------------------------------------*/
  1747.     /* Code Body                                                      */
  1748.     /*----------------------------------------------------------------*/
  1749.     activeScrID = GetActiveScreenId();
  1750.     scrPresent = IsScreenPresent(SCR_DICTIONARY_MAIN);
  1751.     if (activeScrID == SCR_INPUT_METHOD_LIST)
  1752.     {
  1753.         if (!scrPresent)
  1754.         {
  1755.             return MMI_FALSE;
  1756.         }
  1757.     }
  1758.     else if (!(activeScrID == SCR_DICTIONARY_WILDCARD_EXACT_EDITOR || activeScrID == SCR_DICTIONARY_MAIN))
  1759.     {
  1760.         return MMI_FALSE;
  1761.     }
  1762.     switch (g_mmi_dictionary_prev_input_mode)
  1763.     {
  1764.         case INPUT_MODE_MULTITAP_LOWERCASE_ABC:
  1765.         case INPUT_MODE_MULTITAP_UPPERCASE_ABC:
  1766.         case INPUT_MODE_SMART_UPPERCASE_ABC:
  1767.         case INPUT_MODE_SMART_LOWERCASE_ABC:
  1768.             switch (MMI_current_input_mode)
  1769.             {
  1770.                 case INPUT_MODE_MULTITAP_LOWERCASE_ABC:
  1771.                 case INPUT_MODE_MULTITAP_UPPERCASE_ABC:
  1772.                 case INPUT_MODE_SMART_UPPERCASE_ABC:
  1773.                 case INPUT_MODE_SMART_LOWERCASE_ABC:
  1774.                     isOldFamily = MMI_TRUE;
  1775.                     break;
  1776.                 default:
  1777.                     isOldFamily = MMI_FALSE;
  1778.             }
  1779.             break;
  1780.         case INPUT_MODE_TR_MULTITAP_BOPOMO:
  1781.         case INPUT_MODE_TR_STROKE:
  1782.         case INPUT_MODE_SM_MULTITAP_PINYIN:
  1783.         case INPUT_MODE_SM_STROKE:
  1784.         case INPUT_MODE_SM_PINYIN:
  1785.         case INPUT_MODE_TR_BOPOMO:
  1786.             switch (MMI_current_input_mode)
  1787.             {
  1788.                 case INPUT_MODE_TR_MULTITAP_BOPOMO:
  1789.                 case INPUT_MODE_TR_STROKE:
  1790.                 case INPUT_MODE_SM_MULTITAP_PINYIN:
  1791.                 case INPUT_MODE_SM_STROKE:
  1792.                 case INPUT_MODE_SM_PINYIN:
  1793.                 case INPUT_MODE_TR_BOPOMO:
  1794.                     isOldFamily = MMI_TRUE;
  1795.                     break;
  1796.                 default:
  1797.                     isOldFamily = MMI_FALSE;
  1798.             }
  1799.             break;
  1800.         default:
  1801.             isOldFamily = MMI_FALSE;
  1802.     }
  1803.     g_mmi_dictionary_prev_input_mode = MMI_current_input_mode;
  1804.     if (isOldFamily)
  1805.     {
  1806.         return MMI_FALSE;
  1807.     }
  1808.     else
  1809.     {
  1810.         return MMI_TRUE;
  1811.     }
  1812. }
  1813. /*****************************************************************************
  1814.  * FUNCTION
  1815.  *  mmi_dictionary_check_input_family
  1816.  * DESCRIPTION
  1817.  *  This function is  return the input family type
  1818.  * PARAMETERS
  1819.  *  inputType       [IN]        
  1820.  *  input type(?)
  1821.  * RETURNS
  1822.  *  MMI_DICTIONARY_LANGUAGE : english/chinese/none
  1823.  *****************************************************************************/
  1824. MMI_DICTIONARY_LANGUAGE mmi_dictionary_check_input_family(U8 inputType)
  1825. {
  1826.     /*----------------------------------------------------------------*/
  1827.     /* Local Variables                                                */
  1828.     /*----------------------------------------------------------------*/
  1829.     MMI_DICTIONARY_LANGUAGE family;
  1830.     /*----------------------------------------------------------------*/
  1831.     /* Code Body                                                      */
  1832.     /*----------------------------------------------------------------*/
  1833.     switch (inputType)
  1834.     {
  1835.         case INPUT_TYPE_ALPHANUMERIC_UPPERCASE:
  1836.         case INPUT_TYPE_ALPHANUMERIC_LOWERCASE:
  1837.         case INPUT_TYPE_SMART_UPPERCASE_ABC:
  1838.         case INPUT_TYPE_SMART_LOWERCASE_ABC:
  1839.             family = DICTIONARY_ENGLISH;
  1840.             break;
  1841.         case INPUT_TYPE_TR_MULTITAP_BOPOMO:
  1842.         case INPUT_TYPE_SM_MULTITAP_PINYIN:
  1843.         case INPUT_TYPE_TR_BOPOMO:
  1844.         case INPUT_TYPE_SM_PINYIN:
  1845.         case INPUT_TYPE_TR_STROKE:
  1846.         case INPUT_TYPE_SM_STROKE:
  1847.             family = DICTIONARY_CHINESE;
  1848.             break;
  1849.         default:
  1850.             family = DICTIONARY_NONE;
  1851.     }
  1852.     return family;
  1853. }
  1854. /*****************************************************************************
  1855.  * FUNCTION
  1856.  *  mmi_dictionary_flush_exact_wild_editor_buffer
  1857.  * DESCRIPTION
  1858.  *  This function is  called when  input method is changed from exact/wildcard editor -> option->input method
  1859.  * PARAMETERS
  1860.  *  void
  1861.  * RETURNS
  1862.  *  BOOL TRUE : language has been changed
  1863.  *  FALSE : language is not changed
  1864.  *****************************************************************************/
  1865. BOOL mmi_dictionary_flush_exact_wild_editor_buffer(void)
  1866. {
  1867.     /*----------------------------------------------------------------*/
  1868.     /* Local Variables                                                */
  1869.     /*----------------------------------------------------------------*/
  1870.     BOOL scrPresent;
  1871.     U16 activeScrID;
  1872.     MMI_DICTIONARY_LANGUAGE currentLanguage;
  1873.     /*----------------------------------------------------------------*/
  1874.     /* Code Body                                                      */
  1875.     /*----------------------------------------------------------------*/
  1876.     activeScrID = GetActiveScreenId();
  1877.     scrPresent = IsScreenPresent(SCR_DICTIONARY_WILDCARD_EXACT_EDITOR);
  1878.     if (activeScrID == SCR_INPUT_METHOD_LIST)
  1879.     {
  1880.         if (!scrPresent)
  1881.         {
  1882.             return MMI_FALSE;
  1883.         }
  1884.     }
  1885.     else if (!(activeScrID == SCR_DICTIONARY_WILDCARD_EXACT_EDITOR))
  1886.     {
  1887.         return MMI_FALSE;
  1888.     }
  1889.     if (wgui_multiline_inputbox_input_type != 0)
  1890.     {
  1891.         currentLanguage = mmi_dictionary_check_input_family((U8) wgui_multiline_inputbox_input_type);
  1892.         if (currentLanguage != g_dict_current_language)
  1893.         {
  1894.             g_dict_current_language = currentLanguage;
  1895.             return MMI_TRUE;
  1896.         }
  1897.     }
  1898.     else
  1899.     {
  1900.         /* Reset language if input type not assigned */
  1901.         g_dict_current_language = DICTIONARY_ENGLISH;
  1902.         return MMI_FALSE;
  1903.     }
  1904.     return MMI_FALSE;
  1905. }
  1906. #else /* defined(MMI_ON_HARDWARE_P) */ /* #if defined(MMI_ON_HARDWARE_P) */
  1907. #include "PixtelDataTypes.h"
  1908. #include "CommonScreens.h"
  1909. /*****************************************************************************
  1910.  * FUNCTION
  1911.  *  mmi_dictionary_main_menu_highlight_hdlr
  1912.  * DESCRIPTION
  1913.  *  
  1914.  * PARAMETERS
  1915.  *  void
  1916.  * RETURNS
  1917.  *  void
  1918.  *****************************************************************************/
  1919. void mmi_dictionary_main_menu_highlight_hdlr(void)
  1920. {
  1921.     /*----------------------------------------------------------------*/
  1922.     /* Local Variables                                                */
  1923.     /*----------------------------------------------------------------*/
  1924.     /*----------------------------------------------------------------*/
  1925.     /* Code Body                                                      */
  1926.     /*----------------------------------------------------------------*/
  1927.     ChangeLeftSoftkey(STR_GLOBAL_OK, IMG_GLOBAL_OK);
  1928.     ChangeRightSoftkey(STR_GLOBAL_BACK, IMG_GLOBAL_BACK);
  1929.     SetLeftSoftkeyFunction(PopupNoSupport, KEY_EVENT_UP);
  1930.     SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
  1931.     SetKeyHandler(PopupNoSupport, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
  1932.     SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
  1933. }
  1934. /*****************************************************************************
  1935.  * FUNCTION
  1936.  *  mmi_dictionary_init
  1937.  * DESCRIPTION
  1938.  *  
  1939.  * PARAMETERS
  1940.  *  void
  1941.  * RETURNS
  1942.  *  void
  1943.  *****************************************************************************/
  1944. void mmi_dictionary_init()
  1945. {
  1946.     /*----------------------------------------------------------------*/
  1947.     /* Local Variables                                                */
  1948.     /*----------------------------------------------------------------*/
  1949.     /*----------------------------------------------------------------*/
  1950.     /* Code Body                                                      */
  1951.     /*----------------------------------------------------------------*/
  1952.     SetHiliteHandler(EXTRA_DICTIONARY_MENU, mmi_dictionary_main_menu_highlight_hdlr);
  1953. }
  1954. /*****************************************************************************
  1955.  * FUNCTION
  1956.  *  mmi_dictionary_flush_editor_buffer
  1957.  * DESCRIPTION
  1958.  *  
  1959.  * PARAMETERS
  1960.  *  void
  1961.  * RETURNS
  1962.  *  
  1963.  *****************************************************************************/
  1964. pBOOL mmi_dictionary_flush_editor_buffer(void)
  1965. {
  1966.     /*----------------------------------------------------------------*/
  1967.     /* Local Variables                                                */
  1968.     /*----------------------------------------------------------------*/
  1969.     /*----------------------------------------------------------------*/
  1970.     /* Code Body                                                      */
  1971.     /*----------------------------------------------------------------*/
  1972.     return FALSE;
  1973. }
  1974. #endif /* defined(MMI_ON_HARDWARE_P) */ /* #if defined(MMI_ON_HARDWARE_P) */
  1975. #endif /* defined(__MMI_DICTIONARY__) */ /* #if defined(__MMI_DICTIONARY__) */