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