2 * Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies).
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".
9 * Initial Contributors:
10 * Nokia Corporation - initial contribution.
14 * Description: Definition of the Browser Control API
19 #ifndef BRCTLINTERFACE_H
20 #define BRCTLINTERFACE_H
30 #include <brctldialogsprovider.h>
31 #include <brctllayoutobserver.h>
32 #include <brctllinkresolver.h>
33 #include <brctlsoftkeysobserver.h>
34 #include <brctlspecialloadobserver.h>
35 #include <brctlwindowobserver.h>
36 #include <brctldownloadobserver.h>
37 #include <brctldefs.h>
41 // FORWARD DECLARATIONS
42 class MBrCtlDataLoadSupplier;
43 class MBrCtlDataLoadConsumer;
44 class MBrCtlLoadEventObserver;
45 class MBrCtlDialogsProvider;
46 class TBrCtlWmlServiceOption;
47 class TBrCtlSubscribeTo;
48 class MBrCtlStateChangeObserver;
49 class MBrCtlCommandObserver;
50 class MWidgetCallback;
51 class MWidgetExtension;
52 class CBrCtlInterface;
54 class TBrCtlImageCarrier;
57 * Creates the browser control.
59 * @param aParent Parent window of the browser control
60 * @param aRect Bounding rectangle for the browser control
61 * @param aBrCtlCapabilities Desired capabilities of the browser control.
62 * For example, displaying scroll bars, allowing network access for HTTP requests.
63 * @see For a complete list of capability options, see TBrCtlCapabilities
64 * @param aCommandIdBase Base values for Command IDs for Browser Control.
65 * These are added to ensure that each Command ID is unique; Browser Control command IDs must be different from the host application command IDs.
66 * @see For more information, see TBrCtlCommandId
67 * @param aBrCtlSoftkeysObserver Softkeys observer.
68 * Default: the host application does not update the softkeys.
69 * @see For more information, see MBrCtlSoftkeysObserver class
70 * @param aBrCtlLinkResolver Link Resolver. Must be provided if ECapabilityClient
71 * ResolveEmbeddedURL or ECapabilityClientNotifyURL is set.
72 * @see For more information, see MBrCtlLinkResolver class.
73 * @param aBrCtlSpecialLoadObserver Special Load Observer.
74 * @see MBrCtlSpecialLoadObserver class for more details of special load observer.
75 * @param aBrCtlLayoutObserver Layout Observer.
77 * Non-markup pages are not handled by the browser.
78 * Non-HTTP(S) schemes are not handled by the browser.
79 * Connection is created by the Proxy Filter.
80 * @see For more information, see MBrCtlLayoutObserver class
81 * @param aBrCtlDialogsProvider Dialogs Provider.
82 * @see For more information, see MBrCtlDialogsProvider class
83 * @param aBrCtlWindowObserver Window Observer.
84 * @see For more information, see MBrCtlWindowObserver class
85 * @param aBrCtlDownloadObserver Downlaod observer
86 * @see For more information, MBrCtlDownloadObserver class
87 * @return a pointer to CBrCtlInterface class or NULL if this function fails.
89 IMPORT_C CBrCtlInterface* CreateBrowserControlL(CCoeControl* aParent, TRect aRect,
90 TUint aBrCtlCapabilities, TUint aCommandIdBase = TBrCtlDefs::ECommandIdBase,
91 MBrCtlSoftkeysObserver* aBrCtlSoftkeysObserver = NULL,
92 MBrCtlLinkResolver* aBrCtlLinkResolver = NULL,
93 MBrCtlSpecialLoadObserver* aBrCtlSpecialLoadObserver = NULL,
94 MBrCtlLayoutObserver* aBrCtlLayoutObserver = NULL,
95 MBrCtlDialogsProvider* aBrCtlDialogsProvider = NULL,
96 MBrCtlWindowObserver* aBrCtlWindowObserver = NULL,
97 MBrCtlDownloadObserver* aBrCtlDownloadObserver = NULL );
100 * The CBrCtlInterface class is the base class of the Browser Control API.
101 * All clients of browser control must use this class. The functions defined
102 * in the CBrCtlInterface class implement basic Browser Control functionality.
103 * You can customize the Browser Control to extend its functionality by
104 * implementing additional interface classes in the host application. Examples
105 * of such classes are MBrCtlDataLoadSupplier, MBrCtlDialogsProvider,
106 * MBrCtlDialogsProvider etc.
111 * #include <brctlinterface.h>
112 * // Interface that provides dialogs used by the Browser Control.
113 * #include <brctldialogsprovider.h>
114 * // Interface used to receive scrolling events.
115 * #include <brctllayoutobserver.h>
116 * //Interface that provides a callback mechanism for receiving the
117 * //content of an embedded link or the content of a user-initiated
119 * #include <brctllinkresolver.h>
120 * //Interface that handles requests to change the softkeys.
121 * #include <brctlsoftkeysobserver.h>
122 * //Interface that handles special load needs.
123 * #include <brctlspecialloadobserver.h>
124 * //Reserved for future use.
125 * #include <brctlwindowobserver.h>
126 * //Interface that passes download events from the
127 * //Download Manager through the Browser Control to the
128 * //host application.
129 * #include <brctldownloadobserver.h>
130 * Enum Definition of the Browser Control API.
131 * #include <brctldefs.h>
134 * The following types of things you can do with the Browser Control API.
136 * Creating a basic Browser Control
137 * Creating a Browser Control with observer interfaces
139 * Passing content incrementally
140 * Receiving load progress events
141 * Handling special load requests
142 * Customizing dialogs
143 * Specifying the softkeys
145 * Customizing scroll bars
146 * Receiving change-of-state events
148 * @see S60 Platform: Browser Control API Developer's Guide Version 2.0
149 * @lib BrowserEngine.lib
151 * @file brctlinterface.h
154 class CBrCtlInterface : public CCoeControl
156 public: // Constructors and destructor
161 inline virtual ~CBrCtlInterface() {}
163 public: // New functions
166 * Passes a command to the Browser Control..
168 * @param aCommand The command that the Browser Control should process
170 * @see TBrCtlCommands, For a complete list of commands,
172 IMPORT_C virtual void HandleCommandL(TInt aCommand) = 0;
175 * Return the display size that would be needed to see all the content
177 * @return The display size that would be needed to see all the content
179 IMPORT_C virtual TSize ContentSize() = 0;
182 * Update a Browser Control setting
184 * @param aSetting The setting to update
185 * @param aValue The new value of the setting
186 * @leave KErrArgument if the value of aSetting is out of range.
189 IMPORT_C virtual void SetBrowserSettingL(TUint aSetting, TUint aValue) = 0;
192 * Get a setting from the Browser Control
194 * @param aSetting The setting to get
195 * @leave KErrArgument if the value of aSetting is out of range.
196 * @return The value of the setting
198 IMPORT_C virtual TUint BrowserSettingL(TUint aSetting) = 0;
201 * Request the Browser Control to display the content of a buffer
203 * @param aUrl A url that refers to the data. If a url scheme is used, it must be "data:"
204 * @param aData The content to display. Browser Control does not take ownership
205 * @param aDataType The data type of the data
206 * @param aCharsetUid The UID of the character converter of the content's charset 0 assumed Latin-1
208 * @attention If you use this function, the Browser Control does not keep
209 * track of the history. If the data is not markup, Browser Control uses
210 * the Special Load Observer to pass the content back to the Host Application.
211 * The Special Load Observer uses the Document Handler to send the content
212 * to the proper application.
214 IMPORT_C virtual void LoadDataL(const TDesC& aUrl,
216 const TDataType& aDataType,
217 TUid aCharsetUid) = 0;
220 * Request the Browser Control to display content incrementaly
222 * @param aUrl A url that refers to the data. If a url scheme is used, it must be "data:"
223 * @param aDataType The data type of the data
224 * @param aCharsetUid The UID of the character converter of the content's charset 0 assumed Latin-1
225 * @param aContentLength The length of the content.
226 * @param aBrCtlDataLoadSupplier A callback interface to stop passing data if an error occured in the Browser Control
227 * @param aBrCtlDataLoadConsumer A callback interface returned by the browser. Data should be passed to that interface
229 * @attension If you use this function, the Browser Control does not keep
230 * track of the history.If the content type of the data is not markup, Browser
231 * Control uses the Special Load Observer to pass the content back to the Host
232 * Application. The Special Load Observer uses the Document Handler to send
233 * the content to the proper application.
235 // The url scheme must be "data:" The url is needed as reference to this load request
236 IMPORT_C virtual void InitLoadDataL(const TDesC& aUrl,
237 const TDataType& aDataType,
239 TUint aContentLength,
240 MBrCtlDataLoadSupplier* aBrCtlDataLoadSupplier,
241 MBrCtlDataLoadConsumer** aBrCtlDataLoadConsumer) = 0;
244 * Request the Browser Control to load a url
246 * @param aUrl The url to load
247 * @param aApId The Access Point Id to use
248 * @param aCacheMode The cache mode to use.
249 * Values: One of the following:
253 * ECacheModeOnlyCache
254 * @see For a description of each of these values, see TBrCtlCacheMode
257 IMPORT_C virtual void LoadUrlL( const TDesC& aUrl,
259 TBrCtlDefs::TBrCtlCacheMode aBrCtlCacheMode = TBrCtlDefs::ECacheModeNormal) = 0;
262 * Request the Browser Control to load and display a file from the file system
264 * @param aFileName The name of the file
267 IMPORT_C virtual void LoadFileL(const TDesC& aFileName) = 0;
270 * Request the Browser Control to load and display a file from the file system
272 * @param aFileHandle The handle of the file
275 IMPORT_C virtual void LoadFileL(RFile& aFileHandle) = 0;
278 * Return the WML Options for the current page
281 * @return The WML Options for the current page
283 IMPORT_C virtual RPointerArray<TBrCtlWmlServiceOption>* WMLOptionMenuItemsL() = 0;
286 * Request the Browser Control to add its own options to the option menu
288 * @param aMenuPane Handle of the menu that will contain the options
289 * @param aResourceId The resource ID of the menu
290 * @param aAfter WML options should be added after that index
293 IMPORT_C virtual void AddOptionMenuItemsL(CEikMenuPane& aMenuPane, TInt aResourceId, TInt aAfter=-1 ) = 0;
296 * Request the Browser Control to clear the cache
298 * @return The number of bytes that were freed from cache.
300 IMPORT_C virtual TUint ClearCache() = 0;
303 * Ask the Browser Control if a URL is in cache
305 * @param aUrl The Url
306 * @return ETrue, if a specific Url is in cache
307 * EFalse if the URL is not in the cache
309 IMPORT_C virtual TBool IsUrlInCache(TDesC& aUrl) = 0;
312 * Ask the Browser Control to clear a URL from the cache
314 * @param aUrl The Url
315 * @return KErrNone if the URL is cleared from the cache
316 * Error message is the URL has not been cleared.
318 IMPORT_C virtual TInt ClearItemInCache(TDesC& aUrl) = 0;
321 * Request the Browser Control to return info about the page. The info is returned on the Cleanup Stack.
323 * @param aBrCtlPageInfo The type of requested info
324 * @return A descriptor containing the requested page info
325 * @attention The information is returned on the Cleanup stack.
327 IMPORT_C virtual HBufC* PageInfoLC(TBrCtlDefs::TBrCtlPageInfo aBrCtlPageInfo ) = 0;
330 * From CBrCtlInterface Query the Browser Control
331 * if there is a previous or next (depending on aDirection) element in history stack
333 * ENavigationBack if you wish to query whether there is a previous element
334 * in the history stack.
335 * ENavigationForward if you wish to query whether there is a subsequent
336 * element in the history stack.
338 * @return ETrue if can go aDirection, EFalse otherwise
340 IMPORT_C virtual TBool NavigationAvailable( TBrCtlDefs::TBrCtlNavigationDirection aDirection ) = 0;
343 * Request the Browser Control to save the current content to a file
345 * @param aFileName The name of the file to use for saving the content
346 * @return The number of bytes in the saved file
348 IMPORT_C virtual TUint16 SaveToFileL(const TDesC& aFileName) = 0;
351 * Request the Browser Control to pass the server's certificate info for the current page
353 * @return Certificate info of the server of the current page
355 IMPORT_C virtual const TCertInfo* CertInfo() = 0;
358 * Request the Browser Control to register for load events
360 * @param aBrCtlLoadEventObserver A load events observer to add
362 * @attenstion Call this function immediately after creating the Browser Control.
363 * For multiple registrations, the host application may call this function more than once.
364 * Observers must unregister before deleting the Browser Control.
366 IMPORT_C virtual void AddLoadEventObserverL(MBrCtlLoadEventObserver* aBrCtlLoadEventObserver) = 0;
369 * Request the Browser Control to unregister for load events
371 * @param aBrCtlLoadEventObserver A load events observer to remove
373 * @attenstion Call this function for each Load Observer that was previously registered.
377 IMPORT_C virtual void RemoveLoadEventObserver(MBrCtlLoadEventObserver* aBrCtlLoadEventObserver) = 0;
380 * Return the number of images in the current page
383 * @return The number of images in the current page
385 IMPORT_C virtual TInt ImageCountL() = 0;
388 * Returns the focused element
390 * @return The type of the focused element
391 * @attension The host application may need to perform special processing,
392 * such as updating the softkeys, when a specific element has the focus.
394 IMPORT_C virtual TBrCtlDefs::TBrCtlElementType FocusedElementType() = 0;
397 * Register an observer for state changes
399 * @param aBrCtlStateChangeObserver The observer to register
401 * @attenstion The Observer must unregister before deleting the Browser Control.
403 IMPORT_C virtual void AddStateChangeObserverL(MBrCtlStateChangeObserver* aBrCtlStateChangeObserver) = 0;
406 * Unregister an observer for state changes
408 * @param The observer to unregister
411 IMPORT_C virtual void RemoveStateChangeObserver(MBrCtlStateChangeObserver* aBrCtlStateChangeObserver) = 0;
414 * Request the Browser Control to return info about the Browser Control version. The info is returned on the Cleanup Stack.
416 * @param aVersionInfo The type of requested info
417 * @return A descriptor containing the requested page info
418 * @attention The information is returned on the Cleanup Stack.
420 IMPORT_C virtual HBufC* VersionInfoLC(TBrCtlDefs::TBrCtlVersionInfo aVersionInfo) = 0;
423 * Pass a list of content types to the Browser Control.
424 * These content types will not be using the download manager.
425 * The list must be separated by ';' e.g. "text/html;text/wml"
427 * @param aContentTypes The content types that should not use Download Manager
429 * @deprecated This function is deprecated. Use the
430 * EParamsSelfDownloadableTypes parameter of the SetParamL function instead.
432 IMPORT_C virtual void SetSelfDownloadContentTypesL(TDesC& aContentTypes) = 0;
435 * Update a Browser Control parameter. consequent calls with the
436 * same aParam will replace the value, and not append to it.
438 * @param aParam The parameter to update
439 * @param aValue The new value of the parameter
440 * EParamsSelfDownoadableTypes: Pass a list of content types to the
441 * Browser Control. These content types will not be using the
442 * download manager. The list must be separated by ';' e.g.
443 * "text/html;text/wml"
445 * EParamsRequestHeaders: Pass a list of headers that the
446 * Browser Control. These headers will be added to each request.
447 * The list must be separated by '\r'. The header name and value must be
448 * separated by ':' e.g.
449 * "x-myheader: myvalue\rx-myotherheader: myothervalue"
452 IMPORT_C virtual void SetParamL(TBrCtlDefs::TBrCtlParams aParam, const TDesC& aValue) = 0;
455 * Request the Browser Control to load a saved page.
457 * @param aUid a unique identifier for the saved page
458 * @param aSavedPageBuffer buffer which contains the content of the saved page
461 IMPORT_C virtual void LoadSavedPageL(const TDesC& aUid, TDesC& aSavedPageBuffer) = 0;
464 * Return the zoom levels index
466 * @return The zoom levels array.
468 IMPORT_C virtual RArray<TUint>* ZoomLevels() const = 0;
471 * Perform the incremental find operation
472 * @param aKeyword String to be find.
474 * @return TBrCtlFindResponse
476 IMPORT_C virtual int FindKeyword( const TDesC& aKeyword ) = 0;
479 * Continue the incremental find operation
481 * @param aFowardDirection TRUE if search is in forword direction.
482 * For backword direction, it is FALSE.
483 * @return TBrCtlFindResponse
484 * @attention Method that is called when the user searches for the next
485 * keyword in the doc.
488 IMPORT_C virtual TBrCtlDefs::TBrCtlFindResponse FindKeywordAgain( TBool aFowardDirection ) = 0;
491 * Return information about the linked feeds in the current page - used to
492 * build a "Subscribe to" submenu.
494 * @return Information about the linked feeds in the current page. The
495 * caller adopts the result.
497 IMPORT_C virtual const RPointerArray<TBrCtlSubscribeTo>& SubscribeToMenuItemsL() = 0;
501 public: // Functions from base classes
503 // Functions from CCoeControl
506 * From CCoeControl Return the minimum size the Browser Control can use
508 * @return The minimum size that the Browser Control can use.
509 * @attention This function is inherited from the Symbian CCoeControl class.
511 IMPORT_C virtual TSize MinimumSize() = 0;
514 * From CCoeControl Pass key events to the Browser Control
516 * @param aKeyEvent The key event
517 * @param aType The key code
518 * @return If the Browser Control consumed the key event or not
519 * @attention This function is inherited from the Symbian CCoeControl class.
521 IMPORT_C virtual TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent, TEventCode aType) = 0;
524 * From CCoeControl Sets that the Browser Control has keyboard focus.
526 * @param aFocus If the Browser Control gets or loses focus
527 * @param ENoDrawNow If the Browser Control should redraw itself as result of focus change
529 * @attention This function is inherited from the Symbian CCoeControl class.
531 IMPORT_C virtual void SetFocus(TBool aFocus, TDrawNow aDrawNow = ENoDrawNow) = 0;
534 * This method calls to download manager in order to display query "Cancel
535 * outstanding downloads?" and cancel if it requested by user
537 * @return ETrue if it is OK to exit; EFalse - if it is not OK to exit
539 IMPORT_C virtual TBool OkToExit() = 0;
543 * This method calls to download manager in order to send the commands (EDownloadCmdPause,DownloadCmdResume,
544 * EDownloadCmdCancel, EDownloadCmdMarkAsProgressive, EDownloadCmdMarkAsNotProgressive )
545 * @param aCommand The command that the Browser Control should process
546 * @param aTransId The transaction Id associated with this command
549 IMPORT_C virtual void HandleDownloadCommandL(TUint16 aTransId, TBrCtlDefs::TBrCtlDownloadCmd aCommand) = 0;
552 * Request icon for the given url
554 * @param aUrl url to a favicon or a page
555 * @param aBitmapInfo info on whether to retun a favicon or a page icon
556 * @return favion icon or page icon
558 IMPORT_C virtual CGulIcon* GetBitmapData(const TDesC& aUrl, TBrCtlDefs::TBrCtlBitmapInfo aBitmapInfo) = 0;
561 * Register a client command interface for the browser engine
563 * @param The observer to register
566 IMPORT_C virtual void AddCommandObserverL(MBrCtlCommandObserver* aBrCtlCommandObserver) = 0;
569 * Unregister a client command interface for the browser engine
571 * @param The observer to unregister
574 IMPORT_C virtual void RemoveCommandObserver(MBrCtlCommandObserver* aBrCtlCommandObserver) = 0;
577 * Unregister a client command interface for the browser engine
579 * @param The observer to unregister
582 IMPORT_C virtual MWidgetExtension* CreateWidgetExtensionL(MWidgetCallback& aWidgetCallback) = 0;
585 * Get information about the focused image. The function leaves if the focus is not on an image
588 * @return The requested information
590 IMPORT_C virtual TBrCtlImageCarrier* FocusedImageLC() = 0;
593 * Requests the Browser Control to POST to a URL
595 * @param aUrl URL to which the Browser Control sends the POST request
596 * @param aContentType Content type of the data to be posted
597 * @param aPostData Data to be posted
598 * @param aBoundary Boundary for form-data or multi-part content.
599 * @param aReserved For future use only
602 IMPORT_C virtual void PostUrlL (const TDesC& aUrl,
603 const TDesC8& aContentType,
604 const TDesC8& aPostData,
605 const TDesC8* aBoundary,
606 TAny* aReserved) = 0;
608 * Requests the Browser Control for offscreen bitmap
610 * @ fills offscreen bitmap.The bitmap memory has to be set and freed by the api calling that function.
613 IMPORT_C virtual void TakeSnapshotL(CFbsBitmap& snapshot) = 0;
618 * The MBrCtlDataLoadSupplier class is a callback interface that
619 * provides the Browser Control with the ability to display content incrementally.
620 * It does this by providing a means for the Browser Control to cancel the load operation
621 * if an error occurs.
622 * For example, if the Browser Control runs out of memory during the
623 * load operation, it can cancel that operation by means of this interface.
628 * #include <brctlinterface.h>
629 * @see S60 Platform: Browser Control API Developer's Guide Version 2.0
630 * @lib BrowserEngine.lib
632 * @file brctlinterface.h
635 class MBrCtlDataLoadSupplier
637 public: // New functions
639 * Cancel the load operation
643 virtual void CancelLoad() = 0;
649 * The MBrCtlDataLoadConsumer class is a callback interface that provides
650 * the Browser Control with the ability to receive content incrementally.
653 * #include <brctlinterface.h>
654 * @see S60 Platform: Browser Control API Developer's Guide Version 2.0
655 * @lib BrowserEngine.lib
657 * @file brctlinterface.h
660 class MBrCtlDataLoadConsumer
662 public: // New functions
664 * Pass the next data chunk
666 * @param aData The data chunk to process
669 virtual void HandleNextDataChunk(const TDesC8& aData) = 0;
672 * Inform the Browser Control about completion of data load
676 virtual void HandleLoadComplete() = 0;
679 * Inform the Browser Control that an error occured
680 * if HandleError() is called, then LoadComplete() is infered.
682 * @param aError The error code
685 virtual void HandleError(TInt aError) = 0;
689 * The MBrCtlLoadEventObserver interface receives load progress events.
690 * The host application can implement this interface.
693 * #include <brctlinterface.h>
694 * @see S60 Platform: Browser Control API Developer's Guide Version 2.0
695 * @lib BrowserEngine.lib
697 * @file brctlinterface.h
700 class MBrCtlLoadEventObserver
702 public: // New functions
704 * A load events notification
706 * @param aLoadEvent The load event
707 * @param aSize Size depends on the event
708 * @param aTransactionId The transaction id of the transaction that had this event
711 virtual void HandleBrowserLoadEventL(TBrCtlDefs::TBrCtlLoadEvent aLoadEvent, TUint aSize, TUint16 aTransactionId) = 0;
715 * The TBrCtlWmlServiceOption class wraps information about the WML DO elements.
716 * For more information about the DO tag, see http://www.w3schools.com/wap/tag_do.asp.
718 * #include <brctlinterface.h>
719 * @lib BrowserEngine.lib
721 * @file brctlinterface.h
724 class TBrCtlWmlServiceOption
730 * @param aText The text to display in the WML service options
731 * @param aElemID The element Id to use when the user selects this command
732 * @param aActualElemID Internal to the Browser Control. The host
733 * application should not modify this parameter.
735 TBrCtlWmlServiceOption(HBufC* aText, TUint aElemID, TUint aActualElemID);
737 * Displays the text for the WML service options
739 * @return Text to display for the WML service options
741 inline const TDesC& Text() {return *iText;}
743 * Gets the command ID to use when the user selects this command
745 * @return Element ID employed when the user selects this command
747 inline TUint ElemID(){return iElemID;}
749 * Gets the actual element ID defined in the WML page.
751 * @return Actual element ID
752 * @attention This parameter is internal to the Browser Control.
753 * The host application should not modify this parameter.
755 inline TUint ActualElemID(){return iActualElemID;}
760 ~TBrCtlWmlServiceOption();
764 * Default constructor
767 TBrCtlWmlServiceOption() {};
769 // The text to display in the WML service options
771 // The element Id to use when the user selects this command
773 // The actual element Id
778 * The TBrCtlSubscribeTo class provides information of Subscribe to items.
780 * #include <brctlinterface.h>
781 * @lib BrowserEngine.lib
783 * @file brctlinterface.h
786 class TBrCtlSubscribeTo
792 * @param aText The text to display in the subscribe to option. aText
794 * @param aCommandID The menu command Id to use when the user selects it.
796 TBrCtlSubscribeTo(const TPtrC& aTitle, const TPtrC& aUrl, TUint aCommandID);
803 inline const TPtrC& Title() {return iTitle;}
810 inline const TPtrC& Url() {return iUrl;}
813 * Returns the command.
815 * @return The command.
817 inline TUint CommandID() {return iCommandID;}
821 * Default constructor
834 * The MBrCtlStateChangeObserver class receives state-changed events.
835 * At the present time, there is only one state-changed event.
836 * This event is generated when the browser switches to and from
837 * the Image Map view. In Image Map view, only an image map is displayed,
838 * which enables the user to navigate. The host application can
839 * implement this interface in order to find out when the view
840 * changes to and from the Image Map view.
842 * #include <brctlinterface.h>
843 * @lib BrowserEngine.lib
845 * @file brctlinterface.h
848 class MBrCtlStateChangeObserver
852 * Notifies the Browser Control of a state-changed event.
853 * @param aState Indicates whether or not the browser is in Image Map view.
854 * Value:EStateImageMapView
855 * @param aValue Indicates the state being changed.
857 * ETrue indicates entering Image Map view
858 * EFalse indicates exiting Image Map view
862 virtual void StateChanged(TBrCtlDefs::TBrCtlState aState, TInt aValue) = 0;
867 * This class provides a mechanism for the browser engine to pass commands to the client
869 * @lib BrowserEngine.lib
872 class MBrCtlCommandObserver
874 public: // New functions
876 * Method to call client to execute commands
878 * @param A callback command
879 * @param Array of attribute names
880 * @param Array of attribute values
883 virtual void HandleCommandL(TBrCtlDefs::TBrCtlClientCommands aCommand, const CArrayFix<TPtrC>& aAttributesNames,
884 const CArrayFix<TPtrC>& aAttributeValues) = 0;
889 * This class provides a mechanism for the browser engine to interact with the widget host application
891 * @lib BrowserEngine.lib
894 class MWidgetCallback
898 * Navigates through your file system and selects a file of specific mime type;
899 * analogous to the Browse command in Windows.
901 * @param aSelectedFileName The selected file name.
902 * @param aMimeType The accepted mime type.
903 * @return ETrue if the user selected a file
904 * EFalse if the user cancelled the transaction and did not select a file.
905 * @attiontion Returned on cleanup stack. Browser control will free the buffer.
907 virtual TBool DialogMimeFileSelectLC(HBufC*& aSelectedFileName,
908 const TDesC& aMimeType) = 0;
911 * Called to show or hide softkeys
913 * @param aVisible ETrue to show softkeys, EFalse when full screen is needed
915 virtual void SetSoftkeysVisible(TBool aVisible) = 0;
918 * Called to change the display orientation to landscape
921 virtual void SetDisplayMode(TBrCtlDefs::TBrCtlOrientation aOrientation) = 0;
923 //Reserved for future use
924 virtual TInt Reserved_1(TAny*& a0, TAny* a1, TAny* a2) = 0;
925 virtual TInt Reserved_2(TAny*& a0, TAny* a1, TAny* a2) = 0;
926 virtual TInt Reserved_3(TAny*& a0, TAny* a1, TAny* a2) = 0;
927 virtual TInt Reserved_4(TAny*& a0, TAny* a1, TAny* a2) = 0;
928 virtual TInt Reserved_5(TAny*& a0, TAny* a1, TAny* a2) = 0;
929 virtual TInt Reserved_6(TAny*& a0, TAny* a1, TAny* a2) = 0;
930 virtual TInt Reserved_7(TAny*& a0, TAny* a1, TAny* a2) = 0;
931 virtual TInt Reserved_8(TAny*& a0, TAny* a1, TAny* a2) = 0;
932 virtual TInt Reserved_9(TAny*& a0, TAny* a1, TAny* a2) = 0;
933 virtual TInt Reserved_10(TAny*& a0, TAny* a1, TAny* a2) = 0;
938 * This class provides an extension mechanism for the widget host app to interact with the browser engine
939 * This class includes the Widget specific extension needed in the browser engine
940 * @lib BrowserEngine.lib
943 class MWidgetExtension
945 public: // New functions
947 * Method to set parameters in the browser engine
949 * @param The widget identifier
950 * @param The value for the paramater
953 virtual void SetParamL(TBrCtlDefs::TBrCtlWidgetParams aParam, const TDesC& aValue) = 0;
956 * Method to set parameters in the browser engine
958 * @param The widget parameter aParam
959 * @param The value for the paramater
962 virtual void SetParamL(TBrCtlDefs::TBrCtlWidgetParams aParam, TUint aValue) = 0;
965 * Method to invoke callback function for right soft key
968 * @return ETrue if there is a rightsoftkey callback, else EFalse
970 virtual TBool HandleCommandL( TInt aCommandId ) = 0;
973 #endif // BRCTLINTERFACE_H