📄 auiwap.h
字号:
/*******************************************************************************
CONDAT (UK)
********************************************************************************
This software product is the property of Condat (UK) Ltd and may not be
disclosed to any third party without the express permission of the owner.
********************************************************************************
$Project name:
$Project code:
$Module:
$File: AUIWap.h
$Revision:
$Author: Condat(UK)
$Date:
********************************************************************************
Description:
Some definitions and internal function prototypes for the WAP AUI.
********************************************************************************
$History: AUIWap.h
15/05/2003 - SPR#1983 - SH - Updated to latest from 1.6.3 version.
$End
*******************************************************************************/
/* Events */
#define WAP_INIT 200 /* initialise WAP browser */
#define WAP_SHOW_CARD 201 /* display the WAP card */
/* Edit modes
*
* Specify what to do after editing a URL.
*/
enum
{
WAP_GOTO_URL,
WAP_ADD_BOOKMARK,
WAP_ADD_BOOKMARK_NAME,
WAP_EDIT_BOOKMARK,
WAP_EDIT_BOOKMARK_URL,
WAP_EDIT_HISTORY,
WAP_EDIT_HISTORY_URL,
WAP_EDIT_HOMEPAGE,
WAP_EDIT_APN
};
/* Delete modes
*
* Specify what to do after delete confirmation screen.
*/
enum
{
WAP_DELETE_BOOKMARK,
WAP_DELETE_HISTORY,
WAP_CLEAR_HISTORY
};
/* Number edit modes
*
* Specify what to do after a numeric edit screen
*/
enum
{
WAP_DIALUP_NUMBER,
WAP_IP_ADDRESS1,
WAP_IP_ADDRESS2,
WAP_PORT1,
WAP_PORT2,
WAP_RESPONSE_TIMER
};
/* Options menu items
*
* These are the menu items in the options menu.
*/
enum
{
WAP_ADDBOOKMARK,
WAP_BOOKMARKS,
WAP_GOTO,
WAP_HOMEPAGE,
WAP_BACK,
WAP_RELOAD,
WAP_EXIT,
MAX_OPTIONS /* Always have this at the end of the list */
};
/* T_WAP_BROWSER
*
* This structure holds all information about the wap browser window.
*/
typedef struct
{
T_MMI_CONTROL mmi_control;
T_MFW_HND parent_win;
T_MFW_HND win;
T_MFW_HND kbd;
T_MFW_HND kbd_long;
} T_WAP_BROWSER;
/*
* T_WAP_STRING
* Dynamically allocated string. Used to store output text.
*/
typedef struct
{
USHORT *text;
USHORT length;
}
T_WAP_STRING;
/* T_WAP_DATA
*
* All data for WAP can be accessed through this structure.
*/
typedef struct
{
T_MMI_CONTROL mmi_control;
T_MFW_HND parent_win;
T_MFW_HND win; /* The WAP data window (sits behind all other windows) */
T_MFW_HND edit_win; /* ...input window */
T_MFW_HND options_win; /* ...options window */
T_MFW_HND menu_win; /* ...main WAP menu window */
T_MFW_HND browser_win; /* The browser window */
T_MFW_HND list_win; /* List window (bookmarks etc) */
ListMenuData *list_data; /* ...and its list data */
T_MFW_HND optionsmenu_win; /* The options menu window, accessible from browser */
ListMenuData *optionsmenu_data; /* ...and its list data */
T_WAP_LIST *OptionsList; /* The list of options menu items */
T_MFW_HND temp_win; /* Temporary window pointer storage */
T_MFW_HND connect_win; /* The "connecting" dialog window */
T_MFW_HND error_win; /* Error dialog window */
T_MFW_HND main_kbd;
char *Buffer; /* Buffer for text input */
char *Buffer2; /* Second buffer for dual input dialogs */
T_WAP_STRING Message; /* Buffer for text output */
USHORT *LeftSoftKey; /* Text for custom left soft key */
USHORT *RightSoftKey; /* Text for custom right soft key */
char *URLSelect; /* The current URL that is selected in a list menu */
UBYTE OptionSelect; /* The number of the selected URL */
T_WAP_VIEW *View; /* Pointer to current view */
BOOL connected; /* Are we connected? */
void *gen_pointer; /* Pointer to generic data */
BOOL update_forbid; /* If TRUE, forbids update to the WAP browser window */
T_MFW_HND timer; /* Mfw timer */
UBYTE call_waiting; /* TRUE if incoming call is waiting */
} T_WAP_DATA;
/* Window indicators
*
* These flags are used to specify which windows will be destroyed in AUI_destroy()
*/
/* WAP_WIN - Shuts down the WAP application. WARNING: will not deallocate ALL memory */
#define WAP_WIN 0x0001
/* These are standard windows that can be destroyed */
#define MENU_WIN 0x0002
#define OPTIONS_WIN 0x0004
#define LIST_WIN 0x0008
#define EDIT_WIN 0x0010
#define OPTIONSMENU_WIN 0x0020
#define BROWSER_WIN 0x0040
#define CONNECT_WIN 0x0080
/* ALL_WIN - This completely shuts down the WAP application and all its windows */
#define ALL_WIN (WAP_WIN | MENU_WIN | OPTIONS_WIN | LIST_WIN | EDIT_WIN | OPTIONSMENU_WIN | BROWSER_WIN | CONNECT_WIN)
/* RETURN_TO_MENU - This closes all windows, but not WAP itself. It has an extra flag */
#define RETURN_TO_MENU (0x1000 | MENU_WIN | OPTIONS_WIN | LIST_WIN | EDIT_WIN | OPTIONSMENU_WIN | BROWSER_WIN | CONNECT_WIN)
/*******************************
* LOCAL FUNCTION PROTOTYPES *
*******************************/
T_MFW_HND AUI_please_wait(T_MFW_HND parent_win);
void AUI_please_wait_cb(T_MFW_HND win, USHORT identifier, SHORT reason);
static void AUI_menu_cb(T_MFW_HND parent_win, UBYTE identifier, UBYTE reason);
int AUI_homepage(MfwMnu* menu, MfwMnuItem* item);
T_MFW_HND AUI_create (T_MFW_HND parent_win);
T_WAP_DATA *AUI_wap_data (void);
void AUI_destroy (T_MFW_HND own_window, USHORT windows);
static int AUI_cb (T_MFW_EVENT event, T_MFW_WIN * win);
static int AUI_main_kbd_cb(T_MFW_EVENT event, T_MFW_KBD *keyboard);
void AUI_control (T_MFW_HND win, USHORT event, SHORT value, void * parameter);
T_MFW_HND AUI_connecting_dialog (T_MFW_HND win, ULONG status);
void AUI_connecting_dialog_cb (T_MFW_HND win, UBYTE identifier, UBYTE reason);
void AUI_connect_URL (T_MFW_HND win, char *URL);
T_MFW_HND AUI_win_create (T_MFW_HND parent_win);
int AUI_win_destroy (T_MFW_HND win);
static int AUI_win_cb (T_MFW_EVENT event, T_MFW_WIN * win);
void AUI_win_control (T_MFW_HND win, USHORT event, SHORT value, void * parameter);
static int AUI_kbd_cb (T_MFW_EVENT event, T_MFW_KBD *keyboard);
static int AUI_kbd_long_cb(T_MFW_EVENT event, T_MFW_KBD *keyboard);
int AUI_edit(char *shortcut, USHORT identifier, USHORT prompt, USHORT maxlen);
static T_MFW_HND AUI_edit_create(MfwHnd parent_win, USHORT identifier, USHORT prompt, USHORT maxlen, BOOL unicode);
static void AUI_edit_cb(T_MFW_HND win, USHORT identifier, SHORT reason);
static void AUI_list_redraw(USHORT list, USHORT TxtId);
static void AUI_list_redraw_cb(T_MFW_HND win, USHORT identifier, SHORT reason);
static void AUI_bookmarks_list_cb(T_MFW_HND win, ListMenuData *EntryListData);
static void AUI_history_list_cb(T_MFW_HND parent_win, ListMenuData *EntryListData);
static void AUI_profiles_list_cb(T_MFW_HND parent_win, ListMenuData *EntryListData);
static void AUI_profiles_setup_cb(T_MFW_HND win, ListMenuData *EntryListData);
static int AUI_entry_list (T_MFW_HND win, T_WAP_LIST *EntryList, ListCbFunc Callback, UBYTE pos);
static ListMenuData* AUI_entry_list_create (T_MFW_HND win, T_WAP_LIST *EntryList, ListCbFunc Callback, UBYTE pos);
int AUI_entry_goto(WAP_LIST_TYPE identifier);
int AUI_entry_delete(UBYTE identifier);
void AUI_entry_delete_cb(T_MFW_HND win, UBYTE identifier, UBYTE reason);
int AUI_entry_sendSMS(void);
static void AUI_profile_name_edit_cb(T_MFW_HND parent_win, UBYTE identifier, UBYTE reason);
static void AUI_username_cb(T_MFW_HND parent_win, USHORT identifier, SHORT reason);
static void AUI_password_cb(T_MFW_HND parent_win, USHORT identifier, SHORT reason);
int AUI_number_edit(T_MFW_HND parent_win, int identifier, USHORT prompt);
static void AUI_number_edit_cb(T_MFW_HND parent_win, USHORT identifier, SHORT reason);
static void AUI_error_cb(T_MFW_HND win, USHORT identifier, SHORT reason);
static void AUI_info_dialog(T_MFW_HND win, USHORT TxtId1, USHORT TxtId2);
#ifdef NEW_EDITOR
static void AUI_standard_editor(T_AUI_EDITOR_DATA *editor_data, USHORT identifier, USHORT mode, USHORT titleId, T_AUI_EDIT_CB Callback);
#else /* NEW_EDITOR */
static void AUI_standard_editor(T_EDITOR_DATA *editor_data, char *buffer, U16 size, UBYTE mode, T_EDIT_CB callback);
#endif /* NEW_EDITOR */
static void AUI_input_cb(T_MFW_HND win, USHORT identifier, SHORT reason);
static void AUI_password_cb_1(T_MFW_HND win, USHORT identifier, SHORT reason);
static void AUI_password_cb_2(T_MFW_HND win, USHORT identifier, SHORT reason);
static void AUI_confirm_cb(T_MFW_HND win, USHORT identifier, SHORT reason);
static void AUI_info_cb(T_MFW_HND win, USHORT identifier, SHORT reason);
static T_WAP_RES AUI_wap_options_menu_open(UBYTE contextType);
static void AUI_options_menu_cb(T_MFW_HND win, ListMenuData *EntryListData);
static void AUI_goto_cb(T_MFW_HND parent_win, USHORT identifier, SHORT reason);
static USHORT AUI_textid_to_uc(USHORT *dest, int src, USHORT destlen);
static USHORT AUI_text_to_uc(USHORT *dest, USHORT *src, USHORT destlen);
static void AUI_wap_string_alloc(T_WAP_STRING *string, USHORT size);
static void AUI_wap_string_free(T_WAP_STRING *string);
void AUI_error_dialog(T_WAP_VIEW *View, SHORT errorCode);
UBYTE* AUI_wap_memory_alloc(USHORT size);
void AUI_wap_memory_free(UBYTE* address, USHORT size);
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -