📄 atbdata.h
字号:
#ifndef ATBDATA
#define ATBDATA
#define URL_MAX_LEN 80+3 // Max no. of characters for URL //zhaowm 2002.11.28. changed
#define NUMBER_PADDING 4 // History list has a number in front of it; this is how long this is in characters, including "." and " "
#define PROFILENAME_MAX_LEN 12 // Max no. of characters for profile title
#define OPTIONS_MAX_LEN 12 // ...options menu entries
#define NUMBER_MAX_LEN 20 // ...dialup number
#define IPADDRESS_MAX_LEN 15+3 // ...IP address //zhaowm 2002.12.12
#define SOFTKEY_MAX_LEN 10 // ...soft key text
#define INPUT_MAX_LEN 100 // ...standard WML editor
#define USERNAME_MAX_LEN 20 // ...ISP username
#define PASSWORD_MAX_LEN 20 // ...ISP password
#define CARD_TITLE_MAX_LEN 20 // ...title of card
#define TEXT_MAX_LEN 255 // ...any text on the WAP card
#define ERROR_MAX_LEN 50 // ...error messages
#define MAX_BOOKMARKS 15 // maximum number of bookmarks
#define MAX_HISTORY 10 // maximum number of history entries
#define MAX_PROFILES 3 // maximum number of profiles
#define WAP_OBJECT_ID 1 // Default View ID
#define WAP_CHANNEL_ID 1 // Default Channel ID
/*
* Status values
*/
enum
{
ATB_WAP_NO_STATUS = 0,
ATB_WAP_DOWNLOADING,
ATB_WAP_ONLINE_CONNECTION_CLOSED,
ATB_WAP_CONNECTING,
ATB_WAP_LOGGING_IN,
ATB_WAP_ATTACHING,
ATB_WAP_ATTACH_FAILED,
ATB_WAP_CARD_READING, /* SPR#1575 - SH - Card is being read in from cache or network */
ATB_WAP_PLEASE_WAIT /* SPR#1575 - SH - Please wait window */
};
#define WAP_STATUS_SAVEHISTORY 0x00000001 // Whether history list is saved
#define WAP_STATUS_SCALEIMAGES 0x00000002 // Whether images are scaled to fit the screen
/* Extra error codes */
#define ERROR_GPRS_NOT_SUPPORTED -1
#define ERROR_CALL_DISCONNECTED -2 /* SPR#1656 - SH - Added this */
/* Text Strings
*
* These are strings that the ATB will request from AUI.
*/
typedef enum
{
WAP_STRING_DOWNLOADING,
WAP_STRING_UPDATING
};
/* Type of list
*
* As well as a generic type, lists are for bookmarks, history, profiles, options menu and
* for URLs. A URL list is associated with each of the bookmarks and history lists.
*/
typedef enum
{
WAP_GENERIC_LIST,
WAP_BOOKMARKS_LIST,
WAP_HISTORY_LIST,
WAP_PROFILES_LIST,
WAP_PROFILES_SETUP,
WAP_OPTIONS_LIST,
WAP_URL_LIST
} WAP_LIST_TYPE;
/* T_WAP_LIST
*
* This is a generic list type for ATB and AUI. The size of the list and the size of the entries
* are stored so that the list can be handled by standard routines. The generic list handling routines
* have function names starting "ATB_wap_entry_".
*/
typedef struct
{
WAP_LIST_TYPE type; // Type of list
UBYTE no_of_entries; // Number of entries stored
UBYTE entry_size; // Entry size in characters
UBYTE max_entries; // Maximum no. of entries
char **Entry; // Pointers to the entries
} T_WAP_LIST;
/* T_WAP_CONNECTION
*
* Connection type
*/
typedef enum
{
WAP_TEMPORARY,
WAP_CONTINUOUS
}T_WAP_CONNECTION;
/* T_WAP_ACCESS
*
* Access type
*/
typedef enum
{
WAP_GPRS_DATA,
WAP_CS_DATA,
WAP_SMS
} T_WAP_ACCESS;
/* T_WAP_PROFILE
*
* Structure to hold profile information. All information here is stored in flash and
* loaded into RAM for each session. There may be many profiles stored in flash.
*/
typedef struct
{
char Title[CARD_TITLE_MAX_LEN+1]; // The name of the profile
char Homepage[URL_MAX_LEN+1]; // The URL of the homepage
UBYTE ConnectionType; // Temporary or Continuous
BOOL Security;
UBYTE AccessType;
USHORT ResponseTimer;
char IPAddress1[IPADDRESS_MAX_LEN+1];
char IPAddress2[IPADDRESS_MAX_LEN+1];
char DialupNumber[NUMBER_MAX_LEN+1];
USHORT Port1;
USHORT Port2;
char APN[URL_MAX_LEN+1];
char Username[USERNAME_MAX_LEN+1];
char Password[PASSWORD_MAX_LEN+1];
} T_WAP_PROFILE;
/* WAP_ELEMENT_TYPE
*
* For buffering of WAP elements, specifies which of the four types an element is.
*/
typedef enum
{
WAP_TEXT,
WAP_FIELDSET,
WAP_IMAGE,
WAP_TABLE
} WAP_ELEMENT_TYPE;
/* T_WAP_ELEMENT
*
* To speed up redraws, the SEND_TEXT type events are buffered by the ATB. This means that
* WAP does not have to resend the entire card in the event of a redraw. Each element is
* stored as part of a chain, with a pointer to the next element in the chain.
*/
typedef struct WAP_ELEMENT
{
WAP_ELEMENT_TYPE type;
void *data; // Generic pointer to WAP_MMI_SEND_TEXT_IND etc
struct WAP_ELEMENT *NextElement;
} T_WAP_ELEMENT;
/* T_WAP_VIEW
*
* Structure to hold view information. Used to pass information between ATB and the UI.
*/
typedef struct WAP_VIEW
{
UBYTE object_id; // Object id, as used by GLE
UBYTE channel; // channel, as used by AUS
UBYTE ProfileId; // The id of the current profile
USHORT browser_status; // Container of status flags.
T_WAP_PROFILE *Profile; // Pointer to the current profile in RAM
T_WAP_LIST *ProfilesList; // List of the names of all profiles in flash
UBYTE Status; // Status flags (see above)
BOOL CanGoBack; // True if the user can go "back" from the card
char *URL; // The current URL
char *Title; // The title of the current card
BOOL CustSoftKeys; // True if softkeys are customised
USHORT CustSoftKeyId; // Id of customised softkey
USHORT cardWidth; // The width in pixels of the current card
USHORT cardHeight; // The height in pixels of the current card
USHORT cardXPosition; // X displacement of the view of the card
USHORT cardYPosition; // Y displacement of the view of the card
BOOL acceptUpdate; // TRUE if we can draw to the card
void *UIdata; // Generic pointer for use by the User Interface
T_WAP_ELEMENT *ElementHeader; // Pointer to the first element in the existing element chain
T_WAP_ELEMENT *NewElementHeader; // Pointer to element chain currently being built
struct WAP_VIEW *NextView; // Pointer to next element in the view chain
T_WAP_LIST *History; // History
T_WAP_LIST *HistoryURL;
T_WAP_LIST *Bookmarks; // ...and bookmark list
T_WAP_LIST *BookmarksURL;
#ifdef MMS_WAP_ENABLED
UBYTE mms_status;
#endif
}
#ifdef MMS_WAP_ENABLED
T_WAP_VIEW,
T_MMS_VIEW;
#else
T_WAP_VIEW;
#endif
#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -