app_ua.h
13 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
/*****************************************************************************
* 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) 2005
*
* BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
* THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
* RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
* AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
* NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
* SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
* SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
* THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
* NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
* SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
*
* BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
* LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
* AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
* OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
* MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
*
* THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
* WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
* LAWS PRINCIPLES. ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
* RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
* THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
*
*****************************************************************************/
/*****************************************************************************
*
* Filename:
* ---------
* app_ua.h
*
* Project:
* --------
* MAUI
*
* Description:
* ------------
* This file contains user agent function prototypes.
*
* Author:
* -------
*
* Tim Chang (mtk02176)
*
*============================================================================
* HISTORY
* Below this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
*------------------------------------------------------------------------------
* removed!
*
* removed!
* removed!
* removed!
*
* removed!
* removed!
* removed!
*
* removed!
* removed!
* removed!
*
* removed!
* removed!
* removed!
*
* removed!
* removed!
* removed!
*
* removed!
* removed!
* removed!
*
* removed!
* removed!
* removed!
*
*------------------------------------------------------------------------------
* Upper this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
*============================================================================
****************************************************************************/
#ifndef _APP_UA_H
#define _APP_UA_H
#include "MMI_features.h"
#include "custom_wap_config.h"
#ifndef __OPTR_NONE__
#include "op_nvram_common_config.h"
#endif
#ifdef CUSTOM_INET_USER_AGENT_STRING_DEFAULT
#define APPLIB_DEFAULT_UA_STRING CUSTOM_INET_USER_AGENT_STRING_DEFAULT
#elif defined(OPERA_V10_BROWSER)
#define APPLIB_DEFAULT_UA_STRING "Opera/9.80 (MTK; U; en) Presto/2.4.15 Version/10.00"
#elif defined(OPERA_V11_BROWSER)
#define APPLIB_DEFAULT_UA_STRING "Opera/9.80 (MTK; U; en) Presto/2.4.15 Version/10.00"
#else
#define APPLIB_DEFAULT_UA_STRING "Maui Browser"
#endif
#ifdef CUSTOM_INET_USER_AGENT_PROFILE_DEFAULT
#define APPLIB_DEFAULT_UA_PROFILE CUSTOM_INET_USER_AGENT_PROFILE_DEFAULT
#else
#define APPLIB_DEFAULT_UA_PROFILE ""
#endif
#define APPLIB_INET_DEFAULT_USER_AGENT_INDEX (0)
#define APPLIB_INET_DEFAULT_ACCEPT_HEADER_INDEX WAP_CUSTOM_DEFAULT_ACCEPT_HEADER_INDEX
#define APPLIB_INET_DEFAULT_MMS_VERSION_INDEX WAP_CUSTOM_DEFAULT_MMS_VERSION_INDEX
/******************************************************************************
* ENUM
******************************************************************************/
/* This enum is for user to specify the interested type of setting */
typedef enum{
APPLIB_INET_UA_STRING_OPT = 0, /* user agent string */
APPLIB_INET_UA_PROFILE_OPT, /* user agent profile */
APPLIB_INET_ACCEPT_HEADER_OPT, /* accept header */
APPLIB_INET_MMS_VERSION_OPT, /* mms version */
APPLIB_INET_OPT_TOTAL /* total number of setting */
} applib_inet_option_enum;
/* This enum is to specify the type of accept header */
typedef enum{
APPLIB_INET_ACCEPT_HEADER_WAP_1_2_1 = 0, /* WAP 1.2.1 */
APPLIB_INET_ACCEPT_HEADER_WAP_2_0, /* WAP 2.0 */
APPLIB_INET_ACCEPT_HEADER_WML, /* WML */
APPLIB_INET_ACCEPT_HEADER_XHTML, /* WHTML */
APPLIB_INET_ACCEPT_HEADER_HTML, /* HTML */
APPLIB_INET_ACCEPT_HEADER_TOTAL /* total number of setting */
} applib_inet_accept_header_enum;
/* This enum is to specify MMS version */
typedef enum{
APPLIB_INET_MMS_VERSION_10 = 0, /* MMS 1.0 */
APPLIB_INET_MMS_VERSION_11, /* MMS 1.1 */
APPLIB_INET_MMS_VERSION_12, /* MMS 1.2 */
APPLIB_INET_MMS_VERSION_TOTAL /* total number of MMS version */
} applib_inet_mms_version_enum;
/******************************************************************************
* Typedef
******************************************************************************/
/* This structure is to record the setting value passed by the registered event handler */
typedef struct{
kal_uint32 value_int; /* The type of value is integer, including accept header and MMS version. */
const char *value_str; /* The type of value is constant character, including user agent string and user agent profile. */
} applib_inet_setting_struct;
typedef void (*applib_inet_event_func_ptr) (applib_inet_option_enum opt, applib_inet_setting_struct *val);
#if defined(__MMI_ENGINEER_MODE__) && !defined(__MMI_EM_INET_APP_SLIM__)
/* This structrue is for active user agent. */
typedef struct{
char *string;
char *profile;
} applib_inet_user_agent_struct;
typedef struct
{
applib_inet_option_enum opt;
applib_inet_event_func_ptr event_hdlr;
} applib_inet_event_handler_struct;
/* This is the context structure of EMIA. */
typedef struct {
applib_inet_user_agent_struct active_user_agent; /* active user agent setting */
applib_inet_accept_header_enum active_accept_header; /* active accept header index */
applib_inet_mms_version_enum active_mms_version; /* active MMS version */
unsigned short active_user_agent_index; /* the index of active user agent */
} applib_inet_cntx_struct;
/* Max. length of user agent string, defined in nvram_common_defs.h */
#define APPLIB_INET_MAX_UA_STRING_LEN NVRAM_EF_INET_MAX_UA_STRING_LEN
/* Max. length of user agent profile, defined in nvram_common_defs.h */
#define APPLIB_INET_MAX_UA_PROFILE_LEN NVRAM_EF_INET_MAX_UA_PROFILE_LEN
#if (defined(__SLIM_PROJECT_32_32__) || defined(__SLIM_PROJECT_64_32__) || defined(__MMI_EM_INET_APP_SLIM__)) /* #ifdef __MMI_SLIM_ENGINEER_MODE__ */
/* This is to define the total number of user agent setting. */
#define APPLIB_INET_USER_AGENT_TOTAL (1)
#define APPLIB_INET_USER_AGENT_LIST {"Default"}
#define APPLIB_INET_USER_AGENT_DATA {"", ""}
#else /* __SLIM_PROJECT_32_32__ || __SLIM_PROJECT_64_32__ || __MMI_EM_INET_APP_SLIM__)*/
/* This is to define the total number of user agent setting. */
#define APPLIB_INET_USER_AGENT_TOTAL (18)
#define APPLIB_INET_USER_AGENT_LIST {\
"Default", \
"LG KD876", \
"Nokia N72", \
"Nokia E70", \
"Nokia N93", \
"Nokia 6680", \
"Nokia 6280", \
"Nokia 3230", \
"Nokia 6230", \
"SonyEricsson W900i", \
"SonyEricsson W800i", \
"SonyEricsson K700i", \
"SonyEricsson Z800", \
"Samsung D608", \
"Motorola E1070", \
"CMCC PIM", \
"SonyEricssonW908c", \
"CMCC TD LAB TEST"}
/* user agent string and profile
There are 15 settings here, excluding the editable setting. */
#define APPLIB_INET_USER_AGENT_DATA {\
{"LG-KD876/v1.0 Arena/L2.3.3 Release/5.2.2008 Browser/Teleca/QLine Profile/MIDP-2.0 Configuration/CLDC-1.1", "http://gsm.lge.com/html/gsm/LG-KD876.xml"},\
{"NokiaN72/2.0617.1.0.3 Series60/2.8 Profile/MIDP-2.0 Configuration/CLDC-1.1", "http://nds.nokia.com/uaprof/NN72r100.xml"},\
{"NokiaE70-1/3.0 (1.0610.05.06) SymbianOS/9.1 Series60/3.0 Profile/MIDP-2.0 Configuration/CLDC-1.1", "http://nds.nokia.com/uaprof/NE70-1r100.xml"},\
{"NokiaN93-1/20.0.041 SymbianOS/9.1 Series60/3.0 Profile/MIDP-2.0 Configuration/CLDC-1.1", "http://nds.nokia.com/uaprof/NN93r100.xml"},\
{"Nokia6680/1.0 (4.04.07) SymbianOS/8.0 Series60/2.6 Profile/MIDP-2.0Configuration/CLDC-1.1", "http://nds.nokia.com/uaprof/N6680r100.xml"},\
{"Nokia6280/2.0 (03.60) Profile/MIDP-2.0 Configuration/CLDC-1.1", "http://nds.nokia.com/uaprof/N6280r100.xml"},\
{"Nokia3230/2.0 (5.0614.0) SymbianOS/7.0s Series60/2.1 Profile/MIDP-2.0Configuration/CLDC-1.0", "http://nds.nokia.com/uaprof/N3230r100.xml"},\
{"Nokia6230/2.0 (03.15) Profile/MIDP-2.0 Configuration/CLDC-1.1", "http://nds.nokia.com/uaprof/N6230r100.xml"},\
{"SonyEricssonW900i/R1L Browser/NetFront/3.3 Profile/MIDP-2.0 Configuration/CLDC-1.1", "http://wap.sonyericsson.com/UAprof/W900iR101-3G.xml"},\
{"SonyEricssonW800i/R1L Browser/SEMC-Browser/4.2 Profile/MIDP-2.0 Configuration/CLDC-1.1", "http://wap.sonyericsson.com/UAprof/W800iR101.xml"},\
{"SonyEricssonK700i/R2AG SEMC-Browser/4.0.3 Profile/MIDP-1.0 MIDP-2.0 Configuration/CLDC-1.1", "http://wap.sonyericsson.com/UAprof/K700iR201.xml"},\
{"SonyEricssonZ800/R1X Browser/SEMC-Browser/4.1 Profile/MIDP-2.0 Configuration/CLDC-1.1", "http://wap.sonyericsson.com/UAprof/Z800R101.xml"},\
{"SAMSUNG-SGH-D608/1.0/WAP2.0 Profile/MIDP-2.0 Configuration/CL", "http://wap.samsungmobile.com/uaprof/SGH-D608.xml"},\
{"MOT-E1070/85.83.50R MIB/BER2.2 Profile/MIDP-2.0 Configuration/CLDC-1.1", "http://motorola.handango.com/phoneconfig/E1070/Profile/E1070.rdf"},\
{"MTK_MAUI_01/07 Release/22.11.2007 Browser/wap2.0 Sync/SyncClient1.1 Profile/MIDP-2.0 Configuration/CLDC-1.1", ""},\
{"SonyEricssonW908c/R1x Browser/NetFront/3.4 Profile/MIDP-2.0 Configuration/CLDC-1.1 ", ""},\
{"MTK_MAUI_TD_01/07 Release/22.11.2007 Browser/wap2.0 Sync/SyncClient1.1 Profile/MIDP-2.0 Configuration/CLDC-1.1", ""}}
#endif /* __SLIM_PROJECT_32_32__ || __SLIM_PROJECT_64_32__ || __MMI_EM_INET_APP_SLIM__ */
/* accept header list */
#define APPLIB_INET_ACCEPT_HEADER_LIST {\
"WAP 1.2.1", \
"WAP 2.0", \
"WML", \
"XHTML", \
"HTML"}
/* MMS version list */
#define APPLIB_INET_MMS_VERSION_LIST {\
"MMS1.0", \
"MMS1.1", \
"MMS1.2" }
#ifdef OBIGO_Q05A_MMS
extern void mms_em_change_setting(applib_inet_option_enum opt, applib_inet_setting_struct *val);
#endif
#ifdef __MMI_BROWSER_2__
extern void bam_registry_em_setting_changed_callback(applib_inet_option_enum opt, applib_inet_setting_struct *new_setting);
#endif
#ifdef OBIGO_Q03C_MMS_V02
extern void mms_em_change_setting(applib_inet_option_enum opt, applib_inet_setting_struct *val);
#endif
#ifdef OBIGO_Q03C_MMS_V01
extern void mms_em_change_setting(applib_inet_option_enum opt, applib_inet_setting_struct *val);
#endif
extern void applib_inet_activate_ua(unsigned int active_ua_idx);
extern void applib_inet_activate_mms_version(applib_inet_mms_version_enum index);
extern void applib_inet_activate_accept_header(applib_inet_accept_header_enum index);
extern void applib_inet_notify_app(applib_inet_option_enum opt, const char *str_val, kal_uint32 int_val);
extern void applib_inet_set_ua_edited(WCHAR* string, WCHAR* profile);
extern void applib_inet_init(void);
#endif //#if defined(__MMI_ENGINEER_MODE__) && !defined(__MMI_EM_INET_APP_SLIM__)
/******************************************************************************
* External Function
******************************************************************************/
/* This function is to get active user agent string. Notice that the return type is const char */
extern const char* applib_inet_get_user_agent_string(void);
/* This function is to get active user agent profile. Notice that the return type is const char */
extern const char* applib_inet_get_user_agent_profile(void);
#ifdef __MMI_BROWSER_2__
extern void applib_get_dynamic_ua(char *ua);
#endif
extern unsigned int applib_inet_get_active_user_agent_index(void);
extern const char* applib_inet_get_user_agent_from_list(unsigned int index);
extern applib_inet_accept_header_enum applib_inet_get_active_accept_header(void);
extern applib_inet_mms_version_enum applib_inet_get_active_mms_version(void);
#endif /* _APP_CRC_H */