webengine/osswebengine/WebKit/s60/webview/BrCtl.h
changeset 0 dd21522fd290
child 16 a359256acfc6
equal deleted inserted replaced
-1:000000000000 0:dd21522fd290
       
     1 /*
       
     2 * Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of the License "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description: 
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 #ifndef BRCTL_H
       
    21 #define BRCTL_H
       
    22 
       
    23 //  INCLUDES
       
    24 #include <BrCtlInterface.h>
       
    25 
       
    26 #include "BrCtlDefs.h"
       
    27 #include "HistoryInterface.h"
       
    28 
       
    29 #include "WmlInterface.h"
       
    30 //  CONSTANTS
       
    31 
       
    32 // DATA TYPES
       
    33 enum TBrCtlLoadState
       
    34     {
       
    35     ELoadStateIdle,
       
    36     ELoadStateRequestSent,
       
    37     ELoadStateResponseInProgress,
       
    38     ELoadStateLoadingChildren
       
    39     };
       
    40 
       
    41 const int KMainScrollbarWidth = 5;
       
    42 
       
    43 // FORWARD DECLARATIONS
       
    44 class CBrCtl;
       
    45 class WebView;
       
    46 class HistoryHandler;
       
    47 class MWmlEngineInterface;
       
    48 class MWmlInterface;
       
    49 class MWidgetExtension;
       
    50 class MWidgetCallback;
       
    51 class SettingsContainer;
       
    52 //class ScrollingProvider;
       
    53 class CPeriodic;
       
    54 class WebDataLoadConsumer;
       
    55 class HistoryHandler;
       
    56 class HttpDownload;
       
    57 class CPageScaler;
       
    58 class CWmlDispatcher;
       
    59 class CWmlContentInterface;
       
    60 class CUserAgent;
       
    61 
       
    62 namespace WebCore {
       
    63     class FormData;
       
    64 }
       
    65 
       
    66 
       
    67 class HistoryHandler : public HistoryCallback
       
    68 {
       
    69 public:
       
    70     static HistoryHandler* initWithHandle(CBrCtl* brctl);
       
    71     ~HistoryHandler();
       
    72     void updateGlobalHistoryForStandardLoad(const TPtrC8& url, const TPtrC8& requestUrl,
       
    73         TPtrC& formContentType, WebCore::FormData* formData);
       
    74     void setCurrentEntryTitle(TPtrC title);
       
    75     void updateGlobalHistoryForReload ();
       
    76     HistoryHandler(CBrCtl* brctl) { m_brctl = brctl; m_historyController = NULL; }
       
    77 public: // from HistoryCallback
       
    78     virtual CCoeControl* parent();
       
    79     virtual TPoint currentPosition(); 
       
    80     virtual int currentZoomLevel(); 
       
    81     virtual int minZoomLevel(); 
       
    82     virtual bool wmlMode();
       
    83     virtual void setWmlMode(bool aWml);
       
    84     virtual void doHistoryGet(TPtrC8 url, TBrCtlDefs::TBrCtlCacheMode cacheMode);
       
    85     virtual int doHistoryPost(TPtrC8 url, TBrCtlDefs::TBrCtlCacheMode cacheMode, TPtrC contentType, WebCore::FormData* formData);
       
    86     virtual void stateChanged(bool enter);
       
    87     virtual void navigationStateChanged(TBrCtlDefs::TBrCtlState state, bool value);
       
    88     virtual CFbsBitmap* scaledPage() ;
       
    89     virtual void makeVisible(bool visible);
       
    90     virtual WebSurface* surface();
       
    91     virtual void handleWmlBackL();
       
    92     virtual bool dialogSelectOption(SelectArray* historyList);
       
    93     virtual void setUse(bool use, WebCore::FormData* formData);
       
    94     HistoryControllerInterface* historyController() { return m_historyController; }
       
    95     virtual void deferTimers(bool option);
       
    96 
       
    97 private:
       
    98     CBrCtl* m_brctl;
       
    99     HistoryControllerInterface* m_historyController;
       
   100 };
       
   101 
       
   102 
       
   103 /**
       
   104 *  Implementation of the Browser Control
       
   105 *
       
   106 *  @lib webkit.dll
       
   107 *  @since 3.0
       
   108 */
       
   109 class CBrCtl : public CBrCtlInterface, public MBrCtlLoadEventObserver
       
   110     {
       
   111     public:     // Constructors and destructor
       
   112 
       
   113         /**
       
   114         * Two-phased constructor.
       
   115           MBrCtlSoftkeysObserver       // Default: browser does not update softkeys
       
   116           MBrCtlLinkResolver           // Must be provided if ECapabilityClientResolveEmbeddedURL or ECapabilityClientNotifyURL is set
       
   117           MBrCtlSpecialLoadObserver    // Default: DocumentHandler and SchemeDispatcher are not called by browser and connection created by Proxy Filter
       
   118           MBrCtlLayoutObserver         // Default: Browser does not update scroll location
       
   119           MBrCtlDialogsProvider        // Default: Use Browser's own dialogs
       
   120           MBrCtlWindowObserver         // Default:
       
   121           MBrCtlDownloadObserver     // Default:
       
   122         */
       
   123         static CBrCtlInterface* NewL(CCoeControl* aParent,
       
   124                                      TRect aRect,
       
   125                                      TUint aBrCtlCapabilities,
       
   126                                      TUint aCommandIdBase,
       
   127                                      MBrCtlSoftkeysObserver* aBrCtlSoftkeysObserver,
       
   128                                      MBrCtlLinkResolver* aBrCtlLinkResolver,
       
   129                                      MBrCtlSpecialLoadObserver* aBrCtlSpecialLoadObserver,
       
   130                                      MBrCtlLayoutObserver* aBrCtlLayoutObserver,
       
   131                                      MBrCtlDialogsProvider* aBrCtlDialogsProvider,
       
   132                                      MBrCtlWindowObserver* aBrCtlWindowObserver,
       
   133                                      MBrCtlDownloadObserver* aBrCtlDownloadObserver );
       
   134 
       
   135         /**
       
   136         * Destructor.
       
   137         */
       
   138         IMPORT_C virtual ~CBrCtl();
       
   139 
       
   140     public: // Class methods
       
   141 
       
   142         /**
       
   143         * Returns the parent CCoeControl
       
   144         * @since 3.0
       
   145         */
       
   146         CCoeControl* CCoeControlParent()        { return m_coectrlparent; }
       
   147         WebView* webView()              const   { return m_webView; } 
       
   148         void LoadDllWmlEngineL(); 
       
   149         void UnloadDllWmlEngine();
       
   150         MWmlEngineInterface* wmlEngineInterface() const { return m_wmlEngineInterface; }
       
   151         void setWmlMode (bool aWml);
       
   152         bool wmlMode() const {return m_wmlMode;}
       
   153         void resetWmlServiceOptions();
       
   154         void wmlServiceOptionsAddItemL( const TText* aText, TUint32 aActualElemID, TInt aIsPrev );
       
   155         void postUrlL(TDesC& aUrl, TDesC8& aPostData, TDesC& aContentType);
       
   156         void setWmlPageScaler( CPageScaler& aPageScaler ) { m_wmlPageScaler = &aPageScaler; }
       
   157         CPageScaler& wmlPageScaler() const { return *m_wmlPageScaler; }
       
   158         CWmlDispatcher* wmlDispatcher() const {return m_wmlDispatcher;}
       
   159         void setWmlDispatcher(CWmlDispatcher* dispatcher){m_wmlDispatcher = dispatcher;}
       
   160         void loadResource(TDesC8& url, CWmlContentInterface* content );
       
   161         TBrCtlWmlServiceOption* firstPrevDoElement() const { return m_firstPrevDoElement; }
       
   162         HBufC* fileNameToUrlLC(const TDesC& aFileName);
       
   163         void SetScriptLogMode(TInt aMode);
       
   164         
       
   165     public: // Methods from CBrCtlInterface
       
   166 
       
   167         /**
       
   168         * From CBrCtlInterface
       
   169         * Pass a command to the Browser Control
       
   170         * @since 3.0
       
   171         * @param aCommand The command that the Browser Control should process
       
   172         * @return void
       
   173         */
       
   174         IMPORT_C void HandleCommandL(TInt aCommand);
       
   175 
       
   176         /**
       
   177         * From CBrCtlInterface Pass a command to the Browser Control
       
   178         * @since 2.8
       
   179         * @param aCommand The command that the Browser Control should process
       
   180         * @param aTransId The transaction Id associated with this command
       
   181         * @return void
       
   182         */
       
   183         IMPORT_C void HandleDownloadCommandL(TUint16 aTransId, TBrCtlDefs::TBrCtlDownloadCmd aCommand);
       
   184 
       
   185         /**
       
   186         * From CBrCtlInterface
       
   187         * Return the display size that would be needed to see all the content
       
   188         * @since 3.0
       
   189         * @return The display size that would be needed to see all the content
       
   190         */
       
   191         IMPORT_C TSize ContentSize();
       
   192 
       
   193         /**
       
   194         * From CBrCtlInterface
       
   195         * Update a Browser Control setting
       
   196         * @since 3.0
       
   197         * @param aSetting The setting to update
       
   198         * @param aValue The new value of the setting
       
   199         * @return void
       
   200         */
       
   201         IMPORT_C void SetBrowserSettingL(TUint aSetting, TUint aValue);
       
   202 
       
   203         /**
       
   204         * From CBrCtlInterface
       
   205         * Get a setting from the Browser Control
       
   206         * @since 3.0
       
   207         * @param aSetting The setting to get
       
   208         * @return The value of the setting
       
   209         */
       
   210         IMPORT_C TUint BrowserSettingL(TUint aSetting);
       
   211 
       
   212         /**
       
   213         * From CBrCtlInterface
       
   214         * Request the Browser Control to display the content of a buffer
       
   215         * @since 3.0
       
   216         * @param aUrl A url that refers to the data. If a url scheme is used, it must be "data:"
       
   217         * @param aData The content to display. Browser Control does not take ownership
       
   218         * @param aDataType The data type of the data
       
   219         * @param aCharsetUid The UID of the character converter of the content's charset 0 assumed Latin-1
       
   220         * @return void
       
   221         */
       
   222         IMPORT_C void LoadDataL(const TDesC& aUrl,
       
   223                                 const TDesC8& aData,
       
   224                                 const TDataType& aDataType,
       
   225                                 TUid aCharsetUid);
       
   226 
       
   227         /**
       
   228         * From CBrCtlInterface
       
   229         * Request the Browser Control to display content incrementaly
       
   230         * @since 3.0
       
   231         * @param aUrl A url that refers to the data. If a url scheme is used, it must be "data:"
       
   232         * @param aDataType The data type of the data
       
   233         * @param aCharsetUid The UID of the character converter of the content's charset 0 assumed Latin-1
       
   234         * @param aContentLength The length of the content.
       
   235         * @param aBrCtlDataLoadSupplier A callback interface to stop passing data if an error occured in the Browser Control
       
   236         * @param aBrCtlDataLoadConsumer A callback interface returned by the browser. Data should be passed to that interface
       
   237         * @return void
       
   238         */
       
   239         IMPORT_C void InitLoadDataL(const TDesC& aUrl,
       
   240                                     const TDataType& aDataType,
       
   241                                     TUid aCharsetUid,
       
   242                                     TUint aContentLength,
       
   243                                     MBrCtlDataLoadSupplier* aBrCtlDataLoadSupplier,
       
   244                                     MBrCtlDataLoadConsumer** aBrCtlDataLoadConsumer);
       
   245 
       
   246         /**
       
   247         * From CBrCtlInterface
       
   248         * Request the Browser Control to load a url
       
   249         * @since 3.0
       
   250         * @param aUrl The url to load
       
   251         * @param aApId The Access Point Id to use
       
   252         * @param aBrCtlCacheMode The cache mode to use
       
   253         * @return void
       
   254         */
       
   255         IMPORT_C void LoadUrlL(const TDesC& aUrl,
       
   256                                TInt aApId = -1,
       
   257                                TBrCtlDefs::TBrCtlCacheMode aBrCtlCacheMode = TBrCtlDefs::ECacheModeNormal);
       
   258 
       
   259         /**
       
   260         * Requests the Browser Control to POST to a URL
       
   261         * @since 5.0
       
   262         * @param aUrl URL to which the Browser Control sends the POST request
       
   263         * @param aContentType Content type of the data to be posted
       
   264         * @param aPostData Data to be posted
       
   265         * @param aBoundary Boundary for form-data or multi-part content. 
       
   266         * @param aReserved For future use only
       
   267         * @return void
       
   268         */        
       
   269         IMPORT_C void PostUrlL (const TDesC& aUrl, 
       
   270                                 const TDesC8& aContentType, 
       
   271                                 const TDesC8& aPostData, 
       
   272                                 const TDesC8* aBoundary, 
       
   273                                 TAny* aReserved);
       
   274         /**
       
   275         * From CBrCtlInterface
       
   276         * Request the Browser Control to load and display a file from the file system
       
   277         * @since 3.0
       
   278         * @param aFileName The name of the file
       
   279         * @return void
       
   280         */
       
   281         IMPORT_C void LoadFileL(const TDesC& aFileName);
       
   282 
       
   283         /**
       
   284         * From CBrCtlInterface
       
   285         * Request the Browser Control to load and display a file from the file system
       
   286         * @since 3.0
       
   287         * @param aFileHandle The handle of the file
       
   288         * @return void
       
   289         */
       
   290         IMPORT_C void LoadFileL(RFile& aFileHandle);
       
   291 
       
   292         /**
       
   293         * From CBrCtlInterface
       
   294         * Return the WML Options for the current page
       
   295         * @since 3.0
       
   296         * @param
       
   297         * @return The WML Options for the current page
       
   298         */
       
   299         IMPORT_C RPointerArray<TBrCtlWmlServiceOption>* WMLOptionMenuItemsL();
       
   300 
       
   301         /**
       
   302         * From CBrCtlInterface
       
   303         * Request the Browser Control to add its own options to the option menu
       
   304         * @since 3.0
       
   305         * @param aMenuPane Handle of the menu that will contain the options
       
   306         * @param aResourceId The resource ID of the menu
       
   307         * @param aAfter WML options should be added after that index
       
   308         * @return void
       
   309         */
       
   310         IMPORT_C void AddOptionMenuItemsL(CEikMenuPane& aMenuPane, TInt aResourceId, TInt aAfter=-1);
       
   311 
       
   312         /**
       
   313         * From CBrCtlInterface
       
   314         * Request the Browser Control to clear the cache
       
   315         * @since 3.0
       
   316         * @return The number of bytes that were freed from cache
       
   317         */
       
   318         IMPORT_C TUint ClearCache();
       
   319 
       
   320         /**
       
   321         * From CBrCtlInterface
       
   322         * Ask the Browser Control if a URL is in cache
       
   323         * @since 3.0
       
   324         * @param aUrl The Url
       
   325         * @return ETrue if a specific Url is in cache
       
   326         */
       
   327         IMPORT_C TBool IsUrlInCache(TDesC& aUrl);
       
   328 
       
   329         /**
       
   330         * From CBrCtlInterface
       
   331         * Ask the Browser Control to clear a URL from the cache
       
   332         * @since 3.0
       
   333         * @param aUrl The Url
       
   334         * @return KErrNone, or an error code
       
   335         */
       
   336         IMPORT_C TInt ClearItemInCache(TDesC& aUrl);
       
   337 
       
   338         /**
       
   339         * From CBrCtlInterface
       
   340         * Request the Browser Control to return info about the page. The info is returned on the Cleanup Stack.
       
   341         * @since 3.0
       
   342         * @param aBrCtlPageInfo The type of requested info
       
   343         * @return void
       
   344         */
       
   345         IMPORT_C HBufC* PageInfoLC(TBrCtlDefs::TBrCtlPageInfo aBrCtlPageInfo);
       
   346 
       
   347         /**
       
   348         * From CBrCtlInterface
       
   349         * Query the Browser Control if there is a previous or next
       
   350         * (depending on aDirection) element in history stack
       
   351         * @since 3.0
       
   352         * @return ETrue if can go aDirection, EFalse otherwise
       
   353         */
       
   354         IMPORT_C TBool NavigationAvailable(TBrCtlDefs::TBrCtlNavigationDirection aDirection);
       
   355 
       
   356         /**
       
   357         * From CBrCtlInterface
       
   358         * Request the Browser Control to save the current content to a file
       
   359         * @since 3.0
       
   360         * @param aFileName The name of the file to use for saving the content
       
   361         * @return The number of bytes in the saved file
       
   362         */
       
   363         IMPORT_C TUint16 SaveToFileL(const TDesC& aFileName);
       
   364 
       
   365         /**
       
   366         * From CBrCtlInterface
       
   367         * Request the Browser Control to pass the server's certificate info for the current page
       
   368         * @since 3.0
       
   369         * @return Certificate info of the server of the current page
       
   370         */
       
   371         IMPORT_C const TCertInfo* CertInfo();
       
   372 
       
   373         /**
       
   374         * From CBrCtlInterface
       
   375         * Request the Browser Control to register for load events
       
   376         * @since 3.0
       
   377         * @param aBrCtlLoadEventObserver A load events observer to add
       
   378         * @return void
       
   379         */
       
   380         IMPORT_C void AddLoadEventObserverL(MBrCtlLoadEventObserver* aBrCtlLoadEventObserver);
       
   381 
       
   382         /**
       
   383         * From CBrCtlInterface
       
   384         * Request the Browser Control to unregister for load events
       
   385         * @since 3.0
       
   386         * @param aBrCtlLoadEventObserver A load events observer to remove
       
   387         * @return void
       
   388         */
       
   389         IMPORT_C void RemoveLoadEventObserver(MBrCtlLoadEventObserver* aBrCtlLoadEventObserver);
       
   390 
       
   391         /**
       
   392         * From CBrCtlInterface
       
   393         * Return the number of images in the current page
       
   394         * @since 3.0
       
   395         * @param
       
   396         * @return The number of images in the current page
       
   397         */
       
   398         IMPORT_C TInt ImageCountL();
       
   399 
       
   400         /**
       
   401         * From CBrCtlInterface
       
   402         * Returns the focused element
       
   403         * @since 3.0
       
   404         * @return The type of the focused element
       
   405         */
       
   406         IMPORT_C TBrCtlDefs::TBrCtlElementType FocusedElementType();
       
   407 
       
   408         /**
       
   409         * From CBrCtlInterface
       
   410         * Returns void
       
   411         * @since 
       
   412         * @Collects offscreen bitmap
       
   413         */
       
   414         IMPORT_C void TakeSnapshotL(CFbsBitmap& snapshot);
       
   415         
       
   416         /**
       
   417         * From CBrCtlInterface
       
   418         * Register an observer for state change changes
       
   419         * @since 3.0
       
   420         * @param The observer to register
       
   421         * @return void
       
   422         */
       
   423         IMPORT_C void AddStateChangeObserverL(MBrCtlStateChangeObserver* aBrCtlStateChangeObserver);
       
   424 
       
   425         /**
       
   426         * From CBrCtlInterface
       
   427         * Unregister an observer for state changes
       
   428         * @since 3.0
       
   429         * @param The observer to unregister
       
   430         * @return void
       
   431         */
       
   432         IMPORT_C void RemoveStateChangeObserver(MBrCtlStateChangeObserver* aBrCtlStateChangeObserver);
       
   433 
       
   434         /**
       
   435         * From CBrCtlInterface
       
   436         * Returns the version info requested
       
   437         * @since 3.0
       
   438         * @param The observer to unregister
       
   439         * @return The version control info
       
   440         */
       
   441         IMPORT_C HBufC* VersionInfoLC(TBrCtlDefs::TBrCtlVersionInfo aVersionInfo);
       
   442 
       
   443         /**
       
   444         * Pass a list of content types to the Browser Control.
       
   445         * These content types will not be using the download manager
       
   446         * The list must be separated by ';' e.g. "text/html;text/wml"
       
   447         * @since 2.8
       
   448         * @param aContentTypes The content types that should not use Download Manager
       
   449         * @return void
       
   450         */
       
   451         IMPORT_C void SetSelfDownloadContentTypesL(TDesC& aContentTypes);
       
   452 
       
   453         /**
       
   454         * Update a Browser Control parameter.
       
   455         * @since 2.8
       
   456         * @param aParam The parameter to update
       
   457         * @param aValue The new value of the parameter
       
   458         * @return void
       
   459         */
       
   460         IMPORT_C void SetParamL(TBrCtlDefs::TBrCtlParams aParam, const TDesC& aValue);
       
   461 
       
   462         /**
       
   463         * Request the Browser Control to load a saved page.
       
   464         * @since 3.0
       
   465         * @param aUid a unique identifier for the saved page
       
   466         * @param aSavedPageBuffer buffer which contains the content of the saved page
       
   467         * @return void
       
   468         */
       
   469         IMPORT_C void LoadSavedPageL(const TDesC& aUid, TDesC& aSavedPageBuffer);
       
   470 
       
   471         /**
       
   472         * Return the zoom levels index
       
   473         * @since 3.0
       
   474         * @return const RArray<TUint>&
       
   475         */
       
   476         IMPORT_C RArray<TUint>* ZoomLevels() const;
       
   477 
       
   478         /**
       
   479         * Return information about the linked feeds in the current page - used to
       
   480         * build a "Subscribe to" submenu.
       
   481         * @since 3.0
       
   482         * @param aItems Information about the linked feeds in the current page.
       
   483         * @return void
       
   484         */
       
   485         IMPORT_C const RPointerArray<TBrCtlSubscribeTo>& SubscribeToMenuItemsL();
       
   486 
       
   487         /**
       
   488         * Request icon for the given url
       
   489         * @since 3.1
       
   490         * @param aUrl url to a favicon or a page
       
   491         * @param aBitmapInfo info on whether to retun a favicon or a page thumbnail
       
   492         * @return favion icon or page icon
       
   493         */
       
   494         IMPORT_C CGulIcon* GetBitmapData(const TDesC& aUrl, TBrCtlDefs::TBrCtlBitmapInfo aBitmapInfo);
       
   495 
       
   496         /**
       
   497         * Register a client interface for the browser engine
       
   498         * @since 2.8
       
   499         * @param The observer to register
       
   500         * @return void
       
   501         */
       
   502         IMPORT_C void AddCommandObserverL(MBrCtlCommandObserver* aBrCtlCommandObserver);
       
   503 
       
   504         /**
       
   505         * Unregister a client interface for the browser engine
       
   506         * @since 2.8
       
   507         * @param The observer to unregister
       
   508         * @return void
       
   509         */
       
   510         IMPORT_C void RemoveCommandObserver(MBrCtlCommandObserver* aBrCtlCommandObserver);
       
   511 
       
   512 
       
   513    public: // Methods from CCoeControl
       
   514 
       
   515         /**
       
   516         * From CCoeControl
       
   517         * Return the minimum size the Browser Control can use
       
   518         * @since 3.0
       
   519         * @return The minimum size that the Browser Control can use
       
   520         */
       
   521         IMPORT_C TSize MinimumSize();
       
   522 
       
   523         /**
       
   524         * From CCoeControl
       
   525         * Pass key events to the Browser Control
       
   526         * @since 3.0
       
   527         * @param aKeyEvent The key event
       
   528         * @param aType The key code
       
   529         * @return If the Browser Control consumed the key event or not
       
   530         */
       
   531         IMPORT_C TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent, TEventCode aEventCode);
       
   532 
       
   533         /**
       
   534         * From CCoeControl
       
   535         * Sets that the Browser Control has keyboard focus.
       
   536         * @since 3.0
       
   537         * @param aFocus If the Browser Control gets or loses focus
       
   538         * @param ENoDrawNow If the Browser Control should redraw itself as result of focus change
       
   539         * @return void
       
   540         */
       
   541         IMPORT_C void SetFocus(TBool aFocus, TDrawNow aDrawNow = ENoDrawNow);
       
   542         
       
   543         /*
       
   544         * This method calls to download manager in order to display query "Cancel
       
   545         * outstanding downloads?" and cancel if it requested by user
       
   546         * @param none
       
   547         * @return ETrue if it is OK to exit; EFalse - if it is not OK to exit
       
   548         */
       
   549         IMPORT_C TBool OkToExit();
       
   550 
       
   551         /**
       
   552         * Perform the incremental find operation
       
   553         * @since 3.0
       
   554         * @return TBrCtlFindResponse
       
   555         */
       
   556         IMPORT_C int FindKeyword( const TDesC& aKeyword );
       
   557 
       
   558         /**
       
   559         * Continue the incremental find operation
       
   560         * @since 3.0
       
   561         * @return TBrCtlFindResponse
       
   562         */
       
   563         IMPORT_C TBrCtlDefs::TBrCtlFindResponse FindKeywordAgain( TBool aFowardDirection );
       
   564         
       
   565         IMPORT_C MWidgetExtension* CreateWidgetExtensionL(MWidgetCallback& aWidgetCallback);
       
   566   
       
   567         /**
       
   568         * Get information about the focused image. The function leaves if the focus is not on an image
       
   569         * @since 3.2
       
   570         * @param 
       
   571         * @return The requested information
       
   572         */
       
   573         IMPORT_C TBrCtlImageCarrier* FocusedImageLC();
       
   574         
       
   575         /**
       
   576         * From CCoeControl
       
   577         * Sets that the Browser Control visible.
       
   578         * @since 3.0
       
   579         * @param aVisible If the Browser Control is visible or invisible
       
   580         * @return void
       
   581         */
       
   582         void MakeVisible(TBool aVisible);
       
   583 
       
   584         /**
       
   585         * From CCoeControl
       
   586         * Handle changes in size of the display.
       
   587         */
       
   588         void Draw(const TRect& aRect) const;
       
   589 
       
   590         /**
       
   591          * From CCoeControl
       
   592          */
       
   593         void HandlePointerBufferReadyL();
       
   594         MBrCtlSpecialLoadObserver* brCtlSpecialLoadObserver() const { return m_brCtlSpecialLoadObserver; }
       
   595         MBrCtlDownloadObserver* brCtlDownloadObserver();
       
   596         MBrCtlLinkResolver* brCtlLinkResolver() const { return m_brCtlLinkResolver; }
       
   597         MBrCtlDialogsProvider* brCtlDialogsProvider() const { return m_brCtlDialogsProvider; }
       
   598         MBrCtlWindowObserver* brCtlWindowObserver() const { return m_brCtlWindowObserver; }
       
   599         MBrCtlLayoutObserver* brCtlLayoutObserver() const { return m_brCtlLayoutObserver; }
       
   600         MBrCtlSoftkeysObserver* brCtlSoftkeysObserver() const { return m_brCtlSoftkeysObserver; }
       
   601         
       
   602         unsigned int commandIdBase() const { return m_commandIdBase; }
       
   603         unsigned int capabilities() const { return m_capabilities; }
       
   604         SettingsContainer* settings() const { return m_settingsContainer; }
       
   605         CBrCtl* getWindowL(TDesC& windowName, bool userGesture);
       
   606         
       
   607         void reportStateChanged(TBrCtlDefs::TBrCtlState state, bool enter);
       
   608         void showHorizontalScrollbar(bool show);
       
   609         
       
   610         void showWindow();
       
   611         void closeWindowSoon();
       
   612         void doCloseWindowSoon();
       
   613         TBool sendCommandsToClient(TBrCtlDefs::TBrCtlClientCommands aCommand,
       
   614                                     const CArrayFix<TPtrC>& aAttributesNames,
       
   615                                     const CArrayFix<TPtrC>& aAttributeValues );
       
   616         void endLoadData();
       
   617         void updateDefaultSoftkeys();
       
   618         void setCertInfo(TCertInfo* aCertInfo);
       
   619         
       
   620         void updateScrollbars(int documentHeight, int displayHeight, int displayPosY,
       
   621             int documentWidth, int displayWidth, int displayPosX);
       
   622         
       
   623         bool hasHorizontalScrollbar() { return m_hasHorizontalScrollbar; }
       
   624 
       
   625     public: // from MBrCtlLoadEventObserver
       
   626 
       
   627         void HandleBrowserLoadEventL( TBrCtlDefs::TBrCtlLoadEvent aBrCtlLoadEvent,
       
   628             TUint aSize, TUint16 aTransactionId );
       
   629 
       
   630         HistoryHandler* historyHandler() { return m_historyHandler; }
       
   631 
       
   632     protected:  // Functions from CCoeControl
       
   633 
       
   634         /**
       
   635         * From CCoeControl
       
   636         * Handle changes in size of the display.
       
   637         */
       
   638         void SizeChanged();
       
   639 
       
   640         /**
       
   641         * From CCoeControl
       
   642         * Get the number of controls in the Browser Control
       
   643         */
       
   644         TInt CountComponentControls() const;
       
   645 
       
   646         /**
       
   647         * From CCoeControl
       
   648         * Get a specified control with a given index
       
   649         */
       
   650         CCoeControl* ComponentControl(TInt aIndex) const;
       
   651         void doEnableFavicon();
       
   652         static TInt doCloseCb(TAny* aPtr);
       
   653         static TInt doEnableFaviconCb(TAny* aPtr);
       
   654 
       
   655     private:    // Constructors and destructor
       
   656 
       
   657         /**
       
   658         * C++ default constructor.
       
   659         */
       
   660         CBrCtl( CCoeControl* aParent,
       
   661         TUint aBrCtlCapabilities,
       
   662         TUint aCommandIdBase,
       
   663         MBrCtlSoftkeysObserver* aBrCtlSoftkeysObserver,
       
   664         MBrCtlLinkResolver* aBrCtlLinkResolver,
       
   665         MBrCtlSpecialLoadObserver* aBrCtlSpecialLoadObserver,
       
   666         MBrCtlLayoutObserver* aBrCtlLayoutObserver,
       
   667         MBrCtlDialogsProvider* aBrCtlDialogsProvider,
       
   668         MBrCtlWindowObserver* aBrCtlWindowObserver,
       
   669         MBrCtlDownloadObserver* aBrCtlDownloadObserver );
       
   670 
       
   671         /**
       
   672         * By default Symbian 2nd phase constructor is private.
       
   673         */
       
   674         void ConstructL(CCoeControl* aParent, TRect& aRect);
       
   675 
       
   676     private:
       
   677         void LoadResourceFileL();
       
   678         int getMainScrollbarWidth() const;
       
   679 
       
   680     private:    // Class data
       
   681         CCoeControl* m_coectrlparent;
       
   682         TRect        m_rect;
       
   683         WebView*     m_webView;
       
   684         HistoryHandler* m_historyHandler;
       
   685         SettingsContainer* m_settingsContainer;
       
   686         WebDataLoadConsumer* m_dataLoadConsumer;        
       
   687         CUserAgent* m_usrAgnt;
       
   688        
       
   689         RPointerArray<TBrCtlSubscribeTo> m_subscribeToItems;
       
   690         RPointerArray<HBufC> m_subscribeToUrls;
       
   691         RPointerArray<MBrCtlLoadEventObserver> iLoadEventObserversArray;
       
   692         RPointerArray<MBrCtlCommandObserver> m_commandObserverArray;
       
   693 
       
   694         // tot:fixme
       
   695         MBrCtlSpecialLoadObserver* m_brCtlSpecialLoadObserver;
       
   696         MBrCtlLinkResolver* m_brCtlLinkResolver;
       
   697         MBrCtlDialogsProvider* m_brCtlDialogsProvider;
       
   698         MBrCtlWindowObserver* m_brCtlWindowObserver;
       
   699         MBrCtlSoftkeysObserver* m_brCtlSoftkeysObserver;
       
   700         MBrCtlLayoutObserver* m_brCtlLayoutObserver;
       
   701         RPointerArray<MBrCtlStateChangeObserver> m_stateChangeObserverArray;
       
   702         unsigned int m_commandIdBase;
       
   703         unsigned int m_capabilities;
       
   704         TInt m_resourceFile;
       
   705         CPeriodic* m_timer;
       
   706         bool m_wmlMode;
       
   707         bool m_suspendTimers;
       
   708         MWmlEngineInterface* m_wmlEngineInterface;
       
   709         RLibrary  m_Library;
       
   710         MWmlInterface* m_WmlInterface;
       
   711         TCertInfo* m_certInfo;
       
   712         int m_documentHeight;
       
   713         int m_displayHeight;
       
   714         int m_displayPosY;
       
   715         int m_documentWidth;
       
   716         int m_displayWidth;
       
   717         int m_displayPosX;
       
   718         bool m_hasHorizontalScrollbar;
       
   719         bool m_wmlUnloadPending;
       
   720         bool m_ownsLayoutObserver;
       
   721         bool m_ownsDialogsProvider;
       
   722         CPageScaler* m_wmlPageScaler;
       
   723         CWmlDispatcher* m_wmlDispatcher;
       
   724         RPointerArray<TBrCtlWmlServiceOption>   m_wmlServiceOption;
       
   725         TBrCtlWmlServiceOption*                 m_firstPrevDoElement;
       
   726 		MBrCtlDownloadObserver*                 m_brCtlDownloadObserver;
       
   727 
       
   728 };
       
   729 
       
   730 #endif      // BRCTL_H
       
   731 
       
   732 // End of File