browserui/browser/BrowserAppInc/BrowserAppUi.h
branchRCL_3
changeset 48 8e6fa1719340
equal deleted inserted replaced
47:6385c4c93049 48:8e6fa1719340
       
     1 /*
       
     2 * Copyright (c) 2002 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:  Header file for CBrowserAppUi
       
    15 *
       
    16 *
       
    17 */
       
    18 
       
    19 #ifndef __BROWSERAPPUI_H
       
    20 #define __BROWSERAPPUI_H
       
    21 
       
    22 // INCLUDE FILES 
       
    23 #include <browser_platform_variant.hrh>
       
    24 #include <aknviewappui.h>
       
    25 #include <connectionobservers.h>	// CHG!
       
    26 #include <apgcli.h>
       
    27 #include "ApiProvider.h"
       
    28 #include "BrowserBuild.h"
       
    29 #include "WmlBrowserBuild.h"
       
    30 #include <recenturlstore.h>
       
    31 
       
    32 #include <favouritesdb.h>
       
    33 #include <downloadedcontenthandler.h>
       
    34 #include "WindowInfoProvider.h"
       
    35 #include <browseroverriddensettings.h>
       
    36 #ifdef BRDO_IAD_UPDATE_ENABLED_FF
       
    37 #include <iaupdateobserver.h>
       
    38 #endif
       
    39 // FORWARD DECLARATIONS
       
    40 class CBrowserViewBase;
       
    41 class MCommsModel;
       
    42 class CBrowserCommsModel;
       
    43 class CBrowserPreferences;
       
    44 class CWmlBrowserBmOTABinSender;
       
    45 class CBrowserContentView;
       
    46 class CBrowserSoftkeysObserver;
       
    47 class CBrowserSpecialLoadObserver;
       
    48 class CBrowserAsyncExit;
       
    49 class CBrowserLauncherService;
       
    50 
       
    51 // Multiple Windows Support
       
    52 class CBrowserPopupEngine;
       
    53 class CBrowserWindow;
       
    54 class CBrowserWindowManager;
       
    55 class CBrowserBookmarksView;
       
    56 #ifdef __RSS_FEEDS
       
    57 	class CFeedsClientUtilities;
       
    58 #endif  // __RSS_FEEDS
       
    59 
       
    60 // CONSTANTS
       
    61 
       
    62 //
       
    63 // BROWSER UI KNOWN mime types
       
    64 //
       
    65 
       
    66 
       
    67 _LIT(KOPMLMimeType,      "text/x-opml");
       
    68 _LIT(KMimeTypeAppXML,    "application/xml");
       
    69 _LIT(KMimeTypeTextXML,   "text/xml");
       
    70 //++PK
       
    71 _LIT(KMimeTypeCapsTextXML,   "Text/xml");
       
    72 //++PK
       
    73 _LIT(KMimeTypeRSS,       "application/rss+xml");
       
    74 _LIT(KMimeTypeAtom,      "application/atom+xml");
       
    75 _LIT(KMimeTypeRDF,       "application/rdf+xml");
       
    76 
       
    77 
       
    78 class CBrowserPushMtmObserver;
       
    79 #ifdef BRDO_IAD_UPDATE_ENABLED_FF
       
    80 class CIAUpdate; 
       
    81 class CIAUpdateParameters;
       
    82 #endif
       
    83 // CLASS DECLARATION
       
    84 
       
    85 /**
       
    86 *  CBrowserAppUi.
       
    87 * 
       
    88 *  @lib Browser.app
       
    89 *  @since Series 60 1.2 
       
    90 */
       
    91 class CBrowserAppUi : public CAknViewAppUi,
       
    92                       public MApiProvider,
       
    93                       public MConnectionStageObserver,
       
    94                       public MDownloadedContentHandler,
       
    95                       public MWindowInfoProvider
       
    96 					#ifdef BRDO_IAD_UPDATE_ENABLED_FF
       
    97                      ,public MIAUpdateObserver
       
    98 					#endif
       
    99     {
       
   100     public:     // Constructors and destructor
       
   101         /**
       
   102         * Default constructor.
       
   103         */
       
   104         CBrowserAppUi();
       
   105 
       
   106         /**
       
   107         * Destructor.
       
   108         */
       
   109         ~CBrowserAppUi();
       
   110 
       
   111     public:
       
   112 #if defined(__S60_50__)
       
   113         /**
       
   114         * Handling the system Event.
       
   115         * @since Series 60 1.2
       
   116         * @param aEvent The System event passed.
       
   117         */
       
   118                 
       
   119         void HandleSystemEventL(const TWsEvent& aEvent);
       
   120 #endif          
       
   121         /**
       
   122         * Get the active view.
       
   123 		* @since Series 60 1.2
       
   124         * @return The current view.
       
   125         */
       
   126         CBrowserViewBase* ActiveView();
       
   127 
       
   128         /**
       
   129         * Checking if user wants to disconnect.
       
   130 		* @since Series 60 1.2
       
   131         * @param aUserInitiated it can be closed by user or the system.
       
   132         */
       
   133         void ExitBrowser( TBool aUserInitiated );
       
   134 
       
   135         /**
       
   136         * Calls views' method (ALWAYS changes the view's CBA).
       
   137 		* @since Series 60 1.2
       
   138         */
       
   139         void UpdateCbaL();
       
   140 
       
   141         /**
       
   142         * Handles commandline parameters.
       
   143 		* @since Series 60 1.2
       
   144         * @param aDocumentName Parameter string
       
   145         * @param aDoFetch Indicates that this function shoud fetch the given
       
   146         *                 URL. This parameter is required and used 
       
   147         *                 by new embedding architecture.
       
   148         */
       
   149         void ParseAndProcessParametersL( const TDesC8& aDocumentName, TBool aDoFetch = ETrue );
       
   150 
       
   151         /**
       
   152         * Wait a while, contentview initializing itself
       
   153 		* @since Series 60 3.2
       
   154         */
       
   155         void WaitCVInit();
       
   156         /**
       
   157         * Set flag to ETrue if called from another application.
       
   158 		* @since Series 60 1.2
       
   159         * @param aValue Is browser called from some another App.
       
   160         */
       
   161         void SetCalledFromAnotherApp( TBool aValue );
       
   162 
       
   163         /**
       
   164         * Get flag if called from another application.
       
   165 		* @since Series 60 3.1
       
   166 		* @return Etrue if browser is called from some another App.
       
   167         */
       
   168         TBool CalledFromAnotherApp();
       
   169 
       
   170         /**
       
   171         * Override CAknViewAppUi::ProcessCommandL.  Calls CAknAppUi::StopDisplayingMenuBar() before iView one.
       
   172 		* @since Series 60 
       
   173         * @param aCommand GUI command
       
   174         */
       
   175         void ProcessCommandL(TInt aCommand);
       
   176 
       
   177         /** 
       
   178         * Get the instance of the browser UI.
       
   179 		* @since Series 60 1.2
       
   180         * @return The browser UI.
       
   181         */
       
   182         static CBrowserAppUi* Static();
       
   183 
       
   184         /**
       
   185         * Contentview.
       
   186 		* @since Series 60 1.2
       
   187         */
       
   188         CBrowserContentView* ContentView() const;
       
   189 
       
   190         /**
       
   191 		* Check Operator Menu or Video Services status
       
   192 		* @since Series 60 2.0
       
   193 		* @return ETrue if browser is running in Operator Menu or Video Services app
       
   194 		*/
       
   195 		TBool IsEmbeddedInOperatorMenu() const;
       
   196 
       
   197 		/**
       
   198 		* Check if avkon appshutter is running
       
   199 		* @since Series60 2.0
       
   200 		* @return ETrue if avkon appshutter is running
       
   201 		*/
       
   202 		TBool IsAppShutterActive() const;
       
   203 
       
   204 		/**
       
   205 		* Returns value of iSomeItemsNotSecure member 
       
   206 		* @since Series60 2.0
       
   207 		* @return ETrue if some items is unsecure in page
       
   208 		*/
       
   209         TBool SomeItemsNotSecure() const;
       
   210 
       
   211         /**
       
   212         * Fetch the home page
       
   213         */
       
   214         void FetchHomePageL();
       
   215 
       
   216         /**
       
   217         * Check if the application is in foreground
       
   218         * @return ETrue if application is in foreground
       
   219         */
       
   220         inline TBool IsForeGround() const
       
   221             { return iIsForeground; }
       
   222 
       
   223         /**
       
   224         * Sets a private status to indicate that Browser has to use
       
   225         * a special exiting method.
       
   226         */
       
   227         inline void SetExitFromEmbeddedMode( TBool aFlag )
       
   228             { iExitFromEmbeddedMode = aFlag; }
       
   229 
       
   230         /**
       
   231         * Sets a the uid of the embedding application if the
       
   232         * Browser is embedded.
       
   233         */
       
   234         inline void SetEmbeddingAppliacationUid( TUid aEmbeddingApplicationUid )
       
   235         	{ iEmbeddingApplicationUid = aEmbeddingApplicationUid; }
       
   236 
       
   237         inline void SetBrowserLauncherService( CBrowserLauncherService* aBrowserLauncherService )
       
   238             { iBrowserLauncherService = aBrowserLauncherService; }
       
   239 
       
   240         inline CBrowserLauncherService* BrowserLauncherService() const
       
   241             { return iBrowserLauncherService; }
       
   242 
       
   243         void CloseWindowL( TInt aWindowId = 0 );
       
   244 
       
   245         inline CBrowserBookmarksView* GetBookmarksView()
       
   246             { return iBookmarksView; }
       
   247             
       
   248         void OpenLinkInNewWindowL( const CFavouritesItem& aBookmarkItem );
       
   249 
       
   250         /**
       
   251         * Launching HomePage (AP home page, or user-defined home page).
       
   252         */
       
   253         void LaunchHomePageL();
       
   254 
       
   255         /**
       
   256         * Set home page found flag
       
   257         * @param aPgNotFoundFlag: indicate if home page is found or not.
       
   258         */
       
   259         void SetPgNotFound(TBool aPgNotFoundFlag) {iPgNotFound = aPgNotFoundFlag;};
       
   260 
       
   261         /**
       
   262         * Catch any key presses that are Application wide.  Called from OfferKeyEventL() in view containers
       
   263         * @param aKeyEvent: 
       
   264         * @param aType:
       
   265         */
       
   266 		TKeyResponse OfferApplicationSpecificKeyEventL(const TKeyEvent& aKeyEvent,TEventCode aType);
       
   267 
       
   268         /**
       
   269         * Sets requested AP.
       
   270         * @param aAp the AP to use when connectionneeded is called.
       
   271         */
       
   272         void SetRequestedAP( TInt aAp );
       
   273 
       
   274  		/**
       
   275         * Gets the currently focused image, and saves it to Gallery.
       
   276         */
       
   277         void SaveFocusedImageToGalleryL();
       
   278 
       
   279         /**
       
   280         * Check if shutdown was requested.
       
   281         * @return ETrue if shutdown was requested.
       
   282         */
       
   283         TBool IsShutdownRequested() const;
       
   284 
       
   285         /**
       
   286         * Check if a progress bar is shown.
       
   287         * @return ETrue if progress bar is shown.
       
   288         */
       
   289         TBool IsProgressShown() const;
       
   290 
       
   291         /**
       
   292         * Sets prograss bar showing status.
       
   293         * @param ETrue to show, EFalse to hide the progress bar
       
   294         */
       
   295         void SetProgressShown( TBool aProgressShown );
       
   296 
       
   297 		/** 
       
   298 		* Check if RFile content should be handled
       
   299 		* by BrowserUI rather than sent off to BrCtl
       
   300 		* @return ETrue if it should be handled by BrowserUI
       
   301 		* @param an RFile filehandle, and an allocated buffer to hold
       
   302 		*   discovered mime type
       
   303 		*/
       
   304 		TBool CBrowserAppUi::RecognizeUiFileL( RFile& aFileHandle, TBuf<KMaxDataTypeLength>& aDataTypeDes );
       
   305 			
       
   306 		/** 
       
   307 		* Confirm with the user that a file should be handled by
       
   308 		* BrowserUI according to it's mime type with appropriate
       
   309 		* dialogs, etc. The name is used for the dialogs
       
   310 		* @return ETrue if yes, EFalse otherwise
       
   311 		* @param a filename to be shown in dialog, and a mime type
       
   312 		*   to switch on so we can show different dialogs in different situations 
       
   313 		*/
       
   314 		TBool ConfirmUiHandlingL( TFileName& aFilename, TBuf<KMaxDataTypeLength>& aDataTypeDes );
       
   315 
       
   316 		/** 
       
   317 		* Given a file handle (RFile) and a file path,
       
   318 		* copy the contents of the RFile to the file path given
       
   319 		* @return void
       
   320 		* @param a filehandle RFile, and a path to copy the contents to
       
   321 		*/ 
       
   322 		void CopyUiRFileToFileL( RFile& aFile, const TDesC& aFilepath );
       
   323 
       
   324 		/** 
       
   325 		* Handle a file that BrowserUi can process (as opposed to
       
   326 		* BrCtl)
       
   327 		* This will also setup views accordingly (the setup may be different from the HandleUiDownload case)
       
   328 		* @return void
       
   329 		* @param the full path of the filename to be handled and the mime type
       
   330 		*   so that handling can be different for different mime types
       
   331 		*/
       
   332 		void HandleUiFileL( TFileName& aFilepath, TBuf<KMaxDataTypeLength>& aDataTypeDes );
       
   333 		
       
   334 		/** 
       
   335 		* Handle a file that BrowserUi can process that is downloaded from the content view
       
   336 		* This will also setup views accordingly (the setup may be different from the HandleUiFile case)
       
   337 		* @return void
       
   338 		* @param the full path of the filename to be handled and the mime type
       
   339 		*   so that handling can be different for different mime types
       
   340 		*/
       
   341 		void HandleUiDownloadL( TFileName& aFilepath, TBuf<KMaxDataTypeLength>& aDataTypeDes );
       
   342 	
       
   343 		/**
       
   344 		* Launch the browser so that it starts directly into the feeds view
       
   345 		* @return void
       
   346 		* @param none
       
   347 		*/
       
   348 		void LaunchIntoFeedsL();
       
   349 
       
   350     public: // From CEikAppUi
       
   351         /**
       
   352         * Handles user commands.
       
   353         * @param aCommand Command to be handled.
       
   354         */
       
   355         void HandleCommandL( TInt aCommand );
       
   356         void HandleWsEventL(const TWsEvent& aEvent,CCoeControl* aDestination);
       
   357 
       
   358     public: // Functions from MApiProvider
       
   359 
       
   360         /**
       
   361         * Returns reference to the implementation of MDisplay.
       
   362         * @return An implementation of MDisplay.
       
   363         */
       
   364         MDisplay& Display() const;
       
   365 
       
   366         /**
       
   367         * Returns a reference to the implementaion of MConnection,
       
   368         * through wich some high-level connection specific data can be set.
       
   369         * @return reference to MConnection object.
       
   370         */
       
   371         MConnection& Connection( ) const;
       
   372 
       
   373         /**
       
   374         * Returns reference to the implementation of MPrefences.
       
   375         * @return An implementation of MPrefences.
       
   376         */
       
   377         MPreferences& Preferences() const;
       
   378 
       
   379         /**
       
   380         * Returns reference to the implementation of MCommsModel.
       
   381         * @return An implementation of MCommsModel.
       
   382         */
       
   383         MCommsModel& CommsModel() const;
       
   384 
       
   385         /**
       
   386         * Returns reference to the CBrCtlInterface
       
   387 		* @return A reference to CBrCtlInterface
       
   388         */
       
   389 		CBrCtlInterface& BrCtlInterface() const;
       
   390 
       
   391 		/**
       
   392         * Returns reference to CBrowserLoadObserver.
       
   393         * @return An implementation of MBrCtlLoadEventObserver
       
   394         */
       
   395 		CBrowserLoadObserver& LoadObserver() const;
       
   396 
       
   397 	    /**
       
   398         * Returns reference to CBrowserLoadObserver.
       
   399         * @return An implementation of MBrCtlLoadEventObserver
       
   400         */
       
   401 		CBrowserSpecialLoadObserver& SpecialLoadObserver() const;
       
   402 
       
   403 		CBrowserSoftkeysObserver& SoftkeysObserver() const;
       
   404 
       
   405 		/**
       
   406         * Returns reference to CBrowserDialogsProvider.
       
   407         * @return An implementation of MBrCtlDialogsProvider
       
   408         */
       
   409 		CBrowserDialogsProvider& DialogsProvider() const;
       
   410 
       
   411         CBrowserPopupEngine& PopupEngine() const;
       
   412 
       
   413         /**
       
   414         * Returns reference to the implementation of MBmOTABinSender.
       
   415         * @return An implementation of MBmOTABinSender.
       
   416         */
       
   417         MBmOTABinSender& BmOTABinSenderL();
       
   418 
       
   419 
       
   420         /**
       
   421         * Returns reference to the implementation of MStartPageHandler.
       
   422         * @return An implementation of MStartPageHandler.
       
   423         */
       
   424         CBrowserWindowManager& WindowMgr() const;
       
   425 
       
   426         /**
       
   427         *
       
   428         */
       
   429         inline TBool StartedUp() const { return iStartedUp; };
       
   430 
       
   431         /**
       
   432         *
       
   433         */
       
   434         void ConnNeededStatusL( TInt aErr );
       
   435 
       
   436         /**
       
   437         * Checks the last used AP.
       
   438         * @return the Id of the last used AP.
       
   439         */
       
   440         inline TUint32 RequestedAp() const { return iRequestedAp; }
       
   441 
       
   442         /**
       
   443         * In some cases it's not permitted to cancel fetching process.
       
   444         * @return ETrue if cancelling fetch is allowed, otherwise EFalse.
       
   445         */
       
   446         TBool IsCancelFetchAllowed() const;
       
   447 
       
   448         /**
       
   449         * Sets uid which should be activated if needed.
       
   450         * If not, it activates view immediately.
       
   451         * @param aUid Uid of the view.
       
   452         * @param aMessageId Id of the message.
       
   453         */
       
   454         void SetViewToBeActivatedIfNeededL( TUid aUid, TInt aMessageId = 0 );
       
   455 
       
   456         /**
       
   457         * Returns the Uid of the last visited Uid.
       
   458         * @return Uid of the last used view.
       
   459         */
       
   460         TUid LastActiveViewId() const;
       
   461 
       
   462         /**
       
   463         * Sets uid of the last used view.
       
   464         * @param aUid Uid of the latest used view.
       
   465         */
       
   466         void SetLastActiveViewId( TUid aUid );
       
   467 
       
   468 
       
   469         /**
       
   470         * Gets uid of the current view.
       
   471         * @param none
       
   472         * @return TUid of the current view
       
   473         */
       
   474         TUid GetCurrentViewId() const 
       
   475             {
       
   476             return iCurrentView;
       
   477             }
       
   478             
       
   479         /**
       
   480         * Set the View for in which the last CBA update was made
       
   481         * @since 5.0
       
   482         */
       
   483         void SetLastCBAUpdateView( TUid aView ) { iLastCBAUpdateView = aView; }
       
   484 		
       
   485         /**
       
   486         * Get the view in which the last CBA update was made
       
   487         * @since 5.0
       
   488         * @return TUid of last view for which CBA was updated
       
   489         */
       
   490         TUid GetLastCBAUpdateView() { return iLastCBAUpdateView; }
       
   491 
       
   492         /**
       
   493         * Tells if Browser is in the middle of a shutdown process.
       
   494         * @return ETrue if the app is being closed, otherwise with EFalse.
       
   495         */
       
   496         TBool ExitInProgress() const;
       
   497 
       
   498         /**
       
   499         * Sets a flag in Browser to indicate shutdown process.
       
   500         * @param aValue ETrue if exit process will be started, otherwise EFalse.
       
   501         */
       
   502         void SetExitInProgress( TBool aValue );
       
   503 
       
   504         /**
       
   505         * Is Browser connection procedure ongoing or not.
       
   506         * @return ETrue if connection procedure is ongoing, otherwise EFalse.
       
   507         */
       
   508         TBool IsConnecting() const;
       
   509 
       
   510         /**
       
   511         * Updates progress bar in contentview.
       
   512         * @param aStatusMsg Progress bar text.
       
   513         */
       
   514         void UpdateNaviPaneL( TDesC& aStatusMsg );
       
   515 
       
   516         /**
       
   517         * Set view to return to when closing the content view.
       
   518         * @since Series60 1.2
       
   519         * @param aUid View uid
       
   520         */
       
   521         void SetViewToReturnOnClose( TUid const &aUid );
       
   522 
       
   523         /**
       
   524         * Close the content view by activating the bookmarks view
       
   525         * @since Series60 1.2
       
   526         */
       
   527         void CloseContentViewL();
       
   528 		
       
   529 		/**
       
   530         * Tells if Browser is in the embedded mode
       
   531         * @return ETrue if the Browser is in the embedded mode, 
       
   532         * otherwise with EFalse.
       
   533 		*/
       
   534 		TBool IsEmbeddedModeOn() const;
       
   535 
       
   536         /**
       
   537         * Starts prefrences view if no valid ap 
       
   538         * @since Series60 2.0
       
   539         * @return ETrue if access point has been set otherwise EFalse.
       
   540         */
       
   541         TBool StartPreferencesViewL( TUint aListItems );
       
   542         
       
   543 		/**
       
   544         * Gives back a pointer to the Recent Url Store
       
   545         * @return iRecentUrlStore
       
   546 		*/
       
   547         CRecentUrlStore* RecentUrlStore();
       
   548 
       
   549 		/**
       
   550         * Returns ETrue if at least one page has been loaded.
       
   551         * @return   ETrue if at least one page has been loaded.\n
       
   552         *           EFalse if no pages has been loaded.
       
   553         */
       
   554         TBool IsPageLoaded();
       
   555 
       
   556 		/**
       
   557         * Returns fetching status.
       
   558         * @return   ETrue if there is a fetch going on.\n 
       
   559         *           EFalse otherwise.
       
   560         */
       
   561         TBool Fetching() const;
       
   562 
       
   563         /**
       
   564         * Checks if the content of a new page is displayed.
       
   565         * @return ETrue if the content is displayed.
       
   566         *         EFalse otherwise.
       
   567         * (useful for zooming while page is loading)
       
   568         */
       
   569         TBool ContentDisplayed() const;
       
   570 
       
   571        /**
       
   572         * Sets the content displayed status
       
   573         * (useful for zooming while page is loading)
       
   574         */
       
   575         void SetContentDisplayed( TBool aValue );
       
   576 
       
   577         /**
       
   578         * Initiate fetching of bookmark.
       
   579         * @param aBookmarkUid  Uid of bookmark to fetch.
       
   580         */
       
   581         void FetchBookmarkL( TInt aBookmarkUid );
       
   582 
       
   583 		/**
       
   584         * Initiate fetching of bookmark.
       
   585         * @param aBookmarkItem Bookmark item to fetch.
       
   586         */
       
   587         void FetchBookmarkL( const CFavouritesItem& aBookmarkItem );
       
   588 
       
   589 		/**
       
   590         * Initiate fetching of URL.
       
   591         * @param aUrl URL to fetch.
       
   592         * @param aUserName User name.
       
   593         * @param aPassword Password.
       
   594         * @param aAccessPoint AccessPoint.
       
   595         */
       
   596         void FetchL
       
   597             (
       
   598             const TDesC& aUrl,
       
   599             const TDesC& aUserName,
       
   600             const TDesC& aPassword,
       
   601             const TFavouritesWapAp& aAccessPoint,
       
   602             CBrowserLoadObserver::TBrowserLoadUrlType aUrlType
       
   603                 = CBrowserLoadObserver::ELoadUrlTypeOther
       
   604             );
       
   605 
       
   606         /**
       
   607         * Initiate fetching of URL with default AP, empty username and password.
       
   608         * @param aUrl URL to fetch.
       
   609         */
       
   610         void FetchL( const TDesC& aUrl, CBrowserLoadObserver::TBrowserLoadUrlType aUrlType
       
   611             = CBrowserLoadObserver::ELoadUrlTypeOther );
       
   612 
       
   613 		/**
       
   614         * Cancel fetching.
       
   615         */
       
   616         void CancelFetch( TBool aIsUserInitiated = EFalse );
       
   617 
       
   618 		/**
       
   619 		* Starts animation.
       
   620 		*/
       
   621 		void StartProgressAnimationL();
       
   622 
       
   623 		/**
       
   624 		* Stops animation.
       
   625 		*/
       
   626 		void StopProgressAnimationL();
       
   627 	
       
   628 		/*
       
   629 		* Return True if browser was launched especially into feeds view
       
   630 		*/
       
   631 		TBool BrowserWasLaunchedIntoFeeds() { return(iOverriddenLaunchContextId == EBrowserContextIdFeeds); }
       
   632 
       
   633 		/*
       
   634 		* record the overridden launch context id
       
   635 		*/
       
   636 		void SetOverriddenLaunchContextId(TUint aId) { iOverriddenLaunchContextId = aId; }
       
   637 
       
   638 
       
   639 #ifdef __RSS_FEEDS
       
   640         /**
       
   641         * Returns reference to FeedsClientUtilities.
       
   642         */
       
   643         CFeedsClientUtilities& FeedsClientUtilities() const;
       
   644 #endif  // __RSS_FEEDS
       
   645 
       
   646 
       
   647  		/**
       
   648         * Returns the Uid of the previous active view from the view history.
       
   649         * @return Uid of the previous active view.
       
   650         */
       
   651 		TUid GetPreviousViewFromViewHistory();
       
   652 
       
   653         /**
       
   654         * Return if Flash plugin is present in the system or not
       
   655         * @param none
       
   656         * @return TBool
       
   657         */
       
   658         TBool FlashPresent( );
       
   659         
       
   660 				
       
   661 		/**
       
   662 		* Check state of LaunchHomePage command for dimmed state in options menu and shortcut keymap
       
   663 		* @return ETrue is LaunchHomePage command should be dimmed in options menu and shortcut keymap
       
   664 		*         EFalse otherwise
       
   665 		* @param none
       
   666 		*/		
       
   667 		TBool IsLaunchHomePageDimmedL(); 
       
   668 		/**
       
   669 		* Check from CCoeAppUi if a Dialog or Menu is diplayed on top of the view
       
   670 		* @return ETrue if Dialog or Menu is displayed
       
   671 		*         EFalse otherwise
       
   672 		* @param none
       
   673 		*/		
       
   674 		TBool IsDisplayingMenuOrDialog();
       
   675 
       
   676 		/**
       
   677 		* Function to complete the delayed intialization of Browser
       
   678 		* @return ETrue if initialization was successful
       
   679 		*         EFalse otherwise
       
   680 		* @param none
       
   681 		*/	
       
   682         TBool CompleteDelayedInit();  
       
   683 		        
       
   684         
       
   685     public:  // from MWindowInfoProvider
       
   686 
       
   687         HBufC* CreateWindowInfoLC( const CBrowserWindow& aWindow ) ;
       
   688         void SwitchWindowL();
       
   689 
       
   690 		/**
       
   691 		* Initializes the browser, if it is in embedded mode.
       
   692 		* In embedded mode the browser is initialized later, not when it
       
   693 		* is constructed. First the browser must wait for the embedding
       
   694 		* application to send the startup parameters, and only after that
       
   695 		* can be initialized. This method is required and used by new
       
   696 		* embedding architecture.
       
   697 		*/       
       
   698 		void InitBrowserL(); 
       
   699 		
       
   700         /* This method is used for normal startup and when the first view is Bookmarks. 
       
   701          * In order to show the Bookmarks view, initialize only bookmarks and delay the
       
   702          * remaining initialization. 
       
   703          */
       
   704 		void InitBookmarksL();
       
   705 		
       
   706         /* This method is used for normal startup and when the first view is Bookmarks. 
       
   707          * This method includes intialization stuff which are not necessary for Bookmarks
       
   708          * view. This is done using async CIdle approach. 
       
   709          */
       
   710 		void DelayedInitL();		
       
   711 		
       
   712         /**
       
   713         * From CAknViewAppUi, CEikAppUi
       
   714         * Handles changes in keyboard focus when an 
       
   715         * application switches to foreground
       
   716         * @param aForeground Is foreground event?
       
   717         */
       
   718         void HandleForegroundEventL( TBool aForeground );
       
   719 		
       
   720 			public: // From MDownloadedContentHandler
       
   721 	
       
   722         virtual TBool HandleContentL( const TDesC& aFileName, 
       
   723                                       const CAiwGenericParamList& aParamList, 
       
   724                                       TBool& aContinue );
       
   725 
       
   726         virtual TAny* DownloadedContentHandlerReserved1( TAny* /*aAnyParam*/ );
       
   727 
       
   728         void SetContentHandlingResult( TBool aClientWantsToContinue, TBool aWasContentHandled );
       
   729 
       
   730         /**
       
   731         * Loads the defined search page into content view.
       
   732         */
       
   733         void LoadSearchPageL();
       
   734         
       
   735         // This member is public, so BrowserLauncher.dll can close the browser.
       
   736         CBrowserAsyncExit *iBrowserAsyncExit;
       
   737     public:
       
   738         void StopConnectionObserving();
       
   739 
       
   740 #ifdef BRDO_OCC_ENABLED_FF
       
   741         //Retry flags
       
   742         void SetRetryFlag(TBool flag);
       
   743         TBool GetRetryFlag();
       
   744 #endif
       
   745 
       
   746 	private:    
       
   747 	
       
   748         /**
       
   749         *Callback for late constructing of the SendUi in idle
       
   750         *Needed to provide better response time for the user
       
   751         *@return  Returns 0
       
   752         */
       
   753         static TInt DelayedSendUiConstructL(TAny* aCBrowserAppUi);
       
   754 
       
   755 
       
   756         /**
       
   757         * Calls ProcessCommandParametersL with the given parameters.
       
   758         * @param aParams startup parameter (will be casted).
       
   759         * @return Returns 0 (called only once).
       
   760         */
       
   761         //static TInt DelayedProcessParametersL( TAny* aParams );
       
   762 
       
   763         /**
       
   764         * Callback function for CIdle. Calls DoStopDelay.
       
   765         * @param aCBrowserAppUi 
       
   766         * @return Returns 0 (called only once).
       
   767         */
       
   768         static TInt StopDelay( TAny* aCBrowserAppUi);
       
   769 
       
   770         /**
       
   771         * Stops CActiveSchedulerWait loop started 
       
   772         * by ParseAndProcessParametersL().
       
   773         */
       
   774         void DoStopDelay();
       
   775 
       
   776         /**
       
   777         *Construct SendUI now
       
   778         */
       
   779         void DoConstructSendUiL();
       
   780 
       
   781         /*
       
   782         * Changes the connection
       
   783         * @param 
       
   784         * @return None.
       
   785         */
       
   786         void ChangeConnectionL();
       
   787 
       
   788         /*
       
   789         * send disconnect event to multiple windows
       
   790         */
       
   791         void SendDisconnectEventL();
       
   792 
       
   793         /**
       
   794         * Check if Flash plugin is present in the system or not
       
   795         * @param none
       
   796         * @return TBool
       
   797         */
       
   798         TBool CheckFlashPresent( );
       
   799 
       
   800 
       
   801         /**
       
   802         * Checks if a HomePage will be launched
       
   803         * @param none
       
   804         * @return TBool - ETrue if no homepage will be launched otherwise return EFalse
       
   805         */
       
   806         TBool NoHomePageToBeLaunchedL();
       
   807 
       
   808         /**
       
   809         * Show the name of browser and version of the browser
       
   810         * @param none
       
   811         */
       
   812 		void ShowNameAndVersionL();
       
   813 		
       
   814 		/**
       
   815 		* There's a homepage to be launched so start in content view
       
   816 		* [Convenience function that gets used in 2 places]
       
   817         * @param none
       
   818         */		
       
   819 		void StartFetchHomePageL();		
       
   820         TBool IsSameWinApp(TUid aMessageUid);
       
   821 #ifdef BRDO_OCC_ENABLED_FF
       
   822         //For Call back for reconnectivity
       
   823         static TInt RetryConnectivity(TAny* aCBrowserAppUi);
       
   824         TInt RetryInternetConnection();		
       
   825         void CheckOccConnectionStage();
       
   826 #endif
       
   827 
       
   828 #ifdef BRDO_IAD_UPDATE_ENABLED_FF
       
   829 		/**
       
   830         * Check updates
       
   831         */
       
   832         void CheckUpdatesL(); 
       
   833 
       
   834         /**
       
   835         * Clean IAD update parameters
       
   836         */
       
   837         void CleanUpdateParams(); 
       
   838 
       
   839         /**
       
   840         * This callback function is called when the update checking operation has completed.
       
   841         *
       
   842         * @param aErrorCode The error code of the observed update operation.
       
   843         *                   KErrNone for successful completion,
       
   844         *                   otherwise a system wide error code.
       
   845         * @param aAvailableUpdates Number of the updates that were found available.
       
   846         */
       
   847         void CheckUpdatesComplete( TInt aErrorCode, TInt aAvailableUpdates );
       
   848 
       
   849         /**
       
   850         * This callback function is called when an update operation has completed.
       
   851         *
       
   852         * @param aErrorCode The error code of the completed update operation.
       
   853         *                   KErrNone for successful completion,
       
   854         *                   otherwise a system wide error code.
       
   855         * @param aResult Details about the completed update operation.
       
   856         *                Ownership is transferred.
       
   857         */
       
   858         void UpdateComplete( TInt aErrorCode, CIAUpdateResult* aResultDetails );
       
   859 
       
   860 		/**
       
   861         * This callback function is called when an update query operation has completed.
       
   862         *
       
   863         * @param aErrorCode The error code of the observed query operation.
       
   864         *                   KErrNone for successful completion,
       
   865         *                   otherwise a system wide error code.
       
   866         * @param aUpdateNow ETrue informs that an update operation should be started.
       
   867         *                   EFalse informs that there is no need to start an update
       
   868         *                   operation.
       
   869         */
       
   870         void UpdateQueryComplete( TInt aErrorCode, TBool aUpdateNow ){return;}
       
   871 
       
   872         /**
       
   873         * This function is checking the existence of the file containing last update time
       
   874         * @param None
       
   875         * @return TBool.
       
   876         */
       
   877         TBool CheckUpdateFileAvailable();
       
   878         
       
   879         /**
       
   880         * This function is deleting of the file(if exist) containing last update time
       
   881         * @param None
       
   882         * @return None.
       
   883         */
       
   884         void DeleteUpdateFile();
       
   885         
       
   886         /**
       
   887         * This function is will write the current time in file
       
   888         * @param None
       
   889         * @return None.
       
   890         */
       
   891         void WriteUpdateFile();
       
   892         
       
   893         /**
       
   894         * This function will read the content of the file if it exists
       
   895         * @param None
       
   896         * @return TBool.
       
   897         */
       
   898         TInt64 ReadUpdateFile();
       
   899         
       
   900         /**
       
   901         * Callback function to complete the IAD udated check on CIdle::RunL
       
   902         * @param None
       
   903         * @return TBool.
       
   904         */
       
   905         static TInt CompleteIADUpdateCallback( TAny* aBrowserAppUi );
       
   906 #endif		    
       
   907 	protected:
       
   908 
       
   909         /**
       
   910         * Symbian OS constructor.
       
   911         */
       
   912         void ConstructL();
       
   913 		
       
   914         /**
       
   915         * Sends Browser to the background. The task whose window group 
       
   916         * is at the next ordinal position is brought up to the foreground.
       
   917         */
       
   918         void SendBrowserToBackground();
       
   919 
       
   920         /**
       
   921         *
       
   922         */
       
   923         void DelayedConstructL();
       
   924 
       
   925         /**
       
   926         * Clear the cache.
       
   927         */
       
   928         void ClearTheCacheL(TBool afterQuery = EFalse, TBool aShowDoneNote = ETrue);
       
   929 
       
   930 
       
   931         /**
       
   932         * Delete cookies.
       
   933         */
       
   934         void DeleteCookiesL();
       
   935 
       
   936         
       
   937         /**
       
   938         * Delete Form and Password Data
       
   939         * @param aShowPromptAndComplete - show confirmation prompt and completion info note if True
       
   940         */
       
   941         void ClearFormAndPasswdDataL(TBool aShowPromptAndComplete);
       
   942 
       
   943 
       
   944         /**
       
   945         * Clear History of all open windows
       
   946         */
       
   947         void CBrowserAppUi::ClearHistoryL();
       
   948         
       
   949         
       
   950         /**
       
   951         * Prompt before clearing history
       
   952         */
       
   953         void CBrowserAppUi::ClearHistoryWithPromptL();
       
   954 
       
   955         
       
   956         /**
       
   957         * Clear All Privacy Data
       
   958         */
       
   959         void CBrowserAppUi::ClearAllPrivacyL();
       
   960 
       
   961         /**
       
   962         * Disconnect.
       
   963         */
       
   964         void DisconnectL();
       
   965 
       
   966 		/**
       
   967 		* Updates the soft keys. Previously a callback in ViewShellObserver
       
   968 		*/
       
   969 		void UpdateSoftKeys();
       
   970         /**
       
   971         * Logs a record of opened pages to Recent Url Store
       
   972         */
       
   973 		void LogAccessToRecentUrlL( CBrCtlInterface& aBrCtlInterface );
       
   974 
       
   975         /**
       
   976         * Logs a record of requested pages to Recent Url Store
       
   977         */
       
   978 		void LogRequestedPageToRecentUrlL( const TDesC& aUrl );
       
   979    
       
   980         /**
       
   981         * Load previous page from history (back button)
       
   982         * @since Series60 1.2
       
   983         */
       
   984         void HistoryLoadPrevious();
       
   985 
       
   986         /**
       
   987         * Load next page from history (forward button)
       
   988         * @since Series60 1.2
       
   989         */
       
   990         void HistoryLoadNext();
       
   991 
       
   992         /**
       
   993         * Creating a full url containing username, password, 
       
   994         * server domain and document path.
       
   995         * @return buffer pointing to the url
       
   996         */
       
   997         HBufC* CreateFullUrlLC( const TDesC& aUrl,
       
   998                                 const TDesC& aUsername,
       
   999                                 const TDesC& aPassword );
       
  1000 
       
  1001 
       
  1002     protected:  // from MConnectionStageObserver
       
  1003         /**
       
  1004         * Connection stage achieved. 
       
  1005         */
       
  1006         void ConnectionStageAchievedL();
       
  1007 
       
  1008     protected:  // From CAknViewAppUi, CEikAppUi
       
  1009 
       
  1010         /**
       
  1011         * Processes shell commands.
       
  1012         * @param aCommand Command to process.
       
  1013         * @return //TODO
       
  1014         */
       
  1015         TBool ProcessCommandParametersL(TApaCommand aCommand,TFileName& /*aDocumentName*/,const TDesC8& /*aTail*/ );
       
  1016 
       
  1017 
       
  1018         /**
       
  1019         * Handle the external message.
       
  1020         * @param aClientHandleOfTargetWindowGroup Handle.
       
  1021         * @param aMessageUid Message id.
       
  1022         * @param aMessageParameters Message parameters.
       
  1023         * @return Response to the message.
       
  1024         */
       
  1025         MCoeMessageObserver::TMessageResponse HandleMessageL( TUint32 aClientHandleOfTargetWindowGroup,
       
  1026                                                               TUid aMessageUid,
       
  1027                                                               const TDesC8& aMessageParameters );
       
  1028 
       
  1029         /**
       
  1030         * Handles screen resolution changes
       
  1031         */
       
  1032         void HandleResourceChangeL( TInt aType );
       
  1033 
       
  1034 		/**
       
  1035         * Handles application specific events like OOM from window server.
       
  1036         * @param aEventType The type of event.
       
  1037         * @param aWsEvent window server event.
       
  1038         * @return Key response.
       
  1039         */
       
  1040 		void HandleApplicationSpecificEventL(TInt aEventType, const TWsEvent& aWsEvent);
       
  1041 		
       
  1042     private:
       
  1043 
       
  1044         TUint32 iRequestedAp;
       
  1045         TBool iCalledFromAnotherApp;
       
  1046 
       
  1047         TBool iIsForeground;
       
  1048         TUid iViewToBeActivatedIfNeeded;
       
  1049         TUid iViewToReturnOnClose;
       
  1050 
       
  1051         TUid iLastViewId;
       
  1052         TBool iSecureSiteVisited;
       
  1053 
       
  1054 
       
  1055         CWmlBrowserBmOTABinSender* iSender;
       
  1056 
       
  1057         CConnectionStageNotifierWCB* iConnStageNotifier;
       
  1058 
       
  1059         CIdle* iIdle;   // at construction phase
       
  1060         CActiveSchedulerWait iWait;
       
  1061 
       
  1062         TBool   iExitInProgress;
       
  1063 
       
  1064         RSocketServ iSockServSess;
       
  1065 
       
  1066         TBool iShutdownRequested;
       
  1067 		TBool iHTTPSecurityIndicatorSupressed;
       
  1068 		CRecentUrlStore* iRecentUrlStore;
       
  1069 		TInt iParametrizedLaunchInProgress;  //ETrue when launch with parameters is in idling
       
  1070 
       
  1071         TBool iExitFromEmbeddedMode;
       
  1072 
       
  1073         // Flag to indicate that real downloading is
       
  1074         // going on ( we are not loading from cache )
       
  1075 
       
  1076         TBool iShowProgress;
       
  1077         TBool iLongZeroPressed;
       
  1078         TBool iStartedUp;
       
  1079         TBool iFeatureManager;
       
  1080         TBool iUserExit;
       
  1081 		TBool iPgNotFound;
       
  1082         TBool iSuppressAlwaysAsk;
       
  1083         TBool iFlashPresent;
       
  1084         TBool iSpecialSchemeinAddress;
       
  1085         
       
  1086         RFavouritesSession iFavouritesSess;
       
  1087 
       
  1088         // The Uid of the embedding application.
       
  1089         TUid iEmbeddingApplicationUid;
       
  1090         
       
  1091 		TUid iPreviousView;
       
  1092 		TUid iCurrentView;		
       
  1093 
       
  1094 		// Uid for tracking what view the last CBA update was made under,
       
  1095 		// used to avoid extraneous updates
       
  1096 		TUid iLastCBAUpdateView;		
       
  1097 
       
  1098         // Observing changes in PushMtm
       
  1099         CBrowserPushMtmObserver* iPushMtmObserver; // owned
       
  1100 		
       
  1101 		// Record browser launch's overridden context id
       
  1102 		TUint iOverriddenLaunchContextId;
       
  1103 		
       
  1104 		TBool iBrowserAlreadyRunning; 
       
  1105 		
       
  1106 #ifdef BRDO_OCC_ENABLED_FF
       
  1107         CPeriodic *iRetryConnectivity;
       
  1108         TBool reConnectivityFlag;
       
  1109 #endif		
       
  1110 
       
  1111 #ifdef BRDO_IAD_UPDATE_ENABLED_FF		
       
  1112         CIAUpdate* iUpdate;  
       
  1113         CIAUpdateParameters* iParameters; 
       
  1114         RFs iFs;
       
  1115         CIdle* iDelayedUpdate;
       
  1116 #endif        
       
  1117         TBool iSameWinApp;
       
  1118         TInt iWindowIdFromFromExternApp;
       
  1119 	protected:
       
  1120 
       
  1121 		CBrowserCommsModel* iCommsModel;
       
  1122         CBrowserPreferences* iPreferences;
       
  1123 
       
  1124         MConnection* iConnection;
       
  1125 
       
  1126 		CBrowserDialogsProvider* iDialogsProvider;
       
  1127         mutable CBrowserPopupEngine* iPopupEngine;
       
  1128         CBrowserLauncherService* iBrowserLauncherService; // Not owned
       
  1129         CActiveSchedulerWait iLauncherServiceWait;
       
  1130 		TBool iClientWantsToContinue;
       
  1131 		TBool iWasContentHandled;
       
  1132         RArray<TUint>* iZoomLevelArray;
       
  1133         TUint iCurrentZoomLevelIndex;
       
  1134         TUint iCurrentZoomLevel;
       
  1135 
       
  1136         CBrowserWindowManager* iWindowManager;
       
  1137 		CIdle* iLateSendUi;
       
  1138 		CBrowserBookmarksView* iBookmarksView; // not owned
       
  1139 #ifdef __RSS_FEEDS
       
  1140 		CFeedsClientUtilities* iFeedsClientUtilities;
       
  1141 #endif  // __RSS_FEEDS
       
  1142     };
       
  1143 #endif
       
  1144 
       
  1145 // End of File