BrCtlInterface.h

Go to the documentation of this file.
00001 /*
00002 * ==============================================================================
00003 *  Name        : BrCtlInterface.h
00004 *  Part of     : WebKit \ BrowserControl
00005 *  Interface   : Browser Control API
00006 *  Description : Definition of the Browser Control API
00007 *  Version     : %Version%
00008 *
00009 *    Copyright (c) 2006, Nokia Corporation
00010 *    All rights reserved.
00011 *
00012 *   Redistribution and use in source and binary forms, with or without
00013 *   modification, are permitted provided that the following conditions
00014 *   are met:
00015 *
00016 *      * Redistributions of source code must retain the above copyright
00017 *        notice, this list of conditions and the following disclaimer.
00018 *      * Redistributions in binary form must reproduce the above copyright
00019 *        notice, this list of conditions and the following disclaimer in
00020 *        the documentation and/or other materials provided with the
00021 *        distribution.
00022 *      * Neither the name of the Nokia Corporation nor the names of its
00023 *        contributors may be used to endorse or promote products derived
00024 *        from this software without specific prior written permission.
00025 *
00026 *   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
00027 *   "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
00028 *   LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
00029 *   A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
00030 *   OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
00031 *   SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
00032 *   LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
00033 *   DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
00034 *   THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
00035 *   (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
00036 *   USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
00037 *   DAMAGE.
00038 *
00039 *    Please see file patentlicense.txt for further grants.
00040 * ==============================================================================
00041 */
00042 
00043 
00044 #ifndef BRCTLINTERFACE_H
00045 #define BRCTLINTERFACE_H
00046 
00047 //  INCLUDES
00048 #include <../bidi.h>
00049 #include <e32std.h>
00050 #include <e32base.h>
00051 #include <coecntrl.h>
00052 #include <eikmenup.h>
00053 #include <ssl.h>
00054 
00055 #include <BrCtlDialogsProvider.h>
00056 #include <BrCtlLayoutObserver.h>
00057 #include <BrCtlLinkResolver.h>
00058 #include <BrCtlSoftkeysObserver.h>
00059 #include <BrCtlSpecialLoadObserver.h>
00060 #include <BrCtlWindowObserver.h>
00061 #include <BrCtlDownloadObserver.h>
00062 #include <BrCtlDefs.h>
00063 
00064 // DATA TYPES
00065 
00066 // FORWARD DECLARATIONS
00067 class MBrCtlDataLoadSupplier;
00068 class MBrCtlDataLoadConsumer;
00069 class MBrCtlLoadEventObserver;
00070 class MBrCtlDialogsProvider;
00071 class TBrCtlWmlServiceOption;
00072 class TBrCtlSubscribeTo;
00073 class MBrCtlStateChangeObserver;
00074 class MBrCtlCommandObserver;
00075 class MWidgetCallback;
00076 class MWidgetExtension;
00077 class CBrCtlInterface;
00078 class CPluginInfo;
00079 class TBrCtlImageCarrier;
00080 
00114 IMPORT_C CBrCtlInterface* CreateBrowserControlL(CCoeControl* aParent, TRect aRect,
00115     TUint aBrCtlCapabilities, TUint aCommandIdBase = TBrCtlDefs::ECommandIdBase,
00116     MBrCtlSoftkeysObserver* aBrCtlSoftkeysObserver = NULL,
00117     MBrCtlLinkResolver* aBrCtlLinkResolver = NULL,
00118     MBrCtlSpecialLoadObserver* aBrCtlSpecialLoadObserver = NULL,
00119     MBrCtlLayoutObserver* aBrCtlLayoutObserver = NULL,
00120     MBrCtlDialogsProvider* aBrCtlDialogsProvider = NULL,
00121     MBrCtlWindowObserver* aBrCtlWindowObserver = NULL,
00122   MBrCtlDownloadObserver* aBrCtlDownloadObserver = NULL );
00123 
00179 class CBrCtlInterface : public CCoeControl
00180     {
00181     public:  // Constructors and destructor
00182 
00186       inline virtual ~CBrCtlInterface() {}
00187 
00188     public: // New functions
00189 
00197         IMPORT_C virtual void HandleCommandL(TInt aCommand) = 0;
00198 
00204         IMPORT_C virtual TSize ContentSize() = 0;
00205 
00214         IMPORT_C virtual void SetBrowserSettingL(TUint aSetting, TUint aValue) = 0;
00215 
00223         IMPORT_C virtual TUint BrowserSettingL(TUint aSetting) = 0;
00224 
00239         IMPORT_C virtual void LoadDataL(const TDesC& aUrl,
00240                                 const TDesC8& aData,
00241                                 const TDataType& aDataType,
00242                                 TUid aCharsetUid) = 0;
00243 
00260         // The url scheme must be "data:" The url is needed as reference to this load request
00261         IMPORT_C virtual void InitLoadDataL(const TDesC& aUrl,
00262                                     const TDataType& aDataType,
00263                                     TUid aCharsetUid,
00264                                     TUint aContentLength,
00265                                     MBrCtlDataLoadSupplier* aBrCtlDataLoadSupplier,
00266                                     MBrCtlDataLoadConsumer** aBrCtlDataLoadConsumer) = 0;
00267 
00282         IMPORT_C virtual void LoadUrlL( const TDesC& aUrl,
00283                                         TInt aApId = -1,
00284                                         TBrCtlDefs::TBrCtlCacheMode aBrCtlCacheMode = TBrCtlDefs::ECacheModeNormal) = 0;
00285 
00292         IMPORT_C virtual void LoadFileL(const TDesC& aFileName) = 0;
00293 
00300         IMPORT_C virtual void LoadFileL(RFile& aFileHandle) = 0;
00301 
00302         /*                                        
00303         * Return the WML Options for the current page
00304         * @since 2.8
00305         * @param
00306         * @return The WML Options for the current page
00307         */
00308         IMPORT_C virtual RPointerArray<TBrCtlWmlServiceOption>* WMLOptionMenuItemsL()  = 0;
00309 
00318         IMPORT_C virtual void AddOptionMenuItemsL(CEikMenuPane& aMenuPane, TInt aResourceId, TInt aAfter=-1 ) = 0;
00319 
00325         IMPORT_C virtual TUint ClearCache() = 0;
00326 
00334         IMPORT_C virtual TBool IsUrlInCache(TDesC& aUrl) = 0;
00335 
00343         IMPORT_C virtual TInt ClearItemInCache(TDesC& aUrl) = 0;
00344 
00352         IMPORT_C virtual HBufC* PageInfoLC(TBrCtlDefs::TBrCtlPageInfo aBrCtlPageInfo ) = 0;
00353 
00365         IMPORT_C virtual TBool NavigationAvailable( TBrCtlDefs::TBrCtlNavigationDirection aDirection ) = 0;
00366 
00373         IMPORT_C virtual TUint16 SaveToFileL(const TDesC& aFileName) = 0;
00374 
00380         IMPORT_C virtual const TCertInfo* CertInfo() = 0;
00381 
00391         IMPORT_C virtual void AddLoadEventObserverL(MBrCtlLoadEventObserver* aBrCtlLoadEventObserver) = 0;
00392 
00402         IMPORT_C virtual void RemoveLoadEventObserver(MBrCtlLoadEventObserver* aBrCtlLoadEventObserver) = 0;
00403 
00410         IMPORT_C virtual TInt ImageCountL() = 0;
00411 
00419         IMPORT_C virtual TBrCtlDefs::TBrCtlElementType FocusedElementType() = 0;
00420 
00428         IMPORT_C virtual void AddStateChangeObserverL(MBrCtlStateChangeObserver* aBrCtlStateChangeObserver) = 0;
00429 
00436         IMPORT_C virtual void RemoveStateChangeObserver(MBrCtlStateChangeObserver* aBrCtlStateChangeObserver) = 0;
00437 
00445         IMPORT_C virtual HBufC* VersionInfoLC(TBrCtlDefs::TBrCtlVersionInfo aVersionInfo) = 0;
00446 
00457         IMPORT_C virtual void SetSelfDownloadContentTypesL(TDesC& aContentTypes) = 0;
00458 
00477         IMPORT_C virtual void SetParamL(TBrCtlDefs::TBrCtlParams aParam, const TDesC& aValue) = 0;
00478 
00486         IMPORT_C virtual void LoadSavedPageL(const TDesC& aUid, TDesC& aSavedPageBuffer) = 0;
00487 
00493         IMPORT_C virtual RArray<TUint>* ZoomLevels() const = 0;
00494 
00501         IMPORT_C virtual int FindKeyword( const TDesC& aKeyword ) = 0;
00502 
00513         IMPORT_C virtual TBrCtlDefs::TBrCtlFindResponse FindKeywordAgain( TBool aFowardDirection ) = 0;
00514 
00522         IMPORT_C virtual const RPointerArray<TBrCtlSubscribeTo>& SubscribeToMenuItemsL() = 0;
00523 
00524 
00525 
00526     public: // Functions from base classes
00527 
00528         // Functions from CCoeControl
00529 
00536         IMPORT_C virtual TSize MinimumSize() = 0;
00537 
00546         IMPORT_C virtual TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent, TEventCode aType) = 0;
00547 
00556         IMPORT_C virtual void SetFocus(TBool aFocus, TDrawNow aDrawNow = ENoDrawNow) = 0;
00557 
00558         /*
00559         * This method calls to download manager in order to display query "Cancel
00560         * outstanding downloads?" and cancel if it requested by user
00561         * @param none
00562         * @return ETrue if it is OK to exit; EFalse - if it is not OK to exit
00563         */
00564         IMPORT_C virtual TBool OkToExit() = 0;
00565 
00566 
00574     IMPORT_C virtual void HandleDownloadCommandL(TUint16 aTransId, TBrCtlDefs::TBrCtlDownloadCmd aCommand) = 0;
00575 
00583     IMPORT_C virtual CGulIcon* GetBitmapData(const TDesC& aUrl, TBrCtlDefs::TBrCtlBitmapInfo aBitmapInfo) = 0;
00584 
00591         IMPORT_C virtual void AddCommandObserverL(MBrCtlCommandObserver* aBrCtlCommandObserver) = 0;
00592 
00599         IMPORT_C virtual void RemoveCommandObserver(MBrCtlCommandObserver* aBrCtlCommandObserver) = 0;
00600 
00607         IMPORT_C virtual MWidgetExtension* CreateWidgetExtensionL(MWidgetCallback& aWidgetCallback) = 0;
00608 
00615         IMPORT_C virtual TBrCtlImageCarrier* FocusedImageLC() = 0;
00616 
00627         IMPORT_C virtual void PostUrlL (const TDesC& aUrl, 
00628                                         const TDesC8& aContentType, 
00629                                         const TDesC8& aPostData, 
00630                                         const TDesC8* aBoundary, 
00631                                         TAny* aReserved) = 0;
00638         IMPORT_C virtual void TakeSnapshotL(CFbsBitmap& snapshot) = 0; 
00639     };
00640 
00641 
00660 class MBrCtlDataLoadSupplier
00661     {
00662     public: // New functions
00668     virtual void CancelLoad() = 0;
00669     };
00670 
00671 
00672 
00685 class MBrCtlDataLoadConsumer
00686     {
00687     public: // New functions
00694         virtual void HandleNextDataChunk(const TDesC8& aData) = 0;
00695 
00701         virtual void HandleLoadComplete() = 0;
00702 
00710         virtual void HandleError(TInt aError) = 0;
00711     };
00712 
00725 class MBrCtlLoadEventObserver
00726     {
00727     public: // New functions
00736         virtual void HandleBrowserLoadEventL(TBrCtlDefs::TBrCtlLoadEvent aLoadEvent, TUint aSize, TUint16 aTransactionId) = 0;
00737     };
00738 
00749 class TBrCtlWmlServiceOption
00750     {
00751     public:
00760         TBrCtlWmlServiceOption(HBufC* aText, TUint aElemID, TUint aActualElemID);
00766         inline const TDesC& Text() {return *iText;}
00772         inline TUint ElemID(){return iElemID;}
00780         inline TUint ActualElemID(){return iActualElemID;}
00781 
00785         ~TBrCtlWmlServiceOption();
00786 
00787     private:    // Data
00792         TBrCtlWmlServiceOption() {};
00793 
00794         // The text to display in the WML service options
00795         HBufC* iText;
00796         // The element Id to use when the user selects this command
00797         TUint iElemID;
00798         // The actual element Id
00799         TUint iActualElemID;
00800     };
00801 
00811 class TBrCtlSubscribeTo
00812     {
00813     public:
00821         TBrCtlSubscribeTo(const TPtrC& aTitle, const TPtrC& aUrl, TUint aCommandID);
00822 
00828         inline const TPtrC& Title() {return iTitle;}
00829 
00835         inline const TPtrC& Url() {return iUrl;}
00836 
00842         inline TUint CommandID() {return iCommandID;}
00843 
00844     private:
00849         TBrCtlSubscribeTo();
00850 
00851     private:    // Data
00852         const TPtrC iTitle;
00853         const TPtrC iUrl;
00854 
00855         TUint iCommandID;
00856     };
00857 
00873 class MBrCtlStateChangeObserver
00874     {
00875     public:
00887         virtual void StateChanged(TBrCtlDefs::TBrCtlState aState, TInt aValue) = 0;
00888     };
00889 
00890 // CLASS DECLARATION
00897 class MBrCtlCommandObserver
00898     {
00899     public: // New functions
00908         virtual void HandleCommandL(TBrCtlDefs::TBrCtlClientCommands aCommand, const CArrayFix<TPtrC>& aAttributesNames,
00909                                      const CArrayFix<TPtrC>& aAttributeValues) = 0;
00910     };
00911 
00912 // CLASS DECLARATION
00919 class MWidgetCallback
00920     {
00921     public:
00932         virtual TBool DialogMimeFileSelectLC(HBufC*& aSelectedFileName,
00933                                  const TDesC& aMimeType) = 0;
00934 
00940         virtual void SetSoftkeysVisible(TBool aVisible) = 0;
00941 
00946         virtual void SetDisplayMode(TBrCtlDefs::TBrCtlOrientation aOrientation) = 0;
00947 
00948         //Reserved for future use
00949         virtual TInt Reserved_1(TAny*& a0, TAny* a1, TAny* a2) = 0;
00950         virtual TInt Reserved_2(TAny*& a0, TAny* a1, TAny* a2) = 0;
00951         virtual TInt Reserved_3(TAny*& a0, TAny* a1, TAny* a2) = 0;
00952         virtual TInt Reserved_4(TAny*& a0, TAny* a1, TAny* a2) = 0;
00953         virtual TInt Reserved_5(TAny*& a0, TAny* a1, TAny* a2) = 0;
00954         virtual TInt Reserved_6(TAny*& a0, TAny* a1, TAny* a2) = 0;
00955         virtual TInt Reserved_7(TAny*& a0, TAny* a1, TAny* a2) = 0;
00956         virtual TInt Reserved_8(TAny*& a0, TAny* a1, TAny* a2) = 0;
00957         virtual TInt Reserved_9(TAny*& a0, TAny* a1, TAny* a2) = 0;
00958         virtual TInt Reserved_10(TAny*& a0, TAny* a1, TAny* a2) = 0;
00959     };
00960 
00961 // CLASS DECLARATION
00968 class MWidgetExtension
00969     {
00970     public: // New functions
00978         virtual void SetParamL(TBrCtlDefs::TBrCtlWidgetParams aParam, const TDesC& aValue) = 0;
00979 
00987         virtual void SetParamL(TBrCtlDefs::TBrCtlWidgetParams aParam, TUint aValue) = 0;
00988 
00995         virtual TBool HandleCommandL( TInt aCommandId ) = 0;
00996 
00997     };
00998 #endif      // BRCTLINTERFACE_H
00999 
01000 // End of File

Copyright © Nokia Corporation 2001-2007
Back to top