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