|
1 /* |
|
2 * Copyright (c) 2000 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 #ifndef __MVCSHELL_H |
|
20 #define __MVCSHELL_H |
|
21 |
|
22 |
|
23 #include <apmstd.h> |
|
24 #include "BrsrStatusCodes.h" |
|
25 #include "BrsrTypes.h" |
|
26 #include <badesca.h> |
|
27 #include <bldvariant.hrh> |
|
28 #include <charconv.h> |
|
29 #include <e32base.h> |
|
30 #include <e32std.h> |
|
31 #include <f32file.h> |
|
32 #include <ApEngineConsts.h> |
|
33 |
|
34 #include "BrCtlDialogsProvider.h" |
|
35 |
|
36 #include "HEDDocumentListener.h" |
|
37 #include "httploader_mlinkresolvercallbacks.h" |
|
38 #include "MSGMessageListener.h" |
|
39 #include "MVCViewListener.h" |
|
40 #include "nw_hed_appservices.h" |
|
41 #include "nw_errnotify.h" |
|
42 #include "nw_scrproxy.h" |
|
43 #include "nw_wae.h" |
|
44 #include "nwx_defs.h" |
|
45 #include "nwx_status.h" |
|
46 #include "urlloader_urlresponse.h" |
|
47 #include "EmbeddedDocExitObserver.h" |
|
48 //R |
|
49 #include "historystack.h" |
|
50 //#include "webkitview.h" |
|
51 #include "wmlcontrol.h" |
|
52 |
|
53 |
|
54 #ifdef __SERIES60_WIM |
|
55 #include "WimUi.h" |
|
56 #endif __SERIES60_WIM |
|
57 |
|
58 |
|
59 enum TUrlLoadState |
|
60 { |
|
61 // We are now loading the URL |
|
62 EUrlLoadingProgressing, |
|
63 |
|
64 // The loading progress has finished because of successful |
|
65 // finish, user cancel or some other reason. |
|
66 EUrlLoadingStopped, |
|
67 |
|
68 // Reset iDoNotRestoreContentFlag in the BrowserUI |
|
69 EResetDoNotRestoreContentFlag |
|
70 }; |
|
71 |
|
72 class CDataLoadInfo; |
|
73 |
|
74 const TInt KPanicKmShellPanicBase = -10000; |
|
75 const TInt KPanicKmShellSingletonAlreadyCreated = KPanicKmShellPanicBase - 1; |
|
76 const TInt KPanicKmShellViewPtrIsNotSet = KPanicKmShellPanicBase - 2; |
|
77 |
|
78 class CView; |
|
79 class CCnvCharacterSetConverter; |
|
80 class CContentLoader; |
|
81 class CBrCtl; |
|
82 |
|
83 NONSHARABLE_CLASS(CShell): public CBase, public MHttpLoader_LinkResolverCallbacks, |
|
84 public MViewListener, public MHEDDocumentListener, public MMessageListener |
|
85 { |
|
86 public: // Epoc constructor and destructor |
|
87 |
|
88 static CShell* NewL (CView* aEpoc32View, CBrCtl* aBrCtl, MWmlInterface* aWKWmlInterface, CWmlControl* aWmlControl); |
|
89 |
|
90 ~CShell(); |
|
91 |
|
92 |
|
93 public: // Public exported methods |
|
94 |
|
95 /** |
|
96 * |
|
97 * Starts loading of content from given URL. |
|
98 * |
|
99 * @param URL to be loaded |
|
100 * @return KErrNone if successfull, KErrGeneral on error |
|
101 */ |
|
102 TInt Load(const TDesC& aUrl, TInt aApId, NW_Cache_Mode_t cacheMode=NW_CACHE_NORMAL); |
|
103 |
|
104 TInt CancelAll(); |
|
105 |
|
106 TInt FreeConnection(); |
|
107 TInt HistoryLoad(THistoryStackDirection aDirection); |
|
108 |
|
109 /** |
|
110 * |
|
111 * Process the Back event |
|
112 * Now that we have multiple views (normal view and image map view), the processing |
|
113 * of the back event may be different depending on which view we are in. If we |
|
114 * are in the image map view, we will want to switch back to the normal view if the |
|
115 * back button is selected. If we are in normal view, we will want to call HistoryLoad |
|
116 * and load the previous page. |
|
117 * |
|
118 * @param None |
|
119 * @return KErrNone if successfull, KErrUnknown on error |
|
120 */ |
|
121 TInt ProcessBack(); |
|
122 |
|
123 /** |
|
124 * |
|
125 * Switch to image map view |
|
126 * Now that we have multiple views (normal view and image map view).If we select |
|
127 * an image map we want to switch to image map view |
|
128 * |
|
129 * @param None |
|
130 * @return KErrNone if successfull, KErrUnknown on error |
|
131 */ |
|
132 TInt SwitchToImgMapView(); |
|
133 |
|
134 /** |
|
135 * |
|
136 * Switch from image map view |
|
137 * Now that we have multiple views (normal view and image map view).If we |
|
138 * are in the image map view, we will want to switch back to the normal view. |
|
139 * |
|
140 * @param None |
|
141 * @return KErrNone if successfull, KErrUnknown on error |
|
142 */ |
|
143 TInt SwitchFromImgMapViewIfNeeded(); |
|
144 |
|
145 void SetView(CView* aEpocView); // Does not take the ownership! |
|
146 |
|
147 TInt HandleDo( TUint32 aElemId ); |
|
148 |
|
149 /** |
|
150 * |
|
151 * Get a history list |
|
152 * |
|
153 * @param aUrls Descriptor array to append |
|
154 * @return Error code |
|
155 */ |
|
156 TInt GetHistoryList (CArrayFix<TBrCtlSelectOptionData>& aHistoryList); |
|
157 |
|
158 /** |
|
159 * |
|
160 * Gives current position in the history stack |
|
161 * |
|
162 * @return THistoryStackPosition enumeration |
|
163 */ |
|
164 TWmlEngineDefs::THistoryStackPosition HistoryStackPosition(); |
|
165 |
|
166 /** |
|
167 * Loads page from history by given index |
|
168 * |
|
169 * @param history list |
|
170 * @return KErrNone if found, otherwise KErrNotFound |
|
171 */ |
|
172 TInt LoadHistoryEntry( CArrayFix<TBrCtlSelectOptionData>& aHistoryList ); |
|
173 |
|
174 /** |
|
175 * |
|
176 * Gets the current URL as HBufC*, Leaves on error |
|
177 * Returns at least zero-length HBufC on success |
|
178 * |
|
179 * @return HBufC* Current URL |
|
180 */ |
|
181 |
|
182 HBufC* GetCurrentUrlInHBufCL() const; |
|
183 |
|
184 /** |
|
185 * |
|
186 * Gets the current title of the content as HBufC*, leaves on error |
|
187 * Returns at least zero-length HBufC on success |
|
188 * |
|
189 * @return HBufC* Current WML deck / XHTML Page <title> element contents |
|
190 */ |
|
191 HBufC* GetCurrentTitleInHBufCL(TBool& aStripUrl) const; |
|
192 |
|
193 TUint16 SaveToFileL(TDesC& aFileName) const; |
|
194 |
|
195 /** |
|
196 * |
|
197 * Gets the WML of the domtree |
|
198 * Returns pointer to HBufC |
|
199 * |
|
200 * @return HBufC* extracted WML MarkUp |
|
201 */ |
|
202 |
|
203 HBufC8* GetPageAsWMLMarkUp(); |
|
204 |
|
205 |
|
206 /** |
|
207 * |
|
208 * Gets the text of the domtree |
|
209 * Returns pointer to HBufC |
|
210 * |
|
211 * @return HBufC* extracted text |
|
212 */ |
|
213 HBufC* GetPageAsTextL(); |
|
214 |
|
215 |
|
216 /** |
|
217 * |
|
218 * Gets the charset from the domtree |
|
219 * Returns pointer to the charset |
|
220 * |
|
221 * @return charset |
|
222 */ |
|
223 const NW_Uint8* GetCharsetFromResponse(); |
|
224 |
|
225 /** |
|
226 * |
|
227 * |
|
228 */ |
|
229 void ShowImagesL() const; |
|
230 |
|
231 /** |
|
232 *it must be called when the browser view loses focus |
|
233 */ |
|
234 void LoseFocus(); |
|
235 |
|
236 /** |
|
237 *it must be called when the browser view gains focus |
|
238 */ |
|
239 void GainFocus(); |
|
240 |
|
241 /** |
|
242 *provide for browser to reset the history list, when close softkey is selected. |
|
243 */ |
|
244 void ClearHistoryList(); |
|
245 |
|
246 // Called when selected character set changes |
|
247 void CharacterSetChangedL(TUint aSelectedCharacterSet); |
|
248 |
|
249 void* GetCertInfo(); |
|
250 |
|
251 public: // public not exported methods |
|
252 |
|
253 |
|
254 /** |
|
255 * From MHttpLoader_LinkResolverCallbacks Called to obtain the current URL. |
|
256 * @since 2.8 |
|
257 * @param |
|
258 * @return The current URL |
|
259 */ |
|
260 HBufC* CurrentUrlLC(); |
|
261 |
|
262 /** |
|
263 * From MHttpLoader_LinkResolverCallbacks Called to obtain a pointer to the Link Resolver |
|
264 * @since 2.8 |
|
265 * @return The Browser Control's Link Resolver |
|
266 */ |
|
267 MBrCtlLinkResolver* LinkResolver(); |
|
268 |
|
269 /** |
|
270 * From MHttpLoader_LinkResolverCallbacks Called to check if the Host Application should be called to resolve the URL |
|
271 * @since 2.8 |
|
272 * @return ETrue if the Host Application will resolve the URL, EFalse otherwise |
|
273 */ |
|
274 TBool ShouldResolveUrl(TBool aIsTopLevel, NW_Uint8 aReason); |
|
275 |
|
276 /** |
|
277 * From MHttpLoader_LinkResolverCallbacks Called to call LoadUrlL |
|
278 * @since 3.0 |
|
279 * @return void |
|
280 */ |
|
281 void LoadLinkUrl(const TDesC& aUrl, void* aHeaders ); |
|
282 |
|
283 /** |
|
284 * From MHttpLoader_LinkResolverCallbacks Called to call PostUrlL |
|
285 * @since 3.0 |
|
286 * @return void |
|
287 */ |
|
288 void PostLinkUrl(TDesC& aUrl, TDesC8& aPostData, TDesC& aContentType); |
|
289 |
|
290 /** |
|
291 * From MHttpLoader_LinkResolverCallbacks Called to load Embeded content |
|
292 * @since 3.1 |
|
293 * @return void |
|
294 */ |
|
295 CWmlResourceLoadListener* LoadEmbededUrl( const TDesC& aUrl, void *aLoadContext, |
|
296 void* aPartialLoadCallback, TUint16 aTransId ); |
|
297 |
|
298 /** |
|
299 * From MHttpLoader_LinkResolverCallbacks Called to set the OEB event |
|
300 * @since 3.1 |
|
301 * @return void |
|
302 */ |
|
303 void SetOnEnterBackwordReason(); |
|
304 |
|
305 /** |
|
306 * From MHttpLoader_LinkResolverCallbacks Convert a charset from string to IANA encoding |
|
307 * @since 2.8 |
|
308 * @return IANA encoding of the charset |
|
309 */ |
|
310 TUint16 ConvertCharset(const TDesC8& aCharset); |
|
311 |
|
312 TUint ConvertFromForeignCharSetL(void* response); |
|
313 TUint ConvertFromForeignChunkL( NW_Uint32 foreignEncoding, void* inBuf, TInt * numUnconvertible, TInt* indexFirstUnconvertible, void** outBuf); |
|
314 static TBrowserStatusCode ConvertToForeignCharSet(void* ucsText); |
|
315 TUint ConvertToForeignCharSetL(void* text); |
|
316 NW_Text_t* ConvertToValidUrl (NW_Text_t* url, TBrowserStatusCode* status); |
|
317 /** |
|
318 * From MHttpLoader_ToUiCallbacks Called when the user need to be notified with an error |
|
319 * @since 2.0 |
|
320 * @return void |
|
321 */ |
|
322 void CoverageEvent (TInt aError); |
|
323 CBrCtl* BrCtl() {return iBrCtl;} |
|
324 /** |
|
325 * From MHttpLoader_ToUiCallbacks Called after disconnect is complete. |
|
326 * @since 2.0 |
|
327 * @param |
|
328 * @return void |
|
329 */ |
|
330 void Disconnect_Resp() {}; |
|
331 |
|
332 TBrowserStatusCode DocumentChanged (NW_HED_DocumentRoot_t* documentRoot, |
|
333 CActive::TPriority aMessagePriority ); |
|
334 |
|
335 TBrowserStatusCode DocumentChangedPartial (NW_HED_DocumentRoot_t* documentRoot, |
|
336 CActive::TPriority aMessagePriority ); |
|
337 |
|
338 NW_Uint32 GetCharsetUid(NW_Uint32 internalEncoding); |
|
339 NW_Uint32 GetCharsetUid2(NW_Uint32 ianaEncoding); |
|
340 NW_Uint32 GetUidFromCharset( NW_Uint8* charset, NW_Uint32 charsetLength ); |
|
341 NW_Text_t* GetCurrentUrl (); |
|
342 NW_Text_t* GetCurrentUrlL (); |
|
343 const NW_Text_t* GetCurrentTitle (); |
|
344 inline NW_HED_DocumentRoot_t* GetDocumentRoot() { return iDocumentRoot; }; |
|
345 NW_LMgr_RootBox_t* GetRootBox (); |
|
346 TBrowserStatusCode GetUseNumberBuf (NW_ADT_DynamicVector_t* dynamicVector, void** ptr ); |
|
347 TBrowserStatusCode GetUseNumberContent (NW_ADT_DynamicVector_t *dynamicVector); |
|
348 inline CView* GetView() { return iView; }; |
|
349 TBool HandleDownloadL(RArray<TUint>* aTypeArray, CDesCArrayFlat* aDesArray); |
|
350 void HandleError (TBrowserStatusCode status); |
|
351 void FormattingComplete (); |
|
352 void HandleMessage (NW_Msg_Message_t* message); |
|
353 TBrowserStatusCode IsActive (NW_HED_DocumentRoot_t* documentRoot, NW_Bool state); |
|
354 NW_Bool LoadEnd (NW_HED_DocumentRoot_t* documentRoot, NW_Int16 errorClass, NW_WaeError_t error); |
|
355 TBrowserStatusCode LoadProgressOn (NW_Uint16 transactionId); |
|
356 TBrowserStatusCode LoadProgressOff (NW_Uint16 transactionId); |
|
357 void NewDocument (NW_HED_DocumentRoot_t* documentRoot, NW_HED_UrlRequest_t* urlRequest, NW_Bool aDestroyBoxTree); |
|
358 void DestroyPreviousDocument(); |
|
359 void RestoreDocument (); |
|
360 void NotifyProgress (TBrCtlDefs::TBrCtlLoadEvent aEvent, TUint32 aSize, TUint16 aTransactionId); |
|
361 MBrCtlSpecialLoadObserver* GetLoadObserver (); |
|
362 static TBrowserStatusCode NW_Http_ConnNeeded (TInt* aConnectionPtr, TInt* aSockSvrHandle, TBool* aNewConn, TApBearerType* aBearerType); |
|
363 // static TBrowserStatusCode NW_UI_AboutToLoadPageL( NW_Uint32 aNoteType ); |
|
364 static TBrowserStatusCode NW_UI_ConvertFromForeignCharSet (void* ctx, NW_Url_Resp_t* response); |
|
365 static TBrowserStatusCode NW_UI_ConvertToForeignCharSet (void* ctx, NW_String_t* text); |
|
366 static TBrowserStatusCode NW_UI_ConvertFromForeignChunk ( void* ctx, NW_Uint32 foreignEncoding, void* inBuf, TInt * numUnconvertible, TInt* indexFirstUnconvertible, void** outBuf); |
|
367 static void NW_UI_DialogListSelect (NW_Dlg_ListSelect_t* data, void* callbackCtx, NW_Dlg_ListSelectCB_t *callback ); |
|
368 static void NW_UI_DialogPrompt (NW_Dlg_Prompt_t* data, void* callbackCtx, NW_Dlg_PromptCB_t *callback); |
|
369 static void NW_UI_DialogInputPrompt (NW_Dlg_InputPrompt_t *data, void* callbackCtx, NW_Dlg_InputPromptCB_t *callback ); |
|
370 static void NW_UI_DialogSelectOption (NW_Dlg_SelectData_t *data, void* callbackCtx, NW_Dlg_SelectCB_t* callback ); |
|
371 /* Return localized string for 'back', 'reset', 'select', 'submit' */ |
|
372 static NW_Ucs2* NW_UI_GetLocalizedString (NW_Uint32 type); |
|
373 void NW_UI_GetUserAuthenticationDataL(const NW_Ucs2* aUri, const NW_Ucs2* aUsername, const NW_Ucs2* aRealm, |
|
374 NW_Ucs2** aRetUsername, NW_Ucs2** aRetPassword, |
|
375 TBool aBasicAuthentication = EFalse); |
|
376 static void NW_UI_GetUserRedirectionData (void* wae, const NW_Ucs2* originalUrl, const NW_Ucs2* redirectedUrl, |
|
377 void *callbackCtx, NW_Wae_UserRedirectionCB_t *callback); |
|
378 static TBrowserStatusCode NW_UI_HttpError (void *userAgent, const NW_WaeHttpStatus_t httpError, |
|
379 const NW_Ucs2 *uri, void *callback_ctx, NW_ErrorCB_t *callback); |
|
380 /** |
|
381 * |
|
382 * Query if we are in image map view |
|
383 * We have multiple views (image map view or normal view) |
|
384 * |
|
385 * @param None |
|
386 * @return KErrNone if successfull, KErrUnknown on error |
|
387 */ |
|
388 static TBool NW_UI_IsImageMapView(); |
|
389 static void NW_UI_NotifyCoverageEvent (TInt aError); |
|
390 static TBrowserStatusCode NW_UI_NotifyError (void *userAgent, const TBrowserStatusCode status, void *callback_ctx, NW_ErrorCB_t *callback); |
|
391 // Display the object info dialog box |
|
392 static NW_Bool NW_UI_ShowObjectDialog(); |
|
393 static void NW_UI_SoftKey_UpdateSoftKeys (NW_SoftKeyText_t softKeyText); |
|
394 static TBrowserStatusCode NW_UI_StartContentLoad (void *userAgent, const NW_Ucs2* urlName); |
|
395 static TBrowserStatusCode NW_UI_StopContentLoad (void *userAgent, const NW_Ucs2* urlName); |
|
396 static TInt NW_UI_SwitchFromImgMapViewIfNeeded(); |
|
397 static TInt NW_UI_SwitchToImgMapView(); |
|
398 static TBrowserStatusCode NW_UI_UrlLoadProgressOn (void *wae, NW_Uint16 transactionId); |
|
399 static void NW_UI_ViewImage (void* rawData, NW_Int32 length, NW_Bool isWbmp); |
|
400 /* display a alert dialog to the user */ |
|
401 static void NW_UI_WmlScriptDlgAlert (void* wae, const NW_Ucs2* message, void* callback_ctx, NW_ScrProxy_DlgAlertCB_t* callback ); |
|
402 /* display a confirm dialog to the user */ |
|
403 static void NW_UI_WmlScriptDlgConfirm (void *wae, const NW_Ucs2 *message, const NW_Ucs2 *yesMessage, |
|
404 const NW_Ucs2 *noMessage, void *callback_ctx, NW_Dlg_ConfirmCB_t *callback ); |
|
405 /* display a prompt dialog to the user */ |
|
406 static void NW_UI_WmlScriptDlgPrompt (void *wae, const NW_Ucs2 *message, const NW_Ucs2 *defaultInput, |
|
407 void *callback_ctx, NW_ScrProxy_DlgPromptCB_t *callback ); |
|
408 void OptionListInit(); // just forwards call to CEpoc32View |
|
409 void OptionListAddItem( const TText* aText, const TUint32 aElemID, const TInt aElType ); // just forwards call to CEpoc32View |
|
410 NW_Bool ReportError (NW_HED_DocumentRoot_t* documentRoot, NW_Int16 errorClass, NW_WaeError_t error, |
|
411 ReportErrorCallback* callback); |
|
412 TBrowserStatusCode SendRedrawMsg (NW_Bool drawNow); |
|
413 TBrowserStatusCode SendRelayoutMsg (NW_Bool createTabList); |
|
414 TUint SelectedCharacterSet() const {return iSelectedCharacterSet;} |
|
415 TBrowserStatusCode SetAnchorName (NW_Text_t* anchorName); |
|
416 void SetFileOpenedByDocHandler( TBool aFileOpenedByDocHandler ); |
|
417 TBrowserStatusCode ShowNamedBox (NW_LMgr_Box_t* boxTree, const NW_Text_t* targetName); |
|
418 /** |
|
419 * From MHttpLoader_ToUiCallbacks Called after shutdown is complete. |
|
420 * @since 2.0 |
|
421 * @param |
|
422 * @return void |
|
423 */ |
|
424 void Shutdown_Resp() {}; |
|
425 TBrowserStatusCode SwitchLayout (NW_Bool aVerticalLayout, NW_Bool aReformatBoxTree); |
|
426 void UpdateSoftKeys(); |
|
427 void UpdateTitle(); |
|
428 void UrlLoadStateChanged (TBrCtlDefs::TBrCtlLoadEvent aEvent); |
|
429 |
|
430 // Following functions are for ECMAScript support |
|
431 static void WindowAlert (void* browserApp_Ctx, NW_Ucs2* msg); |
|
432 static NW_Bool WindowConfirm (void* browserApp_Ctx, NW_Ucs2* msg, NW_Ucs2* yesMsg, NW_Ucs2* noMsg); |
|
433 static NW_Ucs2* WindowPrompt (void* browserApp_Ctx, NW_Ucs2* msg, NW_Ucs2* defaultVal); |
|
434 |
|
435 static NW_Ucs2* WindowPromptL (void* browserApp_Ctx, NW_Ucs2* msg, NW_Ucs2* defaultVal); |
|
436 static void WindowOpen(void* browserApp_Ctx, NW_Ucs2* url, NW_Ucs2* target, NW_Uint32 reason); |
|
437 |
|
438 /** |
|
439 * Request the host applicaion to open the URL in a new window |
|
440 * @since 3.0 |
|
441 * @param aUrl The Url of the request to be done in the new window |
|
442 * @param aTargetName The name of the new window |
|
443 * @param aReason The reason for opening the new window |
|
444 * @param aMethod The method to be used for fetching the supplied url |
|
445 * @param aContentType If the method is POST, this is the content type of the data to be posted |
|
446 * @param aPostData If the method is POST, this is the data to be posted |
|
447 * @param aBoundary The boundary used if the content is multipart/form-data |
|
448 * @param aReserved For future use |
|
449 * @return Return Value is for future reference and is currently ignored |
|
450 */ |
|
451 void WindowOpenAndPostL(TUint16* url, TUint16* target, TUint32 reason, |
|
452 TUint16 method, TDesC8* contentType, TDesC8* postData, |
|
453 TDesC8* aBoundary, void* reserved); |
|
454 |
|
455 /** |
|
456 * |
|
457 * @since 3.0 |
|
458 * @param url |
|
459 * @param target |
|
460 * @param reason |
|
461 */ |
|
462 void WindowOpenL(TUint16* url, TUint16* target, TUint32 reason); |
|
463 |
|
464 TBool Exiting() {return iExiting;}; |
|
465 |
|
466 // Support for AboutToLoadPage and the UI |
|
467 TBool SecureItemsInNonSecurePage() { return iSecureItemsInNonSecurePage; } |
|
468 TBool NonSecureItemsInSecurePage() { return iNonSecureItemsInSecurePage; } |
|
469 |
|
470 TInt GetCharsetAndCharsetStringFromUid(TUint aUid, TUint16* aCharset, |
|
471 const TUint8** aCharsetString); |
|
472 TBrowserStatusCode StartDataLoad (TDesC& aUrl, CDataLoadInfo* aDataLoadInfo, |
|
473 NW_MVC_ILoadListener_t* loadListener, TUint16* aTransId, |
|
474 void* aOwner, void* aClientData, void* aLoadRecipient, TUint8 aLoadType); |
|
475 |
|
476 TBrowserStatusCode PostUrl(const TDesC& aUrl, |
|
477 const TDesC8& aContentType, const TDesC8& aPostData, |
|
478 const TDesC8* aBoundary, void* aReserved); |
|
479 |
|
480 static TInt RunBGTask(TAny* aShell); |
|
481 void StartIdle() {if (!iIdle->IsActive()) iIdle->Start(TCallBack(RunBGTask, this));} |
|
482 |
|
483 /** |
|
484 * Create observer to delete temp files when the embedded application exists |
|
485 * @param TFilename Name and path for the temporary file |
|
486 * @return NULL if creation failed; |
|
487 */ |
|
488 MApaEmbeddedDocObserver* CreateEmbeddedDocObserver( TFileName aFilename, RFs& aRfs); |
|
489 |
|
490 void WmlShellLoadUrlL( const TDesC& aUrl, TInt aAppId ); |
|
491 public: // Public member variables |
|
492 TBool iEmbedded; |
|
493 TInt iApId; |
|
494 CContentLoader* iContentLoader; |
|
495 RFs iRfs; |
|
496 |
|
497 private: // Private methods |
|
498 |
|
499 CShell( CView* aEpoc32View, CBrCtl* aBrCtl ); |
|
500 void ConstructL (TBool aUseWsp, MWmlInterface* aWmlInterface, CWmlControl* aWmlControl ); |
|
501 TBrowserStatusCode DisplayDocument (); |
|
502 void DisplayError (NW_Int16 errorClass, NW_WaeError_t error); |
|
503 TBrowserStatusCode InitComponents (); |
|
504 TBrowserStatusCode InitializeClass (const NW_Osu_Hwnd_t hWnd); |
|
505 // check whether the charset is supported and whether its char converter is in the ROM |
|
506 NW_Bool IsConversionSupported(NW_Uint32 uid, NW_Bool * ConverterAvailable); |
|
507 static void NW_UI_DoDialogSelectOptionL( NW_Dlg_SelectData_t *data, void* callbackCtx, |
|
508 NW_Dlg_SelectCB_t* callback ); |
|
509 /* display a confirm dialog to the user */ |
|
510 static void NW_UI_WmlScriptDlgConfirmL (void *wae, const NW_Ucs2 *message, const NW_Ucs2 *yesMessage, |
|
511 const NW_Ucs2 *noMessage, void *callback_ctx, NW_Dlg_ConfirmCB_t *callback ); |
|
512 static void NW_UI_WmlScriptDlgPromptL( void* wae, const NW_Ucs2 *message, const NW_Ucs2 *defaultInput, |
|
513 HBufC*& aReturnedInput ); |
|
514 TInt SetBoxTree( NW_LMgr_Box_t* aBoxTree ); // just forwards call to CEpoc32View |
|
515 TBrowserStatusCode StartLoad (const NW_Text_t* url, NW_MVC_ILoadListener_t* loadListener, NW_Cache_Mode_t cacheMode); |
|
516 |
|
517 private: // Private member variables |
|
518 |
|
519 CView* iView; |
|
520 CBrCtl* iBrCtl; |
|
521 TBool iIsEpoc32ShellDestroyed;// The instance is set to true in the |
|
522 // destructor, and is used not to delegate |
|
523 CCnvCharacterSetConverter* iCharacterSetConverter; |
|
524 TUint iSelectedCharacterSet; |
|
525 TUint iCurrentConverter; |
|
526 CArrayFix<CCnvCharacterSetConverter::SCharacterSet>* iArrayOfCharacterSetsAvailable; |
|
527 |
|
528 NW_MVC_ILoadListener_t* iLoadListener; |
|
529 NW_Osu_Hwnd_t iHWnd; |
|
530 NW_HED_DocumentRoot_t* iDocumentRoot; |
|
531 NW_HED_DocumentNode_t* iPrevDocument; |
|
532 NW_Uint16 iNumUpdates; |
|
533 NW_Int16 iNumUpdatesPartial; |
|
534 NW_Uint16 iNumRelayouts; |
|
535 NW_Uint16 iNumRedraws; |
|
536 NW_Bool iDisplayDocumentInvoked ; |
|
537 TBool iSecureItemsInNonSecurePage; |
|
538 TBool iNonSecureItemsInSecurePage; |
|
539 |
|
540 NW_LMgr_Box_t* iBoxTree; |
|
541 |
|
542 /* Do background tasks */ |
|
543 CIdle* iIdle; |
|
544 |
|
545 CEmbeddedDocExitObserver* iDocExitObserver; |
|
546 TBool iExiting; |
|
547 |
|
548 // flag to indicate the file processed by document handler |
|
549 // e.g. unknowCH invoke docHanlder to open a .txt file |
|
550 TBool iFileOpenedByDocHandler; |
|
551 CWmlControl* iWmlControl; |
|
552 }; |
|
553 |
|
554 #endif |