browserui/browser/BrowserAppInc/BrowserWindow.h
changeset 0 84ad3b177aa3
child 24 868cceedabd3
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: 
       
    15 *      API provider.
       
    16 *  
       
    17 *
       
    18 */
       
    19 
       
    20 
       
    21 #ifndef __MULTIPLE_WINDOWS_WINDOW_H__
       
    22 #define __MULTIPLE_WINDOWS_WINDOW_H__
       
    23 
       
    24 // INCLUDES FILES
       
    25 #include "WmlBrowserBuild.h"
       
    26 #include <e32base.h>
       
    27 #include "ApiProvider.h"
       
    28 #include "Preferences.h"
       
    29 #include <BrCtlDefs.h>
       
    30 #include "BrowserLoadObserver.h"
       
    31 #include "BrowserDialogsProviderProxy.h"
       
    32 #include <BrCtlWindowObserver.h>
       
    33 
       
    34 // FORWARD DECLARATIONS
       
    35 class CBrCtlInterface;
       
    36 class CBrowserDisplay;
       
    37 class CBrowserSpecialLoadObserver;
       
    38 class CBrowserSoftkeysObserver;
       
    39 class CBrowserWindowManager;
       
    40 
       
    41 class MDisplay;
       
    42 class MConnection;
       
    43 class CBrowserDialogsProvider;
       
    44 class MBmOTABinSender;
       
    45 class CBrowserPopupEngine;
       
    46 
       
    47 // CLASS DECLARATION
       
    48 
       
    49 /**
       
    50 *  Interface to query several API implementations via Window class.
       
    51 *  
       
    52 *  @lib Browser.app
       
    53 *  @since Series 60 3.0
       
    54 */
       
    55 class CBrowserWindow :  public CBase,
       
    56                         public MApiProvider,
       
    57                         public MPreferencesObserver,
       
    58                         public MBrCtlWindowObserver
       
    59     {
       
    60     public:
       
    61         static CBrowserWindow* NewLC(
       
    62             TInt aWindowId,
       
    63             const TDesC* aTargetName,
       
    64             CBrowserWindowManager* aWindowMgr );
       
    65         static CBrowserWindow* NewL(
       
    66             TInt aWindowId,
       
    67             const TDesC* aTargetName,
       
    68             CBrowserWindowManager* aWindowMgr );
       
    69         ~CBrowserWindow();
       
    70 
       
    71     public:  // new functions
       
    72         
       
    73         /*
       
    74         * Return the window's id.
       
    75         */
       
    76         inline TInt WindowId() const
       
    77             { return iWindowId; }
       
    78 
       
    79         /*
       
    80         * Return the window's targetname.
       
    81         */
       
    82         inline const TDesC* TargetName() const
       
    83             { return iTargetName; }
       
    84 
       
    85         /*
       
    86         * Return the window's active status.
       
    87         */
       
    88         inline TBool IsWindowActive() const
       
    89             { return iActive; }
       
    90             
       
    91         /*
       
    92         * Activates this window, redraw it, updates title, etc.
       
    93         */
       
    94         void ActivateL( TBool aDraw = ETrue );
       
    95 
       
    96         /*
       
    97         * Deactivates this window.
       
    98         */
       
    99         void DeactivateL();
       
   100         
       
   101         /*
       
   102         * Returns a reference to the DialogsProviderProxy
       
   103         */
       
   104         inline CBrowserDialogsProviderProxy& DialogsProviderProxy() const
       
   105                                             { return *iDialogsProviderProxy; };
       
   106         /**
       
   107 		* To check that Page Overview feature is supported or not
       
   108 		* @since Series60 3.0
       
   109 		* @return Returns ETrue if feature is supported
       
   110 		*/
       
   111 		TBool IsPageOverviewSupportedL();
       
   112 		
       
   113         /*
       
   114         * Resets Page Overview setting as defined in Preferences.
       
   115         *  @since Series 60 3.0        
       
   116         */                                            
       
   117 		void ResetPageOverviewLocalSettingL();
       
   118 		
       
   119         /*
       
   120         * Temporarily changes the Page Overview setting.
       
   121         * This function does not change the Page Overview setting
       
   122         * in Preferences.
       
   123         * @since Series 60 3.0                
       
   124         */		
       
   125 		void FlipPageOverviewLocalSettingL();
       
   126 		
       
   127         /*
       
   128         * Changes the title pane text until the given interval.
       
   129         * @since Series 60 3.0                
       
   130         * @param aTitle The new text of the title pane
       
   131         * @param aInterval The interval while the new text will be shown on title pane
       
   132         */                                            
       
   133 		void ChangeTitlePaneTextUntilL( const TDesC& aTitle, TInt aInterval );
       
   134         
       
   135         /*
       
   136         * Set if window contains WML page(s).
       
   137         * @since Series 60 3.1                
       
   138         * @param aHasWMLContent 
       
   139         */                                            
       
   140         void SetHasWMLContent(TBool aHasWMLContent);
       
   141         
       
   142         /*
       
   143         * Set if current window contains WML page(s).
       
   144         * @since Series 60 3.1                
       
   145         * @param aCurrWinHasWMLContent 
       
   146         */                                            
       
   147         void SetCurrWinHasWMLContent(TBool aCurrWinHasWMLContent);
       
   148         
       
   149         /*
       
   150         * Returns wml content state for current page only or any page in window history based on param
       
   151         * @since Series 60 3.1                
       
   152         * @param aCurrWinOnly - If ETrue, Returns ETrue if current window has WML content.
       
   153         * 						If EFalse, Returns ETrue if any window in history has WML content.
       
   154         * @return TBool
       
   155         */                                            
       
   156         TBool HasWMLContent (TBool aCurrWinOnly);
       
   157         
       
   158         /*
       
   159         * Returns true if current window has Feeds content.
       
   160         * @since Series 60 3.1                
       
   161         * @return TBool
       
   162         */                                            
       
   163         TBool HasFeedsContent ()const { return iHasFeedsContent; };
       
   164         
       
   165         /*
       
   166         * Set if current page of window contains WML.
       
   167         * @since Series 60 3.1                
       
   168         * @param aWMLMode 
       
   169         */                                            
       
   170         void SetWMLMode(TBool aWMLMode);
       
   171         
       
   172         /*
       
   173         * Set if hisory needs to be cleared after loading next page.
       
   174         * @since Series 60 3.1                
       
   175         * @param aFirstPage 
       
   176         */                                            
       
   177         void SetFirstPage(TBool aFirstPage);
       
   178         
       
   179         /*
       
   180         * Set if current window contains Feeds Full Story.
       
   181         * Used to go back to feeds view when window is closed
       
   182         * @since Series 60 3.1                
       
   183         * @param aHasFeedsContent 
       
   184         */                                            
       
   185         void SetHasFeedsContent(TBool aHasFeedsContent);
       
   186         
       
   187         /*
       
   188         * Returns true if current page has WML content.
       
   189         * @since Series 60 3.1                
       
   190         * @return TBool
       
   191         */                                            
       
   192         TBool WMLMode ()const { return iWMLMode; };
       
   193         
       
   194         /*
       
   195         * Returns true if current page has images loaded.
       
   196         * @since Series 60 5.0
       
   197         * @return TBool
       
   198         */                                            
       
   199         TBool HasLoadedImages ()const { return iImagesLoaded; };
       
   200         
       
   201         /*
       
   202         * Set true if user selects current page to load images. false when page loads
       
   203         * @since Series 60 5.0
       
   204         * @param aImagesLoaded
       
   205         */                                            
       
   206         void SetImagesLoaded (TBool aImagesLoaded) { iImagesLoaded = aImagesLoaded; };
       
   207         
       
   208         
       
   209     public:  // from MApiProvider
       
   210     
       
   211         CBrCtlInterface&              BrCtlInterface() const ;
       
   212         MDisplay&                     Display() const ;
       
   213         CBrowserLoadObserver&         LoadObserver() const ;
       
   214         CBrowserSoftkeysObserver&     SoftkeysObserver() const ;
       
   215         CBrowserSpecialLoadObserver&  SpecialLoadObserver() const ;
       
   216         inline CBrowserWindowManager& WindowMgr() const 
       
   217             { return *iWindowManager; }
       
   218             
       
   219         MConnection& Connection() const;
       
   220         MPreferences& Preferences() const;
       
   221         MCommsModel& CommsModel() const;
       
   222         CBrowserDialogsProvider& DialogsProvider() const;
       
   223         MBmOTABinSender& BmOTABinSenderL();
       
   224         CBrowserPopupEngine& PopupEngine() const;
       
   225         
       
   226         void SetViewToBeActivatedIfNeededL( TUid aUid, TInt aMessageId = 0 );
       
   227         TBool IsCancelFetchAllowed() const;
       
   228         TUid LastActiveViewId() const;
       
   229         void SetLastActiveViewId( TUid aUid );
       
   230         TBool ExitInProgress() const;
       
   231         void SetExitInProgress( TBool aValue );
       
   232         TBool IsConnecting() const;
       
   233         void UpdateNaviPaneL( TDesC& aStatusMsg );
       
   234         void SetViewToReturnOnClose( TUid const &aUid );
       
   235         void CloseContentViewL();
       
   236         TBool IsEmbeddedModeOn() const;
       
   237         TBool IsShutdownRequested() const;
       
   238         void ExitBrowser(TBool aUserShutdown);
       
   239         TBool IsAppShutterActive() const;
       
   240         TBool StartPreferencesViewL( TUint aListItems );
       
   241         TBool IsPageLoaded();
       
   242         TBool IsForeGround() const;
       
   243         TBool Fetching() const;
       
   244         TBool ContentDisplayed() const;
       
   245         void  SetContentDisplayed( TBool aValue );
       
   246         void FetchBookmarkL( TInt aBookmarkUid );
       
   247         void FetchBookmarkL( const CFavouritesItem& aBookmarkItem );
       
   248         void FetchL(
       
   249 					const TDesC& aUrl,
       
   250 					const TDesC& aUserName,
       
   251 					const TDesC& aPassword,
       
   252 					const TFavouritesWapAp& aAccessPoint,
       
   253                     CBrowserLoadObserver::TBrowserLoadUrlType aUrlType
       
   254 					);
       
   255 		void FetchL( const TDesC& aUrl, CBrowserLoadObserver::TBrowserLoadUrlType aUrlType );
       
   256 		void CancelFetch( TBool aIsUserInitiated );
       
   257 		void SetRequestedAP( TInt aAp );
       
   258 		void SetExitFromEmbeddedMode( TBool aFlag );
       
   259         TBool IsProgressShown() const;
       
   260         void SetProgressShown( TBool aProgressShown );
       
   261         TBool StartedUp() const;
       
   262         TUint32 RequestedAp() const;
       
   263       	void LogAccessToRecentUrlL( CBrCtlInterface& aBrCtlInterface );
       
   264      	void LogRequestedPageToRecentUrlL( const TDesC& aUrl );
       
   265         void StartProgressAnimationL();
       
   266         void StopProgressAnimationL();
       
   267         #ifdef __RSS_FEEDS
       
   268         virtual CFeedsClientUtilities& FeedsClientUtilities() const;
       
   269 		#endif  // __RSS_FEEDS
       
   270 		TUid GetPreviousViewFromViewHistory();
       
   271 						
       
   272 		void SetLastCBAUpdateView( TUid aView );
       
   273 		TUid GetLastCBAUpdateView();
       
   274 		
       
   275         TBool FlashPresent();
       
   276         TBool IsLaunchHomePageDimmedL();
       
   277         void SetCalledFromAnotherApp( TBool aValue );
       
   278         TBool CalledFromAnotherApp();
       
   279 		TBool BrowserWasLaunchedIntoFeeds();
       
   280 		TBool IsDisplayingMenuOrDialog();
       
   281 	
       
   282 
       
   283     //-------------------------------------------------------------------------
       
   284     // Preferences Handling
       
   285     //-------------------------------------------------------------------------
       
   286     
       
   287     public:  // from MPreferencesObserver
       
   288         
       
   289         /**
       
   290         *   Observer for Preference changes
       
   291         *   @param aEvent the type of preference event which happened
       
   292         *   @param aValues a struct of all settings values
       
   293         *   @since Series60 3.0
       
   294         */
       
   295         virtual void HandlePreferencesChangeL( 
       
   296                                     const TPreferencesEvent aEvent,
       
   297 	                                TPreferencesValues& aValues,
       
   298 	                                TBrCtlDefs::TBrCtlSettings aSettingType );
       
   299 	                                
       
   300     //-------------------------------------------------------------------------
       
   301     // Window Observing
       
   302     //-------------------------------------------------------------------------
       
   303     
       
   304     public: // from MBrCtlWindowObserver
       
   305 
       
   306         /**
       
   307         * Request the host applicaion to open the URL in a new window
       
   308         * @since 3.0
       
   309         * @param aUrl The Url of the request to be done in the new window
       
   310         * @param aTargetName The name of the new window
       
   311         * @param aUserInitiated ETrue if the new window is initiated by a user event (click)
       
   312         * @param aReserved For future use
       
   313         * @return Return Value is the new browser control associated with the new window
       
   314         */
       
   315         CBrCtlInterface* OpenWindowL( TDesC& aUrl, TDesC* aTargetName, TBool aUserInitiated,
       
   316             TAny* aReserved );
       
   317             
       
   318         /**
       
   319         * Find a window by target name
       
   320         * @since 3.0
       
   321         * @param aTargetName name of the window to find
       
   322         * @return Return Value is the browser control associated with the window name
       
   323         */
       
   324         CBrCtlInterface* FindWindowL( const TDesC& aTargetName ) const;
       
   325 
       
   326         /**
       
   327         * Handle window events such as close/focus etc
       
   328         * @since 3.0
       
   329         * @param aTargetName name of the window to send the event to
       
   330         * @param aCommand Command to pass to the window
       
   331         * @return void
       
   332         */
       
   333         void HandleWindowCommandL( const TDesC& aTargetName, TBrCtlWindowCommand aCommand );
       
   334         
       
   335     //-------------------------------------------------------------------------
       
   336     
       
   337     protected:
       
   338         
       
   339         /**
       
   340         *   Checks for any changes in Global Prefeernces and notifies 
       
   341         *   Browser Control
       
   342         *   @param aSettingType an enum defining a setting
       
   343         *   @since Series60 3.0
       
   344         **/
       
   345         void UpdateGlobalPreferencesL( TBrCtlDefs::TBrCtlSettings aSettingType  );
       
   346         
       
   347         /**
       
   348         *   Checks for any changes in Local Preferences and notifies 
       
   349         *   Browser Control
       
   350         *   @param aValues a struct of all settings values        
       
   351         *   @since Series60 3.0
       
   352         **/
       
   353         void UpdateLocalPreferencesL( TPreferencesValues& aValues );
       
   354         
       
   355         /**
       
   356         *   Initialises Local Preferences
       
   357         *   @since Series60 3.0
       
   358         **/
       
   359         void InitialiseLocalPreferencesL();
       
   360         
       
   361         /**
       
   362         *   Passes a subset of settings to the Browser Control
       
   363         *   @since Series60 3.0
       
   364         */
       
   365         void UpdateBrCtlSettingsL();
       
   366         
       
   367     //-------------------------------------------------------------------------
       
   368         
       
   369     protected:
       
   370         /**
       
   371         * Default C++ constructor.
       
   372         */
       
   373         CBrowserWindow(
       
   374             TInt aWindowId,
       
   375             const TDesC* aTargetName,
       
   376             CBrowserWindowManager* aWindowMgr );
       
   377             
       
   378         /*
       
   379         * 2nd phase constructor.
       
   380         */
       
   381         void ConstructL();
       
   382 
       
   383     //-------------------------------------------------------------------------
       
   384     
       
   385     private:
       
   386         TBool        iClosing;
       
   387         TInt         iWindowId;
       
   388         const TDesC* iTargetName;  // owned
       
   389         TBool        iActive;
       
   390         TBool		 iHasWMLContent;
       
   391         TBool		 iCurrWinHasWMLContent;
       
   392         TBool		 iHasFeedsContent;
       
   393         TBool		 iWMLMode;
       
   394         TBool        iFirstPage;
       
   395         TBool        iImagesLoaded;
       
   396 
       
   397         CBrCtlInterface*              iBrCtlInterface;
       
   398         CBrowserDialogsProviderProxy* iDialogsProviderProxy;
       
   399         CBrowserDisplay*              iDisplay;
       
   400         CBrowserLoadObserver*         iLoadObserver;
       
   401         CBrowserSoftkeysObserver*     iSoftkeysObserver;
       
   402         CBrowserSpecialLoadObserver*  iSpecialLoadObserver;
       
   403         CBrowserWindowManager*        iWindowManager;  // not owned
       
   404         
       
   405     private:    // Local Settings
       
   406         
       
   407         TInt    iFontSize;
       
   408         TUint32 iEncoding;
       
   409         TBool   iTextWrap;
       
   410         TBool 	iIsPageOverviewOn;
       
   411         static TBool    iIsPageOverviewSupported;
       
   412 		static TBool    iIsPageOverviewSupportQueried;
       
   413     };
       
   414 
       
   415 #endif  // __MULTIPLE_WINDOWS_WINDOW_H__
       
   416 
       
   417 // End of file