webengine/osswebengine/WebKit/s60/webview/HistoryInterface.h
changeset 0 dd21522fd290
child 36 0ed94ceaa377
equal deleted inserted replaced
-1:000000000000 0:dd21522fd290
       
     1 /*
       
     2 * Copyright (c) 2004-2008 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     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".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:   Definition of HistoryController
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef HISTORYINTERFACE_H
       
    20 #define HISTORYINTERFACE_H
       
    21 
       
    22 //  INCLUDES
       
    23 #include <e32base.h>
       
    24 #include <BrCtlDefs.h>
       
    25 
       
    26 // CONSTANTS
       
    27 
       
    28 
       
    29 // MACROS
       
    30 class HistoryView;
       
    31 
       
    32 // DATA TYPES
       
    33 enum THistoryStackDirection
       
    34 {
       
    35 
       
    36     EHistoryStackDirectionPrevious,
       
    37     EHistoryStackDirectionCurrent,
       
    38     EHistoryStackDirectionNext
       
    39 };
       
    40 
       
    41 // FUNCTION PROTOTYPES
       
    42 
       
    43 // FORWARD DECLARATIONS
       
    44 class TBrCtlDefs;
       
    45 class TBrCtlSelectOptionData;
       
    46 class HistoryEntry;
       
    47 class HistoryCallback;
       
    48 class CCoeControl;
       
    49 class CFbsBitmap;
       
    50 class WebSurface;
       
    51 
       
    52 namespace WebCore {
       
    53     class FormData;
       
    54 }
       
    55 
       
    56 typedef CArrayFixFlat<TBrCtlSelectOptionData> SelectArray;
       
    57 
       
    58 // CLASS DECLARATION
       
    59 
       
    60 class HistoryCallback {
       
    61 public:
       
    62     virtual CCoeControl* parent() = 0;
       
    63     virtual TPoint currentPosition() = 0;
       
    64     virtual int currentZoomLevel() = 0;
       
    65     virtual int minZoomLevel() = 0;
       
    66     virtual bool wmlMode() = 0;
       
    67     virtual void setWmlMode(bool aWml) = 0;
       
    68     virtual void doHistoryGet(TPtrC8 url, TBrCtlDefs::TBrCtlCacheMode cacheMode) = 0;
       
    69     virtual int doHistoryPost(TPtrC8 url, TBrCtlDefs::TBrCtlCacheMode cacheMode, TPtrC contentType, WebCore::FormData* formData) = 0;
       
    70     virtual void stateChanged(bool enter) = 0;
       
    71     virtual void navigationStateChanged(TBrCtlDefs::TBrCtlState state, bool value) = 0;
       
    72     virtual CFbsBitmap* scaledPage() = 0;
       
    73     virtual void makeVisible(bool visible) = 0;
       
    74     virtual WebSurface* surface() = 0;
       
    75     virtual void handleWmlBackL() = 0;
       
    76     virtual void setUse(bool use, WebCore::FormData* formData) = 0;
       
    77     virtual bool dialogSelectOption(SelectArray* historyList) = 0;
       
    78     virtual void deferTimers(bool option) = 0;
       
    79 };
       
    80 
       
    81 class HistoryControllerInterface {
       
    82 
       
    83     public: 
       
    84         virtual ~HistoryControllerInterface() {}
       
    85 
       
    86        /**
       
    87         * Insert
       
    88         * Add Url to History List
       
    89         * @since 5.x
       
    90         * @return void
       
    91         */
       
    92         virtual void insert( const TPtrC8& url, const TPtrC8& requestUrl, 
       
    93             TPtrC& formContentType, WebCore::FormData* formData ) = 0;
       
    94 
       
    95         /**
       
    96         * Implements virtual bool ContainsItemForURL(const TDesC& aUrl) = 0;)
       
    97         * @return bool
       
    98         * Return TRUE if URL request is in the history list
       
    99         */
       
   100         virtual bool containsItemForURL (const TPtrC& url) = 0;
       
   101         virtual int historyLength() const = 0;
       
   102 
       
   103         /**
       
   104         * PageInfoLC
       
   105         * Return the pageInfo requested, such as page's url or title
       
   106         * @since 3.x
       
   107         * @return HBufC* - The page information that was requested
       
   108         */
       
   109         virtual HBufC* pageInfoLC( TBrCtlDefs::TBrCtlPageInfo aBrCtlPageInfo ) = 0;
       
   110 
       
   111         /**
       
   112         * HandleHistoryCommandL
       
   113         * Handle the commands related to history object
       
   114         * @since 3.x
       
   115         * @return void
       
   116         */
       
   117         virtual void handleHistoryCommandL( int command ) = 0;
       
   118 
       
   119         /**
       
   120         * ClearHistoryList
       
   121         * Clears History List
       
   122         * @since 3.x
       
   123         * @return void
       
   124         */
       
   125         virtual void clearHistoryList() = 0;
       
   126 
       
   127         /**
       
   128         * CanGoBackOrForward
       
   129         * Check if back/forward is possible
       
   130         * @return void
       
   131         */
       
   132         virtual bool canGoBackOrForward( int distance ) = 0;
       
   133 
       
   134         /**
       
   135         * Updates HistoryEntryThumbnail
       
   136         *
       
   137         */
       
   138         virtual void updateHistoryEntryThumbnailL(const CFbsBitmap* bitmap) = 0;
       
   139 
       
   140         /**
       
   141         * Set the title
       
   142         *
       
   143         */
       
   144         virtual void setCurrentEntryTitle( const TPtrC& pageTitle ) = 0;
       
   145 
       
   146         /**
       
   147         * CurrentEntryPosition
       
   148         * Asks the history controller to update the current entry position
       
   149         */
       
   150         virtual void updateCurrentEntryPositionIfNeeded() = 0;
       
   151 
       
   152         /**
       
   153         * CurrentEntryPosition
       
   154         * Gets the current entry position
       
   155         */
       
   156         virtual TPoint currentEntryPosition() = 0;
       
   157 
       
   158         /**
       
   159         * CurrentEntryZoomLevel
       
   160         * Asks the history controller to update the current entry zoom level
       
   161         */
       
   162         virtual void updateCurrentEntryZoomLevelIfNeeded() = 0;
       
   163 
       
   164         /**
       
   165         * CurrentEntryZoomLevel
       
   166         * Gets the current entry zoom level
       
   167         */
       
   168         virtual int currentEntryZoomLevel() = 0;
       
   169 
       
   170         /**
       
   171         * CurrentEntryMinZoomLevel
       
   172         * Asks the history controller to update the current entry zoom level
       
   173         */
       
   174         virtual void updateCurrentEntryMinZoomLevelIfNeeded() = 0;
       
   175 
       
   176         /**
       
   177         * CurrentEntryMinZoomLevel
       
   178         * Gets the current entry zoom level
       
   179         */
       
   180         virtual int currentEntryMinZoomLevel() = 0;
       
   181 
       
   182         /**
       
   183          * Sets Url request 
       
   184          */
       
   185         //virtual void setRequestUrlL(const TPtrC& aUrl) = 0;
       
   186 
       
   187         /**
       
   188          * Sets Url Response 
       
   189          */
       
   190         //virtual void setResponseUrlL(const TPtrC& aUrl) = 0;
       
   191         
       
   192         /**
       
   193          * Gets the entry 
       
   194          */
       
   195         virtual HistoryEntry* entry (THistoryStackDirection direction) = 0;
       
   196         
       
   197         /**
       
   198          * Gets Url Request 
       
   199          */
       
   200         virtual TPtrC8 requestUrl() = 0;
       
   201         
       
   202         /**
       
   203         * Returns a pointer to the URL response
       
   204         * @return TPtrC to the response
       
   205         */
       
   206         virtual TPtrC8 responseUrl () = 0;
       
   207         
       
   208         /**
       
   209         * Returns a pointer to HistoryEntry
       
   210         * @return HistoryEntry* to the wml hystory
       
   211         */
       
   212         virtual HistoryEntry* entryByIndex (int historyIndex) = 0;
       
   213         
       
   214         /**
       
   215          * Gets the index 
       
   216          */
       
   217         virtual int index (THistoryStackDirection direction) = 0;
       
   218         
       
   219         /**
       
   220         * Delete the entry from the list
       
   221         */
       
   222         virtual void deleteEntry (int index) = 0;
       
   223 
       
   224         /**
       
   225         * set the current entry
       
   226         */
       
   227         virtual void setCurrentL ( THistoryStackDirection direction ) = 0;
       
   228 
       
   229         /**
       
   230         * Change the time stamp during a reload
       
   231         */
       
   232         virtual void updateGlobalHistoryForReload () = 0;
       
   233 
       
   234         virtual HistoryCallback* historyCallback() = 0;
       
   235         virtual void setBackListAllowed( bool enabled ) = 0;
       
   236         virtual HistoryView* historyView() = 0;
       
   237         virtual TBool historyViewEnabled() = 0;
       
   238         virtual void setHistoryViewEnabled( TBool aEnabled ) = 0;
       
   239         virtual void setCurrentIndex (int index) = 0;
       
   240         virtual void goBackOrForward( int distance ) = 0;
       
   241         virtual void setPossibleWmlOEB( TBool flag ) = 0;
       
   242         virtual TBool possibleWmlOEB() = 0;
       
   243         
       
   244 		virtual void performTransition(int direction) = 0;
       
   245 
       
   246 };
       
   247 
       
   248 
       
   249 
       
   250 #endif      // HISTORYINTERFACE_H
       
   251 
       
   252 // End of File