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 <e32std.h>
00049 #include <e32base.h>
00050 #include <coecntrl.h>
00051 #include <eikmenup.h>
00052 #include <ssl.h>
00053 
00054 #include <BrCtlDialogsProvider.h>
00055 #include <BrCtlLayoutObserver.h>
00056 #include <BrCtlLinkResolver.h>
00057 #include <BrCtlSoftkeysObserver.h>
00058 #include <BrCtlSpecialLoadObserver.h>
00059 #include <BrCtlWindowObserver.h>
00060 #include <BrCtlDownloadObserver.h>
00061 #include <BrCtlDefs.h>
00062 
00063 // DATA TYPES
00064 
00065 // FORWARD DECLARATIONS
00066 class MBrCtlDataLoadSupplier;
00067 class MBrCtlDataLoadConsumer;
00068 class MBrCtlLoadEventObserver;
00069 class MBrCtlDialogsProvider;
00070 class TBrCtlWmlServiceOption;
00071 class TBrCtlSubscribeTo;
00072 class MBrCtlStateChangeObserver;
00073 class MBrCtlCommandObserver;
00074 class MWidgetCallback;
00075 class MWidgetExtension;
00076 class CBrCtlInterface;
00077 class CPluginInfo;
00078 class TBrCtlImageCarrier;
00079 
00113 IMPORT_C CBrCtlInterface* CreateBrowserControlL(CCoeControl* aParent, TRect aRect,
00114     TUint aBrCtlCapabilities, TUint aCommandIdBase = TBrCtlDefs::ECommandIdBase,
00115     MBrCtlSoftkeysObserver* aBrCtlSoftkeysObserver = NULL,
00116     MBrCtlLinkResolver* aBrCtlLinkResolver = NULL,
00117     MBrCtlSpecialLoadObserver* aBrCtlSpecialLoadObserver = NULL,
00118     MBrCtlLayoutObserver* aBrCtlLayoutObserver = NULL,
00119     MBrCtlDialogsProvider* aBrCtlDialogsProvider = NULL,
00120     MBrCtlWindowObserver* aBrCtlWindowObserver = NULL,
00121   MBrCtlDownloadObserver* aBrCtlDownloadObserver = NULL );
00122 
00178 class CBrCtlInterface : public CCoeControl
00179     {
00180     public:  // Constructors and destructor
00181 
00185       inline virtual ~CBrCtlInterface() {}
00186 
00187     public: // New functions
00188 
00196         IMPORT_C virtual void HandleCommandL(TInt aCommand) = 0;
00197 
00203         IMPORT_C virtual TSize ContentSize() = 0;
00204 
00213         IMPORT_C virtual void SetBrowserSettingL(TUint aSetting, TUint aValue) = 0;
00214 
00222         IMPORT_C virtual TUint BrowserSettingL(TUint aSetting) = 0;
00223 
00238         IMPORT_C virtual void LoadDataL(const TDesC& aUrl,
00239                                 const TDesC8& aData,
00240                                 const TDataType& aDataType,
00241                                 TUid aCharsetUid) = 0;
00242 
00259         // The url scheme must be "data:" The url is needed as reference to this load request
00260         IMPORT_C virtual void InitLoadDataL(const TDesC& aUrl,
00261                                     const TDataType& aDataType,
00262                                     TUid aCharsetUid,
00263                                     TUint aContentLength,
00264                                     MBrCtlDataLoadSupplier* aBrCtlDataLoadSupplier,
00265                                     MBrCtlDataLoadConsumer** aBrCtlDataLoadConsumer) = 0;
00266 
00281         IMPORT_C virtual void LoadUrlL( const TDesC& aUrl,
00282                                         TInt aApId = -1,
00283                                         TBrCtlDefs::TBrCtlCacheMode aBrCtlCacheMode = TBrCtlDefs::ECacheModeNormal) = 0;
00284 
00291         IMPORT_C virtual void LoadFileL(const TDesC& aFileName) = 0;
00292 
00299         IMPORT_C virtual void LoadFileL(RFile& aFileHandle) = 0;
00300 
00307         IMPORT_C virtual RPointerArray<TBrCtlWmlServiceOption>* WMLOptionMenuItemsL()  = 0;
00308 
00317         IMPORT_C virtual void AddOptionMenuItemsL(CEikMenuPane& aMenuPane, TInt aResourceId, TInt aAfter=-1 ) = 0;
00318 
00324         IMPORT_C virtual TUint ClearCache() = 0;
00325 
00333         IMPORT_C virtual TBool IsUrlInCache(TDesC& aUrl) = 0;
00334 
00342         IMPORT_C virtual TInt ClearItemInCache(TDesC& aUrl) = 0;
00343 
00351         IMPORT_C virtual HBufC* PageInfoLC(TBrCtlDefs::TBrCtlPageInfo aBrCtlPageInfo ) = 0;
00352 
00364         IMPORT_C virtual TBool NavigationAvailable( TBrCtlDefs::TBrCtlNavigationDirection aDirection ) = 0;
00365 
00372         IMPORT_C virtual TUint16 SaveToFileL(const TDesC& aFileName) = 0;
00373 
00379         IMPORT_C virtual const TCertInfo* CertInfo() = 0;
00380 
00390         IMPORT_C virtual void AddLoadEventObserverL(MBrCtlLoadEventObserver* aBrCtlLoadEventObserver) = 0;
00391 
00401         IMPORT_C virtual void RemoveLoadEventObserver(MBrCtlLoadEventObserver* aBrCtlLoadEventObserver) = 0;
00402 
00409         IMPORT_C virtual TInt ImageCountL() = 0;
00410 
00418         IMPORT_C virtual TBrCtlDefs::TBrCtlElementType FocusedElementType() = 0;
00419 
00427         IMPORT_C virtual void AddStateChangeObserverL(MBrCtlStateChangeObserver* aBrCtlStateChangeObserver) = 0;
00428 
00435         IMPORT_C virtual void RemoveStateChangeObserver(MBrCtlStateChangeObserver* aBrCtlStateChangeObserver) = 0;
00436 
00444         IMPORT_C virtual HBufC* VersionInfoLC(TBrCtlDefs::TBrCtlVersionInfo aVersionInfo) = 0;
00445 
00456         IMPORT_C virtual void SetSelfDownloadContentTypesL(TDesC& aContentTypes) = 0;
00457 
00476         IMPORT_C virtual void SetParamL(TBrCtlDefs::TBrCtlParams aParam, const TDesC& aValue) = 0;
00477 
00485         IMPORT_C virtual void LoadSavedPageL(const TDesC& aUid, TDesC& aSavedPageBuffer) = 0;
00486 
00492         IMPORT_C virtual RArray<TUint>* ZoomLevels() const = 0;
00493 
00500         IMPORT_C virtual int FindKeyword( const TDesC& aKeyword ) = 0;
00501 
00512         IMPORT_C virtual TBrCtlDefs::TBrCtlFindResponse FindKeywordAgain( TBool aFowardDirection ) = 0;
00513 
00521         IMPORT_C virtual const RPointerArray<TBrCtlSubscribeTo>& SubscribeToMenuItemsL() = 0;
00522 
00523 
00524 
00525     public: // Functions from base classes
00526 
00527         // Functions from CCoeControl
00528 
00535         IMPORT_C virtual TSize MinimumSize() = 0;
00536 
00545         IMPORT_C virtual TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent, TEventCode aType) = 0;
00546 
00555         IMPORT_C virtual void SetFocus(TBool aFocus, TDrawNow aDrawNow = ENoDrawNow) = 0;
00556 
00557         /*
00558         * This method calls to download manager in order to display query "Cancel
00559         * outstanding downloads?" and cancel if it requested by user
00560         * @param none
00561         * @return ETrue if it is OK to exit; EFalse - if it is not OK to exit
00562         */
00563         IMPORT_C virtual TBool OkToExit() = 0;
00564 
00565 
00573     IMPORT_C virtual void HandleDownloadCommandL(TUint16 aTransId, TBrCtlDefs::TBrCtlDownloadCmd aCommand) = 0;
00574 
00582     IMPORT_C virtual CGulIcon* GetBitmapData(const TDesC& aUrl, TBrCtlDefs::TBrCtlBitmapInfo aBitmapInfo) = 0;
00583 
00590         IMPORT_C virtual void AddCommandObserverL(MBrCtlCommandObserver* aBrCtlCommandObserver) = 0;
00591 
00598         IMPORT_C virtual void RemoveCommandObserver(MBrCtlCommandObserver* aBrCtlCommandObserver) = 0;
00599 
00606         IMPORT_C virtual MWidgetExtension* CreateWidgetExtensionL(MWidgetCallback& aWidgetCallback) = 0;
00607 
00614         IMPORT_C virtual TBrCtlImageCarrier* FocusedImageLC() = 0;
00615     };
00616 
00617 
00636 class MBrCtlDataLoadSupplier
00637     {
00638     public: // New functions
00644     virtual void CancelLoad() = 0;
00645     };
00646 
00647 
00648 
00661 class MBrCtlDataLoadConsumer
00662     {
00663     public: // New functions
00670         virtual void HandleNextDataChunk(const TDesC8& aData) = 0;
00671 
00677         virtual void HandleLoadComplete() = 0;
00678 
00686         virtual void HandleError(TInt aError) = 0;
00687     };
00688 
00701 class MBrCtlLoadEventObserver
00702     {
00703     public: // New functions
00712         virtual void HandleBrowserLoadEventL(TBrCtlDefs::TBrCtlLoadEvent aLoadEvent, TUint aSize, TUint16 aTransactionId) = 0;
00713     };
00714 
00725 class TBrCtlWmlServiceOption
00726     {
00727     public:
00736         TBrCtlWmlServiceOption(HBufC* aText, TUint aElemID, TUint aActualElemID);
00742         inline const TDesC& Text() {return *iText;}
00748         inline TUint ElemID(){return iElemID;}
00756         inline TUint ActualElemID(){return iActualElemID;}
00757 
00761         ~TBrCtlWmlServiceOption();
00762 
00763     private:    // Data
00768         TBrCtlWmlServiceOption() {};
00769 
00770         // The text to display in the WML service options
00771         HBufC* iText;
00772         // The element Id to use when the user selects this command
00773         TUint iElemID;
00774         // The actual element Id
00775         TUint iActualElemID;
00776     };
00777 
00787 class TBrCtlSubscribeTo
00788     {
00789     public:
00797         TBrCtlSubscribeTo(const TPtrC& aTitle, const TPtrC& aUrl, TUint aCommandID);
00798 
00804         inline const TPtrC& Title() {return iTitle;}
00805 
00811         inline const TPtrC& Url() {return iUrl;}
00812 
00818         inline TUint CommandID() {return iCommandID;}
00819 
00820     private:
00825         TBrCtlSubscribeTo();
00826 
00827     private:    // Data
00828         const TPtrC iTitle;
00829         const TPtrC iUrl;
00830 
00831         TUint iCommandID;
00832     };
00833 
00849 class MBrCtlStateChangeObserver
00850     {
00851     public:
00863         virtual void StateChanged(TBrCtlDefs::TBrCtlState aState, TInt aValue) = 0;
00864     };
00865 
00866 // CLASS DECLARATION
00873 class MBrCtlCommandObserver
00874     {
00875     public: // New functions
00884         virtual void HandleCommandL(TBrCtlDefs::TBrCtlClientCommands aCommand, const CArrayFix<TPtrC>& aAttributesNames,
00885                                      const CArrayFix<TPtrC>& aAttributeValues) = 0;
00886     };
00887 
00888 // CLASS DECLARATION
00895 class MWidgetCallback
00896     {
00897     public:
00908         virtual TBool DialogMimeFileSelectLC(HBufC*& aSelectedFileName,
00909                                  const TDesC& aMimeType) = 0;
00910 
00916         virtual void SetSoftkeysVisible(TBool aVisible) = 0;
00917 
00922         virtual void SetDisplayMode(TBrCtlDefs::TBrCtlOrientation aOrientation) = 0;
00923 
00924         //Reserved for future use
00925         virtual TInt Reserved_1(TAny*& a0, TAny* a1, TAny* a2) = 0;
00926         virtual TInt Reserved_2(TAny*& a0, TAny* a1, TAny* a2) = 0;
00927         virtual TInt Reserved_3(TAny*& a0, TAny* a1, TAny* a2) = 0;
00928         virtual TInt Reserved_4(TAny*& a0, TAny* a1, TAny* a2) = 0;
00929         virtual TInt Reserved_5(TAny*& a0, TAny* a1, TAny* a2) = 0;
00930         virtual TInt Reserved_6(TAny*& a0, TAny* a1, TAny* a2) = 0;
00931         virtual TInt Reserved_7(TAny*& a0, TAny* a1, TAny* a2) = 0;
00932         virtual TInt Reserved_8(TAny*& a0, TAny* a1, TAny* a2) = 0;
00933         virtual TInt Reserved_9(TAny*& a0, TAny* a1, TAny* a2) = 0;
00934         virtual TInt Reserved_10(TAny*& a0, TAny* a1, TAny* a2) = 0;
00935     };
00936 
00937 // CLASS DECLARATION
00944 class MWidgetExtension
00945     {
00946     public: // New functions
00954         virtual void SetParamL(TBrCtlDefs::TBrCtlWidgetParams aParam, const TDesC& aValue) = 0;
00955 
00963         virtual void SetParamL(TBrCtlDefs::TBrCtlWidgetParams aParam, TUint aValue) = 0;
00964 
00971         virtual TBool HandleCommandL( TInt aCommandId ) = 0;
00972 
00973     };
00974 // BRCTLINTERFACE_H
00975 #endif
00976 
00977 // End of File

Copyright © Nokia Corporation 2001-2008
Back to top