williamr@2: /* williamr@2: * Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). williamr@2: * All rights reserved. williamr@2: * This component and the accompanying materials are made available williamr@2: * under the terms of the License "Eclipse Public License v1.0" williamr@2: * which accompanies this distribution, and is available williamr@2: * at the URL "http://www.eclipse.org/legal/epl-v10.html". williamr@2: * williamr@2: * Initial Contributors: williamr@2: * Nokia Corporation - initial contribution. williamr@2: * williamr@2: * Contributors: williamr@2: * williamr@2: * Description: Definition of the Browser Control API williamr@2: * williamr@2: */ williamr@2: williamr@2: williamr@2: #ifndef BRCTLINTERFACE_H williamr@2: #define BRCTLINTERFACE_H williamr@2: williamr@2: // INCLUDES williamr@2: #include <../bidi.h> williamr@2: #include williamr@2: #include williamr@2: #include williamr@2: #include williamr@2: #include williamr@2: williamr@2: #include williamr@2: #include williamr@2: #include williamr@2: #include williamr@2: #include williamr@2: #include williamr@2: #include williamr@2: #include williamr@2: williamr@2: // DATA TYPES williamr@2: williamr@2: // FORWARD DECLARATIONS williamr@2: class MBrCtlDataLoadSupplier; williamr@2: class MBrCtlDataLoadConsumer; williamr@2: class MBrCtlLoadEventObserver; williamr@2: class MBrCtlDialogsProvider; williamr@2: class TBrCtlWmlServiceOption; williamr@2: class TBrCtlSubscribeTo; williamr@2: class MBrCtlStateChangeObserver; williamr@2: class MBrCtlCommandObserver; williamr@2: class MWidgetCallback; williamr@2: class MWidgetExtension; williamr@2: class CBrCtlInterface; williamr@2: class CPluginInfo; williamr@2: class TBrCtlImageCarrier; williamr@2: williamr@2: /** williamr@2: * Creates the browser control. williamr@2: * williamr@2: * @param aParent Parent window of the browser control williamr@2: * @param aRect Bounding rectangle for the browser control williamr@2: * @param aBrCtlCapabilities Desired capabilities of the browser control. williamr@2: * For example, displaying scroll bars, allowing network access for HTTP requests. williamr@2: * @see For a complete list of capability options, see TBrCtlCapabilities williamr@2: * @param aCommandIdBase Base values for Command IDs for Browser Control. williamr@2: * These are added to ensure that each Command ID is unique; Browser Control command IDs must be different from the host application command IDs. williamr@2: * @see For more information, see TBrCtlCommandId williamr@2: * @param aBrCtlSoftkeysObserver Softkeys observer. williamr@2: * Default: the host application does not update the softkeys. williamr@2: * @see For more information, see MBrCtlSoftkeysObserver class williamr@2: * @param aBrCtlLinkResolver Link Resolver. Must be provided if ECapabilityClient williamr@2: * ResolveEmbeddedURL or ECapabilityClientNotifyURL is set. williamr@2: * @see For more information, see MBrCtlLinkResolver class. williamr@2: * @param aBrCtlSpecialLoadObserver Special Load Observer. williamr@2: * @see MBrCtlSpecialLoadObserver class for more details of special load observer. williamr@2: * @param aBrCtlLayoutObserver Layout Observer. williamr@2: * Default: williamr@2: * Non-markup pages are not handled by the browser. williamr@2: * Non-HTTP(S) schemes are not handled by the browser. williamr@2: * Connection is created by the Proxy Filter. williamr@2: * @see For more information, see MBrCtlLayoutObserver class williamr@2: * @param aBrCtlDialogsProvider Dialogs Provider. williamr@2: * @see For more information, see MBrCtlDialogsProvider class williamr@2: * @param aBrCtlWindowObserver Window Observer. williamr@2: * @see For more information, see MBrCtlWindowObserver class williamr@2: * @param aBrCtlDownloadObserver Downlaod observer williamr@2: * @see For more information, MBrCtlDownloadObserver class williamr@2: * @return a pointer to CBrCtlInterface class or NULL if this function fails. williamr@2: */ williamr@2: IMPORT_C CBrCtlInterface* CreateBrowserControlL(CCoeControl* aParent, TRect aRect, williamr@2: TUint aBrCtlCapabilities, TUint aCommandIdBase = TBrCtlDefs::ECommandIdBase, williamr@2: MBrCtlSoftkeysObserver* aBrCtlSoftkeysObserver = NULL, williamr@2: MBrCtlLinkResolver* aBrCtlLinkResolver = NULL, williamr@2: MBrCtlSpecialLoadObserver* aBrCtlSpecialLoadObserver = NULL, williamr@2: MBrCtlLayoutObserver* aBrCtlLayoutObserver = NULL, williamr@2: MBrCtlDialogsProvider* aBrCtlDialogsProvider = NULL, williamr@2: MBrCtlWindowObserver* aBrCtlWindowObserver = NULL, williamr@2: MBrCtlDownloadObserver* aBrCtlDownloadObserver = NULL ); williamr@2: williamr@2: /** williamr@2: * The CBrCtlInterface class is the base class of the Browser Control API. williamr@2: * All clients of browser control must use this class. The functions defined williamr@2: * in the CBrCtlInterface class implement basic Browser Control functionality. williamr@2: * You can customize the Browser Control to extend its functionality by williamr@2: * implementing additional interface classes in the host application. Examples williamr@2: * of such classes are MBrCtlDataLoadSupplier, MBrCtlDialogsProvider, williamr@2: * MBrCtlDialogsProvider etc. williamr@2: * williamr@2: * Usage: williamr@2: * williamr@2: * @code williamr@2: * #include williamr@2: * // Interface that provides dialogs used by the Browser Control. williamr@2: * #include williamr@2: * // Interface used to receive scrolling events. williamr@2: * #include williamr@2: * //Interface that provides a callback mechanism for receiving the williamr@2: * //content of an embedded link or the content of a user-initiated williamr@2: * //load request. williamr@2: * #include williamr@2: * //Interface that handles requests to change the softkeys. williamr@2: * #include williamr@2: * //Interface that handles special load needs. williamr@2: * #include williamr@2: * //Reserved for future use. williamr@2: * #include williamr@2: * //Interface that passes download events from the williamr@2: * //Download Manager through the Browser Control to the williamr@2: * //host application. williamr@2: * #include williamr@2: * Enum Definition of the Browser Control API. williamr@2: * #include williamr@2: * williamr@2: * williamr@2: * The following types of things you can do with the Browser Control API. williamr@2: * williamr@2: * Creating a basic Browser Control williamr@2: * Creating a Browser Control with observer interfaces williamr@2: * Loading content williamr@2: * Passing content incrementally williamr@2: * Receiving load progress events williamr@2: * Handling special load requests williamr@2: * Customizing dialogs williamr@2: * Specifying the softkeys williamr@2: * Resolving links williamr@2: * Customizing scroll bars williamr@2: * Receiving change-of-state events williamr@2: * williamr@2: * @see S60 Platform: Browser Control API Developer's Guide Version 2.0 williamr@2: * @lib BrowserEngine.lib williamr@2: * @since 2.8 williamr@2: * @file BrCtlInterface.h williamr@2: * @endcode * williamr@2: */ williamr@2: class CBrCtlInterface : public CCoeControl williamr@2: { williamr@2: public: // Constructors and destructor williamr@2: williamr@2: /** williamr@2: * Destructor. williamr@2: */ williamr@2: inline virtual ~CBrCtlInterface() {} williamr@2: williamr@2: public: // New functions williamr@2: williamr@2: /** williamr@2: * Passes a command to the Browser Control.. williamr@2: * @since 2.8 williamr@2: * @param aCommand The command that the Browser Control should process williamr@2: * @return void williamr@2: * @see TBrCtlCommands, For a complete list of commands, williamr@2: */ williamr@2: IMPORT_C virtual void HandleCommandL(TInt aCommand) = 0; williamr@2: williamr@2: /** williamr@2: * Return the display size that would be needed to see all the content williamr@2: * @since 2.8 williamr@2: * @return The display size that would be needed to see all the content williamr@2: */ williamr@2: IMPORT_C virtual TSize ContentSize() = 0; williamr@2: williamr@2: /** williamr@2: * Update a Browser Control setting williamr@2: * @since 2.8 williamr@2: * @param aSetting The setting to update williamr@2: * @param aValue The new value of the setting williamr@2: * @leave KErrArgument if the value of aSetting is out of range. williamr@2: * @return void williamr@2: */ williamr@2: IMPORT_C virtual void SetBrowserSettingL(TUint aSetting, TUint aValue) = 0; williamr@2: williamr@2: /** williamr@2: * Get a setting from the Browser Control williamr@2: * @since 2.8 williamr@2: * @param aSetting The setting to get williamr@2: * @leave KErrArgument if the value of aSetting is out of range. williamr@2: * @return The value of the setting williamr@2: */ williamr@2: IMPORT_C virtual TUint BrowserSettingL(TUint aSetting) = 0; williamr@2: williamr@2: /** williamr@2: * Request the Browser Control to display the content of a buffer williamr@2: * @since 2.8 williamr@2: * @param aUrl A url that refers to the data. If a url scheme is used, it must be "data:" williamr@2: * @param aData The content to display. Browser Control does not take ownership williamr@2: * @param aDataType The data type of the data williamr@2: * @param aCharsetUid The UID of the character converter of the content's charset 0 assumed Latin-1 williamr@2: * @return void williamr@2: * @attention If you use this function, the Browser Control does not keep williamr@2: * track of the history. If the data is not markup, Browser Control uses williamr@2: * the Special Load Observer to pass the content back to the Host Application. williamr@2: * The Special Load Observer uses the Document Handler to send the content williamr@2: * to the proper application. williamr@2: */ williamr@2: IMPORT_C virtual void LoadDataL(const TDesC& aUrl, williamr@2: const TDesC8& aData, williamr@2: const TDataType& aDataType, williamr@2: TUid aCharsetUid) = 0; williamr@2: williamr@2: /** williamr@2: * Request the Browser Control to display content incrementaly williamr@2: * @since 2.8 williamr@2: * @param aUrl A url that refers to the data. If a url scheme is used, it must be "data:" williamr@2: * @param aDataType The data type of the data williamr@2: * @param aCharsetUid The UID of the character converter of the content's charset 0 assumed Latin-1 williamr@2: * @param aContentLength The length of the content. williamr@2: * @param aBrCtlDataLoadSupplier A callback interface to stop passing data if an error occured in the Browser Control williamr@2: * @param aBrCtlDataLoadConsumer A callback interface returned by the browser. Data should be passed to that interface williamr@2: * @return void williamr@2: * @attension If you use this function, the Browser Control does not keep williamr@2: * track of the history.If the content type of the data is not markup, Browser williamr@2: * Control uses the Special Load Observer to pass the content back to the Host williamr@2: * Application. The Special Load Observer uses the Document Handler to send williamr@2: * the content to the proper application. williamr@2: */ williamr@2: // The url scheme must be "data:" The url is needed as reference to this load request williamr@2: IMPORT_C virtual void InitLoadDataL(const TDesC& aUrl, williamr@2: const TDataType& aDataType, williamr@2: TUid aCharsetUid, williamr@2: TUint aContentLength, williamr@2: MBrCtlDataLoadSupplier* aBrCtlDataLoadSupplier, williamr@2: MBrCtlDataLoadConsumer** aBrCtlDataLoadConsumer) = 0; williamr@2: williamr@2: /** williamr@2: * Request the Browser Control to load a url williamr@2: * @since 2.8 williamr@2: * @param aUrl The url to load williamr@2: * @param aApId The Access Point Id to use williamr@2: * @param aCacheMode The cache mode to use. williamr@2: * Values: One of the following: williamr@2: * ECacheModeNormal williamr@2: * ECacheModeHistory williamr@2: * ECacheModeNoCache williamr@2: * ECacheModeOnlyCache williamr@2: * @see For a description of each of these values, see TBrCtlCacheMode williamr@2: * @return void williamr@2: */ williamr@2: IMPORT_C virtual void LoadUrlL( const TDesC& aUrl, williamr@2: TInt aApId = -1, williamr@2: TBrCtlDefs::TBrCtlCacheMode aBrCtlCacheMode = TBrCtlDefs::ECacheModeNormal) = 0; williamr@2: williamr@2: /** williamr@2: * Request the Browser Control to load and display a file from the file system williamr@2: * @since 2.8 williamr@2: * @param aFileName The name of the file williamr@2: * @return void williamr@2: */ williamr@2: IMPORT_C virtual void LoadFileL(const TDesC& aFileName) = 0; williamr@2: williamr@2: /** williamr@2: * Request the Browser Control to load and display a file from the file system williamr@2: * @since 2.8 williamr@2: * @param aFileHandle The handle of the file williamr@2: * @return void williamr@2: */ williamr@2: IMPORT_C virtual void LoadFileL(RFile& aFileHandle) = 0; williamr@2: williamr@2: /* williamr@2: * Return the WML Options for the current page williamr@2: * @since 2.8 williamr@2: * @param williamr@2: * @return The WML Options for the current page williamr@2: */ williamr@2: IMPORT_C virtual RPointerArray* WMLOptionMenuItemsL() = 0; williamr@2: williamr@2: /** williamr@2: * Request the Browser Control to add its own options to the option menu williamr@2: * @since 2.8 williamr@2: * @param aMenuPane Handle of the menu that will contain the options williamr@2: * @param aResourceId The resource ID of the menu williamr@2: * @param aAfter WML options should be added after that index williamr@2: * @return void williamr@2: */ williamr@2: IMPORT_C virtual void AddOptionMenuItemsL(CEikMenuPane& aMenuPane, TInt aResourceId, TInt aAfter=-1 ) = 0; williamr@2: williamr@2: /** williamr@2: * Request the Browser Control to clear the cache williamr@2: * @since 2.8 williamr@2: * @return The number of bytes that were freed from cache. williamr@2: */ williamr@2: IMPORT_C virtual TUint ClearCache() = 0; williamr@2: williamr@2: /** williamr@2: * Ask the Browser Control if a URL is in cache williamr@2: * @since 2.8 williamr@2: * @param aUrl The Url williamr@2: * @return ETrue, if a specific Url is in cache williamr@2: * EFalse if the URL is not in the cache williamr@2: */ williamr@2: IMPORT_C virtual TBool IsUrlInCache(TDesC& aUrl) = 0; williamr@2: williamr@2: /** williamr@2: * Ask the Browser Control to clear a URL from the cache williamr@2: * @since 2.8 williamr@2: * @param aUrl The Url williamr@2: * @return KErrNone if the URL is cleared from the cache williamr@2: * Error message is the URL has not been cleared. williamr@2: */ williamr@2: IMPORT_C virtual TInt ClearItemInCache(TDesC& aUrl) = 0; williamr@2: williamr@2: /** williamr@2: * Request the Browser Control to return info about the page. The info is returned on the Cleanup Stack. williamr@2: * @since 2.8 williamr@2: * @param aBrCtlPageInfo The type of requested info williamr@2: * @return A descriptor containing the requested page info williamr@2: * @attention The information is returned on the Cleanup stack. williamr@2: */ williamr@2: IMPORT_C virtual HBufC* PageInfoLC(TBrCtlDefs::TBrCtlPageInfo aBrCtlPageInfo ) = 0; williamr@2: williamr@2: /** williamr@2: * From CBrCtlInterface Query the Browser Control williamr@2: * if there is a previous or next (depending on aDirection) element in history stack williamr@2: * @param aDirection williamr@2: * ENavigationBack if you wish to query whether there is a previous element williamr@2: * in the history stack. williamr@2: * ENavigationForward if you wish to query whether there is a subsequent williamr@2: * element in the history stack. williamr@2: * @since 2.8 williamr@2: * @return ETrue if can go aDirection, EFalse otherwise williamr@2: */ williamr@2: IMPORT_C virtual TBool NavigationAvailable( TBrCtlDefs::TBrCtlNavigationDirection aDirection ) = 0; williamr@2: williamr@2: /** williamr@2: * Request the Browser Control to save the current content to a file williamr@2: * @since 2.8 williamr@2: * @param aFileName The name of the file to use for saving the content williamr@2: * @return The number of bytes in the saved file williamr@2: */ williamr@2: IMPORT_C virtual TUint16 SaveToFileL(const TDesC& aFileName) = 0; williamr@2: williamr@2: /** williamr@2: * Request the Browser Control to pass the server's certificate info for the current page williamr@2: * @since 2.8 williamr@2: * @return Certificate info of the server of the current page williamr@2: */ williamr@2: IMPORT_C virtual const TCertInfo* CertInfo() = 0; williamr@2: williamr@2: /** williamr@2: * Request the Browser Control to register for load events williamr@2: * @since 2.8 williamr@2: * @param aBrCtlLoadEventObserver A load events observer to add williamr@2: * @return void williamr@2: * @attenstion Call this function immediately after creating the Browser Control. williamr@2: * For multiple registrations, the host application may call this function more than once. williamr@2: * Observers must unregister before deleting the Browser Control. williamr@2: */ williamr@2: IMPORT_C virtual void AddLoadEventObserverL(MBrCtlLoadEventObserver* aBrCtlLoadEventObserver) = 0; williamr@2: williamr@2: /** williamr@2: * Request the Browser Control to unregister for load events williamr@2: * @since 2.8 williamr@2: * @param aBrCtlLoadEventObserver A load events observer to remove williamr@2: * @return void williamr@2: * @attenstion Call this function for each Load Observer that was previously registered. williamr@2: williamr@2: williamr@2: */ williamr@2: IMPORT_C virtual void RemoveLoadEventObserver(MBrCtlLoadEventObserver* aBrCtlLoadEventObserver) = 0; williamr@2: williamr@2: /** williamr@2: * Return the number of images in the current page williamr@2: * @since 2.8 williamr@2: * @param williamr@2: * @return The number of images in the current page williamr@2: */ williamr@2: IMPORT_C virtual TInt ImageCountL() = 0; williamr@2: williamr@2: /** williamr@2: * Returns the focused element williamr@2: * @since 2.8 williamr@2: * @return The type of the focused element williamr@2: * @attension The host application may need to perform special processing, williamr@2: * such as updating the softkeys, when a specific element has the focus. williamr@2: */ williamr@2: IMPORT_C virtual TBrCtlDefs::TBrCtlElementType FocusedElementType() = 0; williamr@2: williamr@2: /** williamr@2: * Register an observer for state changes williamr@2: * @since 2.8 williamr@2: * @param aBrCtlStateChangeObserver The observer to register williamr@2: * @return void williamr@2: * @attenstion The Observer must unregister before deleting the Browser Control. williamr@2: */ williamr@2: IMPORT_C virtual void AddStateChangeObserverL(MBrCtlStateChangeObserver* aBrCtlStateChangeObserver) = 0; williamr@2: williamr@2: /** williamr@2: * Unregister an observer for state changes williamr@2: * @since 2.8 williamr@2: * @param The observer to unregister williamr@2: * @return void williamr@2: */ williamr@2: IMPORT_C virtual void RemoveStateChangeObserver(MBrCtlStateChangeObserver* aBrCtlStateChangeObserver) = 0; williamr@2: williamr@2: /** williamr@2: * Request the Browser Control to return info about the Browser Control version. The info is returned on the Cleanup Stack. williamr@2: * @since 2.8 williamr@2: * @param aVersionInfo The type of requested info williamr@2: * @return A descriptor containing the requested page info williamr@2: * @attention The information is returned on the Cleanup Stack. williamr@2: */ williamr@2: IMPORT_C virtual HBufC* VersionInfoLC(TBrCtlDefs::TBrCtlVersionInfo aVersionInfo) = 0; williamr@2: williamr@2: /** williamr@2: * Pass a list of content types to the Browser Control. williamr@2: * These content types will not be using the download manager. williamr@2: * The list must be separated by ';' e.g. "text/html;text/wml" williamr@2: * @since 2.8 williamr@2: * @param aContentTypes The content types that should not use Download Manager williamr@2: * @return void williamr@2: * @deprecated This function is deprecated. Use the williamr@2: * EParamsSelfDownloadableTypes parameter of the SetParamL function instead. williamr@2: */ williamr@2: IMPORT_C virtual void SetSelfDownloadContentTypesL(TDesC& aContentTypes) = 0; williamr@2: williamr@2: /** williamr@2: * Update a Browser Control parameter. consequent calls with the williamr@2: * same aParam will replace the value, and not append to it. williamr@2: * @since 2.8 williamr@2: * @param aParam The parameter to update williamr@2: * @param aValue The new value of the parameter williamr@2: * EParamsSelfDownoadableTypes: Pass a list of content types to the williamr@2: * Browser Control. These content types will not be using the williamr@2: * download manager. The list must be separated by ';' e.g. williamr@2: * "text/html;text/wml" williamr@2: * williamr@2: * EParamsRequestHeaders: Pass a list of headers that the williamr@2: * Browser Control. These headers will be added to each request. williamr@2: * The list must be separated by '\r'. The header name and value must be williamr@2: * separated by ':' e.g. williamr@2: * "x-myheader: myvalue\rx-myotherheader: myothervalue" williamr@2: * @return void williamr@2: */ williamr@2: IMPORT_C virtual void SetParamL(TBrCtlDefs::TBrCtlParams aParam, const TDesC& aValue) = 0; williamr@2: williamr@2: /** williamr@2: * Request the Browser Control to load a saved page. williamr@2: * @since 3.0 williamr@2: * @param aUid a unique identifier for the saved page williamr@2: * @param aSavedPageBuffer buffer which contains the content of the saved page williamr@2: * @return void williamr@2: */ williamr@2: IMPORT_C virtual void LoadSavedPageL(const TDesC& aUid, TDesC& aSavedPageBuffer) = 0; williamr@2: williamr@2: /** williamr@2: * Return the zoom levels index williamr@2: * @since 3.0 williamr@2: * @return The zoom levels array. williamr@2: */ williamr@2: IMPORT_C virtual RArray* ZoomLevels() const = 0; williamr@2: williamr@2: /** williamr@2: * Perform the incremental find operation williamr@2: * @param aKeyword String to be find. williamr@2: * @since 3.0 williamr@2: * @return TBrCtlFindResponse williamr@2: */ williamr@2: IMPORT_C virtual int FindKeyword( const TDesC& aKeyword ) = 0; williamr@2: williamr@2: /** williamr@2: * Continue the incremental find operation williamr@2: * @since 3.0 williamr@2: * @param aFowardDirection TRUE if search is in forword direction. williamr@2: * For backword direction, it is FALSE. williamr@2: * @return TBrCtlFindResponse williamr@2: * @attention Method that is called when the user searches for the next williamr@2: * keyword in the doc. williamr@2: * williamr@2: */ williamr@2: IMPORT_C virtual TBrCtlDefs::TBrCtlFindResponse FindKeywordAgain( TBool aFowardDirection ) = 0; williamr@2: williamr@2: /** williamr@2: * Return information about the linked feeds in the current page - used to williamr@2: * build a "Subscribe to" submenu. williamr@2: * @since 3.0 williamr@2: * @return Information about the linked feeds in the current page. The williamr@2: * caller adopts the result. williamr@2: */ williamr@2: IMPORT_C virtual const RPointerArray& SubscribeToMenuItemsL() = 0; williamr@2: williamr@2: williamr@2: williamr@2: public: // Functions from base classes williamr@2: williamr@2: // Functions from CCoeControl williamr@2: williamr@2: /** williamr@2: * From CCoeControl Return the minimum size the Browser Control can use williamr@2: * @since 2.8 williamr@2: * @return The minimum size that the Browser Control can use. williamr@2: * @attention This function is inherited from the Symbian CCoeControl class. williamr@2: */ williamr@2: IMPORT_C virtual TSize MinimumSize() = 0; williamr@2: williamr@2: /** williamr@2: * From CCoeControl Pass key events to the Browser Control williamr@2: * @since 2.8 williamr@2: * @param aKeyEvent The key event williamr@2: * @param aType The key code williamr@2: * @return If the Browser Control consumed the key event or not williamr@2: * @attention This function is inherited from the Symbian CCoeControl class. williamr@2: */ williamr@2: IMPORT_C virtual TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent, TEventCode aType) = 0; williamr@2: williamr@2: /** williamr@2: * From CCoeControl Sets that the Browser Control has keyboard focus. williamr@2: * @since 2.8 williamr@2: * @param aFocus If the Browser Control gets or loses focus williamr@2: * @param ENoDrawNow If the Browser Control should redraw itself as result of focus change williamr@2: * @return void williamr@2: * @attention This function is inherited from the Symbian CCoeControl class. williamr@2: */ williamr@2: IMPORT_C virtual void SetFocus(TBool aFocus, TDrawNow aDrawNow = ENoDrawNow) = 0; williamr@2: williamr@2: /* williamr@2: * This method calls to download manager in order to display query "Cancel williamr@2: * outstanding downloads?" and cancel if it requested by user williamr@2: * @param none williamr@2: * @return ETrue if it is OK to exit; EFalse - if it is not OK to exit williamr@2: */ williamr@2: IMPORT_C virtual TBool OkToExit() = 0; williamr@2: williamr@2: williamr@2: /** williamr@2: * This method calls to download manager in order to send the commands (EDownloadCmdPause,DownloadCmdResume, williamr@2: * EDownloadCmdCancel, EDownloadCmdMarkAsProgressive, EDownloadCmdMarkAsNotProgressive ) williamr@2: * @param aCommand The command that the Browser Control should process williamr@2: * @param aTransId The transaction Id associated with this command williamr@2: * @return void williamr@2: */ williamr@2: IMPORT_C virtual void HandleDownloadCommandL(TUint16 aTransId, TBrCtlDefs::TBrCtlDownloadCmd aCommand) = 0; williamr@2: williamr@2: /** williamr@2: * Request icon for the given url williamr@2: * @since 3.1 williamr@2: * @param aUrl url to a favicon or a page williamr@2: * @param aBitmapInfo info on whether to retun a favicon or a page icon williamr@2: * @return favion icon or page icon williamr@2: */ williamr@2: IMPORT_C virtual CGulIcon* GetBitmapData(const TDesC& aUrl, TBrCtlDefs::TBrCtlBitmapInfo aBitmapInfo) = 0; williamr@2: williamr@2: /** williamr@2: * Register a client command interface for the browser engine williamr@2: * @since 3.1 williamr@2: * @param The observer to register williamr@2: * @return void williamr@2: */ williamr@2: IMPORT_C virtual void AddCommandObserverL(MBrCtlCommandObserver* aBrCtlCommandObserver) = 0; williamr@2: williamr@2: /** williamr@2: * Unregister a client command interface for the browser engine williamr@2: * @since 3.1 williamr@2: * @param The observer to unregister williamr@2: * @return void williamr@2: */ williamr@2: IMPORT_C virtual void RemoveCommandObserver(MBrCtlCommandObserver* aBrCtlCommandObserver) = 0; williamr@2: williamr@2: /** williamr@2: * Unregister a client command interface for the browser engine williamr@2: * @since 3.1 williamr@2: * @param The observer to unregister williamr@2: * @return void williamr@2: */ williamr@2: IMPORT_C virtual MWidgetExtension* CreateWidgetExtensionL(MWidgetCallback& aWidgetCallback) = 0; williamr@2: williamr@2: /** williamr@2: * Get information about the focused image. The function leaves if the focus is not on an image williamr@2: * @since 3.2 williamr@2: * @param williamr@2: * @return The requested information williamr@2: */ williamr@2: IMPORT_C virtual TBrCtlImageCarrier* FocusedImageLC() = 0; williamr@2: williamr@2: /** williamr@2: * Requests the Browser Control to POST to a URL williamr@2: * @since 5.0 williamr@2: * @param aUrl URL to which the Browser Control sends the POST request williamr@2: * @param aContentType Content type of the data to be posted williamr@2: * @param aPostData Data to be posted williamr@2: * @param aBoundary Boundary for form-data or multi-part content. williamr@2: * @param aReserved For future use only williamr@2: * @return void williamr@2: */ williamr@2: IMPORT_C virtual void PostUrlL (const TDesC& aUrl, williamr@2: const TDesC8& aContentType, williamr@2: const TDesC8& aPostData, williamr@2: const TDesC8* aBoundary, williamr@2: TAny* aReserved) = 0; williamr@2: /** williamr@2: * Requests the Browser Control for offscreen bitmap williamr@2: * @since 5.0 williamr@2: * @ fills offscreen bitmap.The bitmap memory has to be set and freed by the api calling that function. williamr@2: * @return void. williamr@2: */ williamr@2: IMPORT_C virtual void TakeSnapshotL(CFbsBitmap& snapshot) = 0; williamr@2: }; williamr@2: williamr@2: williamr@2: /** williamr@2: * The MBrCtlDataLoadSupplier class is a callback interface that williamr@2: * provides the Browser Control with the ability to display content incrementally. williamr@2: * It does this by providing a means for the Browser Control to cancel the load operation williamr@2: * if an error occurs. williamr@2: * For example, if the Browser Control runs out of memory during the williamr@2: * load operation, it can cancel that operation by means of this interface. williamr@2: * williamr@2: * Usage: williamr@2: * williamr@2: * @code williamr@2: * #include williamr@2: * @see S60 Platform: Browser Control API Developer's Guide Version 2.0 williamr@2: * @lib BrowserEngine.lib williamr@2: * @since 2.8 williamr@2: * @file BrCtlInterface.h williamr@2: * @endcode * williamr@2: */ williamr@2: class MBrCtlDataLoadSupplier williamr@2: { williamr@2: public: // New functions williamr@2: /** williamr@2: * Cancel the load operation williamr@2: * @since 2.8 williamr@2: * @return void williamr@2: */ williamr@2: virtual void CancelLoad() = 0; williamr@2: }; williamr@2: williamr@2: williamr@2: williamr@2: /** williamr@2: * The MBrCtlDataLoadConsumer class is a callback interface that provides williamr@2: * the Browser Control with the ability to receive content incrementally. williamr@2: * williamr@2: * @code williamr@2: * #include williamr@2: * @see S60 Platform: Browser Control API Developer's Guide Version 2.0 williamr@2: * @lib BrowserEngine.lib williamr@2: * @since 2.8 williamr@2: * @file BrCtlInterface.h williamr@2: * @endcode * williamr@2: */ williamr@2: class MBrCtlDataLoadConsumer williamr@2: { williamr@2: public: // New functions williamr@2: /** williamr@2: * Pass the next data chunk williamr@2: * @since 2.8 williamr@2: * @param aData The data chunk to process williamr@2: * @return void williamr@2: */ williamr@2: virtual void HandleNextDataChunk(const TDesC8& aData) = 0; williamr@2: williamr@2: /** williamr@2: * Inform the Browser Control about completion of data load williamr@2: * @since 2.8 williamr@2: * @return void williamr@2: */ williamr@2: virtual void HandleLoadComplete() = 0; williamr@2: williamr@2: /** williamr@2: * Inform the Browser Control that an error occured williamr@2: * if HandleError() is called, then LoadComplete() is infered. williamr@2: * @since 2.8 williamr@2: * @param aError The error code williamr@2: * @return void williamr@2: */ williamr@2: virtual void HandleError(TInt aError) = 0; williamr@2: }; williamr@2: williamr@2: /** williamr@2: * The MBrCtlLoadEventObserver interface receives load progress events. williamr@2: * The host application can implement this interface. williamr@2: * williamr@2: * @code williamr@2: * #include williamr@2: * @see S60 Platform: Browser Control API Developer's Guide Version 2.0 williamr@2: * @lib BrowserEngine.lib williamr@2: * @since 2.8 williamr@2: * @file BrCtlInterface.h williamr@2: * @endcode * williamr@2: */ williamr@2: class MBrCtlLoadEventObserver williamr@2: { williamr@2: public: // New functions williamr@2: /** williamr@2: * A load events notification williamr@2: * @since 2.8 williamr@2: * @param aLoadEvent The load event williamr@2: * @param aSize Size depends on the event williamr@2: * @param aTransactionId The transaction id of the transaction that had this event williamr@2: * @return void williamr@2: */ williamr@2: virtual void HandleBrowserLoadEventL(TBrCtlDefs::TBrCtlLoadEvent aLoadEvent, TUint aSize, TUint16 aTransactionId) = 0; williamr@2: }; williamr@2: williamr@2: /** williamr@2: * The TBrCtlWmlServiceOption class wraps information about the WML DO elements. williamr@2: * For more information about the DO tag, see http://www.w3schools.com/wap/tag_do.asp. williamr@2: * @code williamr@2: * #include williamr@2: * @lib BrowserEngine.lib williamr@2: * @since 2.8 williamr@2: * @file BrCtlInterface.h williamr@2: * @endcode * williamr@2: */ williamr@2: class TBrCtlWmlServiceOption williamr@2: { williamr@2: public: williamr@2: /** williamr@2: * Constructor williamr@2: * @since 2.8 williamr@2: * @param aText The text to display in the WML service options williamr@2: * @param aElemID The element Id to use when the user selects this command williamr@2: * @param aActualElemID Internal to the Browser Control. The host williamr@2: * application should not modify this parameter. williamr@2: */ williamr@2: TBrCtlWmlServiceOption(HBufC* aText, TUint aElemID, TUint aActualElemID); williamr@2: /** williamr@2: * Displays the text for the WML service options williamr@2: * @since 2.8 williamr@2: * @return Text to display for the WML service options williamr@2: */ williamr@2: inline const TDesC& Text() {return *iText;} williamr@2: /** williamr@2: * Gets the command ID to use when the user selects this command williamr@2: * @since 2.8 williamr@2: * @return Element ID employed when the user selects this command williamr@2: */ williamr@2: inline TUint ElemID(){return iElemID;} williamr@2: /** williamr@2: * Gets the actual element ID defined in the WML page. williamr@2: * @since 2.8 williamr@2: * @return Actual element ID williamr@2: * @attention This parameter is internal to the Browser Control. williamr@2: * The host application should not modify this parameter. williamr@2: */ williamr@2: inline TUint ActualElemID(){return iActualElemID;} williamr@2: williamr@2: /** williamr@2: * Destructor. williamr@2: */ williamr@2: ~TBrCtlWmlServiceOption(); williamr@2: williamr@2: private: // Data williamr@2: /** williamr@2: * Default constructor williamr@2: * @since 2.8 williamr@2: */ williamr@2: TBrCtlWmlServiceOption() {}; williamr@2: williamr@2: // The text to display in the WML service options williamr@2: HBufC* iText; williamr@2: // The element Id to use when the user selects this command williamr@2: TUint iElemID; williamr@2: // The actual element Id williamr@2: TUint iActualElemID; williamr@2: }; williamr@2: williamr@2: /** williamr@2: * The TBrCtlSubscribeTo class provides information of Subscribe to items. williamr@2: * @code williamr@2: * #include williamr@2: * @lib BrowserEngine.lib williamr@2: * @since 2.8 williamr@2: * @file BrCtlInterface.h williamr@2: * @endcode * williamr@2: */ williamr@2: class TBrCtlSubscribeTo williamr@2: { williamr@2: public: williamr@2: /** williamr@2: * Constructor williamr@2: * @since 3.0 williamr@2: * @param aText The text to display in the subscribe to option. aText williamr@2: * is adopted. williamr@2: * @param aCommandID The menu command Id to use when the user selects it. williamr@2: */ williamr@2: TBrCtlSubscribeTo(const TPtrC& aTitle, const TPtrC& aUrl, TUint aCommandID); williamr@2: williamr@2: /** williamr@2: * Returns the title. williamr@2: * @since 3.0 williamr@2: * @return The title. williamr@2: */ williamr@2: inline const TPtrC& Title() {return iTitle;} williamr@2: williamr@2: /** williamr@2: * Returns the url. williamr@2: * @since 3.0 williamr@2: * @return The url. williamr@2: */ williamr@2: inline const TPtrC& Url() {return iUrl;} williamr@2: williamr@2: /** williamr@2: * Returns the command. williamr@2: * @since 3.0 williamr@2: * @return The command. williamr@2: */ williamr@2: inline TUint CommandID() {return iCommandID;} williamr@2: williamr@2: private: williamr@2: /** williamr@2: * Default constructor williamr@2: * @since 3.0 williamr@2: */ williamr@2: TBrCtlSubscribeTo(); williamr@2: williamr@2: private: // Data williamr@2: const TPtrC iTitle; williamr@2: const TPtrC iUrl; williamr@2: williamr@2: TUint iCommandID; williamr@2: }; williamr@2: williamr@2: /** williamr@2: * The MBrCtlStateChangeObserver class receives state-changed events. williamr@2: * At the present time, there is only one state-changed event. williamr@2: * This event is generated when the browser switches to and from williamr@2: * the Image Map view. In Image Map view, only an image map is displayed, williamr@2: * which enables the user to navigate. The host application can williamr@2: * implement this interface in order to find out when the view williamr@2: * changes to and from the Image Map view. williamr@2: * @code williamr@2: * #include williamr@2: * @lib BrowserEngine.lib williamr@2: * @since 2.8 williamr@2: * @file BrCtlInterface.h williamr@2: * @endcode * williamr@2: */ williamr@2: class MBrCtlStateChangeObserver williamr@2: { williamr@2: public: williamr@2: /** williamr@2: * Notifies the Browser Control of a state-changed event. williamr@2: * @param aState Indicates whether or not the browser is in Image Map view. williamr@2: * Value:EStateImageMapView williamr@2: * @param aValue Indicates the state being changed. williamr@2: * Values: williamr@2: * ETrue indicates entering Image Map view williamr@2: * EFalse indicates exiting Image Map view williamr@2: * @since 2.8 williamr@2: * @return void williamr@2: */ williamr@2: virtual void StateChanged(TBrCtlDefs::TBrCtlState aState, TInt aValue) = 0; williamr@2: }; williamr@2: williamr@2: // CLASS DECLARATION williamr@2: /** williamr@2: * This class provides a mechanism for the browser engine to pass commands to the client williamr@2: * williamr@2: * @lib BrowserEngine.lib williamr@2: * @since 3.1 williamr@2: */ williamr@2: class MBrCtlCommandObserver williamr@2: { williamr@2: public: // New functions williamr@2: /** williamr@2: * Method to call client to execute commands williamr@2: * @since 3.1 williamr@2: * @param A callback command williamr@2: * @param Array of attribute names williamr@2: * @param Array of attribute values williamr@2: * @return void williamr@2: */ williamr@2: virtual void HandleCommandL(TBrCtlDefs::TBrCtlClientCommands aCommand, const CArrayFix& aAttributesNames, williamr@2: const CArrayFix& aAttributeValues) = 0; williamr@2: }; williamr@2: williamr@2: // CLASS DECLARATION williamr@2: /** williamr@2: * This class provides a mechanism for the browser engine to interact with the widget host application williamr@2: * williamr@2: * @lib BrowserEngine.lib williamr@2: * @since 3.2 williamr@2: */ williamr@2: class MWidgetCallback williamr@2: { williamr@2: public: williamr@2: /** williamr@2: * Navigates through your file system and selects a file of specific mime type; williamr@2: * analogous to the Browse command in Windows. williamr@2: * @since 3.2 williamr@2: * @param aSelectedFileName The selected file name. williamr@2: * @param aMimeType The accepted mime type. williamr@2: * @return ETrue if the user selected a file williamr@2: * EFalse if the user cancelled the transaction and did not select a file. williamr@2: * @attiontion Returned on cleanup stack. Browser control will free the buffer. williamr@2: */ williamr@2: virtual TBool DialogMimeFileSelectLC(HBufC*& aSelectedFileName, williamr@2: const TDesC& aMimeType) = 0; williamr@2: williamr@2: /** williamr@2: * Called to show or hide softkeys williamr@2: * @since 3.1 williamr@2: * @param aVisible ETrue to show softkeys, EFalse when full screen is needed williamr@2: */ williamr@2: virtual void SetSoftkeysVisible(TBool aVisible) = 0; williamr@2: williamr@2: /** williamr@2: * Called to change the display orientation to landscape williamr@2: * @since 3.1 williamr@2: */ williamr@2: virtual void SetDisplayMode(TBrCtlDefs::TBrCtlOrientation aOrientation) = 0; williamr@2: williamr@2: //Reserved for future use williamr@2: virtual TInt Reserved_1(TAny*& a0, TAny* a1, TAny* a2) = 0; williamr@2: virtual TInt Reserved_2(TAny*& a0, TAny* a1, TAny* a2) = 0; williamr@2: virtual TInt Reserved_3(TAny*& a0, TAny* a1, TAny* a2) = 0; williamr@2: virtual TInt Reserved_4(TAny*& a0, TAny* a1, TAny* a2) = 0; williamr@2: virtual TInt Reserved_5(TAny*& a0, TAny* a1, TAny* a2) = 0; williamr@2: virtual TInt Reserved_6(TAny*& a0, TAny* a1, TAny* a2) = 0; williamr@2: virtual TInt Reserved_7(TAny*& a0, TAny* a1, TAny* a2) = 0; williamr@2: virtual TInt Reserved_8(TAny*& a0, TAny* a1, TAny* a2) = 0; williamr@2: virtual TInt Reserved_9(TAny*& a0, TAny* a1, TAny* a2) = 0; williamr@2: virtual TInt Reserved_10(TAny*& a0, TAny* a1, TAny* a2) = 0; williamr@2: }; williamr@2: williamr@2: // CLASS DECLARATION williamr@2: /** williamr@2: * This class provides an extension mechanism for the widget host app to interact with the browser engine williamr@2: * This class includes the Widget specific extension needed in the browser engine williamr@2: * @lib BrowserEngine.lib williamr@2: * @since 3.2 williamr@2: */ williamr@2: class MWidgetExtension williamr@2: { williamr@2: public: // New functions williamr@2: /** williamr@2: * Method to set parameters in the browser engine williamr@2: * @since 3.2 williamr@2: * @param The widget identifier williamr@2: * @param The value for the paramater williamr@2: * @return void williamr@2: */ williamr@2: virtual void SetParamL(TBrCtlDefs::TBrCtlWidgetParams aParam, const TDesC& aValue) = 0; williamr@2: williamr@2: /** williamr@2: * Method to set parameters in the browser engine williamr@2: * @since 3.2 williamr@2: * @param The widget parameter aParam williamr@2: * @param The value for the paramater williamr@2: * @return void williamr@2: */ williamr@2: virtual void SetParamL(TBrCtlDefs::TBrCtlWidgetParams aParam, TUint aValue) = 0; williamr@2: williamr@2: /** williamr@2: * Method to invoke callback function for right soft key williamr@2: * @since 3.2 williamr@2: * @param none williamr@2: * @return ETrue if there is a rightsoftkey callback, else EFalse williamr@2: */ williamr@2: virtual TBool HandleCommandL( TInt aCommandId ) = 0; williamr@2: williamr@2: }; williamr@2: #endif // BRCTLINTERFACE_H williamr@2: williamr@2: // End of File