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 #start_since SINCE_3_1_SDK 00074 class MBrCtlCommandObserver; 00075 #end_since SINCE_3_1_SDK 00076 #ifdef RD_BROWSER_WIDGETS 00077 class MWidgetCallback; 00078 class MWidgetExtension; 00079 //RD_BROWSER_WIDGETS 00080 #endif 00081 class CBrCtlInterface; 00082 class CPluginInfo; 00083 00084 00118 IMPORT_C CBrCtlInterface* CreateBrowserControlL(CCoeControl* aParent, TRect aRect, 00119 TUint aBrCtlCapabilities, TUint aCommandIdBase = TBrCtlDefs::ECommandIdBase, 00120 MBrCtlSoftkeysObserver* aBrCtlSoftkeysObserver = NULL, 00121 MBrCtlLinkResolver* aBrCtlLinkResolver = NULL, 00122 MBrCtlSpecialLoadObserver* aBrCtlSpecialLoadObserver = NULL, 00123 MBrCtlLayoutObserver* aBrCtlLayoutObserver = NULL, 00124 MBrCtlDialogsProvider* aBrCtlDialogsProvider = NULL, 00125 MBrCtlWindowObserver* aBrCtlWindowObserver = NULL, 00126 MBrCtlDownloadObserver* aBrCtlDownloadObserver = NULL ); 00127 00183 class CBrCtlInterface : public CCoeControl 00184 { 00185 public: // Constructors and destructor 00186 00190 inline virtual ~CBrCtlInterface() {} 00191 00192 public: // New functions 00193 00201 IMPORT_C virtual void HandleCommandL(TInt aCommand) = 0; 00202 00208 IMPORT_C virtual TSize ContentSize() = 0; 00209 00218 IMPORT_C virtual void SetBrowserSettingL(TUint aSetting, TUint aValue) = 0; 00219 00227 IMPORT_C virtual TUint BrowserSettingL(TUint aSetting) = 0; 00228 00243 IMPORT_C virtual void LoadDataL(const TDesC& aUrl, 00244 const TDesC8& aData, 00245 const TDataType& aDataType, 00246 TUid aCharsetUid) = 0; 00247 00264 // The url scheme must be "data:" The url is needed as reference to this load request 00265 IMPORT_C virtual void InitLoadDataL(const TDesC& aUrl, 00266 const TDataType& aDataType, 00267 TUid aCharsetUid, 00268 TUint aContentLength, 00269 MBrCtlDataLoadSupplier* aBrCtlDataLoadSupplier, 00270 MBrCtlDataLoadConsumer** aBrCtlDataLoadConsumer) = 0; 00271 00286 IMPORT_C virtual void LoadUrlL( const TDesC& aUrl, 00287 TInt aApId = -1, 00288 TBrCtlDefs::TBrCtlCacheMode aBrCtlCacheMode = TBrCtlDefs::ECacheModeNormal) = 0; 00289 00296 IMPORT_C virtual void LoadFileL(const TDesC& aFileName) = 0; 00297 00304 IMPORT_C virtual void LoadFileL(RFile& aFileHandle) = 0; 00305 00312 IMPORT_C virtual RPointerArray<TBrCtlWmlServiceOption>* WMLOptionMenuItemsL() = 0; 00313 00322 IMPORT_C virtual void AddOptionMenuItemsL(CEikMenuPane& aMenuPane, TInt aResourceId, TInt aAfter=-1 ) = 0; 00323 00329 IMPORT_C virtual TUint ClearCache() = 0; 00330 00338 IMPORT_C virtual TBool IsUrlInCache(TDesC& aUrl) = 0; 00339 00347 IMPORT_C virtual TInt ClearItemInCache(TDesC& aUrl) = 0; 00348 00356 IMPORT_C virtual HBufC* PageInfoLC(TBrCtlDefs::TBrCtlPageInfo aBrCtlPageInfo ) = 0; 00357 00369 IMPORT_C virtual TBool NavigationAvailable( TBrCtlDefs::TBrCtlNavigationDirection aDirection ) = 0; 00370 00377 IMPORT_C virtual TUint16 SaveToFileL(const TDesC& aFileName) = 0; 00378 00384 IMPORT_C virtual const TCertInfo* CertInfo() = 0; 00385 00395 IMPORT_C virtual void AddLoadEventObserverL(MBrCtlLoadEventObserver* aBrCtlLoadEventObserver) = 0; 00396 00406 IMPORT_C virtual void RemoveLoadEventObserver(MBrCtlLoadEventObserver* aBrCtlLoadEventObserver) = 0; 00407 00414 IMPORT_C virtual TInt ImageCountL() = 0; 00415 00423 IMPORT_C virtual TBrCtlDefs::TBrCtlElementType FocusedElementType() = 0; 00424 00432 IMPORT_C virtual void AddStateChangeObserverL(MBrCtlStateChangeObserver* aBrCtlStateChangeObserver) = 0; 00433 00440 IMPORT_C virtual void RemoveStateChangeObserver(MBrCtlStateChangeObserver* aBrCtlStateChangeObserver) = 0; 00441 00449 IMPORT_C virtual HBufC* VersionInfoLC(TBrCtlDefs::TBrCtlVersionInfo aVersionInfo) = 0; 00450 00461 IMPORT_C virtual void SetSelfDownloadContentTypesL(TDesC& aContentTypes) = 0; 00462 00481 IMPORT_C virtual void SetParamL(TBrCtlDefs::TBrCtlParams aParam, const TDesC& aValue) = 0; 00482 00490 IMPORT_C virtual void LoadSavedPageL(const TDesC& aUid, TDesC& aSavedPageBuffer) = 0; 00491 00497 IMPORT_C virtual RArray<TUint>* ZoomLevels() const = 0; 00498 00505 IMPORT_C virtual int FindKeyword( const TDesC& aKeyword ) = 0; 00506 00517 IMPORT_C virtual TBrCtlDefs::TBrCtlFindResponse FindKeywordAgain( TBool aFowardDirection ) = 0; 00518 00526 IMPORT_C virtual const RPointerArray<TBrCtlSubscribeTo>& SubscribeToMenuItemsL() = 0; 00527 00528 00529 00530 public: // Functions from base classes 00531 00532 // Functions from CCoeControl 00533 00540 IMPORT_C virtual TSize MinimumSize() = 0; 00541 00550 IMPORT_C virtual TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent, TEventCode aType) = 0; 00551 00560 IMPORT_C virtual void SetFocus(TBool aFocus, TDrawNow aDrawNow = ENoDrawNow) = 0; 00561 00562 /* 00563 * This method calls to download manager in order to display query "Cancel 00564 * outstanding downloads?" and cancel if it requested by user 00565 * @param none 00566 * @return ETrue if it is OK to exit; EFalse - if it is not OK to exit 00567 */ 00568 IMPORT_C virtual TBool OkToExit() = 0; 00569 00570 00578 IMPORT_C virtual void HandleDownloadCommandL(TUint16 aTransId, TBrCtlDefs::TBrCtlDownloadCmd aCommand) = 0; 00579 00580 #start_since SINCE_3_1_SDK 00581 00589 IMPORT_C virtual CGulIcon* GetBitmapData(const TDesC& aUrl, TBrCtlDefs::TBrCtlBitmapInfo aBitmapInfo) = 0; 00590 #end_since SINCE_3_1_SDK 00591 00592 #start_since SINCE_3_1_SDK 00593 00600 IMPORT_C virtual void AddCommandObserverL(MBrCtlCommandObserver* aBrCtlCommandObserver) = 0; 00601 #end_since SINCE_3_1_SDK 00602 00603 #start_since SINCE_3_1_SDK 00604 00611 IMPORT_C virtual void RemoveCommandObserver(MBrCtlCommandObserver* aBrCtlCommandObserver) = 0; 00612 #end_since SINCE_3_1_SDK 00613 00614 #ifdef RD_BROWSER_WIDGETS 00615 00621 IMPORT_C virtual MWidgetExtension* CreateWidgetExtensionL(MWidgetCallback& aWidgetCallback) = 0; 00622 //RD_BROWSER_WIDGETS 00623 #endif 00624 }; 00625 00626 00645 class MBrCtlDataLoadSupplier 00646 { 00647 public: // New functions 00653 virtual void CancelLoad() = 0; 00654 }; 00655 00656 00657 00670 class MBrCtlDataLoadConsumer 00671 { 00672 public: // New functions 00679 virtual void HandleNextDataChunk(const TDesC8& aData) = 0; 00680 00686 virtual void HandleLoadComplete() = 0; 00687 00695 virtual void HandleError(TInt aError) = 0; 00696 }; 00697 00710 class MBrCtlLoadEventObserver 00711 { 00712 public: // New functions 00721 virtual void HandleBrowserLoadEventL(TBrCtlDefs::TBrCtlLoadEvent aLoadEvent, TUint aSize, TUint16 aTransactionId) = 0; 00722 }; 00723 00734 class TBrCtlWmlServiceOption 00735 { 00736 public: 00745 TBrCtlWmlServiceOption(HBufC* aText, TUint aElemID, TUint aActualElemID); 00751 inline const TDesC& Text() {return *iText;} 00757 inline TUint ElemID(){return iElemID;} 00765 inline TUint ActualElemID(){return iActualElemID;} 00766 00770 ~TBrCtlWmlServiceOption(); 00771 00772 private: // Data 00777 TBrCtlWmlServiceOption() {}; 00778 00779 // The text to display in the WML service options 00780 HBufC* iText; 00781 // The element Id to use when the user selects this command 00782 TUint iElemID; 00783 // The actual element Id 00784 TUint iActualElemID; 00785 }; 00786 00796 class TBrCtlSubscribeTo 00797 { 00798 public: 00806 TBrCtlSubscribeTo(const TPtrC& aTitle, const TPtrC& aUrl, TUint aCommandID); 00807 00813 inline const TPtrC& Title() {return iTitle;} 00814 00820 inline const TPtrC& Url() {return iUrl;} 00821 00827 inline TUint CommandID() {return iCommandID;} 00828 00829 private: 00834 TBrCtlSubscribeTo(); 00835 00836 private: // Data 00837 const TPtrC iTitle; 00838 const TPtrC iUrl; 00839 00840 TUint iCommandID; 00841 }; 00842 00858 class MBrCtlStateChangeObserver 00859 { 00860 public: 00872 virtual void StateChanged(TBrCtlDefs::TBrCtlState aState, TInt aValue) = 0; 00873 }; 00874 00875 // CLASS DECLARATION 00876 #start_since SINCE_3_1_SDK 00877 00882 class MBrCtlCommandObserver 00883 { 00884 public: // New functions 00894 virtual void HandleCommandL(TBrCtlDefs::TBrCtlClientCommands aCommand, const CArrayFix<TPtrC>& aAttributesNames, 00895 const CArrayFix<TPtrC>& aAttributeValues) = 0; 00896 }; 00897 #end_since SINCE_3_1_SDK 00898 00899 // BRCTLINTERFACE_H 00900 #endif 00901 00902 // End of File