CurrencyConvertorE.c
资源名称:mmi.rar [点击查看]
上传用户:lqx1163
上传日期:2014-08-13
资源大小:9183k
文件大小:61k
源码类别:
MTK
开发平台:
C/C++
- /*****************************************************************************
- * Copyright Statement:
- * --------------------
- * This software is protected by Copyright and the information contained
- * herein is confidential. The software may not be copied and the information
- * contained herein may not be used or disclosed except with the written
- * permission of MediaTek Inc. (C) 2004
- *
- *****************************************************************************/
- /*****************************************************************************
- *
- * Filename:
- * ---------
- * CurrencyConvertorE.c
- *
- * Project:
- * --------
- * MAUI
- *
- * Description:
- * ------------
- * This file implements Cur Convertor application.
- *
- * Author:
- * -------
- * Cecil Wei
- *
- *============================================================================
- * HISTORY
- * Below this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
- *------------------------------------------------------------------------------
- * $Log$
- *
- * removed!
- * removed!
- *
- *
- * removed!
- * removed!
- * Update foreign rate immediately when local rate has been changed.
- *
- * removed!
- * removed!
- * Redraw the single text line after updating its position.
- *
- * removed!
- * removed!
- *
- *
- * removed!
- * removed!
- * Add screen check when executing closecategory57.
- *
- * removed!
- * removed!
- * Execute closeCategory57 in delete callback function.
- *
- * removed!
- * removed!
- * Move CconvClearResult out of __MMI_CURRENCY_CONVERTER__ and __MMI_EXTENDED_CURRENCY_CONVERTER__
- *
- *
- * removed!
- * removed!
- * Skip CloseCategory57Screen() if global context has already been freed by delete callback function.
- *
- * removed!
- * removed!
- * Save the gui buffer to history when exiting screen.
- *
- * removed!
- * removed!
- *
- *
- * removed!
- * removed!
- *
- *
- * removed!
- * removed!
- * Remove CconvClearResult function
- *
- * removed!
- * removed!
- *
- *
- *------------------------------------------------------------------------------
- * Upper this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
- *============================================================================*/
- #ifndef _MMI_CURRENCYCONVERTORE_C
- #define _MMI_CURRENCYCONVERTORE_C
- /* Include: MMI header file */
- #include "MMI_features.h"
- #ifdef __MMI_EXTENDED_CURRENCY_CONVERTER__
- #include "PixtelDataTypes.h"
- #include "WrapperGprot.h"
- #include "currencyconvertorE.h"
- #include "CurrencyConvertor.h"
- #include "Unicodexdcl.h"
- #include "HistoryGprot.h"
- #include "GlobalDefs.h"
- #include "TimerEvents.h"
- #include "DebugInitDef.h"
- #include "EventsGprot.h"
- #include "SettingProfile.h"
- #include "wgui_inputs.h"
- #include "wgui_categories.h"
- #include "wgui_categories_inputs.h"
- #include "string.h"
- #include "NVRAMType.h"
- #include "NVRAMProt.h"
- #include "NVRAMEnum.h"
- #include "ExtraDef.h"
- #include "CustDataProts.h"
- #include "CommonScreens.h"
- /* Include: PS header file */
- /* ... Add More PS header */
- /*
- * Define
- */
- #define CCONV_MAX_CURRENCY 9 /* total number of currencies */
- #define CCONV_NAMED_CURRENCY 6 /* number of named currencies */
- #define CCONV_MAX_RATE 10
- #define CCONV_MAX_INPUT 8
- #define CCONV_MAX_RESULT 12
- #define CCONV_SEL_BUF_LEN 12*ENCODING_LENGTH /* length of inline selection string */
- #define CCONV_RESULT_BUF_LEN (12+1)*ENCODING_LENGTH
- #define CCONV_MAX_RATEENTRIES 5 /* number of exchange rate entries */
- #define ITEM_BASE CCONV_RATE_INLINE_FORE_SELECT1
- /*
- * Typedef
- */
- typedef struct
- {
- DOUBLE selectedRate; /* active exchange rate */
- DOUBLE rate[CCONV_MAX_RATEENTRIES];
- S32 localCurID; /* selected local cur */
- S32 foreignCurID; /* selected foreign cur */
- S32 localCurIndex; /* selected local cur */
- S32 foreignCurIndex; /* selected foreign cur */
- S32 curID[CCONV_MAX_RATEENTRIES]; /* Setting selected foreign cur */
- S32 curIndex[CCONV_MAX_RATEENTRIES]; /* Setting selected foreign cur */
- S32 selectedLocalCurID; /* selected local cur */
- S32 prevSelectedLocalCurID; /* previous selected local cur */
- S8 LocalBuff[CCONV_RESULT_BUF_LEN];
- S8 ForeBuff[CCONV_RESULT_BUF_LEN];
- S8 strRate[CCONV_MAX_RATEENTRIES][CCONV_SEL_BUF_LEN];
- S32 hiliteItemIndex;
- /* U8 IsComputingResult; */
- S8 *curList1[CCONV_MAX_CURRENCY];
- S8 *curList2[CCONV_MAX_CURRENCY];
- S8 *curList[CCONV_MAX_RATEENTRIES][CCONV_MAX_CURRENCY];
- U8 reloadFromNVRAM;
- U8 isRedrawScreen;
- S8 bRateDefined;
- } cconv_context_struct;
- /*
- * Local Variable
- */
- /*
- * Local Function
- */
- /* Utility functions */
- S32 mmi_cconv_get_cur_id(S32 index, S8 **list);
- S32 mmi_cconv_get_cur_index(S32 id, S8 **list, S8 nItems);
- DOUBLE mmi_cconv_get_exchange_rate(S32 cur1Idx, S32 cur2Idx);
- void mmi_cconv_compute_result(U8 *buffer);
- void mmi_cconv_return_to_menu(void);
- void mmi_cconv_fill_inline(void);
- U8 mmi_cconv_del_scr_callback(void *p);
- S8 mmi_cconv_local_select_list();
- S8 mmi_cconv_fore_select_list();
- /* Highlight handlers */
- void mmi_cconv_compute_item_highlight_hdlr(S32 index);
- void mmi_cconv_compute_local_select_highlight_hdlr(S32 index);
- void mmi_cconv_compute_fore_select_highlight_hdlr(S32 index);
- void mmi_cconv_compute_inline_edit_highlight_hdlr(void);
- void mmi_cconv_rate_item_highlight_hdlr(S32 index);
- void mmi_cconv_rate_local_select_hdlr(S32 index);
- void mmi_cconv_rate_inline_select_highlight_hdlr(S32 index);
- void mmi_cconv_rate_inline_edit_highlight_hdlr(void);
- void mmi_cconv_rate_inline_edit_key_hdlr(void);
- /* Validation handler */
- void mmi_cconv_compute_inline_edit_validation_hdlr(U8 *buffer, U8 *cursor, S32 text_length);
- void mmi_cconv_rate_inline_edit_validation_hdlr(U8 *buffer, U8 *cursor, S32 text_length);
- /* Key Handlers */
- void mmi_cconv_rate_save_change(void);
- /*
- * Global Variable
- */
- cconv_context_struct *g_cconv_ctx = NULL;
- extern wgui_inline_item wgui_inline_items[];
- extern single_line_input_box MMI_inline_singleline_inputbox;
- S8 *curShortName[CCONV_MAX_CURRENCY];
- S8 *curName[CCONV_MAX_CURRENCY];
- S8 *strEmpty = "