|
1 /* |
|
2 * Copyright (c) 1999 - 2001 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of the License "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 /*************************************************************************** |
|
20 ** File: nw_wae.h |
|
21 ** Subsystem Name: WAE User Agent |
|
22 ** Purpose: Provides interface to the WAE Browser. This module |
|
23 ** has mostly glue logic that integrates the WML Interpreter with |
|
24 ** the URL Loaders |
|
25 **************************************************************************/ |
|
26 #ifndef NW_WAE_H |
|
27 #define NW_WAE_H |
|
28 |
|
29 #ifdef __cplusplus |
|
30 extern "C" { |
|
31 #endif |
|
32 |
|
33 /* |
|
34 **---------------------------------------------------------------------- |
|
35 ** Includes |
|
36 **---------------------------------------------------------------------- |
|
37 */ |
|
38 #include "nw_errnotify.h" |
|
39 #include "nw_scrproxy.h" |
|
40 #include "nw_wml_core.h" |
|
41 #include "nw_wml_api.h" |
|
42 #include "nw_wtai_api.h" |
|
43 #include "nwx_generic_dlg.h" |
|
44 #include "nw_evlog_api.h" |
|
45 #include "wml_wae_transaction.h" |
|
46 #include "BrsrStatusCodes.h" |
|
47 |
|
48 |
|
49 /* */ |
|
50 /* Spectrum uses the new SIA/OTA Push application, which registers directly */ |
|
51 /* with the WSP stack, rather than the Rainbow OEM Push handlering code */ |
|
52 /* */ |
|
53 |
|
54 /* Define the default port number */ |
|
55 #define NW_DEFAULT_PORT 2948 |
|
56 |
|
57 /* |
|
58 **---------------------------------------------------------------------- |
|
59 ** Type Declarations |
|
60 **---------------------------------------------------------------------- |
|
61 */ |
|
62 |
|
63 /* |
|
64 * --------------------------------------------------------------------- |
|
65 */ |
|
66 |
|
67 typedef struct _NW_UrlLoadProgressApi_t NW_UrlLoadProgressApi_t; |
|
68 typedef struct _NW_AuthenticationApi_t NW_AuthenticationApi_t; |
|
69 typedef struct _NW_GenDlgApi_t NW_GenDlgApi_t; |
|
70 typedef struct _NW_WaeUsrAgent_t NW_WaeUsrAgent_t; |
|
71 typedef struct _NW_UserRedirectionApi_t NW_UserRedirectionApi_t; |
|
72 |
|
73 struct _NW_WaeUsrAgent_t { |
|
74 NW_Wml_t *wml; /* WML Interpreter */ |
|
75 NW_WaeTransaction_t wmlReq; /* WML Interpreter loader request */ |
|
76 NW_ScrProxy_t *scrProxy; /* WML Script Proxy */ |
|
77 const NW_AuthenticationApi_t *authApi; /* Authentication API */ |
|
78 const NW_GenDlgApi_t *genDlgApi; /* Generic dialogs API */ |
|
79 const NW_UrlLoadProgressApi_t *loadProgApi; /* URL Load Progress API */ |
|
80 const NW_ErrorApi_t *errorApi; /* Error API */ |
|
81 const NW_WtaiApi_t *wtaiApi; /* Wtai API */ |
|
82 const NW_EvLogApi_t *evLogApi; /* Event Logging API */ |
|
83 void *uiCtx; /* GUI Context */ |
|
84 |
|
85 const NW_UserRedirectionApi_t *userRedirection; /* User Redirection */ |
|
86 }; |
|
87 |
|
88 /* The callback to call when done displaying a authentication dialog */ |
|
89 typedef TBrowserStatusCode (NW_Wae_AuthenticationCB_t)(void *callback_ctx, |
|
90 TBrowserStatusCode status, |
|
91 const NW_Ucs2 *username, |
|
92 const NW_Ucs2 *password, |
|
93 NW_Bool cancel, |
|
94 NW_Bool endPressed); |
|
95 |
|
96 typedef TBrowserStatusCode (NW_Wae_UserRedirectionCB_t)(void *callback_ctx, |
|
97 TBrowserStatusCode status, |
|
98 NW_Dlg_Confirm_Result_t resp); |
|
99 |
|
100 /* Display a authentication dialog to the user */ |
|
101 struct _NW_AuthenticationApi_t { |
|
102 void (*getAuthenticationData)(void *wae, |
|
103 void *callbackCtx, |
|
104 NW_Wae_AuthenticationCB_t *callback); |
|
105 void (*getAuthenticationDataFailed)(void *msg, |
|
106 NW_Dlg_ConfirmCB_t *callback); |
|
107 }; |
|
108 |
|
109 /* Display a authentication dialog to the user */ |
|
110 struct _NW_UserRedirectionApi_t { |
|
111 void (*getUserRedirectionData)(void *wae, |
|
112 const NW_Ucs2 *originalUrl, |
|
113 const NW_Ucs2 *redirectedUrl, |
|
114 void *callbackCtx, |
|
115 NW_Wae_UserRedirectionCB_t *callback); |
|
116 }; |
|
117 |
|
118 struct _NW_GenDlgApi_t { |
|
119 void (*DialogListSelect)(NW_Dlg_ListSelect_t *data, void* callbackCtx, NW_Dlg_ListSelectCB_t* callback); |
|
120 void (*DialogPrompt)(NW_Dlg_Prompt_t *data, void* callbackCtx, NW_Dlg_PromptCB_t* callback); |
|
121 void (*DialogInputPrompt)(NW_Dlg_InputPrompt_t *data, void* callbackCtx, NW_Dlg_InputPromptCB_t* callback); |
|
122 void (*DialogSelectOption)(NW_Dlg_SelectData_t *data, void* callbackCtx, NW_Dlg_SelectCB_t* callback); |
|
123 void (*DetailsDialogHashkeyPressed)(NW_Ucs2* input, void* callbackCtx, NW_Dlg_DetailsDlgCB_t* callback); |
|
124 }; |
|
125 |
|
126 /* URL load process API, UI interface*/ |
|
127 struct _NW_UrlLoadProgressApi_t { |
|
128 /* start of a URL load ie. request to load a URL has been |
|
129 sent to the URL Loader. */ |
|
130 TBrowserStatusCode (*start) (void *wae, const NW_Ucs2 *url); |
|
131 /* the URL Loader has completed the load. */ |
|
132 TBrowserStatusCode (*finish) (void *wae, const NW_Ucs2 *url); |
|
133 /* Progress status is available */ |
|
134 TBrowserStatusCode (*load_progress_on) (void *wae, NW_Uint16 transactionId); |
|
135 |
|
136 }; |
|
137 |
|
138 /* |
|
139 **---------------------------------------------------------------------- |
|
140 ** Global Function Declarations |
|
141 **---------------------------------------------------------------------- |
|
142 */ |
|
143 |
|
144 /* Create the wae browser */ |
|
145 NW_WaeUsrAgent_t *NW_WaeUsrAgent_New(); |
|
146 |
|
147 /* |
|
148 * Free the wae browser. This function will shutdown the |
|
149 * URL Loader, WML Interpreter, Image Loader and the script proxy. |
|
150 */ |
|
151 void NW_WaeUsrAgent_Free(NW_WaeUsrAgent_t *wae); |
|
152 |
|
153 |
|
154 |
|
155 TBrowserStatusCode NW_Wae_RegisterWml(NW_WaeUsrAgent_t *wae, NW_Wml_t *wml); |
|
156 |
|
157 TBrowserStatusCode NW_Wae_UnRegisterWml(NW_WaeUsrAgent_t *wae); |
|
158 |
|
159 TBrowserStatusCode NW_Wae_RegisterWmlScriptProxy(NW_WaeUsrAgent_t *wae, |
|
160 NW_ScrProxy_t *scrProxy); |
|
161 |
|
162 TBrowserStatusCode NW_Wae_UnRegisterWmlScriptProxy(NW_WaeUsrAgent_t *wae); |
|
163 |
|
164 |
|
165 /* */ |
|
166 /* Spectrum uses the new SIA/OTA Push application, which registers directly */ |
|
167 /* with the WSP stack, rather than the Rainbow OEM Push handlering code */ |
|
168 /* */ |
|
169 |
|
170 TBrowserStatusCode |
|
171 NW_WaeUsrAgent_RegisterGenDlg(NW_WaeUsrAgent_t *wae, |
|
172 const NW_GenDlgApi_t *genDlgApi); |
|
173 |
|
174 TBrowserStatusCode |
|
175 NW_WaeUsrAgent_UnRegisterGenDlg(NW_WaeUsrAgent_t *wae); |
|
176 |
|
177 |
|
178 /* |
|
179 * Get a pointer to the script proxy. The caller should not free |
|
180 * the returned pointer. |
|
181 */ |
|
182 NW_ScrProxy_t *NW_WaeUsrAgent_GetScript(NW_WaeUsrAgent_t *wae); |
|
183 |
|
184 |
|
185 /* */ |
|
186 /* Spectrum uses the new SIA/OTA Push application, which registers directly */ |
|
187 /* with the WSP stack, rather than the Rainbow OEM Push handlering code */ |
|
188 /* */ |
|
189 |
|
190 TBrowserStatusCode NW_WaeUsrAgent_RegisterError(NW_WaeUsrAgent_t *wae, |
|
191 const NW_ErrorApi_t *errorApi); |
|
192 |
|
193 TBrowserStatusCode NW_WaeUsrAgent_RegisterLoadProgress(NW_WaeUsrAgent_t *wae, |
|
194 const NW_UrlLoadProgressApi_t *loadProgApi); |
|
195 |
|
196 |
|
197 /* */ |
|
198 /* Spectrum uses the new SIA/OTA Push application, which registers directly */ |
|
199 /* with the WSP stack, rather than the Rainbow OEM Push handlering code */ |
|
200 /* */ |
|
201 |
|
202 /* Register event log API */ |
|
203 TBrowserStatusCode NW_WaeUsrAgent_RegisterEvLog(NW_WaeUsrAgent_t *wae, |
|
204 const NW_EvLogApi_t *evLogApi); |
|
205 |
|
206 /* Unregister event log API */ |
|
207 TBrowserStatusCode NW_WaeUsrAgent_UnRegisterEvLog(NW_WaeUsrAgent_t *wae); |
|
208 |
|
209 /* Get a pointer to the EvLogApi. */ |
|
210 const NW_EvLogApi_t *NW_WaeUsrAgent_GetEvLog(NW_WaeUsrAgent_t *wae); |
|
211 |
|
212 TBrowserStatusCode |
|
213 NW_WaeUsrAgent_RegisterUserRedirection(NW_WaeUsrAgent_t *wae, |
|
214 const NW_UserRedirectionApi_t *userRedirectionapi); |
|
215 |
|
216 TBrowserStatusCode |
|
217 NW_WaeUsrAgent_UnRegisterUserRedirection(NW_WaeUsrAgent_t *wae); |
|
218 |
|
219 |
|
220 |
|
221 TBrowserStatusCode NW_WaeUsrAgent_DlgListSelect(NW_WaeUsrAgent_t *wae, |
|
222 NW_Dlg_ListSelect_t *data, |
|
223 void *callbackCtx, |
|
224 NW_Dlg_ListSelectCB_t callback); |
|
225 |
|
226 TBrowserStatusCode NW_WaeUsrAgent_DlgPrompt(NW_WaeUsrAgent_t *wae, |
|
227 NW_Dlg_Prompt_t *data, |
|
228 void *callbackCtx, |
|
229 NW_Dlg_PromptCB_t callback); |
|
230 |
|
231 TBrowserStatusCode NW_WaeUsrAgent_DlgInputPrompt(NW_WaeUsrAgent_t *wae, |
|
232 NW_Dlg_InputPrompt_t *data, |
|
233 void *callbackCtx, |
|
234 NW_Dlg_InputPromptCB_t callback); |
|
235 |
|
236 |
|
237 |
|
238 #ifdef __cplusplus |
|
239 } /* extern "C" */ |
|
240 #endif |
|
241 |
|
242 #endif /* NW_WAE_H */ |