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

MTK

开发平台:

C/C++

  1.         tmp_flags &= ~UI_MULTI_LINE_INPUT_BOX_STATE_MULTITAP;
  2.         //barcode
  3.         if (MMI_multiline_inputbox.hilite_cb == NULL)
  4.         {
  5.         tmp_flags &= ~UI_MULTI_LINE_INPUT_BOX_WORD_HIGHLIGHT;
  6.         }
  7.         /* MTK end */
  8.         for (i = 0; i < sizeof(U32); i++)
  9.         {
  10.             memcpy((U8*) (&h->flags) + i, (U8*) (&tmp_flags) + i, 1);
  11.         }
  12.         /* Calvin end */
  13.         h->UCS2_count = (S16) MMI_multiline_inputbox.UCS2_count;
  14.     #if defined(__MMI_TOUCH_SCREEN__)
  15.         /* W05.41 Do not Strore Virtual Keyboard into History when View Mode */
  16.         if (!(MMI_multiline_inputbox.flags & UI_MULTI_LINE_INPUT_BOX_VIEW_MODE))
  17.         {
  18.             if (GUI_VIRTUAL_KEYBOARD_MAX_LANG == mmi_pen_editor_history_vk_lang_type())
  19.             {
  20.                 h->vk_lang_type = MMI_virtual_keyboard.lang_type;
  21.             }
  22.             else
  23.             {
  24.                 h->vk_lang_type = mmi_pen_editor_history_vk_lang_type();
  25.             }
  26.         }
  27.         else
  28.         {
  29.             h->vk_lang_type = GUI_VIRTUAL_KEYBOARD_EMPTY_TRAY;
  30.         }
  31.     #endif /* defined(__MMI_TOUCH_SCREEN__) */ 
  32.         h->state = (S8) - 1;    /* MTK 2004-02-13 Wilson, Initialize history buffer state */
  33.     }
  34. }
  35. /* MTK 2004-02-13 Wilson, Set and Get state of multiine inputbox history buffer */
  36. /*****************************************************************************
  37.  * FUNCTION
  38.  *  set_multiline_inputbox_category_history_state
  39.  * DESCRIPTION
  40.  *  Sets the state of history data for state list
  41.  * PARAMETERS
  42.  *  history_ID          [IN]        Is the ID used by category screens
  43.  *  history_buffer      [IN]        Is the buffer into which history data is written
  44.  *  state               [IN]        Is the state to be set to state list
  45.  * RETURNS
  46.  *  void
  47.  *****************************************************************************/
  48. void set_multiline_inputbox_category_history_state(U16 history_ID, U8 *history_buffer, S8 state)
  49. {
  50.     /*----------------------------------------------------------------*/
  51.     /* Local Variables                                                */
  52.     /*----------------------------------------------------------------*/
  53.     /*----------------------------------------------------------------*/
  54.     /* Code Body                                                      */
  55.     /*----------------------------------------------------------------*/
  56.     if (history_buffer != NULL)
  57.     {
  58.         multiline_inputbox_category_history *h = (multiline_inputbox_category_history*) history_buffer;
  59.         h->state = state;
  60.     }
  61. }
  62. /*****************************************************************************
  63.  * FUNCTION
  64.  *  get_multiline_inputbox_category_history_state
  65.  * DESCRIPTION
  66.  *  Gets the state of history data for state list
  67.  * PARAMETERS
  68.  *  history_ID          [IN]        Is the ID used by category screens
  69.  *  history_buffer      [IN]        Is the buffer into which history data is written
  70.  *  state(?)            [IN]        Is the state to be set to state list
  71.  * RETURNS
  72.  *  void
  73.  *****************************************************************************/
  74. S8 get_multiline_inputbox_category_history_state(U16 history_ID, U8 *history_buffer)
  75. {
  76.     /*----------------------------------------------------------------*/
  77.     /* Local Variables                                                */
  78.     /*----------------------------------------------------------------*/
  79.     /*----------------------------------------------------------------*/
  80.     /* Code Body                                                      */
  81.     /*----------------------------------------------------------------*/
  82.     if (history_buffer != NULL)
  83.     {
  84.         multiline_inputbox_category_history *h = (multiline_inputbox_category_history*) history_buffer;
  85.         return h->state;
  86.     }
  87.     return (S8) - 1;
  88. }
  89. /* MTK END */
  90. /* Start Dialer Input Boxs */
  91. extern stFontAttribute wgui_dialer_box_f1;
  92. extern stFontAttribute wgui_dialer_box_f2;
  93. /* struxcture handle star key input in dialer box */
  94. multitap_input wgui_dialer_box_star_key_handler;
  95. #if(ENABLE_DIALER_ZERO_KEY_MULTITAP)
  96. multitap_input wgui_dialer_box_zero_key_handler;
  97. #endif 
  98. U8 wgui_dialer_box_active_multitap = WGUI_DIALER_BOX_ACTIVE_MULTITAP_NONE;
  99. #if(ENABLE_DIALER_ZERO_KEY_MULTITAP)
  100. UI_character_type wgui_dialer_box_star_key_string[] = { '*', 'p', 'w', '' };
  101. /* MTK Elvis for multitap zero Key */
  102. #ifdef __MMI_MULTITAP_KEY_0__
  103. UI_character_type wgui_dialer_box_zero_key_string[] = { '+', 'p', 'w', '' };
  104. #else 
  105. UI_character_type wgui_dialer_box_zero_key_string[] = { '0', '+', '' };
  106. #endif 
  107. /* MTK end */
  108. #else /* (ENABLE_DIALER_ZERO_KEY_MULTITAP) */ 
  109. UI_character_type wgui_dialer_box_star_key_string[] = { '*', '+', 'p', 'w', '' };
  110. #endif /* (ENABLE_DIALER_ZERO_KEY_MULTITAP) */ 
  111. /*----------------------------------------------------------------------------
  112. Function:         wgui_dialer_inputbox_RSK_function
  113. Description:      Function pointer store the address of RSK function handler
  114. Input Parameters: void
  115. Output Parameters:   none
  116. Returns:       none
  117. ----------------------------------------------------------------------------*/
  118. void (*wgui_dialer_inputbox_RSK_function) (void) = NULL;
  119. U8 wgui_dialer_inputbox_RSK_label_clear = 0;
  120. /* store the string of RSK of dialer input box */
  121. UI_string_type wgui_dialer_inputbox_RSK_label_string;
  122. /* store the icon of RSK of dialer input box */
  123. PU8 wgui_dialer_inputbox_RSK_label_icon;
  124. /* used to keep tarck of decimal input in dialer input box */
  125. U8 wgui_dialer_inputbox_decimal_flag = 0;
  126. /* used to chekc if decimal input is enable for dialer box or not */
  127. U8 wgui_dialer_inputbox_decimal_input_mode_flag = 0;
  128. #if(0)
  129. /* Dependent on the width of the Input box.
  130. Values must be changed from platform to platform */
  131. void dialer_input_box_change_callback(void)
  132. { s32 text_length=pixtel_UI_dialer_input_box_get_text_length(&MMI_dialer_inputbox);
  133. UI_font_type f=MMI_dialer_inputbox.text_font;
  134. if(f==&wgui_dialer_box_f1)
  135. { if(text_length>18) MMI_dialer_inputbox.text_font=(&wgui_dialer_box_f2);
  136. }
  137. else if(f==&wgui_dialer_box_f2)
  138. { if(text_length<=18) MMI_dialer_inputbox.text_font=(&wgui_dialer_box_f1);
  139. else if(text_length>30) MMI_dialer_inputbox.text_font=(&wgui_dialer_box_f3);
  140. }
  141. else if(f==&wgui_dialer_box_f3)
  142. { if(text_length<=30) MMI_dialer_inputbox.text_font=(&wgui_dialer_box_f2);
  143. }
  144. }
  145. #endif /* (0) */ 
  146. /*****************************************************************************
  147.  * FUNCTION
  148.  *  dialer_input_box_change_callback
  149.  * DESCRIPTION
  150.  *  change callback funtion of dialer input box
  151.  * PARAMETERS
  152.  *  void
  153.  * RETURNS
  154.  *  void
  155.  *****************************************************************************/
  156. void dialer_input_box_change_callback(void)
  157. {
  158.     /*----------------------------------------------------------------*/
  159.     /* Local Variables                                                */
  160.     /*----------------------------------------------------------------*/
  161.     /* MTK Elvis to change the font size while the dialer box is too small to insert chars */
  162.     S32 text_width = 0, text_height = 0, i = 0, j = 0;
  163.     static S32 max_char_height_in_dialer_box = 0;
  164.     UI_buffer_type b_text;
  165.     S32 text_length;
  166.     UI_character_type ch;
  167.     /*----------------------------------------------------------------*/
  168.     /* Code Body                                                      */
  169.     /*----------------------------------------------------------------*/
  170.     MMI_dialer_inputbox.text_font = (&wgui_dialer_box_f1);
  171.     gui_lock_double_buffer();
  172.     MMI_dialer_inputbox.flags |= UI_DIALER_INPUT_BOX_DISABLE_DRAW;
  173.     gui_show_dialer_input_box(&MMI_dialer_inputbox);
  174.     MMI_dialer_inputbox.flags &= ~UI_DIALER_INPUT_BOX_DISABLE_DRAW;
  175.     gui_unlock_double_buffer();
  176.     /* f=MMI_dialer_inputbox.text_font; */
  177.     gui_measure_string((UI_string_type) MMI_dialer_inputbox.text, &text_width, &text_height);
  178.     text_length = gui_dialer_input_box_get_text_length(&MMI_dialer_inputbox);
  179.     b_text = MMI_dialer_inputbox.text;
  180.     if (max_char_height_in_dialer_box < text_height)
  181.     {
  182.         max_char_height_in_dialer_box = text_height;
  183.     }
  184.     text_width = 0;
  185.     for (i = 0; i < text_length; i++)
  186.     {
  187.         UI_STRING_GET_NEXT_CHARACTER(b_text, ch);
  188.         text_width += gui_get_character_width(ch);
  189.         text_width += MMI_dialer_inputbox.text_gap;
  190.         if (text_width + 1 > MMI_dialer_inputbox.width)
  191.         {
  192.             if (max_char_height_in_dialer_box > 0)
  193.             {
  194.                 if (++j >= ((MMI_dialer_inputbox.height / (max_char_height_in_dialer_box + 1))))
  195.                 {
  196.                     MMI_dialer_inputbox.text_font = (&wgui_dialer_box_f2);
  197.                     break;
  198.                 }
  199.                 else
  200.                 {
  201.                     text_width = gui_get_character_width(ch);
  202.                     text_width += MMI_dialer_inputbox.text_gap;
  203.                 }
  204.             }
  205.         }
  206.     }
  207. }
  208. void dialer_inputbox_complete_multitap_star_key(void);
  209. #if(ENABLE_DIALER_ZERO_KEY_MULTITAP)
  210. void dialer_inputbox_complete_multitap_zero_key(void);
  211. #endif 
  212. /*****************************************************************************
  213.  * FUNCTION
  214.  *  dialer_inputbox_handle_multitap_complete
  215.  * DESCRIPTION
  216.  *  
  217.  * PARAMETERS
  218.  *  type        [IN]        
  219.  * RETURNS
  220.  *  void
  221.  *****************************************************************************/
  222. extern void MMI_key_0_down(void);
  223. extern void MMI_key_0_up(void);
  224. extern pBOOL isInCall(void);
  225. void dialer_inputbox_handle_multitap_complete(S32 type)
  226. {
  227.     /*----------------------------------------------------------------*/
  228.     /* Local Variables                                                */
  229.     /*----------------------------------------------------------------*/
  230.     /*----------------------------------------------------------------*/
  231.     /* Code Body                                                      */
  232.     /*----------------------------------------------------------------*/
  233.     if (wgui_dialer_box_active_multitap != WGUI_DIALER_BOX_ACTIVE_MULTITAP_NONE)
  234.     {
  235.         switch (wgui_dialer_box_active_multitap)
  236.         {
  237.             case WGUI_DIALER_BOX_ACTIVE_MULTITAP_STAR_KEY:
  238.                 if (type == WGUI_DIALER_BOX_ACTIVE_MULTITAP_STAR_KEY)
  239.                 {
  240.                     return;
  241.                 }
  242.                 if (MMI_dialer_inputbox.flags & UI_DIALER_INPUT_BOX_STATE_MULTITAP)
  243.                 {
  244.                     gui_cancel_timer(dialer_inputbox_complete_multitap_star_key);
  245.                     gui_multitap_input_complete(&wgui_dialer_box_star_key_handler);
  246.                 }
  247.                 break;
  248.             #if(ENABLE_DIALER_ZERO_KEY_MULTITAP)
  249.             case WGUI_DIALER_BOX_ACTIVE_MULTITAP_ZERO_KEY:
  250.                 if (type == WGUI_DIALER_BOX_ACTIVE_MULTITAP_ZERO_KEY)
  251.                 {
  252.                     return;
  253.                 }
  254.                 if (MMI_dialer_inputbox.flags & UI_DIALER_INPUT_BOX_STATE_MULTITAP)
  255.                 {
  256.                     gui_cancel_timer(dialer_inputbox_complete_multitap_zero_key);
  257.                     gui_multitap_input_complete(&wgui_dialer_box_zero_key_handler);
  258.                     /* MTK Elvis to store the zero key hander for idleScreenDigitHandler.... */
  259.                     if (isInCall())
  260.                     {
  261.                         wgui_key_handlers[KEY_0][KEY_EVENT_DOWN] = storeZeroKeyFuncPtrs[KEY_0][KEY_EVENT_DOWN];
  262.                         wgui_key_handlers[KEY_0][KEY_EVENT_UP] = storeZeroKeyFuncPtrs[KEY_0][KEY_EVENT_UP];
  263.                     }
  264.                     else
  265.                     {
  266.                         SetKeyHandler(storeZeroKeyFuncPtrs[KEY_0][KEY_EVENT_DOWN], KEY_0, KEY_EVENT_DOWN);
  267.                         SetKeyHandler(storeZeroKeyFuncPtrs[KEY_0][KEY_EVENT_UP], KEY_0, KEY_EVENT_UP);
  268.                     }
  269.                     /* SetKeyHandler(MMI_key_0_down,KEY_0,KEY_EVENT_DOWN); */
  270.                 }
  271.                 break;
  272.             #endif /* (ENABLE_DIALER_ZERO_KEY_MULTITAP) */ 
  273.         }
  274.         wgui_dialer_box_active_multitap = WGUI_DIALER_BOX_ACTIVE_MULTITAP_NONE;
  275.     }
  276. }
  277. /*****************************************************************************
  278.  * FUNCTION
  279.  *  dialer_inputbox_handle_key_down
  280.  * DESCRIPTION
  281.  *  Function handles a key down wvwnt of dialer input box
  282.  * PARAMETERS
  283.  *  k           [IN]        
  284.  *  S32(?)      [IN]        MMI_key_code_type :- Key code
  285.  * RETURNS
  286.  *  void
  287.  *****************************************************************************/
  288. void dialer_inputbox_handle_key_down(MMI_key_code_type k)
  289. {
  290.     /*----------------------------------------------------------------*/
  291.     /* Local Variables                                                */
  292.     /*----------------------------------------------------------------*/
  293.     /*----------------------------------------------------------------*/
  294.     /* Code Body                                                      */
  295.     /*----------------------------------------------------------------*/
  296.     dialer_inputbox_handle_multitap_complete(WGUI_DIALER_BOX_ACTIVE_MULTITAP_ANY);
  297.     dialer_inputbox_direct_input((UI_character_type) ('0' + k));
  298. }
  299. /*****************************************************************************
  300.  * FUNCTION
  301.  *  dialer_inputbox_complete_multitap_star_key
  302.  * DESCRIPTION
  303.  *  Function handles a multitap star key down input and draw the dialer input box
  304.  * PARAMETERS
  305.  *  void
  306.  *  noen(?)     [IN]        
  307.  * RETURNS
  308.  *  void
  309.  *****************************************************************************/
  310. void dialer_inputbox_complete_multitap_star_key(void)
  311. {
  312.     /*----------------------------------------------------------------*/
  313.     /* Local Variables                                                */
  314.     /*----------------------------------------------------------------*/
  315.     /*----------------------------------------------------------------*/
  316.     /* Code Body                                                      */
  317.     /*----------------------------------------------------------------*/
  318.     gui_multitap_input_complete(&wgui_dialer_box_star_key_handler);
  319.     mmi_idle_star_key_disable_long_press(); /* special handler for star key pressed in touch screen dial pad */
  320. }
  321. /*****************************************************************************
  322.  * FUNCTION
  323.  *  dialer_inputbox_handle_multitap_star_key_down
  324.  * DESCRIPTION
  325.  *  Function handles a multitap star key down input of dialer box
  326.  * PARAMETERS
  327.  *  void
  328.  * RETURNS
  329.  *  void
  330.  *****************************************************************************/
  331. void dialer_inputbox_handle_multitap_star_key_down(void)
  332. {
  333.     /*----------------------------------------------------------------*/
  334.     /* Local Variables                                                */
  335.     /*----------------------------------------------------------------*/
  336.     /*----------------------------------------------------------------*/
  337.     /* Code Body                                                      */
  338.     /*----------------------------------------------------------------*/
  339.     dialer_inputbox_handle_multitap_complete(WGUI_DIALER_BOX_ACTIVE_MULTITAP_STAR_KEY);
  340.     wgui_dialer_box_active_multitap = WGUI_DIALER_BOX_ACTIVE_MULTITAP_STAR_KEY;
  341.     gui_change_multitap_input_state(&wgui_dialer_box_star_key_handler);
  342.     if (MMI_dialer_inputbox.text_length <= 2)
  343.     {
  344.         gui_start_timer(MMI_MULTITAP_TIMEOUT, dialer_inputbox_complete_multitap_star_key);
  345.     }
  346. }
  347. /*****************************************************************************
  348.  * FUNCTION
  349.  *  dialer_inputbox_handle_multitap_star_key_up
  350.  * DESCRIPTION
  351.  *  Function handles a multitap star key up input of dialer box
  352.  * PARAMETERS
  353.  *  void
  354.  * RETURNS
  355.  *  void
  356.  *****************************************************************************/
  357. void dialer_inputbox_handle_multitap_star_key_up(void)
  358. {
  359.     /*----------------------------------------------------------------*/
  360.     /* Local Variables                                                */
  361.     /*----------------------------------------------------------------*/
  362.     /*----------------------------------------------------------------*/
  363.     /* Code Body                                                      */
  364.     /*----------------------------------------------------------------*/
  365.     gui_start_timer(MMI_MULTITAP_TIMEOUT, dialer_inputbox_complete_multitap_star_key);
  366. }
  367. #if(ENABLE_DIALER_ZERO_KEY_MULTITAP)
  368. /*****************************************************************************
  369.  * FUNCTION
  370.  *  dialer_inputbox_complete_multitap_zero_key
  371.  * DESCRIPTION
  372.  *  
  373.  * PARAMETERS
  374.  *  void
  375.  * RETURNS
  376.  *  void
  377.  *****************************************************************************/
  378. void dialer_inputbox_complete_multitap_zero_key(void)
  379. {
  380.     /*----------------------------------------------------------------*/
  381.     /* Local Variables                                                */
  382.     /*----------------------------------------------------------------*/
  383.     /*----------------------------------------------------------------*/
  384.     /* Code Body                                                      */
  385.     /*----------------------------------------------------------------*/
  386.     gui_multitap_input_complete(&wgui_dialer_box_zero_key_handler);
  387. #ifdef __MMI_MULTITAP_KEY_0__
  388.     /* MTK Elvis to store the zero key hander for idleScreenDigitHandler.... */
  389.     if (isInCall())
  390.     {
  391.         wgui_key_handlers[KEY_0][KEY_EVENT_DOWN] = storeZeroKeyFuncPtrs[KEY_0][KEY_EVENT_DOWN];
  392.         wgui_key_handlers[KEY_0][KEY_EVENT_UP] = storeZeroKeyFuncPtrs[KEY_0][KEY_EVENT_UP];
  393.     }
  394.     else
  395.     {
  396.         SetKeyHandler(storeZeroKeyFuncPtrs[KEY_0][KEY_EVENT_DOWN], KEY_0, KEY_EVENT_DOWN);
  397.         SetKeyHandler(storeZeroKeyFuncPtrs[KEY_0][KEY_EVENT_UP], KEY_0, KEY_EVENT_UP);
  398.     }
  399.     /* MTK end */
  400. #endif /* __MMI_MULTITAP_KEY_0__ */ 
  401. }
  402. /*****************************************************************************
  403.  * FUNCTION
  404.  *  dialer_inputbox_handle_multitap_zero_key_down
  405.  * DESCRIPTION
  406.  *  Function handles a zero key down input of dialer box
  407.  * PARAMETERS
  408.  *  void
  409.  * RETURNS
  410.  *  void
  411.  *****************************************************************************/
  412. void dialer_inputbox_handle_multitap_zero_key_down(void)
  413. {
  414.     /*----------------------------------------------------------------*/
  415.     /* Local Variables                                                */
  416.     /*----------------------------------------------------------------*/
  417.     /*----------------------------------------------------------------*/
  418.     /* Code Body                                                      */
  419.     /*----------------------------------------------------------------*/
  420.     dialer_inputbox_handle_multitap_complete(WGUI_DIALER_BOX_ACTIVE_MULTITAP_ZERO_KEY);
  421.     wgui_dialer_box_active_multitap = WGUI_DIALER_BOX_ACTIVE_MULTITAP_ZERO_KEY;
  422.     gui_change_multitap_input_state(&wgui_dialer_box_zero_key_handler);
  423.     if (MMI_dialer_inputbox.text_length <= 2)
  424.     {
  425.         gui_start_timer(MMI_MULTITAP_TIMEOUT, dialer_inputbox_complete_multitap_zero_key);
  426.     }
  427. }
  428. /*****************************************************************************
  429.  * FUNCTION
  430.  *  dialer_inputbox_handle_multitap_zero_key_up
  431.  * DESCRIPTION
  432.  *  Function handles a zero key up input of dialer box
  433.  * PARAMETERS
  434.  *  void
  435.  * RETURNS
  436.  *  void
  437.  *****************************************************************************/
  438. void dialer_inputbox_handle_multitap_zero_key_up(void)
  439. {
  440.     /*----------------------------------------------------------------*/
  441.     /* Local Variables                                                */
  442.     /*----------------------------------------------------------------*/
  443.     /*----------------------------------------------------------------*/
  444.     /* Code Body                                                      */
  445.     /*----------------------------------------------------------------*/
  446. #ifdef __MMI_MULTITAP_KEY_0__
  447.     gui_start_timer(MMI_MULTITAP_TIMEOUT + 400, dialer_inputbox_complete_multitap_zero_key);
  448. #else 
  449.     gui_start_timer(MMI_MULTITAP_TIMEOUT, dialer_inputbox_complete_multitap_zero_key);
  450. #endif 
  451.     /* MTK Terry for Cannon_plus #3504 */
  452.     if (storeZeroKeyFuncPtrs[KEY_0][KEY_EVENT_UP])
  453.     {
  454.         (*storeZeroKeyFuncPtrs[KEY_0][KEY_EVENT_UP]) ();
  455.     }
  456.     /* MTK end */
  457. }
  458. #endif /* (ENABLE_DIALER_ZERO_KEY_MULTITAP) */ 
  459. /*****************************************************************************
  460.  * FUNCTION
  461.  *  dialer_inputbox_handle_zero_key_long_press
  462.  * DESCRIPTION
  463.  *  Function handles a zero key long press  input of dialer box
  464.  * PARAMETERS
  465.  *  void
  466.  * RETURNS
  467.  *  void
  468.  *****************************************************************************/
  469. void dialer_inputbox_handle_zero_key_long_press(void)
  470. {
  471. #if(ENABLE_DIALER_ZERO_KEY_MULTITAP)
  472.     /*----------------------------------------------------------------*/
  473.     /* Local Variables                                                */
  474.     /*----------------------------------------------------------------*/
  475.     /*----------------------------------------------------------------*/
  476.     /* Code Body                                                      */
  477.     /*----------------------------------------------------------------*/
  478.     SetKeyHandler(dialer_inputbox_handle_multitap_zero_key_down, KEY_0, KEY_REPEAT);
  479. #else /* (ENABLE_DIALER_ZERO_KEY_MULTITAP) */ 
  480.     SetKeyHandler(UI_dummy_function, KEY_0, KEY_REPEAT);
  481. #endif /* (ENABLE_DIALER_ZERO_KEY_MULTITAP) */ 
  482.     dialer_inputbox_delete_character();
  483.     /* MTK added by JL 031112, for multitap key register */
  484. #if(ENABLE_DIALER_ZERO_KEY_MULTITAP)
  485.     dialer_inputbox_handle_multitap_zero_key_down();
  486.     /* MTK Elvis to store the zero key hander for idleScreenDigitHandler.... */
  487.     if (isInCall())
  488.     {
  489.         storeZeroKeyFuncPtrs[KEY_0][KEY_EVENT_DOWN] = wgui_key_handlers[KEY_0][KEY_EVENT_DOWN];
  490.         storeZeroKeyFuncPtrs[KEY_0][KEY_EVENT_UP] = wgui_key_handlers[KEY_0][KEY_EVENT_UP];
  491.         wgui_key_handlers[KEY_0][KEY_EVENT_DOWN] = dialer_inputbox_handle_multitap_zero_key_down;
  492.         wgui_key_handlers[KEY_0][KEY_EVENT_UP] = dialer_inputbox_handle_multitap_zero_key_up;
  493.     }
  494.     else
  495.     {
  496.         storeZeroKeyFuncPtrs[KEY_0][KEY_EVENT_DOWN] = currKeyFuncPtrs[KEY_0][KEY_EVENT_DOWN];
  497.         storeZeroKeyFuncPtrs[KEY_0][KEY_EVENT_UP] = currKeyFuncPtrs[KEY_0][KEY_EVENT_UP];
  498.         SetKeyHandler(dialer_inputbox_handle_multitap_zero_key_down, KEY_0, KEY_EVENT_DOWN);
  499.         SetKeyHandler(dialer_inputbox_handle_multitap_zero_key_up, KEY_0, KEY_EVENT_UP);
  500.     }
  501.     /* MTK end */
  502. #endif /* (ENABLE_DIALER_ZERO_KEY_MULTITAP) */ 
  503.     /* MTK end */
  504. }
  505. /*****************************************************************************
  506.  * FUNCTION
  507.  *  dialer_inputbox_handle_hash_key_down
  508.  * DESCRIPTION
  509.  *  Function handles a hash key down input of dialer box
  510.  * PARAMETERS
  511.  *  void
  512.  * RETURNS
  513.  *  void
  514.  *****************************************************************************/
  515. void dialer_inputbox_handle_hash_key_down(void)
  516. {
  517.     /*----------------------------------------------------------------*/
  518.     /* Local Variables                                                */
  519.     /*----------------------------------------------------------------*/
  520.     /*----------------------------------------------------------------*/
  521.     /* Code Body                                                      */
  522.     /*----------------------------------------------------------------*/
  523.     dialer_inputbox_handle_multitap_complete(WGUI_DIALER_BOX_ACTIVE_MULTITAP_ANY);
  524.     dialer_inputbox_direct_input((UI_character_type) '#');
  525. }
  526. /*****************************************************************************
  527.  * FUNCTION
  528.  *  dialer_inputbox_handle_star_key_down
  529.  * DESCRIPTION
  530.  *  Function handles a start key down input of dialer box
  531.  * PARAMETERS
  532.  *  void
  533.  * RETURNS
  534.  *  void
  535.  *****************************************************************************/
  536. void dialer_inputbox_handle_star_key_down(void)
  537. {
  538.     /*----------------------------------------------------------------*/
  539.     /* Local Variables                                                */
  540.     /*----------------------------------------------------------------*/
  541.     /*----------------------------------------------------------------*/
  542.     /* Code Body                                                      */
  543.     /*----------------------------------------------------------------*/
  544.     dialer_inputbox_handle_multitap_complete(WGUI_DIALER_BOX_ACTIVE_MULTITAP_ANY);
  545.     dialer_inputbox_direct_input((UI_character_type) '*');
  546. }
  547. /*****************************************************************************
  548.  * FUNCTION
  549.  *  wgui_handle_dialer_inputbox_right_softkey_down
  550.  * DESCRIPTION
  551.  *  Function handles a RSK  key down input of dialer box
  552.  * PARAMETERS
  553.  *  void
  554.  * RETURNS
  555.  *  void
  556.  *****************************************************************************/
  557. void wgui_handle_dialer_inputbox_right_softkey_down(void)
  558. {
  559.     /*----------------------------------------------------------------*/
  560.     /* Local Variables                                                */
  561.     /*----------------------------------------------------------------*/
  562.     /*----------------------------------------------------------------*/
  563.     /* Code Body                                                      */
  564.     /*----------------------------------------------------------------*/
  565.     /* MTK Elvis to complete the active multitap key */
  566.     dialer_inputbox_handle_multitap_complete(WGUI_DIALER_BOX_ACTIVE_MULTITAP_ANY);
  567.     /* MTK end */
  568.     dialer_inputbox_delete_character();
  569. }
  570. /*****************************************************************************
  571.  * FUNCTION
  572.  *  wgui_handle_dialer_inputbox_right_softkey_up
  573.  * DESCRIPTION
  574.  *  Function handles a RSK  key up input of dialer box
  575.  * PARAMETERS
  576.  *  void
  577.  * RETURNS
  578.  *  void
  579.  *****************************************************************************/
  580. void wgui_handle_dialer_inputbox_right_softkey_up(void)
  581. {
  582.     /*----------------------------------------------------------------*/
  583.     /* Local Variables                                                */
  584.     /*----------------------------------------------------------------*/
  585.     /* MTK Terry for reentry issue */
  586. #if defined(__MMI_WITH_C_KEY__)
  587.     static U8 executing = 0;
  588.     /*----------------------------------------------------------------*/
  589.     /* Code Body                                                      */
  590.     /*----------------------------------------------------------------*/
  591.     if (1 == executing)
  592.     {
  593.         return;
  594.     }
  595.     executing = 1;
  596. #endif /* defined(__MMI_WITH_C_KEY__) */ 
  597. #ifdef __MMI_MULTITAP_KEY_0__
  598.     if (wgui_dialer_box_active_multitap == WGUI_DIALER_BOX_ACTIVE_MULTITAP_ZERO_KEY)
  599.     {
  600.         gui_cancel_timer(dialer_inputbox_complete_multitap_zero_key);
  601.     }
  602. #else /* __MMI_MULTITAP_KEY_0__ */ 
  603.     if (wgui_dialer_box_active_multitap == WGUI_DIALER_BOX_ACTIVE_MULTITAP_STAR_KEY)
  604.     {
  605.         gui_cancel_timer(dialer_inputbox_complete_multitap_star_key);
  606.     }
  607. #endif /* __MMI_MULTITAP_KEY_0__ */ 
  608.     if (wgui_dialer_inputbox_RSK_function != NULL)
  609.     {
  610.         wgui_dialer_inputbox_RSK_function();
  611.     }
  612. #if defined(__MMI_WITH_C_KEY__)
  613.     executing = 0;
  614. #endif 
  615. }
  616. /*****************************************************************************
  617.  * FUNCTION
  618.  *  wgui_register_dialer_inputbox_handle_right_softkey_up
  619.  * DESCRIPTION
  620.  *  register RSK function of dialer box
  621.  * PARAMETERS
  622.  *  void
  623.  * RETURNS
  624.  *  void
  625.  *****************************************************************************/
  626. void wgui_register_dialer_inputbox_handle_right_softkey_up(void)
  627. {
  628.     /*----------------------------------------------------------------*/
  629.     /* Local Variables                                                */
  630.     /*----------------------------------------------------------------*/
  631.     /*----------------------------------------------------------------*/
  632.     /* Code Body                                                      */
  633.     /*----------------------------------------------------------------*/
  634.     set_right_softkey_function(wgui_handle_dialer_inputbox_right_softkey_up, KEY_EVENT_UP);
  635. }
  636. /*****************************************************************************
  637.  * FUNCTION
  638.  *  wgui_register_dialer_inputbox_handle_clear_key_up
  639.  * DESCRIPTION
  640.  *  register RSK function of dialer box
  641.  * PARAMETERS
  642.  *  void
  643.  * RETURNS
  644.  *  void
  645.  *****************************************************************************/
  646. void wgui_register_dialer_inputbox_handle_clear_key_up(void)
  647. {
  648.     /*----------------------------------------------------------------*/
  649.     /* Local Variables                                                */
  650.     /*----------------------------------------------------------------*/
  651.     /*----------------------------------------------------------------*/
  652.     /* Code Body                                                      */
  653.     /*----------------------------------------------------------------*/
  654.     SetKeyHandler(wgui_handle_dialer_inputbox_right_softkey_up, KEY_CLEAR, KEY_EVENT_UP);
  655. }
  656. /*****************************************************************************
  657.  * FUNCTION
  658.  *  wgui_handle_dialer_inputbox_input
  659.  * DESCRIPTION
  660.  *  handle dialer input box set RSK function of dialer box
  661.  * PARAMETERS
  662.  *  void
  663.  * RETURNS
  664.  *  void
  665.  *****************************************************************************/
  666. void wgui_handle_dialer_inputbox_input(void)
  667. {
  668.     /*----------------------------------------------------------------*/
  669.     /* Local Variables                                                */
  670.     /*----------------------------------------------------------------*/
  671.     /*----------------------------------------------------------------*/
  672.     /* Code Body                                                      */
  673.     /*----------------------------------------------------------------*/
  674.     if (gui_dialer_input_box_get_text_length(&MMI_dialer_inputbox) > 0)
  675.     {
  676.     #if defined(__MMI_WITH_C_KEY__)
  677.         if (wgui_dialer_inputbox_RSK_label_clear == 0)
  678.         {
  679.             if (wgui_inputbox_not_empty_callback != NULL)
  680.             {
  681.                 wgui_inputbox_not_empty_callback();
  682.             }
  683.             wgui_dialer_inputbox_RSK_label_clear = 1;
  684.             SetKeyHandler(wgui_handle_dialer_inputbox_right_softkey_down, KEY_CLEAR, KEY_EVENT_DOWN);
  685.             SetKeyHandler(UI_dummy_function, KEY_CLEAR, KEY_EVENT_UP);
  686.             SetKeyHandler(wgui_handle_dialer_inputbox_right_softkey_long_press, KEY_CLEAR, KEY_EVENT_LONG_PRESS);
  687.         }
  688.     #else /* defined(__MMI_WITH_C_KEY__) */ 
  689.         if (wgui_dialer_inputbox_RSK_label_clear == 0)
  690.         {
  691.             set_right_softkey_label((UI_string_type) get_string(WGUI_CATEGORY_CLEAR_STRING_ID));
  692.             set_right_softkey_icon(NULL);
  693.             if (wgui_inputbox_not_empty_callback != NULL)
  694.             {
  695.                 wgui_inputbox_not_empty_callback();
  696.             }
  697.             redraw_right_softkey();
  698.             wgui_dialer_inputbox_RSK_label_clear = 1;
  699.             set_right_softkey_function(UI_dummy_function, KEY_EVENT_UP);
  700.             set_right_softkey_function(wgui_handle_dialer_inputbox_right_softkey_down, KEY_EVENT_DOWN);
  701.         #ifdef __MMI_TOUCH_DIAL_SCREEN__
  702.             //SetRightSoftkeyFunction(TouchDialerClearKey,KEY_LONG_PRESS); 
  703.         #endif /* __MMI_TOUCH_DIAL_SCREEN__ */ 
  704.         }
  705.     #endif /* defined(__MMI_WITH_C_KEY__) */ 
  706.     }
  707.     else
  708.     {
  709.     #if defined(__MMI_WITH_C_KEY__)
  710.         if (wgui_dialer_inputbox_RSK_label_clear == 1)
  711.         {
  712.             if (wgui_inputbox_empty_callback != NULL)
  713.             {
  714.                 wgui_inputbox_empty_callback();
  715.             }
  716.             wgui_dialer_inputbox_RSK_label_clear = 0;
  717.             SetKeyHandler(UI_dummy_function, KEY_CLEAR, KEY_EVENT_DOWN);
  718.             SetKeyHandler(wgui_handle_dialer_inputbox_right_softkey_up, KEY_CLEAR, KEY_EVENT_UP);
  719.             SetKeyHandler(UI_dummy_function, KEY_CLEAR, KEY_EVENT_LONG_PRESS);
  720.             wgui_handle_dialer_inputbox_right_softkey_up();
  721.         }
  722.     #else /* defined(__MMI_WITH_C_KEY__) */ 
  723.         if (wgui_dialer_inputbox_RSK_label_clear == 1)
  724.         {
  725.         #if(DISABLE_DIALER_BACK_KEY)
  726.             set_right_softkey_function(wgui_handle_dialer_inputbox_right_softkey_up, KEY_EVENT_UP);
  727.             if (wgui_inputbox_empty_callback != NULL)
  728.             {
  729.                 wgui_inputbox_empty_callback();
  730.             }
  731.             wgui_dialer_inputbox_RSK_label_clear = 0;
  732.         #else /* (DISABLE_DIALER_BACK_KEY) */ 
  733.             set_right_softkey_label(wgui_dialer_inputbox_RSK_label_string);
  734.             set_right_softkey_icon(wgui_dialer_inputbox_RSK_label_icon);
  735.             if (wgui_inputbox_empty_callback != NULL)
  736.             {
  737.                 wgui_inputbox_empty_callback();
  738.             }
  739.             redraw_right_softkey();
  740.             wgui_dialer_inputbox_RSK_label_clear = 0;
  741.             set_right_softkey_function(wgui_register_dialer_inputbox_handle_right_softkey_up, KEY_EVENT_UP);
  742.             set_right_softkey_function(UI_dummy_function, KEY_EVENT_DOWN);
  743.         #endif /* (DISABLE_DIALER_BACK_KEY) */ 
  744.         }
  745.     #endif /* defined(__MMI_WITH_C_KEY__) */ 
  746.     }
  747. }
  748. /*****************************************************************************
  749.  * FUNCTION
  750.  *  register_dialer_inputbox_dialer_keys
  751.  * DESCRIPTION
  752.  *  register key handlers of dialer box
  753.  * PARAMETERS
  754.  *  void
  755.  * RETURNS
  756.  *  void
  757.  *****************************************************************************/
  758. void register_dialer_inputbox_dialer_keys(void)
  759. {
  760.     /*----------------------------------------------------------------*/
  761.     /* Local Variables                                                */
  762.     /*----------------------------------------------------------------*/
  763.     /*----------------------------------------------------------------*/
  764.     /* Code Body                                                      */
  765.     /*----------------------------------------------------------------*/
  766.     register_dialer_inputbox_keys();
  767.     change_multitap_mode(INPUT_MODE_123);
  768.     clear_multitap_key_handlers();
  769.     register_MMI_key_input_handler();
  770.     register_key_down_handler(dialer_inputbox_handle_key_down);
  771.     register_keyboard_input_handler(dialer_inputbox_numeric_keyboard_input_handler);
  772. #ifdef __MMI_MULTITAP_KEY_0__
  773.     SetKeyHandler(dialer_inputbox_handle_star_key_down, KEY_STAR, KEY_EVENT_DOWN);
  774. #else /* __MMI_MULTITAP_KEY_0__ */ 
  775.     SetKeyHandler(dialer_inputbox_handle_multitap_star_key_down, KEY_STAR, KEY_EVENT_DOWN);
  776.     SetKeyHandler(dialer_inputbox_handle_multitap_star_key_up, KEY_STAR, KEY_EVENT_UP);
  777. #endif /* __MMI_MULTITAP_KEY_0__ */ 
  778.     SetKeyHandler(dialer_inputbox_handle_hash_key_down, KEY_POUND, KEY_EVENT_DOWN);
  779. #if(ENABLE_DIALER_ZERO_KEY_MULTITAP)
  780. #ifdef __MMI_MULTITAP_KEY_0__
  781.     SetKeyHandler(dialer_inputbox_handle_zero_key_long_press, KEY_0, KEY_EVENT_LONG_PRESS);
  782. #else /* __MMI_MULTITAP_KEY_0__ */ 
  783.     SetKeyHandler(dialer_inputbox_handle_multitap_zero_key_down, KEY_0, KEY_EVENT_DOWN);
  784.     SetKeyHandler(dialer_inputbox_handle_multitap_zero_key_up, KEY_0, KEY_EVENT_UP);
  785. #endif /* __MMI_MULTITAP_KEY_0__ */ 
  786. #endif /* (ENABLE_DIALER_ZERO_KEY_MULTITAP) */ 
  787. }
  788. /*****************************************************************************
  789.  * FUNCTION
  790.  *  wgui_dialer_validation_callback
  791.  * DESCRIPTION
  792.  *  validation function of dialer box
  793.  * PARAMETERS
  794.  *  text            [IN]        Text of dialer input box
  795.  *  cursor          [IN]        
  796.  *  text_length     [IN]        Text length
  797.  * RETURNS
  798.  *  void
  799.  *****************************************************************************/
  800. void wgui_dialer_validation_callback(UI_buffer_type text, UI_buffer_type cursor, S32 text_length)
  801. {
  802.     /*----------------------------------------------------------------*/
  803.     /* Local Variables                                                */
  804.     /*----------------------------------------------------------------*/
  805.     /*----------------------------------------------------------------*/
  806.     /* Code Body                                                      */
  807.     /*----------------------------------------------------------------*/
  808.     if (wgui_inputbox_validation_callback != NULL)
  809.     {
  810.         wgui_inputbox_validation_callback(text, cursor, text_length);
  811.     }
  812. }
  813. /*****************************************************************************
  814.  * FUNCTION
  815.  *  wgui_handle_dialer_inputbox_right_softkey_long_press
  816.  * DESCRIPTION
  817.  *  function handle long press of RSK
  818.  * PARAMETERS
  819.  *  void
  820.  * RETURNS
  821.  *  void
  822.  *****************************************************************************/
  823. void wgui_handle_dialer_inputbox_right_softkey_long_press(void)
  824. {
  825.     /*----------------------------------------------------------------*/
  826.     /* Local Variables                                                */
  827.     /*----------------------------------------------------------------*/
  828.     /*----------------------------------------------------------------*/
  829.     /* Code Body                                                      */
  830.     /*----------------------------------------------------------------*/
  831.     dialer_inputbox_delete_all_characters();
  832. }
  833. /*****************************************************************************
  834.  * FUNCTION
  835.  *  wgui_dialer_inputbox_set_border
  836.  * DESCRIPTION
  837.  *  add border for dialer inputbox
  838.  * PARAMETERS
  839.  *  is_border_existing      [IN]        
  840.  *  border_color            [IN]        
  841.  * RETURNS
  842.  *  void
  843.  *****************************************************************************/
  844. void wgui_dialer_inputbox_set_border(MMI_BOOL is_border_existing, color border_color)
  845. {
  846.     /*----------------------------------------------------------------*/
  847.     /* Local Variables                                                */
  848.     /*----------------------------------------------------------------*/
  849.     /*----------------------------------------------------------------*/
  850.     /* Code Body                                                      */
  851.     /*----------------------------------------------------------------*/
  852.     if (is_border_existing) /* draw a single border on dialer inputbox */
  853.     {
  854.         MMI_dialer_inputbox.flags |= UI_DIALER_INPUT_BOX_SHOW_BORDER;
  855.     }
  856.     else
  857.     {
  858.         MMI_dialer_inputbox.flags &= ~UI_DIALER_INPUT_BOX_SHOW_BORDER;
  859.     }
  860. }
  861. /*****************************************************************************
  862.  * FUNCTION
  863.  *  wgui_setup_dialer_inputbox
  864.  * DESCRIPTION
  865.  *  create dialer input box
  866.  * PARAMETERS
  867.  *  x                       [IN]        Start x position of dialer input box
  868.  *  y                       [IN]        Start y position of dialer input box
  869.  *  width                   [IN]        Width of dilaer input box
  870.  *  height                  [IN]        Height of dialer input box
  871.  *  buffer                  [IN]        Text buffer of dialer input box
  872.  *  buffer_size             [IN]        Buffer size
  873.  *  category_screen_ID      [IN]        Category screen iD
  874.  *  RSK_label               [IN]        RSK label
  875.  *  RSK_icon                [IN]        RSK icon
  876.  *  history_buffer          [IN]        History buffer
  877.  *  flags                   [IN]        
  878.  * RETURNS
  879.  *  void
  880.  *****************************************************************************/
  881. void wgui_setup_dialer_inputbox(
  882.         S32 x,
  883.         S32 y,
  884.         S32 width,
  885.         S32 height,
  886.         U8 *buffer,
  887.         S32 buffer_size,
  888.         U16 category_screen_ID,
  889.         UI_string_type RSK_label,
  890.         PU8 RSK_icon,
  891.         U8 *history_buffer,
  892.         U32 flags)
  893. {
  894.     /*----------------------------------------------------------------*/
  895.     /* Local Variables                                                */
  896.     /*----------------------------------------------------------------*/
  897.     S32 l;
  898.     /*----------------------------------------------------------------*/
  899.     /* Code Body                                                      */
  900.     /*----------------------------------------------------------------*/
  901.     UI_UNUSED_PARAMETER(flags);
  902. #ifndef __MMI_MULTITAP_KEY_0__
  903.     gui_create_multitap_input(
  904.         &wgui_dialer_box_star_key_handler,
  905.         0,
  906.         0,
  907.         0,
  908.         0,
  909.         (UI_string_type) wgui_dialer_box_star_key_string);
  910.     gui_set_multitap_input_callbacks(
  911.         &wgui_dialer_box_star_key_handler,
  912.         dialer_inputbox_multitap_input,
  913.         dialer_inputbox_multitap_input_complete);
  914. #endif /* __MMI_MULTITAP_KEY_0__ */ 
  915. #if(ENABLE_DIALER_ZERO_KEY_MULTITAP)
  916.     gui_create_multitap_input(
  917.         &wgui_dialer_box_zero_key_handler,
  918.         0,
  919.         0,
  920.         0,
  921.         0,
  922.         (UI_string_type) wgui_dialer_box_zero_key_string);
  923.     gui_set_multitap_input_callbacks(
  924.         &wgui_dialer_box_zero_key_handler,
  925.         dialer_inputbox_multitap_input,
  926.         dialer_inputbox_multitap_input_complete);
  927. #endif /* (ENABLE_DIALER_ZERO_KEY_MULTITAP) */ 
  928.     l = gui_strlen((UI_string_type) buffer);
  929.     create_dialer_inputbox_set_buffer((UI_string_type) buffer, buffer_size, l, l);
  930.     MMI_dialer_inputbox.text_font = &wgui_dialer_box_f2;
  931.     MMI_dialer_inputbox.flags |= UI_DIALER_INPUT_BOX_CHARACTER_QUEUE;
  932. #if(ENABLE_DIALER_PLUS_CHARACTER_HANDLING)
  933.     MMI_dialer_inputbox.flags |= UI_DIALER_INPUT_BOX_PLUS_CHARACTER_HANDLING;
  934. #endif 
  935.     register_dialer_inputbox_keys();
  936.     move_dialer_inputbox(x, y);
  937.     resize_dialer_inputbox(width, height);
  938.     MMI_dialer_inputbox.text_font = (&wgui_dialer_box_f1);
  939.     MMI_dialer_inputbox.change_callback = dialer_input_box_change_callback;
  940.     set_dialer_inputbox_mask(0);
  941.     register_dialer_inputbox_dialer_keys();
  942.     /* This is done to choose the right font size, if the buffer contains valid data */
  943.     dialer_input_box_change_callback();
  944.     dialer_input_box_change_callback();
  945.     MMI_current_input_mode = INPUT_MODE_123;
  946.     register_dialer_inputbox_input_callback(wgui_handle_dialer_inputbox_input);
  947.     /* Leo start 20050805, add dialer inputbox history */
  948.     set_dialer_inputbox_category_history(category_screen_ID, history_buffer);
  949.     /* Leo end 20050805 */
  950.     wgui_dialer_inputbox_RSK_label_icon = RSK_icon;
  951.     wgui_dialer_inputbox_RSK_label_string = RSK_label;
  952. #if defined(__MMI_WITH_C_KEY__)
  953.     SetKeyHandler(wgui_handle_dialer_inputbox_right_softkey_long_press, KEY_CLEAR, KEY_LONG_PRESS);
  954.     set_right_softkey_function(wgui_handle_dialer_inputbox_right_softkey_up, KEY_EVENT_UP);
  955. #else /* defined(__MMI_WITH_C_KEY__) */ 
  956.     set_right_softkey_function(wgui_handle_dialer_inputbox_right_softkey_long_press, KEY_LONG_PRESS);
  957. #endif /* defined(__MMI_WITH_C_KEY__) */ 
  958.     wgui_handle_dialer_inputbox_input();
  959.     if (gui_dialer_input_box_get_text_length(&MMI_dialer_inputbox) <= 0)
  960.     {
  961.     #if defined(__MMI_WITH_C_KEY__)
  962.         SetKeyHandler(wgui_handle_dialer_inputbox_right_softkey_up, KEY_CLEAR, KEY_EVENT_UP);
  963.         if (wgui_inputbox_empty_callback != NULL)
  964.         {
  965.             wgui_inputbox_empty_callback();
  966.         }
  967.     #else /* defined(__MMI_WITH_C_KEY__) */ 
  968.         set_right_softkey_function(wgui_handle_dialer_inputbox_right_softkey_up, KEY_EVENT_UP);
  969.         if (wgui_inputbox_empty_callback != NULL)
  970.         {
  971.             wgui_inputbox_empty_callback();
  972.         }
  973.     #endif /* defined(__MMI_WITH_C_KEY__) */ 
  974.     }
  975.     else if (wgui_inputbox_not_empty_callback != NULL)
  976.     {
  977.         wgui_inputbox_not_empty_callback();
  978.     }
  979.     MMI_dialer_inputbox.validation_callback = wgui_dialer_validation_callback;
  980.     MMI_dialer_inputbox.validation_callback(
  981.                             MMI_dialer_inputbox.text,
  982.                             MMI_dialer_inputbox.current_text_p,
  983.                             (MMI_dialer_inputbox.text_length >> 1) - 1);
  984. #if defined(__MMI_TOUCH_SCREEN__)
  985.     SetLeftSoftkeyAlwaysKeyUpByPen();
  986.     SetRightSoftkeyAlwaysKeyUpByPen();
  987.     #ifdef __MMI_WGUI_CSK_ENABLE__
  988.         SetCenterSoftkeyAlwaysKeyUpByPen();
  989.     #endif 
  990. #endif /* defined(__MMI_TOUCH_SCREEN__) */ 
  991. }
  992. /*****************************************************************************
  993.  * FUNCTION
  994.  *  close_dialer_inputbox
  995.  * DESCRIPTION
  996.  *  close dialer input box
  997.  * PARAMETERS
  998.  *  void
  999.  * RETURNS
  1000.  *  void
  1001.  *****************************************************************************/
  1002. void close_dialer_inputbox(void)
  1003. {
  1004.     /*----------------------------------------------------------------*/
  1005.     /* Local Variables                                                */
  1006.     /*----------------------------------------------------------------*/
  1007.     /*----------------------------------------------------------------*/
  1008.     /* Code Body                                                      */
  1009.     /*----------------------------------------------------------------*/
  1010.     wgui_inputbox_not_empty_callback = NULL;
  1011.     wgui_inputbox_empty_callback = NULL;
  1012.     wgui_inputbox_validation_callback = NULL;
  1013.     wgui_dialer_inputbox_RSK_function = NULL;
  1014.     wgui_dialer_inputbox_RSK_label_clear = 0;
  1015.     reset_dialer_inputbox();
  1016. #ifndef __MMI_MULTITAP_KEY_0__
  1017.     gui_cancel_timer(dialer_inputbox_complete_multitap_star_key);
  1018. #endif 
  1019. }
  1020. /* Multitap handling for phone number input mode   */
  1021. #define WGUI_INPUTBOX_MULTITAP_NONE          0
  1022. #define WGUI_INPUTBOX_EDIT_MULTITAP_STAR     1
  1023. #define WGUI_INPUTBOX_EDIT_MULTITAP_ANY         2
  1024. #define WGUI_INPUTBOX_EDIT_MULTITAP_ZERO     3
  1025. U8 wgui_inputbox_active_multitap = WGUI_INPUTBOX_MULTITAP_NONE;
  1026. UI_character_type wgui_inputbox_phone_number_star_key_string_for_SIM_number[] = { '*', '+', '' };
  1027. UI_character_type wgui_inputbox_phone_number_zero_key_string_for_SIM_number[] = { '+', '' };
  1028. UI_character_type wgui_inputbox_phone_number_star_key_string[] = { '*', '+', 'p', 'w', '' };
  1029. multitap_input wgui_inputbox_multitap_star_key;
  1030. UI_character_type wgui_inputbox_phone_number_zero_key_string[] = { '+', 'p', 'w', '' };
  1031. multitap_input wgui_inputbox_multitap_zero_key;
  1032. /* flag used to check if english input mpde is on /off */
  1033. U8 MMI_english_input_mode_flag = 0;
  1034. /* byte    MMI_allow_only_english_input_modes=0; */
  1035. /* flag used to store current input mode */
  1036. U8 MMI_current_input_mode = INPUT_MODE_MULTITAP_UPPERCASE_ABC;
  1037. /* used to store current input type */
  1038. S16 MMI_current_input_type = 0;
  1039. /* MTK Terry for 0x81 encoding support for Phone Book */
  1040. S16 MMI_current_input_ext_type = 0;
  1041. pBOOL flag_use_current_input_type = FALSE;
  1042. //MTK Elvis it is not used, so remove it
  1043. //S16           MMI_saved_input_type=0;
  1044. //MTK end
  1045. /* MTK Elvis for prefered input method */
  1046. #if defined(__MMI_PREFER_INPUT_METHOD__)
  1047. S16 MMI_prefered_input_type = INPUT_TYPE_TR_BOPOMO;
  1048. #endif 
  1049. /* MTK end */
  1050. /*----------------------------------------------------------------------------
  1051. Function:         inputbox_change_mode
  1052. Description:      a function pointer store the address of function whcih handle
  1053.                input box change mode
  1054. Input parameters :   none
  1055. Output Parameters:   none
  1056. Returns:       none
  1057. ----------------------------------------------------------------------------*/
  1058. void (*inputbox_change_mode) (void);
  1059. /*****************************************************************************
  1060.  * FUNCTION
  1061.  *  set_MMI_current_input_type
  1062.  * DESCRIPTION
  1063.  *  set mmi current input mode
  1064.  * PARAMETERS
  1065.  *  void
  1066.  * RETURNS
  1067.  *  void
  1068.  *****************************************************************************/
  1069. /* MTK Elvis modify for stacked character---thai */
  1070. void set_MMI_current_input_type(void)
  1071. {
  1072.     /*----------------------------------------------------------------*/
  1073.     /* Local Variables                                                */
  1074.     /*----------------------------------------------------------------*/
  1075.     /*----------------------------------------------------------------*/
  1076.     /* Code Body                                                      */
  1077.     /*----------------------------------------------------------------*/
  1078.     switch (MMI_current_input_mode)
  1079.     {
  1080.         case INPUT_MODE_MULTITAP_UPPERCASE_ABC:
  1081.             MMI_current_input_type = INPUT_TYPE_ALPHANUMERIC_UPPERCASE;
  1082.             break;
  1083.         case INPUT_MODE_MULTITAP_LOWERCASE_ABC:
  1084.             MMI_current_input_type = INPUT_TYPE_ALPHANUMERIC_LOWERCASE;
  1085.             break;
  1086.         case INPUT_MODE_123:
  1087.             MMI_current_input_type = INPUT_TYPE_NUMERIC_CHANGEABLE;
  1088.             break;
  1089.     #if defined(__MMI_WCSS_INPUT_FORMAT_SUPPORT__)
  1090.         case INPUT_MODE_MULTITAP_UPPERCASE_ABC_NO_NUMERIC:
  1091.             MMI_current_input_type = INPUT_TYPE_ALPHABATIC_UPPERCASE;
  1092.             break;
  1093.         case INPUT_MODE_MULTITAP_LOWERCASE_ABC_NO_NUMERIC:
  1094.             MMI_current_input_type = INPUT_TYPE_ALPHABATIC_LOWERCASE;
  1095.             break;
  1096.         case INPUT_MODE_123_SYMBOLS:
  1097.             MMI_current_input_type = INPUT_TYPE_NUMERIC_SYMBOL;
  1098.             break;
  1099.     #endif /* defined(__MMI_WCSS_INPUT_FORMAT_SUPPORT__) */ 
  1100.     #if defined(__MMI_MULTITAP_THAI__)
  1101.         case INPUT_MODE_MULTITAP_THAI:
  1102.             MMI_current_input_type = INPUT_TYPE_ALPHANUMERIC_MULTITAP_THAI;
  1103.             break;
  1104.     #endif /* defined(__MMI_MULTITAP_THAI__) */ 
  1105.     #if defined(__MMI_MULTITAP_SPANISH__)
  1106.         case INPUT_MODE_MULTITAP_UPPERCASE_SPANISH:
  1107.             MMI_current_input_type = INPUT_TYPE_ALPHANUMERIC_UPPERCASE_SPANISH;
  1108.             break;
  1109.         case INPUT_MODE_MULTITAP_LOWERCASE_SPANISH:
  1110.             MMI_current_input_type = INPUT_TYPE_ALPHANUMERIC_LOWERCASE_SPANISH;
  1111.             break;
  1112.     #endif /* defined(__MMI_MULTITAP_SPANISH__) */ 
  1113.     #if defined(__MMI_MULTITAP_DANISH__)
  1114.         case INPUT_MODE_MULTITAP_UPPERCASE_DANISH:
  1115.             MMI_current_input_type = INPUT_TYPE_ALPHANUMERIC_UPPERCASE_DANISH;
  1116.             break;
  1117.         case INPUT_MODE_MULTITAP_LOWERCASE_DANISH:
  1118.             MMI_current_input_type = INPUT_TYPE_ALPHANUMERIC_LOWERCASE_DANISH;
  1119.             break;
  1120.     #endif /* defined(__MMI_MULTITAP_DANISH__) */ 
  1121.     #if defined(__MMI_MULTITAP_POLISH__)
  1122.         case INPUT_MODE_MULTITAP_UPPERCASE_POLISH:
  1123.             MMI_current_input_type = INPUT_TYPE_ALPHANUMERIC_UPPERCASE_POLISH;
  1124.             break;
  1125.         case INPUT_MODE_MULTITAP_LOWERCASE_POLISH:
  1126.             MMI_current_input_type = INPUT_TYPE_ALPHANUMERIC_LOWERCASE_POLISH;
  1127.             break;
  1128.     #endif /* defined(__MMI_MULTITAP_POLISH__) */ 
  1129.     #if defined(__MMI_MULTITAP_FRENCH__)
  1130.         case INPUT_MODE_MULTITAP_UPPERCASE_FRENCH:
  1131.             MMI_current_input_type = INPUT_TYPE_ALPHANUMERIC_UPPERCASE_FRENCH;
  1132.             break;
  1133.         case INPUT_MODE_MULTITAP_LOWERCASE_FRENCH:
  1134.             MMI_current_input_type = INPUT_TYPE_ALPHANUMERIC_LOWERCASE_FRENCH;
  1135.             break;
  1136.     #endif /* defined(__MMI_MULTITAP_FRENCH__) */ 
  1137.     #if defined(__MMI_MULTITAP_GERMAN__)
  1138.         case INPUT_MODE_MULTITAP_UPPERCASE_GERMAN:
  1139.             MMI_current_input_type = INPUT_TYPE_ALPHANUMERIC_UPPERCASE_GERMAN;
  1140.             break;
  1141.         case INPUT_MODE_MULTITAP_LOWERCASE_GERMAN:
  1142.             MMI_current_input_type = INPUT_TYPE_ALPHANUMERIC_LOWERCASE_GERMAN;
  1143.             break;
  1144.     #endif /* defined(__MMI_MULTITAP_GERMAN__) */ 
  1145.     #if defined(__MMI_MULTITAP_ITALIAN__)
  1146.         case INPUT_MODE_MULTITAP_UPPERCASE_ITALIAN:
  1147.             MMI_current_input_type = INPUT_TYPE_ALPHANUMERIC_UPPERCASE_ITALIAN;
  1148.             break;
  1149.         case INPUT_MODE_MULTITAP_LOWERCASE_ITALIAN:
  1150.             MMI_current_input_type = INPUT_TYPE_ALPHANUMERIC_LOWERCASE_ITALIAN;
  1151.             break;
  1152.     #endif /* defined(__MMI_MULTITAP_ITALIAN__) */ 
  1153.     #if defined(__MMI_MULTITAP_RUSSIAN__)
  1154.         case INPUT_MODE_MULTITAP_UPPERCASE_RUSSIAN:
  1155.             MMI_current_input_type = INPUT_TYPE_ALPHANUMERIC_UPPERCASE_RUSSIAN;
  1156.             break;
  1157.         case INPUT_MODE_MULTITAP_LOWERCASE_RUSSIAN:
  1158.             MMI_current_input_type = INPUT_TYPE_ALPHANUMERIC_LOWERCASE_RUSSIAN;
  1159.             break;
  1160.     #endif /* defined(__MMI_MULTITAP_RUSSIAN__) */ 
  1161.     #if defined(__MMI_MULTITAP_BULGARIAN__)
  1162.         case INPUT_MODE_MULTITAP_UPPERCASE_BULGARIAN:
  1163.             MMI_current_input_type = INPUT_TYPE_ALPHANUMERIC_UPPERCASE_BULGARIAN;
  1164.             break;
  1165.         case INPUT_MODE_MULTITAP_LOWERCASE_BULGARIAN:
  1166.             MMI_current_input_type = INPUT_TYPE_ALPHANUMERIC_LOWERCASE_BULGARIAN;
  1167.             break;
  1168.     #endif /* defined(__MMI_MULTITAP_BULGARIAN__) */ 
  1169.     #if defined(__MMI_MULTITAP_TURKISH__)
  1170.         case INPUT_MODE_MULTITAP_UPPERCASE_TURKISH:
  1171.             MMI_current_input_type = INPUT_TYPE_ALPHANUMERIC_UPPERCASE_TURKISH;
  1172.             break;
  1173.         case INPUT_MODE_MULTITAP_LOWERCASE_TURKISH:
  1174.             MMI_current_input_type = INPUT_TYPE_ALPHANUMERIC_LOWERCASE_TURKISH;
  1175.             break;
  1176.     #endif /* defined(__MMI_MULTITAP_TURKISH__) */ 
  1177.     #if defined(__MMI_MULTITAP_PORTUGUESE__)
  1178.         case INPUT_MODE_MULTITAP_UPPERCASE_PORTUGUESE:
  1179.             MMI_current_input_type = INPUT_TYPE_ALPHANUMERIC_UPPERCASE_PORTUGUESE;
  1180.             break;
  1181.         case INPUT_MODE_MULTITAP_LOWERCASE_PORTUGUESE:
  1182.             MMI_current_input_type = INPUT_TYPE_ALPHANUMERIC_LOWERCASE_PORTUGUESE;
  1183.             break;
  1184.     #endif /* defined(__MMI_MULTITAP_PORTUGUESE__) */ 
  1185.     #if defined(__MMI_MULTITAP_HINDI__)
  1186.         case INPUT_MODE_MULTITAP_HINDI:
  1187.             MMI_current_input_type = INPUT_TYPE_MULTITAP_HINDI;
  1188.             break;
  1189.     #endif /* defined(__MMI_MULTITAP_HINDI__) */ 
  1190.             /* PMT RAKESH START 20061006 */
  1191.     #if defined(__MMI_MULTITAP_MARATHI__)
  1192.         case INPUT_MODE_MULTITAP_MARATHI:
  1193.             MMI_current_input_type = INPUT_TYPE_MULTITAP_MARATHI;
  1194.             break;
  1195.     #endif /* defined(__MMI_MULTITAP_MARATHI__) */ 
  1196.             /* PMT RAKESH END 20061006 */
  1197.     #if defined(__MMI_MULTITAP_INDONESIAN__)
  1198.         case INPUT_MODE_MULTITAP_UPPERCASE_INDONESIAN:
  1199.             MMI_current_input_type = INPUT_TYPE_ALPHANUMERIC_UPPERCASE_INDONESIAN;
  1200.             break;
  1201.         case INPUT_MODE_MULTITAP_LOWERCASE_INDONESIAN:
  1202.             MMI_current_input_type = INPUT_TYPE_ALPHANUMERIC_LOWERCASE_INDONESIAN;
  1203.             break;
  1204.     #endif /* defined(__MMI_MULTITAP_INDONESIAN__) */ 
  1205.     #if defined(__MMI_MULTITAP_CZECH__)
  1206.         case INPUT_MODE_MULTITAP_UPPERCASE_CZECH:
  1207.             MMI_current_input_type = INPUT_TYPE_ALPHANUMERIC_UPPERCASE_CZECH;
  1208.             break;
  1209.         case INPUT_MODE_MULTITAP_LOWERCASE_CZECH:
  1210.             MMI_current_input_type = INPUT_TYPE_ALPHANUMERIC_LOWERCASE_CZECH;
  1211.             break;
  1212.     #endif /* defined(__MMI_MULTITAP_CZECH__) */ 
  1213.     #if defined(__MMI_MULTITAP_MALAY__)
  1214.         case INPUT_MODE_MULTITAP_UPPERCASE_MALAY:
  1215.             MMI_current_input_type = INPUT_TYPE_ALPHANUMERIC_UPPERCASE_MALAY;
  1216.             break;
  1217.         case INPUT_MODE_MULTITAP_LOWERCASE_MALAY:
  1218.             MMI_current_input_type = INPUT_TYPE_ALPHANUMERIC_LOWERCASE_MALAY;
  1219.             break;
  1220.     #endif /* defined(__MMI_MULTITAP_MALAY__) */ 
  1221.     #if defined(__MMI_MULTITAP_VIETNAMESE__)
  1222.         case INPUT_MODE_MULTITAP_UPPERCASE_VIETNAMESE:
  1223.             MMI_current_input_type = INPUT_TYPE_ALPHANUMERIC_UPPERCASE_VIETNAMESE;
  1224.             break;
  1225.         case INPUT_MODE_MULTITAP_LOWERCASE_VIETNAMESE:
  1226.             MMI_current_input_type = INPUT_TYPE_ALPHANUMERIC_LOWERCASE_VIETNAMESE;
  1227.             break;
  1228.     #endif /* defined(__MMI_MULTITAP_VIETNAMESE__) */ 
  1229.     #if defined(__MMI_MULTITAP_FINNISH__)
  1230.         case INPUT_MODE_MULTITAP_UPPERCASE_FINNISH:
  1231.             MMI_current_input_type = INPUT_TYPE_ALPHANUMERIC_UPPERCASE_FINNISH;
  1232.             break;
  1233.         case INPUT_MODE_MULTITAP_LOWERCASE_FINNISH:
  1234.             MMI_current_input_type = INPUT_TYPE_ALPHANUMERIC_LOWERCASE_FINNISH;
  1235.             break;
  1236.     #endif /* defined(__MMI_MULTITAP_FINNISH__) */ 
  1237.     #if defined(__MMI_MULTITAP_HUNGARIAN__)
  1238.         case INPUT_MODE_MULTITAP_UPPERCASE_HUNGARIAN:
  1239.             MMI_current_input_type = INPUT_TYPE_ALPHANUMERIC_UPPERCASE_HUNGARIAN;
  1240.             break;
  1241.         case INPUT_MODE_MULTITAP_LOWERCASE_HUNGARIAN:
  1242.             MMI_current_input_type = INPUT_TYPE_ALPHANUMERIC_LOWERCASE_HUNGARIAN;
  1243.             break;
  1244.     #endif /* defined(__MMI_MULTITAP_HUNGARIAN__) */ 
  1245.     #if defined(__MMI_MULTITAP_HEBREW__)
  1246.         case INPUT_MODE_MULTITAP_HEBREW:
  1247.             MMI_current_input_type = INPUT_TYPE_ALPHANUMERIC_HEBREW;
  1248.             break;
  1249.     #endif /* defined(__MMI_MULTITAP_HEBREW__) */ 
  1250.     #if defined(__MMI_MULTITAP_SLOVAK__)
  1251.         case INPUT_MODE_MULTITAP_UPPERCASE_SLOVAK:
  1252.             MMI_current_input_type = INPUT_TYPE_ALPHANUMERIC_UPPERCASE_SLOVAK;
  1253.             break;
  1254.         case INPUT_MODE_MULTITAP_LOWERCASE_SLOVAK:
  1255.             MMI_current_input_type = INPUT_TYPE_ALPHANUMERIC_LOWERCASE_SLOVAK;
  1256.             break;
  1257.     #endif /* defined(__MMI_MULTITAP_SLOVAK__) */ 
  1258.     #if defined(__MMI_MULTITAP_DUTCH__)
  1259.         case INPUT_MODE_MULTITAP_UPPERCASE_DUTCH:
  1260.             MMI_current_input_type = INPUT_TYPE_ALPHANUMERIC_UPPERCASE_DUTCH;
  1261.             break;
  1262.         case INPUT_MODE_MULTITAP_LOWERCASE_DUTCH:
  1263.             MMI_current_input_type = INPUT_TYPE_ALPHANUMERIC_LOWERCASE_DUTCH;
  1264.             break;
  1265.     #endif /* defined(__MMI_MULTITAP_DUTCH__) */ 
  1266.     #if defined(__MMI_MULTITAP_ARABIC__)
  1267.         case INPUT_MODE_MULTITAP_ARABIC:
  1268.             MMI_current_input_type = INPUT_TYPE_ALPHANUMERIC_ARABIC;
  1269.             break;
  1270.     #endif /* defined(__MMI_MULTITAP_ARABIC__) */ 
  1271. //PMT START PERSIAN
  1272. #if defined(__MMI_MULTITAP_PERSIAN__)
  1273. case INPUT_MODE_MULTITAP_PERSIAN:
  1274. MMI_current_input_type=INPUT_TYPE_ALPHANUMERIC_PERSIAN;
  1275. break;
  1276. #endif
  1277. //PMT END PERSIAN
  1278.     #if defined(__MMI_MULTITAP_NORWEGIAN__)
  1279.         case INPUT_MODE_MULTITAP_UPPERCASE_NORWEGIAN:
  1280.             MMI_current_input_type = INPUT_TYPE_ALPHANUMERIC_UPPERCASE_NORWEGIAN;
  1281.             break;
  1282.         case INPUT_MODE_MULTITAP_LOWERCASE_NORWEGIAN:
  1283.             MMI_current_input_type = INPUT_TYPE_ALPHANUMERIC_LOWERCASE_NORWEGIAN;
  1284.             break;
  1285.     #endif /* defined(__MMI_MULTITAP_NORWEGIAN__) */ 
  1286.     #if defined(__MMI_MULTITAP_SWEDISH__)
  1287.         case INPUT_MODE_MULTITAP_UPPERCASE_SWEDISH:
  1288.             MMI_current_input_type = INPUT_TYPE_ALPHANUMERIC_UPPERCASE_SWEDISH;
  1289.             break;
  1290.         case INPUT_MODE_MULTITAP_LOWERCASE_SWEDISH:
  1291.             MMI_current_input_type = INPUT_TYPE_ALPHANUMERIC_LOWERCASE_SWEDISH;
  1292.             break;
  1293.     #endif /* defined(__MMI_MULTITAP_SWEDISH__) */ 
  1294.     #if defined(__MMI_MULTITAP_CROATIAN__)
  1295.         case INPUT_MODE_MULTITAP_UPPERCASE_CROATIAN:
  1296.             MMI_current_input_type = INPUT_TYPE_ALPHANUMERIC_UPPERCASE_CROATIAN;
  1297.             break;
  1298.         case INPUT_MODE_MULTITAP_LOWERCASE_CROATIAN:
  1299.             MMI_current_input_type = INPUT_TYPE_ALPHANUMERIC_LOWERCASE_CROATIAN;
  1300.             break;
  1301.     #endif /* defined(__MMI_MULTITAP_CROATIAN__) */ 
  1302.     #if defined(__MMI_MULTITAP_ROMANIAN__)
  1303.         case INPUT_MODE_MULTITAP_UPPERCASE_ROMANIAN:
  1304.             MMI_current_input_type = INPUT_TYPE_ALPHANUMERIC_UPPERCASE_ROMANIAN;
  1305.             break;
  1306.         case INPUT_MODE_MULTITAP_LOWERCASE_ROMANIAN:
  1307.             MMI_current_input_type = INPUT_TYPE_ALPHANUMERIC_LOWERCASE_ROMANIAN;
  1308.             break;
  1309.     #endif /* defined(__MMI_MULTITAP_ROMANIAN__) */ 
  1310.     #if defined(__MMI_MULTITAP_SLOVENIAN__)
  1311.         case INPUT_MODE_MULTITAP_UPPERCASE_SLOVENIAN:
  1312.             MMI_current_input_type = INPUT_TYPE_ALPHANUMERIC_UPPERCASE_SLOVENIAN;
  1313.             break;
  1314.         case INPUT_MODE_MULTITAP_LOWERCASE_SLOVENIAN:
  1315.             MMI_current_input_type = INPUT_TYPE_ALPHANUMERIC_LOWERCASE_SLOVENIAN;
  1316.             break;
  1317.     #endif /* defined(__MMI_MULTITAP_SLOVENIAN__) */ 
  1318.     #if defined(__MMI_MULTITAP_GREEK__)
  1319.         case INPUT_MODE_MULTITAP_UPPERCASE_GREEK:
  1320.             MMI_current_input_type = INPUT_TYPE_ALPHANUMERIC_UPPERCASE_GREEK;
  1321.             break;
  1322.         case INPUT_MODE_MULTITAP_LOWERCASE_GREEK:
  1323.             MMI_current_input_type = INPUT_TYPE_ALPHANUMERIC_LOWERCASE_GREEK;
  1324.             break;
  1325.     #endif /* defined(__MMI_MULTITAP_GREEK__) */ 
  1326.     #if defined(__MMI_T9__) || defined(__MMI_ZI__) || defined(__MMI_KA__) || defined(__MMI_ITAP__)|| defined(__MMI_CSTAR__)     //KP Jerry add "__MMI_CSTAR__" on 2007-3-8
  1327. //KP Jerry modify on 2007-4-18 start
  1328. #ifdef __MMI_LANG_TR_CHINESE__      //KP Jerry add on 2007-4-17
  1329.         case INPUT_MODE_TR_MULTITAP_BOPOMO:
  1330.             MMI_current_input_type = INPUT_TYPE_TR_MULTITAP_BOPOMO;
  1331.             break;
  1332.         case INPUT_MODE_TR_BOPOMO:
  1333.             MMI_current_input_type = INPUT_TYPE_TR_BOPOMO;
  1334.             break;
  1335.         case INPUT_MODE_TR_STROKE:
  1336.             MMI_current_input_type = INPUT_TYPE_TR_STROKE;
  1337.             break;
  1338. #endif/*__MMI_LANG_TR_CHINESE__*/      //KP Jerry add on 2007-4-17
  1339. #ifdef __MMI_LANG_SM_CHINESE__      //KP Jerry add on 2007-4-17
  1340.         case INPUT_MODE_SM_MULTITAP_PINYIN:
  1341.             MMI_current_input_type = INPUT_TYPE_SM_MULTITAP_PINYIN;
  1342.             break;
  1343.         case INPUT_MODE_SM_PINYIN:
  1344.             MMI_current_input_type = INPUT_TYPE_SM_PINYIN;
  1345.             break;
  1346.         case INPUT_MODE_SM_STROKE:
  1347.             MMI_current_input_type = INPUT_TYPE_SM_STROKE;
  1348.             break;
  1349. #endif/*__MMI_LANG_SM_CHINESE__*/      //KP Jerry add on 2007-4-17
  1350. //KP Jerry modify on 2007-4-18 end
  1351.         case INPUT_MODE_SMART_UPPERCASE_ABC:
  1352.             MMI_current_input_type = INPUT_TYPE_SMART_UPPERCASE_ABC;
  1353.             break;
  1354.         case INPUT_MODE_SMART_LOWERCASE_ABC:
  1355.             MMI_current_input_type = INPUT_TYPE_SMART_LOWERCASE_ABC;
  1356.             break;
  1357. #ifdef __MMI_LANG_THAI__      //KP Jerry add on 2007-4-17
  1358.         case INPUT_MODE_SMART_THAI:
  1359.             MMI_current_input_type = INPUT_TYPE_SMART_THAI;
  1360.             break;
  1361. #endif     //KP Jerry add on 2007-4-17
  1362.             /* MTK Elvis for R2L characters */
  1363. #ifdef __MMI_LANG_ARABIC__      //KP Jerry add on 2007-4-17
  1364.         case INPUT_MODE_SMART_ARABIC:
  1365.             MMI_current_input_type = INPUT_TYPE_SMART_ARABIC;
  1366.             break;
  1367. #endif     //KP Jerry add on 2007-4-17
  1368. //PMT START PERSIAN
  1369. #ifdef __MMI_LANG_PERSIAN__      //KP Jerry add on 2007-4-17
  1370. case INPUT_MODE_SMART_PERSIAN:
  1371.             MMI_current_input_type = INPUT_TYPE_SMART_PERSIAN;
  1372.             break;
  1373. #endif     //KP Jerry add on 2007-4-17
  1374. //PMT END PERSIAN
  1375. #ifdef __MMI_LANG_HINDI__      //KP Jerry add on 2007-4-17
  1376.         case INPUT_MODE_SMART_HINDI:
  1377.             MMI_current_input_type = INPUT_TYPE_SMART_HINDI;
  1378.             break;
  1379. #endif     //KP Jerry add on 2007-4-17
  1380. #ifdef __MMI_LANG_HEBREW__      //KP Jerry add on 2007-4-17
  1381.         case INPUT_MODE_SMART_HEBREW:
  1382.             MMI_current_input_type = INPUT_TYPE_SMART_HEBREW;
  1383.             break;
  1384. #endif     //KP Jerry add on 2007-4-17
  1385.     #if defined(__MMI_T9_SPANISH__) || defined(__MMI_ZI_EU_SPANISH__) || defined(__MMI_ZI_SA_SPANISH__) || defined(__MMI_CSTAR_SPANISH__)    //KP Jerry add "__MMI_CSTAR_SPANISH__" on 2007-4-6
  1386.         case INPUT_MODE_SMART_UPPERCASE_SPANISH:
  1387.             MMI_current_input_type = INPUT_TYPE_SMART_UPPERCASE_SPANISH;
  1388.             break;
  1389.         case INPUT_MODE_SMART_LOWERCASE_SPANISH:
  1390.             MMI_current_input_type = INPUT_TYPE_SMART_LOWERCASE_SPANISH;
  1391.             break;
  1392.     #endif /* defined(__MMI_T9_SPANISH__) || defined(__MMI_ZI_EU_SPANISH__) || defined(__MMI_ZI_SA_SPANISH__) || defined(__MMI_CSTAR_SPANISH__) */     //KP Jerry add "__MMI_CSTAR_SPANISH__" on 2007-4-6
  1393.     #if defined(__MMI_T9_DANISH__) || defined(__MMI_ZI_DANISH__) || defined(__MMI_CSTAR_DANISH__) //KP Jerry add "__MMI_CSTAR_DANISH__" on 2007-4-6
  1394.         case INPUT_MODE_SMART_UPPERCASE_DANISH:
  1395.             MMI_current_input_type = INPUT_TYPE_SMART_UPPERCASE_DANISH;
  1396.             break;
  1397.         case INPUT_MODE_SMART_LOWERCASE_DANISH:
  1398.             MMI_current_input_type = INPUT_TYPE_SMART_LOWERCASE_DANISH;
  1399.             break;
  1400.     #endif /* defined(__MMI_T9_DANISH__) || defined(__MMI_ZI_DANISH__) || defined(__MMI_CSTAR_DANISH__) */  //KP Jerry add "__MMI_CSTAR_DANISH__" on 2007-4-6
  1401.     #if defined(__MMI_T9_POLISH__) || defined(__MMI_ZI_POLISH__) || defined(__MMI_CSTAR_POLISH__) //KP Jerry add "__MMI_CSTAR_POLISH__" on 2007-4-6
  1402.         case INPUT_MODE_SMART_UPPERCASE_POLISH:
  1403.             MMI_current_input_type = INPUT_TYPE_SMART_UPPERCASE_POLISH;
  1404.             break;
  1405.         case INPUT_MODE_SMART_LOWERCASE_POLISH:
  1406.             MMI_current_input_type = INPUT_TYPE_SMART_LOWERCASE_POLISH;
  1407.             break;
  1408.     #endif /* defined(__MMI_T9_POLISH__) || defined(__MMI_ZI_POLISH__) || defined(__MMI_CSTAR_POLISH__) */  //KP Jerry add "__MMI_CSTAR_POLISH__" on 2007-4-6
  1409.     #if defined(__MMI_T9_FRENCH__) || defined(__MMI_ZI_CA_FRENCH__) || defined(__MMI_ZI_EU_FRENCH__) || defined(__MMI_CSTAR_FRENCH__) //KP Jerry add "__MMI_CSTAR_FRENCH__" on 2007-4-6
  1410.         case INPUT_MODE_SMART_UPPERCASE_FRENCH:
  1411.             MMI_current_input_type = INPUT_TYPE_SMART_UPPERCASE_FRENCH;
  1412.             break;
  1413.         case INPUT_MODE_SMART_LOWERCASE_FRENCH:
  1414.             MMI_current_input_type = INPUT_TYPE_SMART_LOWERCASE_FRENCH;
  1415.             break;
  1416.     #endif /* defined(__MMI_T9_FRENCH__) || defined(__MMI_ZI_CA_FRENCH__) || defined(__MMI_ZI_EU_FRENCH__) || defined(__MMI_CSTAR_FRENCH__) */  //KP Jerry add "__MMI_CSTAR_FRENCH__" on 2007-4-6
  1417.     #if defined(__MMI_T9_GERMAN__) || defined(__MMI_ZI_GERMAN__) || defined(__MMI_CSTAR_GERMAN__) //KP Jerry add "__MMI_CSTAR_GERMAN__" on 2007-4-6
  1418.         case INPUT_MODE_SMART_UPPERCASE_GERMAN:
  1419.             MMI_current_input_type = INPUT_TYPE_SMART_UPPERCASE_GERMAN;
  1420.             break;
  1421.         case INPUT_MODE_SMART_LOWERCASE_GERMAN:
  1422.             MMI_current_input_type = INPUT_TYPE_SMART_LOWERCASE_GERMAN;
  1423.             break;
  1424.     #endif /* defined(__MMI_T9_GERMAN__) || defined(__MMI_ZI_GERMAN__) || defined(__MMI_CSTAR_GERMAN__) */  //KP Jerry add "__MMI_CSTAR_GERMAN__" on 2007-4-6
  1425.     #if defined(__MMI_T9_ITALIAN__) || defined(__MMI_ZI_ITALIAN__) || defined(__MMI_CSTAR_ITALIAN__) //KP Jerry add "__MMI_CSTAR_ITALIAN__" on 2007-4-6
  1426.         case INPUT_MODE_SMART_UPPERCASE_ITALIAN:
  1427.             MMI_current_input_type = INPUT_TYPE_SMART_UPPERCASE_ITALIAN;
  1428.             break;
  1429.         case INPUT_MODE_SMART_LOWERCASE_ITALIAN:
  1430.             MMI_current_input_type = INPUT_TYPE_SMART_LOWERCASE_ITALIAN;
  1431.             break;
  1432.     #endif /* defined(__MMI_T9_ITALIAN__) || defined(__MMI_ZI_ITALIAN__) || defined(__MMI_CSTAR_ITALIAN__) */  //KP Jerry add "__MMI_CSTAR_ITALIAN__" on 2007-4-6
  1433.     #if defined(__MMI_T9_RUSSIAN__) || defined(__MMI_ZI_RUSSIAN__) || defined(__MMI_ZI_RECOMMENDED_SIZE_RUSSIAN__) || defined(__MMI_CSTAR_RUSSIAN__) //KP Jerry add "__MMI_CSTAR_RUSSIAN__" on 2007-4-6
  1434.         case INPUT_MODE_SMART_UPPERCASE_RUSSIAN:
  1435.             MMI_current_input_type = INPUT_TYPE_SMART_UPPERCASE_RUSSIAN;
  1436.             break;
  1437.         case INPUT_MODE_SMART_LOWERCASE_RUSSIAN:
  1438.             MMI_current_input_type = INPUT_TYPE_SMART_LOWERCASE_RUSSIAN;
  1439.             break;
  1440.     #endif /* defined(__MMI_T9_RUSSIAN__) || defined(__MMI_ZI_RUSSIAN__) || defined(__MMI_ZI_RECOMMENDED_SIZE_RUSSIAN__) || defined(__MMI_CSTAR_RUSSIAN__) */  //KP Jerry add "__MMI_CSTAR_RUSSIAN__" on 2007-4-6
  1441.     #if defined(__MMI_T9_BULGARIAN__) || defined(__MMI_ZI_BULGARIAN__) || defined(__MMI_CSTAR_BULGARIAN__) //KP Jerry add "__MMI_CSTAR_BULGARIAN__" on 2007-4-6
  1442.         case INPUT_MODE_SMART_UPPERCASE_BULGARIAN:
  1443.             MMI_current_input_type = INPUT_TYPE_SMART_UPPERCASE_BULGARIAN;
  1444.             break;
  1445.         case INPUT_MODE_SMART_LOWERCASE_BULGARIAN:
  1446.             MMI_current_input_type = INPUT_TYPE_SMART_LOWERCASE_BULGARIAN;
  1447.             break;
  1448.     #endif /* defined(__MMI_T9_BULGARIAN__) || defined(__MMI_ZI_BULGARIAN__) || defined(__MMI_CSTAR_BULGARIAN__) */  //KP Jerry add "__MMI_CSTAR_BULGARIAN__" on 2007-4-6
  1449.     #if defined(__MMI_ZI_TURKISH__) || defined(__MMI_T9_TURKISH__) || defined(__MMI_CSTAR_TURKISH__) //KP Jerry add "__MMI_CSTAR_TURKISH__" on 2007-4-6
  1450.         case INPUT_MODE_SMART_UPPERCASE_TURKISH:
  1451.             MMI_current_input_type = INPUT_TYPE_SMART_UPPERCASE_TURKISH;
  1452.             break;
  1453.         case INPUT_MODE_SMART_LOWERCASE_TURKISH:
  1454.             MMI_current_input_type = INPUT_TYPE_SMART_LOWERCASE_TURKISH;
  1455.             break;
  1456.     #endif /* defined(__MMI_ZI_TURKISH__) || defined(__MMI_T9_TURKISH__) || defined(__MMI_CSTAR_TURKISH__) */  //KP Jerry add "__MMI_CSTAR_TURKISH__" on 2007-4-6
  1457.     #if defined(__MMI_T9_PORTUGUESE__) || defined(__MMI_ZI_EU_PORTUGUESE__) || defined(__MMI_ZI_SA_PORTUGUESE__) || defined(__MMI_ZI_BZ_PORTUGUESE__) || defined(__MMI_CSTAR_PORTUGUESE__) //KP Jerry add "__MMI_CSTAR_PORTUGUESE__" on 2007-4-6
  1458.         case INPUT_MODE_SMART_UPPERCASE_PORTUGUESE:
  1459.             MMI_current_input_type = INPUT_TYPE_SMART_UPPERCASE_PORTUGUESE;
  1460.             break;
  1461.         case INPUT_MODE_SMART_LOWERCASE_PORTUGUESE:
  1462.             MMI_current_input_type = INPUT_TYPE_SMART_LOWERCASE_PORTUGUESE;
  1463.             break;
  1464.     #endif /* defined(__MMI_T9_PORTUGUESE__) || defined(__MMI_ZI_EU_PORTUGUESE__) || defined(__MMI_ZI_SA_PORTUGUESE__) || defined(__MMI_ZI_BZ_PORTUGUESE__) || defined(__MMI_CSTAR_PORTUGUESE__) */  //KP Jerry add "__MMI_CSTAR_PORTUGUESE__" on 2007-4-6
  1465.     #if defined(__MMI_ZI_INDONESIAN__) || defined(__MMI_T9_INDONESIAN__) || defined(__MMI_CSTAR_INDONESIAN__) //KP Jerry add "__MMI_CSTAR_INDONESIAN__" on 2007-4-6
  1466.         case INPUT_MODE_SMART_UPPERCASE_INDONESIAN:
  1467.             MMI_current_input_type = INPUT_TYPE_SMART_UPPERCASE_INDONESIAN;
  1468.             break;
  1469.         case INPUT_MODE_SMART_LOWERCASE_INDONESIAN:
  1470.             MMI_current_input_type = INPUT_TYPE_SMART_LOWERCASE_INDONESIAN;
  1471.             break;
  1472.     #endif /* defined(__MMI_ZI_INDONESIAN__) || defined(__MMI_T9_INDONESIAN__) || defined(__MMI_CSTAR_INDONESIAN__) */  //KP Jerry add "__MMI_CSTAR_INDONESIAN__" on 2007-4-6
  1473.     #if defined(__MMI_ZI_CZECH__) || defined(__MMI_T9_CZECH__) || defined(__MMI_CSTAR_CZECH__) //KP Jerry add "__MMI_CSTAR_CZECH__" on 2007-4-6
  1474.         case INPUT_MODE_SMART_UPPERCASE_CZECH:
  1475.             MMI_current_input_type = INPUT_TYPE_SMART_UPPERCASE_CZECH;
  1476.             break;
  1477.         case INPUT_MODE_SMART_LOWERCASE_CZECH:
  1478.             MMI_current_input_type = INPUT_TYPE_SMART_LOWERCASE_CZECH;
  1479.             break;
  1480.     #endif /* defined(__MMI_ZI_CZECH__) || defined(__MMI_T9_CZECH__) || defined(__MMI_CSTAR_CZECH__) */  //KP Jerry add "__MMI_CSTAR_CZECH__" on 2007-4-6
  1481.     #if defined(__MMI_ZI_MALAY__) || defined(__MMI_T9_MALAY__) || defined(__MMI_CSTAR_MALAY__) //KP Jerry add "__MMI_CSTAR_MALAY__" on 2007-4-6
  1482.         case INPUT_MODE_SMART_UPPERCASE_MALAY:
  1483.             MMI_current_input_type = INPUT_TYPE_SMART_UPPERCASE_MALAY;
  1484.             break;
  1485.         case INPUT_MODE_SMART_LOWERCASE_MALAY:
  1486.             MMI_current_input_type = INPUT_TYPE_SMART_LOWERCASE_MALAY;
  1487.             break;
  1488.     #endif /* defined(__MMI_ZI_MALAY__) || defined(__MMI_T9_MALAY__) || defined(__MMI_CSTAR_MALAY__) */  //KP Jerry add "__MMI_CSTAR_MALAY__" on 2007-4-6
  1489.     #if defined(__MMI_ZI_VIETNAMESE__) || defined(__MMI_T9_VIETNAMESE__) || defined(__MMI_CSTAR_VIETNAMESE__) //KP Jerry add "__MMI_CSTAR_VIETNAMESE__" on 2007-4-6
  1490.         case INPUT_MODE_SMART_UPPERCASE_VIETNAMESE:
  1491.             MMI_current_input_type = INPUT_TYPE_SMART_UPPERCASE_VIETNAMESE;
  1492.             break;
  1493.         case INPUT_MODE_SMART_LOWERCASE_VIETNAMESE:
  1494.             MMI_current_input_type = INPUT_TYPE_SMART_LOWERCASE_VIETNAMESE;
  1495.             break;
  1496.     #endif /* defined(__MMI_ZI_VIETNAMESE__) || defined(__MMI_T9_VIETNAMESE__) || defined(__MMI_CSTAR_VIETNAMESE__) */  //KP Jerry add "__MMI_CSTAR_VIETNAMESE__" on 2007-4-6
  1497.     #if defined(__MMI_T9_FINNISH__) || defined(__MMI_ZI_FINNISH__) || defined(__MMI_CSTAR_FINNISH__) //KP Jerry add "__MMI_CSTAR_FINNISH__" on 2007-4-6
  1498.         case INPUT_MODE_SMART_UPPERCASE_FINNISH:
  1499.             MMI_current_input_type = INPUT_TYPE_SMART_UPPERCASE_FINNISH;
  1500.             break;
  1501.         case INPUT_MODE_SMART_LOWERCASE_FINNISH:
  1502.             MMI_current_input_type = INPUT_TYPE_SMART_LOWERCASE_FINNISH;
  1503.             break;
  1504.     #endif /* defined(__MMI_T9_FINNISH__) || defined(__MMI_ZI_FINNISH__) || defined(__MMI_CSTAR_FINNISH__) */  //KP Jerry add "__MMI_CSTAR_FINNISH__" on 2007-4-6
  1505.     #if defined(__MMI_ZI_HUNGARIAN__) || defined(__MMI_T9_HUNGARIAN__) || defined(__MMI_CSTAR_HUNGARIAN__) //KP Jerry add "__MMI_CSTAR_HUNGARIAN__" on 2007-4-6
  1506.         case INPUT_MODE_SMART_UPPERCASE_HUNGARIAN:
  1507.             MMI_current_input_type = INPUT_TYPE_SMART_UPPERCASE_HUNGARIAN;
  1508.             break;
  1509.         case INPUT_MODE_SMART_LOWERCASE_HUNGARIAN:
  1510.             MMI_current_input_type = INPUT_TYPE_SMART_LOWERCASE_HUNGARIAN;
  1511.             break;
  1512.     #endif /* defined(__MMI_ZI_HUNGARIAN__) || defined(__MMI_T9_HUNGARIAN__) || defined(__MMI_CSTAR_HUNGARIAN__) */  //KP Jerry add "__MMI_CSTAR_HUNGARIAN__" on 2007-4-6
  1513.     #if defined(__MMI_T9_SLOVAK__) || defined(__MMI_ZI_SLOVAK__) || defined(__MMI_CSTAR_SLOVAK__) //KP Jerry add "__MMI_CSTAR_SLOVAK__" on 2007-4-6
  1514.         case INPUT_MODE_SMART_UPPERCASE_SLOVAK:
  1515.             MMI_current_input_type = INPUT_TYPE_SMART_UPPERCASE_SLOVAK;
  1516.             break;
  1517.         case INPUT_MODE_SMART_LOWERCASE_SLOVAK:
  1518.             MMI_current_input_type = INPUT_TYPE_SMART_LOWERCASE_SLOVAK;
  1519.             break;
  1520.     #endif /* defined(__MMI_T9_SLOVAK__) || defined(__MMI_ZI_SLOVAK__) || defined(__MMI_CSTAR_SLOVAK__) */  //KP Jerry add "__MMI_CSTAR_SLOVAK__" on 2007-4-6
  1521.     #if defined(__MMI_ZI_DUTCH__) || defined(__MMI_T9_DUTCH__) || defined(__MMI_CSTAR_DUTCH__) //KP Jerry add "__MMI_CSTAR_DUTCH__" on 2007-4-6
  1522.         case INPUT_MODE_SMART_UPPERCASE_DUTCH:
  1523.             MMI_current_input_type = INPUT_TYPE_SMART_UPPERCASE_DUTCH;
  1524.             break;
  1525.         case INPUT_MODE_SMART_LOWERCASE_DUTCH:
  1526.             MMI_current_input_type = INPUT_TYPE_SMART_LOWERCASE_DUTCH;
  1527.             break;
  1528.     #endif /* defined(__MMI_ZI_DUTCH__) || defined(__MMI_T9_DUTCH__) || defined(__MMI_CSTAR_DUTCH__) */  //KP Jerry add "__MMI_CSTAR_DUTCH__" on 2007-4-6
  1529.     #if defined(__MMI_T9_NORWEGIAN__) || defined(__MMI_ZI_NORWEGIAN__) || defined(__MMI_CSTAR_NORWEGIAN__) //KP Jerry add "__MMI_CSTAR_NORWEGIAN__" on 2007-4-6
  1530.         case INPUT_MODE_SMART_UPPERCASE_NORWEGIAN:
  1531.             MMI_current_input_type = INPUT_TYPE_SMART_UPPERCASE_NORWEGIAN;
  1532.             break;
  1533.         case INPUT_MODE_SMART_LOWERCASE_NORWEGIAN:
  1534.             MMI_current_input_type = INPUT_TYPE_SMART_LOWERCASE_NORWEGIAN;
  1535.             break;
  1536.     #endif /* defined(__MMI_T9_NORWEGIAN__) || defined(__MMI_ZI_NORWEGIAN__) || defined(__MMI_CSTAR_NORWEGIAN__) */  //KP Jerry add "__MMI_CSTAR_NORWEGIAN__" on 2007-4-6
  1537.     #if defined(__MMI_T9_SWEDISH__) || defined(__MMI_ZI_SWEDISH__) || defined(__MMI_CSTAR_SWEDISH__) //KP Jerry add "__MMI_CSTAR_SWEDISH__" on 2007-4-6
  1538.         case INPUT_MODE_SMART_UPPERCASE_SWEDISH:
  1539.             MMI_current_input_type = INPUT_TYPE_SMART_UPPERCASE_SWEDISH;
  1540.             break;
  1541.         case INPUT_MODE_SMART_LOWERCASE_SWEDISH:
  1542.             MMI_current_input_type = INPUT_TYPE_SMART_LOWERCASE_SWEDISH;
  1543.             break;
  1544.     #endif /* defined(__MMI_T9_SWEDISH__) || defined(__MMI_ZI_SWEDISH__) || defined(__MMI_CSTAR_SWEDISH__) */  //KP Jerry add "__MMI_CSTAR_SWEDISH__" on 2007-4-6
  1545.     #if defined(__MMI_T9_CROATIAN__) || defined(__MMI_ZI_CROATIAN__) || defined(__MMI_CSTAR_CROATIAN__) //KP Jerry add "__MMI_CSTAR_CROATIAN__" on 2007-4-6
  1546.         case INPUT_MODE_SMART_UPPERCASE_CROATIAN:
  1547.             MMI_current_input_type = INPUT_TYPE_SMART_UPPERCASE_CROATIAN;
  1548.             break;
  1549.         case INPUT_MODE_SMART_LOWERCASE_CROATIAN:
  1550.             MMI_current_input_type = INPUT_TYPE_SMART_LOWERCASE_CROATIAN;
  1551.             break;
  1552.     #endif /* defined(__MMI_T9_CROATIAN__) || defined(__MMI_ZI_CROATIAN__) || defined(__MMI_CSTAR_CROATIAN__) */  //KP Jerry add "__MMI_CSTAR_CROATIAN__" on 2007-4-6
  1553.     #if defined(__MMI_ZI_ROMANIAN__) || defined(__MMI_T9_ROMANIAN__) || defined(__MMI_CSTAR_ROMANIAN__) //KP Jerry add "__MMI_CSTAR_ROMANIAN__" on 2007-4-6
  1554.         case INPUT_MODE_SMART_UPPERCASE_ROMANIAN:
  1555.             MMI_current_input_type = INPUT_TYPE_SMART_UPPERCASE_ROMANIAN;
  1556.             break;
  1557.         case INPUT_MODE_SMART_LOWERCASE_ROMANIAN:
  1558.             MMI_current_input_type = INPUT_TYPE_SMART_LOWERCASE_ROMANIAN;
  1559.             break;
  1560.     #endif /* defined(__MMI_ZI_ROMANIAN__) || defined(__MMI_T9_ROMANIAN__) || defined(__MMI_CSTAR_ROMANIAN__) */  //KP Jerry add "__MMI_CSTAR_ROMANIAN__" on 2007-4-6
  1561.     #if defined(__MMI_T9_SLOVENIAN__) || defined(__MMI_ZI_SLOVENIAN__) || defined(__MMI_CSTAR_SLOVENIAN__) //KP Jerry add "__MMI_CSTAR_SLOVENIAN__" on 2007-4-6
  1562.         case INPUT_MODE_SMART_UPPERCASE_SLOVENIAN:
  1563.             MMI_current_input_type = INPUT_TYPE_SMART_UPPERCASE_SLOVENIAN;
  1564.             break;
  1565.         case INPUT_MODE_SMART_LOWERCASE_SLOVENIAN:
  1566.             MMI_current_input_type = INPUT_TYPE_SMART_LOWERCASE_SLOVENIAN;
  1567.             break;
  1568.     #endif /* defined(__MMI_T9_SLOVENIAN__) || defined(__MMI_ZI_SLOVENIAN__) || defined(__MMI_CSTAR_SLOVENIAN__) */  //KP Jerry add "__MMI_CSTAR_SLOVENIAN__" on 2007-4-6
  1569.     #if defined(__MMI_T9_GREEK__) || defined(__MMI_ZI_GREEK__) || defined(__MMI_CSTAR_GREEK__) //KP Jerry add "__MMI_CSTAR_GREEK__" on 2007-4-6
  1570.         case INPUT_MODE_SMART_UPPERCASE_GREEK:
  1571.             MMI_current_input_type = INPUT_TYPE_SMART_UPPERCASE_GREEK;
  1572.             break;
  1573.         case INPUT_MODE_SMART_LOWERCASE_GREEK:
  1574.             MMI_current_input_type = INPUT_TYPE_SMART_LOWERCASE_GREEK;
  1575.             break;
  1576.     #endif /* defined(__MMI_T9_GREEK__) || defined(__MMI_ZI_GREEK__) || defined(__MMI_CSTAR_GREEK__) */  //KP Jerry add "__MMI_CSTAR_GREEK__" on 2007-4-6
  1577.     #endif /* defined(__MMI_T9__) || defined(__MMI_ZI__) || defined(__MMI_CSTAR__) || defined(__MMI_KA__) || defined(__MMI_ITAP__) */    //KP Jerry add "__MMI_CSTAR__" on 2007-4-17
  1578.             /* MTK Elvis to add some APIs for Qsearch */
  1579. //KP Jerry modify on 2007-4-18 start
  1580. #ifdef __MMI_LANG_TR_CHINESE__      //KP Jerry add on 2007-4-17
  1581.         case INPUT_MODE_MMI_MULTITAP_BPMF:
  1582.             MMI_current_input_type = INPUT_TYPE_MMI_MULTITAP_BPMF;
  1583.             break;
  1584.         case INPUT_MODE_MMI_TR_STROKE:
  1585.             MMI_current_input_type = INPUT_TYPE_MMI_TR_STROKE;
  1586.             break;
  1587. #endif/*__MMI_LANG_TR_CHINESE__*/      //KP Jerry add on 2007-4-17
  1588. #ifdef __MMI_LANG_SM_CHINESE__      //KP Jerry add on 2007-4-17
  1589.         case INPUT_MODE_MMI_MULTITAP_PINYIN:
  1590.             MMI_current_input_type = INPUT_TYPE_MMI_MULTITAP_PINYIN;
  1591.             break;
  1592.         case INPUT_MODE_MMI_SM_STROKE:
  1593.             MMI_current_input_type = INPUT_TYPE_MMI_SM_STROKE;
  1594.             break;
  1595. #endif/*__MMI_LANG_SM_CHINESE__*/      //KP Jerry add on 2007-4-17
  1596. //KP Jerry modify on 2007-4-18 end
  1597.         case INPUT_MODE_MMI_NUMERIC:
  1598.             MMI_current_input_type = INPUT_TYPE_MMI_NUMERIC;
  1599.             break;
  1600.         case INPUT_MODE_MMI_LOWERCASE_ABC:
  1601.             MMI_current_input_type = INPUT_TYPE_MMI_LOWERCASE_ABC;
  1602.             break;
  1603.     #if defined(__MMI_MULTITAP_SPANISH__)
  1604.         case INPUT_MODE_MMI_LOWERCASE_SPANISH:
  1605.             MMI_current_input_type = INPUT_TYPE_MMI_LOWERCASE_SPANISH;
  1606.             break;
  1607.     #endif /* defined(__MMI_MULTITAP_SPANISH__) */ 
  1608.     #if defined(__MMI_MULTITAP_DANISH__)
  1609.         case INPUT_MODE_MMI_LOWERCASE_DANISH:
  1610.             MMI_current_input_type = INPUT_TYPE_MMI_LOWERCASE_DANISH;
  1611.             break;
  1612.     #endif /* defined(__MMI_MULTITAP_DANISH__) */ 
  1613.     #if defined(__MMI_MULTITAP_POLISH__)
  1614.         case INPUT_MODE_MMI_LOWERCASE_POLISH:
  1615.             MMI_current_input_type = INPUT_TYPE_MMI_LOWERCASE_POLISH;
  1616.             break;
  1617.     #endif /* defined(__MMI_MULTITAP_POLISH__) */ 
  1618.     #if defined(__MMI_MULTITAP_FRENCH__)
  1619.         case INPUT_MODE_MMI_LOWERCASE_FRENCH:
  1620.             MMI_current_input_type = INPUT_TYPE_MMI_LOWERCASE_FRENCH;
  1621.             break;
  1622.     #endif /* defined(__MMI_MULTITAP_FRENCH__) */ 
  1623.     #if defined(__MMI_MULTITAP_GERMAN__)
  1624.         case INPUT_MODE_MMI_LOWERCASE_GERMAN:
  1625.             MMI_current_input_type = INPUT_TYPE_MMI_LOWERCASE_GERMAN;
  1626.             break;
  1627.     #endif /* defined(__MMI_MULTITAP_GERMAN__) */ 
  1628.     #if defined(__MMI_MULTITAP_ITALIAN__)
  1629.         case INPUT_MODE_MMI_LOWERCASE_ITALIAN:
  1630.             MMI_current_input_type = INPUT_TYPE_MMI_LOWERCASE_ITALIAN;
  1631.             break;
  1632.     #endif /* defined(__MMI_MULTITAP_ITALIAN__) */ 
  1633.     #if defined(__MMI_MULTITAP_RUSSIAN__)
  1634.         case INPUT_MODE_MMI_LOWERCASE_RUSSIAN:
  1635.             MMI_current_input_type = INPUT_TYPE_MMI_LOWERCASE_RUSSIAN;
  1636.             break;
  1637.     #endif /* defined(__MMI_MULTITAP_RUSSIAN__) */ 
  1638.     #if defined(__MMI_MULTITAP_BULGARIAN__)
  1639.         case INPUT_MODE_MMI_LOWERCASE_BULGARIAN:
  1640.             MMI_current_input_type = INPUT_TYPE_MMI_LOWERCASE_BULGARIAN;
  1641.             break;
  1642.     #endif /* defined(__MMI_MULTITAP_BULGARIAN__) */ 
  1643.     #if defined(__MMI_MULTITAP_TURKISH__)
  1644.         case INPUT_MODE_MMI_LOWERCASE_TURKISH:
  1645.             MMI_current_input_type = INPUT_TYPE_MMI_LOWERCASE_TURKISH;
  1646.             break;
  1647.     #endif /* defined(__MMI_MULTITAP_TURKISH__) */ 
  1648.     #if defined(__MMI_MULTITAP_PORTUGUESE__)
  1649.         case INPUT_MODE_MMI_LOWERCASE_PORTUGUESE:
  1650.             MMI_current_input_type = INPUT_TYPE_MMI_LOWERCASE_PORTUGUESE;
  1651.             break;
  1652.     #endif /* defined(__MMI_MULTITAP_PORTUGUESE__) */ 
  1653.     #if defined(__MMI_MULTITAP_INDONESIAN__)
  1654.         case INPUT_MODE_MMI_LOWERCASE_INDONESIAN:
  1655.             MMI_current_input_type = INPUT_TYPE_MMI_LOWERCASE_INDONESIAN;
  1656.             break;
  1657.     #endif /* defined(__MMI_MULTITAP_INDONESIAN__) */ 
  1658.     #if defined(__MMI_MULTITAP_CZECH__)
  1659.         case INPUT_MODE_MMI_LOWERCASE_CZECH:
  1660.             MMI_current_input_type = INPUT_TYPE_MMI_LOWERCASE_CZECH;
  1661.             break;
  1662.     #endif /* defined(__MMI_MULTITAP_CZECH__) */ 
  1663.     #if defined(__MMI_MULTITAP_MALAY__)
  1664.         case INPUT_MODE_MMI_LOWERCASE_MALAY:
  1665.             MMI_current_input_type = INPUT_TYPE_MMI_LOWERCASE_MALAY;
  1666.             break;
  1667.     #endif /* defined(__MMI_MULTITAP_MALAY__) */ 
  1668.     #if defined(__MMI_MULTITAP_VIETNAMESE__)
  1669.         case INPUT_MODE_MMI_LOWERCASE_VIETNAMESE:
  1670.             MMI_current_input_type = INPUT_TYPE_MMI_LOWERCASE_VIETNAMESE;
  1671.             break;
  1672.     #endif /* defined(__MMI_MULTITAP_VIETNAMESE__) */ 
  1673.     #if defined(__MMI_MULTITAP_FINNISH__)
  1674.         case INPUT_MODE_MMI_LOWERCASE_FINNISH:
  1675.             MMI_current_input_type = INPUT_TYPE_MMI_LOWERCASE_FINNISH;
  1676.             break;
  1677.     #endif /* defined(__MMI_MULTITAP_FINNISH__) */ 
  1678.     #if defined(__MMI_MULTITAP_HUNGARIAN__)
  1679.         case INPUT_MODE_MMI_LOWERCASE_HUNGARIAN:
  1680.             MMI_current_input_type = INPUT_TYPE_MMI_LOWERCASE_HUNGARIAN;
  1681.             break;
  1682.     #endif /* defined(__MMI_MULTITAP_HUNGARIAN__) */ 
  1683.     #if defined(__MMI_MULTITAP_SWEDISH__)
  1684.         case INPUT_MODE_MMI_LOWERCASE_SWEDISH:
  1685.             MMI_current_input_type = INPUT_TYPE_MMI_LOWERCASE_SWEDISH;
  1686.             break;
  1687.     #endif /* defined(__MMI_MULTITAP_SWEDISH__) */ 
  1688.     #if defined(__MMI_MULTITAP_HEBREW__)
  1689.         case INPUT_MODE_MMI_MULTITAP_HEBREW:
  1690.             MMI_current_input_type = INPUT_TYPE_MMI_MULTITAP_HEBREW;
  1691.             break;
  1692.     #endif /* defined(__MMI_MULTITAP_HEBREW__) */ 
  1693.     #if defined(__MMI_MULTITAP_SLOVAK__)
  1694.         case INPUT_MODE_MMI_LOWERCASE_SLOVAK:
  1695.             MMI_current_input_type = INPUT_TYPE_MMI_LOWERCASE_SLOVAK;
  1696.             break;
  1697.     #endif /* defined(__MMI_MULTITAP_SLOVAK__) */ 
  1698.     #if defined(__MMI_MULTITAP_DUTCH__)
  1699.         case INPUT_MODE_MMI_LOWERCASE_DUTCH:
  1700.             MMI_current_input_type = INPUT_TYPE_MMI_LOWERCASE_DUTCH;
  1701.             break;
  1702.     #endif /* defined(__MMI_MULTITAP_DUTCH__) */ 
  1703.     #if defined(__MMI_MULTITAP_NORWEGIAN__)
  1704.         case INPUT_MODE_MMI_LOWERCASE_NORWEGIAN:
  1705.             MMI_current_input_type = INPUT_TYPE_MMI_LOWERCASE_NORWEGIAN;
  1706.             break;
  1707.     #endif /* defined(__MMI_MULTITAP_NORWEGIAN__) */ 
  1708.     #if defined(__MMI_MULTITAP_ARABIC__)
  1709.         case INPUT_MODE_MMI_MULTITAP_ARABIC:
  1710.             MMI_current_input_type = INPUT_TYPE_MMI_MULTITAP_ARABIC;
  1711.             break;
  1712.     #endif /* defined(__MMI_MULTITAP_ARABIC__) */ 
  1713.     //PMT START PERSIAN
  1714.     #if defined(__MMI_MULTITAP_PERSIAN__)
  1715.          case INPUT_MODE_MMI_MULTITAP_PERSIAN:
  1716.       MMI_current_input_type = INPUT_TYPE_MMI_MULTITAP_PERSIAN;
  1717.       break;
  1718.     #endif          
  1719.     //PMT END PERSIAN
  1720.     #if defined(__MMI_MULTITAP_CROATIAN__)
  1721.         case INPUT_MODE_MMI_LOWERCASE_CROATIAN:
  1722.             MMI_current_input_type = INPUT_TYPE_MMI_LOWERCASE_CROATIAN;
  1723.             break;
  1724.     #endif /* defined(__MMI_MULTITAP_CROATIAN__) */ 
  1725.     #if defined(__MMI_MULTITAP_ROMANIAN__)
  1726.         case INPUT_MODE_MMI_LOWERCASE_ROMANIAN:
  1727.             MMI_current_input_type = INPUT_TYPE_MMI_LOWERCASE_ROMANIAN;
  1728.             break;
  1729.     #endif /* defined(__MMI_MULTITAP_ROMANIAN__) */ 
  1730.     #if defined(__MMI_MULTITAP_SLOVENIAN__)
  1731.         case INPUT_MODE_MMI_LOWERCASE_SLOVENIAN:
  1732.             MMI_current_input_type = INPUT_TYPE_MMI_LOWERCASE_SLOVENIAN;
  1733.             break;
  1734.     #endif /* defined(__MMI_MULTITAP_SLOVENIAN__) */ 
  1735.     #if defined(__MMI_MULTITAP_GREEK__)
  1736.         case INPUT_MODE_MMI_LOWERCASE_GREEK:
  1737.             MMI_current_input_type = INPUT_TYPE_MMI_LOWERCASE_GREEK;
  1738.             break;
  1739.     #endif /* defined(__MMI_MULTITAP_GREEK__) */ 
  1740.     }
  1741.     /* MTK Elvis for R2L characters */
  1742. #ifdef __MMI_BIDI_ALG__
  1743. //PMT START PERSIAN
  1744.     if (MMI_current_input_type == INPUT_TYPE_SMART_ARABIC || MMI_current_input_type == INPUT_TYPE_SMART_HEBREW || MMI_current_input_type == INPUT_TYPE_SMART_PERSIAN)
  1745. //PMT END PERSIAN
  1746.     {
  1747.         MMI_bidi_input_type = BIDI_R;
  1748.     }
  1749.     else
  1750.     {
  1751.         MMI_bidi_input_type = BIDI_L;
  1752.     }
  1753. #endif /* __MMI_BIDI_ALG__ */ 
  1754.     /* MTK end */
  1755. }
  1756. /*****************************************************************************
  1757.  * FUNCTION
  1758.  *  RegisterInputBoxValidationFunction
  1759.  * DESCRIPTION
  1760.  *  register input box validation function
  1761.  * PARAMETERS
  1762.  *  f       [IN]        )(U8*,U8*,S32) function pointer
  1763.  * RETURNS
  1764.  *  void
  1765.  *****************************************************************************/
  1766. void RegisterInputBoxValidationFunction(void (*f) (U8 *, U8 *, S32))
  1767. {
  1768.     /*----------------------------------------------------------------*/
  1769.     /* Local Variables                                                */
  1770.     /*----------------------------------------------------------------*/
  1771.     /*----------------------------------------------------------------*/
  1772.     /* Code Body                                                      */
  1773.     /*----------------------------------------------------------------*/
  1774.     wgui_inputbox_validation_callback = f;
  1775. }
  1776. /*****************************************************************************
  1777.  * FUNCTION
  1778.  *  RegisterInputBoxNotEmptyFunction
  1779.  * DESCRIPTION
  1780.  *  register input box validation function
  1781.  * PARAMETERS
  1782.  *  f       [IN]        )(void) function pointer
  1783.  * RETURNS
  1784.  *  void
  1785.  *****************************************************************************/
  1786. void RegisterInputBoxNotEmptyFunction(void (*f) (void))
  1787. {
  1788.     /*----------------------------------------------------------------*/
  1789.     /* Local Variables                                                */
  1790.     /*----------------------------------------------------------------*/
  1791.     /*----------------------------------------------------------------*/
  1792.     /* Code Body                                                      */
  1793.     /*----------------------------------------------------------------*/
  1794.     wgui_inputbox_not_empty_callback = f;
  1795. }
  1796. /*****************************************************************************
  1797.  * FUNCTION
  1798.  *  RegisterInputBoxEmptyFunction
  1799.  * DESCRIPTION
  1800.  *  register input box validation function
  1801.  * PARAMETERS
  1802.  *  f       [IN]        )(void) function pointer
  1803.  * RETURNS
  1804.  *  void
  1805.  *****************************************************************************/
  1806. void RegisterInputBoxEmptyFunction(void (*f) (void))
  1807. {
  1808.     /*----------------------------------------------------------------*/
  1809.     /* Local Variables                                                */
  1810.     /*----------------------------------------------------------------*/
  1811.     /*----------------------------------------------------------------*/
  1812.     /* Code Body                                                      */
  1813.     /*----------------------------------------------------------------*/
  1814.     wgui_inputbox_empty_callback = f;
  1815. }
  1816. S32(*wgui_inputbox_GSM_ext_count_function) (void) = NULL;
  1817. S32(*wgui_inputbox_UCS2_count_function) (void) = NULL;
  1818. /*****************************************************************************
  1819.  * FUNCTION
  1820.  *  GetInputBoxUCS2Count
  1821.  * DESCRIPTION
  1822.  *  Returns the number of UCS2 characters present
  1823.  *  in the current inputbox buffer
  1824.  * PARAMETERS
  1825.  *  void
  1826.  * RETURNS
  1827.  *  Number of UCS2 characters
  1828.  *****************************************************************************/
  1829. S32 GetInputBoxUCS2Count(void)
  1830. {
  1831.     /*----------------------------------------------------------------*/
  1832.     /* Local Variables                                                */
  1833.     /*----------------------------------------------------------------*/
  1834.     /*----------------------------------------------------------------*/
  1835.     /* Code Body                                                      */
  1836.     /*----------------------------------------------------------------*/
  1837.     if (wgui_inputbox_UCS2_count_function != NULL)
  1838.     {
  1839.         return (wgui_inputbox_UCS2_count_function());
  1840.     }
  1841.     else
  1842.     {
  1843.         return (0);
  1844.     }
  1845. }
  1846. /*****************************************************************************
  1847.  * FUNCTION
  1848.  *  GetInputBoxExtendedGSMCount
  1849.  * DESCRIPTION
  1850.  *  Returns the number of GSM extended characters present
  1851.  *  in the current inputbox buffer.
  1852.  * PARAMETERS
  1853.  *  void
  1854.  * RETURNS
  1855.  *  Number of GSM extended characters
  1856.  *****************************************************************************/
  1857. S32 GetInputBoxExtendedGSMCount(void)
  1858. {
  1859.     /*----------------------------------------------------------------*/
  1860.     /* Local Variables                                                */
  1861.     /*----------------------------------------------------------------*/
  1862.     /*----------------------------------------------------------------*/
  1863.     /* Code Body                                                      */
  1864.     /*----------------------------------------------------------------*/
  1865.     if (wgui_inputbox_GSM_ext_count_function != NULL)
  1866.     {
  1867.         return (wgui_inputbox_GSM_ext_count_function());
  1868.     }
  1869.     else
  1870.     {
  1871.         return (0);
  1872.     }
  1873. }
  1874. /* Common functions for single line input box screens */
  1875. /* Clear / back key handling  */
  1876. /*----------------------------------------------------------------------------
  1877. Function:         wgui_singleline_inputbox_RSK_function
  1878. Description:      a function pointer store the address of function
  1879.                whch handle single input box rsk key
  1880. Input parameters :   none
  1881. Output Parameters:   none
  1882. Returns:       none
  1883. ----------------------------------------------------------------------------*/
  1884. void (*wgui_singleline_inputbox_RSK_function) (void) = UI_dummy_function;
  1885. /* MTK Elvis for QSearch */
  1886. void (*wgui_singleline_inputbox_LSK_function) (void) = UI_dummy_function;
  1887. /* store rsk key string of single input box */
  1888. UI_string_type wgui_singleline_inputbox_LSK_label_string;
  1889. /* store rsk key icon of single input box */
  1890. PU8 wgui_singleline_inputbox_LSK_label_icon;
  1891. U8 wgui_singleline_inputbox_RSK_label_clear = 0;
  1892. /* store rsk key string of single input box */
  1893. UI_string_type wgui_singleline_inputbox_RSK_label_string;
  1894. /* store rsk key icon of single input box */
  1895. PU8 wgui_singleline_inputbox_RSK_label_icon;
  1896. /* store flag of decimal input of single input box */
  1897. U8 wgui_singleline_inputbox_decimal_flag = 0;
  1898. /* store flag of decimal input of mode single input box */
  1899. U8 wgui_singleline_inputbox_decimal_input_mode_flag = 0;
  1900. /* store buffer size of single input box */
  1901. S32 wgui_singleline_inputbox_buffer_size = 0;
  1902. /* MTK end */
  1903. /*****************************************************************************
  1904.  * FUNCTION
  1905.  *  wgui_handle_singleline_inputbox_right_softkey_down
  1906.  * DESCRIPTION
  1907.  *  handle single line input box RSK down key
  1908.  * PARAMETERS
  1909.  *  void
  1910.  * RETURNS
  1911.  *  void
  1912.  *****************************************************************************/
  1913. /* MTK ELvis 20040104 */
  1914. extern void PbookListSearchEntryReq(void);
  1915. extern U8 inPinyinSearchScreen;
  1916. void refresh_search_list(U8 *name);
  1917. extern S32(*cat200_search_function) (U8 *);
  1918. void wgui_handle_singleline_inputbox_right_softkey_down(void)
  1919. {
  1920.     /*----------------------------------------------------------------*/
  1921.     /* Local Variables                                                */
  1922.     /*----------------------------------------------------------------*/
  1923.     /*----------------------------------------------------------------*/
  1924.     /* Code Body                                                      */
  1925.     /*----------------------------------------------------------------*/
  1926.     if (wgui_singleline_inputbox_decimal_input_mode_flag)
  1927.     {
  1928.         if (wgui_singleline_inputbox_decimal_flag)
  1929.         {
  1930.             UI_buffer_type p = MMI_singleline_inputbox.current_text_p;
  1931.             UI_character_type c;
  1932.             if (p != MMI_singleline_inputbox.text)
  1933.             {
  1934.                 UI_STRING_GET_PREVIOUS_CHARACTER(p, c);
  1935.                 if (c == (UI_character_type) '.')
  1936.                 {
  1937.                     wgui_singleline_inputbox_decimal_flag = 0;
  1938.                 }
  1939.             }
  1940.         }
  1941.         if (gui_single_line_input_box_get_text_length(&MMI_singleline_inputbox) > 0)
  1942.         {
  1943.             singleline_inputbox_delete_character();
  1944.         }
  1945.     }
  1946.     else
  1947.     {
  1948.         if (gui_single_line_input_box_get_text_length(&MMI_singleline_inputbox) > 0)
  1949.         {
  1950.             singleline_inputbox_delete_character();
  1951.             /* MTK Elvis 20040527--if the text buffer length is zero, it's not required to call this function to redraw screen */
  1952.             if (cat200_search_function)
  1953.             {
  1954.                 refresh_search_list(MMI_singleline_inputbox.text);
  1955.             }
  1956.             /* MTK end */
  1957.         #ifdef __MMI_PINYIN_SEARCH__
  1958.             if (inPinyinSearchScreen)
  1959.             {
  1960.                 PbookListSearchEntryReq();
  1961.             }
  1962.         #endif /* __MMI_PINYIN_SEARCH__ */ 
  1963.         }
  1964.     }
  1965. }
  1966. /*****************************************************************************
  1967.  * FUNCTION
  1968.  *  wgui_handle_singleline_inputbox_right_softkey_up
  1969.  * DESCRIPTION
  1970.  *  handle single line input box RSK up  key
  1971.  * PARAMETERS
  1972.  *  void
  1973.  * RETURNS
  1974.  *  void
  1975.  *****************************************************************************/
  1976. void wgui_handle_singleline_inputbox_right_softkey_up(void)
  1977. {
  1978.     /*----------------------------------------------------------------*/
  1979.     /* Local Variables                                                */
  1980.     /*----------------------------------------------------------------*/
  1981.     /*----------------------------------------------------------------*/
  1982.     /* Code Body                                                      */
  1983.     /*----------------------------------------------------------------*/
  1984.     if (wgui_singleline_inputbox_RSK_function != NULL)
  1985.     {
  1986.         wgui_singleline_inputbox_RSK_function();
  1987.     }
  1988. }
  1989. /*****************************************************************************
  1990.  * FUNCTION
  1991.  *  wgui_register_singleline_inputbox_handle_right_softkey_up
  1992.  * DESCRIPTION
  1993.  *  register a function handler of RSK up key of single input box
  1994.  * PARAMETERS
  1995.  *  void
  1996.  * RETURNS
  1997.  *  void
  1998.  *****************************************************************************/
  1999. void wgui_register_singleline_inputbox_handle_right_softkey_up(void)
  2000. {
  2001.     /*----------------------------------------------------------------*/
  2002.     /* Local Variables                                                */
  2003.     /*----------------------------------------------------------------*/
  2004.     /*----------------------------------------------------------------*/
  2005.     /* Code Body                                                      */
  2006.     /*----------------------------------------------------------------*/
  2007.     set_right_softkey_function(wgui_handle_singleline_inputbox_right_softkey_up, KEY_EVENT_UP);
  2008. }
  2009. /*****************************************************************************
  2010.  * FUNCTION
  2011.  *  wgui_register_singleline_inputbox_handle_clear_key_up
  2012.  * DESCRIPTION
  2013.  *  register a function handler of RSK up key of single input box
  2014.  * PARAMETERS
  2015.  *  void
  2016.  * RETURNS
  2017.  *  void
  2018.  *****************************************************************************/
  2019. void wgui_register_singleline_inputbox_handle_clear_key_up(void)
  2020. {
  2021.     /*----------------------------------------------------------------*/
  2022.     /* Local Variables                                                */
  2023.     /*----------------------------------------------------------------*/
  2024.     /*----------------------------------------------------------------*/
  2025.     /* Code Body                                                      */
  2026.     /*----------------------------------------------------------------*/
  2027.     SetKeyHandler(wgui_handle_singleline_inputbox_right_softkey_up, KEY_CLEAR, KEY_EVENT_UP);
  2028. }
  2029. /*****************************************************************************
  2030.  * FUNCTION
  2031.  *  wgui_handle_singleline_inputbox_right_softkey_long_press
  2032.  * DESCRIPTION
  2033.  *  handle long press of RSK of single input box
  2034.  * PARAMETERS
  2035.  *  void
  2036.  * RETURNS
  2037.  *  void
  2038.  *****************************************************************************/
  2039. void wgui_handle_singleline_inputbox_right_softkey_long_press(void)
  2040. {
  2041.     /*----------------------------------------------------------------*/
  2042.     /* Local Variables                                                */
  2043.     /*----------------------------------------------------------------*/
  2044.     /*----------------------------------------------------------------*/
  2045.     /* Code Body                                                      */
  2046.     /*----------------------------------------------------------------*/
  2047.     singleline_inputbox_delete_all_characters();
  2048.     if (wgui_singleline_inputbox_decimal_input_mode_flag)
  2049.     {
  2050.         wgui_singleline_inputbox_decimal_flag = 0;
  2051.     }
  2052.     /* MTK Terry 20041111--if the text buffer length is zero, it's required to call this function to redraw screen */
  2053.     if (cat200_search_function)
  2054.     {
  2055.         refresh_search_list(MMI_singleline_inputbox.text);
  2056.     }
  2057.     /* MTK end */
  2058. }
  2059. /*****************************************************************************
  2060.  * FUNCTION
  2061.  *  wgui_handle_singleline_inputbox_input
  2062.  * DESCRIPTION
  2063.  *  handle input of single line input box
  2064.  * PARAMETERS
  2065.  *  void
  2066.  * RETURNS
  2067.  *  void
  2068.  *****************************************************************************/
  2069. void wgui_handle_singleline_inputbox_input(void)
  2070. {
  2071.     /*----------------------------------------------------------------*/
  2072.     /* Local Variables                                                */
  2073.     /*----------------------------------------------------------------*/
  2074.     /*----------------------------------------------------------------*/
  2075.     /* Code Body                                                      */
  2076.     /*----------------------------------------------------------------*/
  2077.     if (gui_single_line_input_box_get_text_length(&MMI_singleline_inputbox) > 0)
  2078.     {
  2079.     #if defined(__MMI_WITH_C_KEY__)
  2080.         if (wgui_singleline_inputbox_RSK_label_clear == 0)
  2081.         {
  2082.             if (wgui_inputbox_not_empty_callback != NULL)
  2083.             {
  2084.                 wgui_inputbox_not_empty_callback();
  2085.             }
  2086.             wgui_singleline_inputbox_RSK_label_clear = 1;
  2087.             SetKeyHandler(wgui_handle_singleline_inputbox_right_softkey_down, KEY_CLEAR, KEY_EVENT_DOWN);
  2088.             SetKeyHandler(UI_dummy_function, KEY_CLEAR, KEY_EVENT_UP);
  2089.             SetKeyHandler(wgui_handle_singleline_inputbox_right_softkey_long_press, KEY_CLEAR, KEY_EVENT_LONG_PRESS);
  2090.         }
  2091.     #else /* defined(__MMI_WITH_C_KEY__) */ 
  2092.         if (wgui_singleline_inputbox_RSK_label_clear == 0)
  2093.         {
  2094.             set_right_softkey_label((UI_string_type) get_string(WGUI_CATEGORY_CLEAR_STRING_ID));
  2095.             set_right_softkey_icon(NULL);
  2096.             if (wgui_inputbox_not_empty_callback != NULL)
  2097.             {
  2098.                 wgui_inputbox_not_empty_callback();
  2099.             }
  2100.             redraw_right_softkey();
  2101.             wgui_singleline_inputbox_RSK_label_clear = 1;
  2102.             set_right_softkey_function(UI_dummy_function, KEY_EVENT_UP);
  2103.             set_right_softkey_function(wgui_handle_singleline_inputbox_right_softkey_down, KEY_EVENT_DOWN);
  2104.         }
  2105.     #endif /* defined(__MMI_WITH_C_KEY__) */ 
  2106.     }
  2107.     else
  2108.     {
  2109.     #if defined(__MMI_WITH_C_KEY__)
  2110.         if (wgui_singleline_inputbox_RSK_label_clear == 1)
  2111.         {
  2112.             if (wgui_inputbox_empty_callback != NULL)
  2113.             {
  2114.                 wgui_inputbox_empty_callback();
  2115.             }
  2116.             wgui_singleline_inputbox_RSK_label_clear = 0;
  2117.             SetKeyHandler(UI_dummy_function, KEY_CLEAR, KEY_EVENT_DOWN);
  2118.             /* MTK Terry Temp solution for C key in Enter Pin */
  2119.             SetKeyHandler(UI_dummy_function, KEY_CLEAR, KEY_EVENT_UP);
  2120.             SetKeyHandler(UI_dummy_function, KEY_CLEAR, KEY_EVENT_LONG_PRESS);
  2121.         }
  2122.     #else /* defined(__MMI_WITH_C_KEY__) */ 
  2123.         if (wgui_singleline_inputbox_RSK_label_clear == 1)
  2124.         {
  2125.             set_right_softkey_label(wgui_singleline_inputbox_RSK_label_string);
  2126.             set_right_softkey_icon(wgui_singleline_inputbox_RSK_label_icon);
  2127.             if (wgui_inputbox_empty_callback != NULL)
  2128.             {
  2129.                 wgui_inputbox_empty_callback();
  2130.             }
  2131.             redraw_right_softkey();
  2132.             wgui_singleline_inputbox_RSK_label_clear = 0;
  2133.             set_right_softkey_function(wgui_register_singleline_inputbox_handle_right_softkey_up, KEY_EVENT_UP);
  2134.             set_right_softkey_function(UI_dummy_function, KEY_EVENT_DOWN);
  2135.         }
  2136.     #endif /* defined(__MMI_WITH_C_KEY__) */ 
  2137.     }
  2138. #if(0)
  2139. if(pixtel_UI_single_line_input_box_test_first_position(&MMI_singleline_inputbox))
  2140. {
  2141. if(wgui_singleline_inputbox_RSK_label_clear==1)
  2142. {
  2143. set_right_softkey_label(wgui_singleline_inputbox_RSK_label_string);
  2144. set_right_softkey_icon(wgui_singleline_inputbox_RSK_label_icon);
  2145. redraw_right_softkey();
  2146. wgui_singleline_inputbox_RSK_label_clear=0;
  2147. set_right_softkey_function(wgui_register_singleline_inputbox_handle_right_softkey_up,KEY_EVENT_UP);
  2148. set_right_softkey_function(UI_dummy_function,KEY_EVENT_DOWN);
  2149. }
  2150. }
  2151. #endif /* (0) */ 
  2152.     if (MMI_singleline_inputbox.flags & UI_SINGLE_LINE_INPUT_BOX_PLUS_CHARACTER_HANDLING)
  2153.     {
  2154.         if (MMI_singleline_inputbox.text[0] == '+')
  2155.         {
  2156.             MMI_singleline_inputbox.available_length = (wgui_singleline_inputbox_buffer_size + 1) * ENCODING_LENGTH;
  2157.         }
  2158.         else
  2159.         {
  2160.             MMI_singleline_inputbox.available_length = wgui_singleline_inputbox_buffer_size * ENCODING_LENGTH;
  2161.         }
  2162.     }
  2163.     //MTK Elvis 20040517 to turn on this    
  2164.     //Draw Information Bar If Enable - Gurinder - 23/4/2004
  2165.     if (wgui_inputbox_information_flag)
  2166.     {
  2167.         wgui_redraw_singleline_input_information_bar();
  2168.     }
  2169.     /* MTK end */
  2170. }
  2171. /*****************************************************************************
  2172.  * FUNCTION
  2173.  *  wgui_handle_singleline_inputbox_navigate
  2174.  * DESCRIPTION
  2175.  *  handle navigation  of single line input box
  2176.  * PARAMETERS
  2177.  *  void
  2178.  * RETURNS
  2179.  *  void
  2180.  *****************************************************************************/
  2181. void wgui_handle_singleline_inputbox_navigate(void)
  2182. {
  2183.     /*----------------------------------------------------------------*/
  2184.     /* Local Variables                                                */
  2185.     /*----------------------------------------------------------------*/
  2186.     /*----------------------------------------------------------------*/
  2187.     /* Code Body                                                      */
  2188.     /*----------------------------------------------------------------*/
  2189.     if (gui_single_line_input_box_test_first_position(&MMI_singleline_inputbox) ||
  2190.         (gui_single_line_input_box_get_text_length(&MMI_singleline_inputbox) <= 0))
  2191.     {
  2192.         if (wgui_singleline_inputbox_RSK_label_clear == 1)
  2193.         {
  2194.             set_right_softkey_label(wgui_singleline_inputbox_RSK_label_string);
  2195.             set_right_softkey_icon(wgui_singleline_inputbox_RSK_label_icon);
  2196.             redraw_right_softkey();
  2197.             wgui_singleline_inputbox_RSK_label_clear = 0;
  2198.             set_right_softkey_function(wgui_handle_singleline_inputbox_right_softkey_up, KEY_EVENT_UP);
  2199.             set_right_softkey_function(UI_dummy_function, KEY_EVENT_DOWN);
  2200.         }
  2201.     }
  2202.     else
  2203.     {
  2204.         if (wgui_singleline_inputbox_RSK_label_clear == 0)
  2205.         {
  2206.             set_right_softkey_label((UI_string_type) get_string(WGUI_CATEGORY_CLEAR_STRING_ID));
  2207.             set_right_softkey_icon(NULL);
  2208.             redraw_right_softkey();
  2209.             wgui_singleline_inputbox_RSK_label_clear = 1;
  2210.             set_right_softkey_function(UI_dummy_function, KEY_EVENT_UP);
  2211.             set_right_softkey_function(wgui_handle_singleline_inputbox_right_softkey_down, KEY_EVENT_DOWN);
  2212.         }
  2213.     }
  2214. }
  2215. /* Multitap handling for phone number input mode   */
  2216. /*----------------------------------------------------------------------------
  2217. Function:         wgui_singleline_inputbox_phone_number_input_complete_multitap_star_key
  2218. Description:      handle multital star key of phone number input box
  2219. Input parameters :   none
  2220. Output Parameters:   none
  2221. Returns:       none
  2222. ----------------------------------------------------------------------------*/
  2223. void wgui_singleline_inputbox_phone_number_input_complete_multitap_star_key(void);
  2224. /*----------------------------------------------------------------------------
  2225. Function:         wgui_singleline_inputbox_phone_number_input_complete_multitap_zero_key
  2226. Description:      handle multitap zero key of phone number input box
  2227. Input parameters :   none
  2228. Output Parameters:   none
  2229. Returns:       none
  2230. ----------------------------------------------------------------------------*/
  2231. void wgui_singleline_inputbox_phone_number_input_complete_multitap_zero_key(void);
  2232. /*****************************************************************************
  2233.  * FUNCTION
  2234.  *  wgui_singleline_inputbox_handle_multitap_input_complete
  2235.  * DESCRIPTION
  2236.  *  handle multitap input complete of single line input box
  2237.  * PARAMETERS
  2238.  *  type        [IN]        Type  of multitap select
  2239.  * RETURNS
  2240.  *  void
  2241.  *****************************************************************************/
  2242. void wgui_singleline_inputbox_handle_multitap_input_complete(S32 type)
  2243. {
  2244.     /*----------------------------------------------------------------*/
  2245.     /* Local Variables                                                */
  2246.     /*----------------------------------------------------------------*/
  2247.     /*----------------------------------------------------------------*/
  2248.     /* Code Body                                                      */
  2249.     /*----------------------------------------------------------------*/
  2250.     if (wgui_inputbox_active_multitap == WGUI_INPUTBOX_MULTITAP_NONE)
  2251.     {
  2252.         return;
  2253.     }
  2254.     switch (wgui_inputbox_active_multitap)
  2255.     {
  2256.         case WGUI_INPUTBOX_EDIT_MULTITAP_STAR:
  2257.             if (type == WGUI_INPUTBOX_EDIT_MULTITAP_STAR)
  2258.             {
  2259.                 return;
  2260.             }
  2261.             if (MMI_singleline_inputbox.flags & UI_SINGLE_LINE_INPUT_BOX_STATE_MULTITAP)
  2262.             {
  2263.                 gui_cancel_timer(wgui_singleline_inputbox_phone_number_input_complete_multitap_star_key);
  2264.                 gui_multitap_input_complete(&wgui_inputbox_multitap_star_key);
  2265.             }
  2266.             break;
  2267.         #ifdef __MMI_MULTITAP_KEY_0__
  2268.         case WGUI_INPUTBOX_EDIT_MULTITAP_ZERO:
  2269.             if (type == WGUI_INPUTBOX_EDIT_MULTITAP_ZERO)
  2270.             {
  2271.                 return;
  2272.             }
  2273.             if (MMI_singleline_inputbox.flags & UI_SINGLE_LINE_INPUT_BOX_STATE_MULTITAP)
  2274.             {
  2275.                 gui_cancel_timer(wgui_singleline_inputbox_phone_number_input_complete_multitap_zero_key);
  2276.                 gui_multitap_input_complete(&wgui_inputbox_multitap_zero_key);
  2277.             }
  2278.             break;
  2279.         #endif /* __MMI_MULTITAP_KEY_0__ */ 
  2280.     }
  2281.     wgui_inputbox_active_multitap = WGUI_INPUTBOX_MULTITAP_NONE;
  2282. }
  2283. /*****************************************************************************
  2284.  * FUNCTION
  2285.  *  wgui_singleline_inputbox_phone_number_input_complete_multitap_star_key
  2286.  * DESCRIPTION
  2287.  *  handle multitap input complete of single line phone number input box
  2288.  * PARAMETERS
  2289.  *  void
  2290.  * RETURNS
  2291.  *  void
  2292.  *****************************************************************************/
  2293. void wgui_singleline_inputbox_phone_number_input_complete_multitap_star_key(void)
  2294. {
  2295.     /*----------------------------------------------------------------*/
  2296.     /* Local Variables                                                */
  2297.     /*----------------------------------------------------------------*/
  2298.     /*----------------------------------------------------------------*/
  2299.     /* Code Body                                                      */
  2300.     /*----------------------------------------------------------------*/
  2301.     gui_multitap_input_complete(&wgui_inputbox_multitap_star_key);
  2302. }
  2303. /*****************************************************************************
  2304.  * FUNCTION
  2305.  *  wgui_singleline_inputbox_phone_number_input_handle_multitap_star_key_down
  2306.  * DESCRIPTION
  2307.  *  handle multitap input complete of single line phone numebr start keyx
  2308.  * PARAMETERS
  2309.  *  void
  2310.  * RETURNS
  2311.  *  void
  2312.  *****************************************************************************/
  2313. void wgui_singleline_inputbox_phone_number_input_handle_multitap_star_key_down(void)
  2314. {
  2315.     /*----------------------------------------------------------------*/
  2316.     /* Local Variables                                                */
  2317.     /*----------------------------------------------------------------*/
  2318.     /*----------------------------------------------------------------*/
  2319.     /* Code Body                                                      */
  2320.     /*----------------------------------------------------------------*/
  2321.     wgui_singleline_inputbox_handle_multitap_input_complete(WGUI_INPUTBOX_EDIT_MULTITAP_STAR);
  2322.     wgui_inputbox_active_multitap = WGUI_INPUTBOX_EDIT_MULTITAP_STAR;
  2323.     gui_change_multitap_input_state(&wgui_inputbox_multitap_star_key);
  2324. }
  2325. /*****************************************************************************
  2326.  * FUNCTION
  2327.  *  wgui_singleline_inputbox_phone_number_input_handle_multitap_star_key_up
  2328.  * DESCRIPTION
  2329.  *  handle multitap input complete of single line phone numebr start key up
  2330.  * PARAMETERS
  2331.  *  void
  2332.  * RETURNS
  2333.  *  void
  2334.  *****************************************************************************/
  2335. void wgui_singleline_inputbox_phone_number_input_handle_multitap_star_key_up(void)
  2336. {
  2337.     /*----------------------------------------------------------------*/
  2338.     /* Local Variables                                                */
  2339.     /*----------------------------------------------------------------*/
  2340.     /*----------------------------------------------------------------*/
  2341.     /* Code Body                                                      */
  2342.     /*----------------------------------------------------------------*/
  2343.     gui_start_timer(MMI_MULTITAP_TIMEOUT, wgui_singleline_inputbox_phone_number_input_complete_multitap_star_key);
  2344. }
  2345. #ifdef __MMI_MULTITAP_KEY_0__
  2346. /*****************************************************************************
  2347.  * FUNCTION
  2348.  *  wgui_singleline_inputbox_phone_number_input_complete_multitap_zero_key
  2349.  * DESCRIPTION
  2350.  *  handle multitap input complete of single line phone numebr zero key
  2351.  * PARAMETERS
  2352.  *  void
  2353.  * RETURNS
  2354.  *  void
  2355.  *****************************************************************************/
  2356. void wgui_singleline_inputbox_phone_number_input_complete_multitap_zero_key(void)
  2357. {
  2358.     /*----------------------------------------------------------------*/
  2359.     /* Local Variables                                                */
  2360.     /*----------------------------------------------------------------*/
  2361.     /*----------------------------------------------------------------*/
  2362.     /* Code Body                                                      */
  2363.     /*----------------------------------------------------------------*/
  2364.     gui_multitap_input_complete(&wgui_inputbox_multitap_zero_key);
  2365.     SetKeyHandler(MMI_key_0_down, KEY_0, KEY_EVENT_DOWN);
  2366.     SetKeyHandler(MMI_key_0_down, KEY_0, KEY_REPEAT);
  2367.     SetKeyHandler(MMI_key_0_up, KEY_0, KEY_EVENT_UP);
  2368. }
  2369. /*****************************************************************************
  2370.  * FUNCTION
  2371.  *  wgui_singleline_inputbox_phone_number_input_handle_multitap_zero_key_down
  2372.  * DESCRIPTION
  2373.  *  handle multitap input complete of single line phone numebr zero key down
  2374.  * PARAMETERS
  2375.  *  void
  2376.  * RETURNS
  2377.  *  void
  2378.  *****************************************************************************/
  2379. void wgui_singleline_inputbox_phone_number_input_handle_multitap_zero_key_down(void)
  2380. {
  2381.     /*----------------------------------------------------------------*/
  2382.     /* Local Variables                                                */
  2383.     /*----------------------------------------------------------------*/
  2384.     /*----------------------------------------------------------------*/
  2385.     /* Code Body                                                      */
  2386.     /*----------------------------------------------------------------*/
  2387.     wgui_singleline_inputbox_handle_multitap_input_complete(WGUI_INPUTBOX_EDIT_MULTITAP_ZERO);
  2388.     wgui_inputbox_active_multitap = WGUI_INPUTBOX_EDIT_MULTITAP_ZERO;
  2389.     gui_change_multitap_input_state(&wgui_inputbox_multitap_zero_key);
  2390. }
  2391. /*****************************************************************************
  2392.  * FUNCTION
  2393.  *  wgui_singleline_inputbox_phone_number_input_handle_multitap_zero_key_up
  2394.  * DESCRIPTION
  2395.  *  handle multitap input complete of single line phone numebr zero key up
  2396.  * PARAMETERS
  2397.  *  void
  2398.  * RETURNS
  2399.  *  void
  2400.  *****************************************************************************/
  2401. void wgui_singleline_inputbox_phone_number_input_handle_multitap_zero_key_up(void)
  2402. {
  2403.     /*----------------------------------------------------------------*/
  2404.     /* Local Variables                                                */
  2405.     /*----------------------------------------------------------------*/
  2406.     /*----------------------------------------------------------------*/
  2407.     /* Code Body                                                      */
  2408.     /*----------------------------------------------------------------*/
  2409.     gui_start_timer(MMI_MULTITAP_TIMEOUT + 400, wgui_singleline_inputbox_phone_number_input_complete_multitap_zero_key);
  2410. }
  2411. /*****************************************************************************
  2412.  * FUNCTION
  2413.  *  wgui_singleline_inputbox_phone_number_input_handle_zero_key_long_press
  2414.  * DESCRIPTION
  2415.  *  handle long press zero key on phone number input box
  2416.  * PARAMETERS
  2417.  *  void
  2418.  * RETURNS
  2419.  *  void
  2420.  *****************************************************************************/
  2421. void wgui_singleline_inputbox_phone_number_input_handle_zero_key_long_press(void)
  2422. {
  2423.     /*----------------------------------------------------------------*/
  2424.     /* Local Variables                                                */
  2425.     /*----------------------------------------------------------------*/
  2426.     /*----------------------------------------------------------------*/
  2427.     /* Code Body                                                      */
  2428.     /*----------------------------------------------------------------*/
  2429.     SetKeyHandler(UI_dummy_function, KEY_0, KEY_REPEAT);
  2430.     singleline_inputbox_delete_character();