ginebra2/ContentViews/GWebContentView.h
changeset 16 3c88a81ff781
parent 12 afcd8e6d025b
equal deleted inserted replaced
14:6aeb7a756187 16:3c88a81ff781
    27 #include <QGraphicsWidget>
    27 #include <QGraphicsWidget>
    28 #include <QWebElement>
    28 #include <QWebElement>
    29 #include <QGraphicsWebView>
    29 #include <QGraphicsWebView>
    30 #include "controllableviewimpl.h"
    30 #include "controllableviewimpl.h"
    31 #include "messageboxproxy.h"
    31 #include "messageboxproxy.h"
    32 #include "ZoomMetaData.h"
       
    33 #include "GSuperWebPage.h"
    32 #include "GSuperWebPage.h"
    34 #include "ContentViewDelegate.h"
    33 #include "ContentViewDelegate.h"
    35 #include "GContentViewTouchNavigation.h"
    34 #include "GContentViewTouchNavigation.h"
       
    35 #include "webpagedata.h"
    36 
    36 
    37 static const char KBOOKMARKURLFILE[]            = "file://";
    37 static const char KBOOKMARKURLFILE[]            = "file://";
    38 static const char KBOOKMARKURLFILESLASH[]       = "file:///";
    38 static const char KBOOKMARKURLFILESLASH[]       = "file:///";
    39 static const char KENCODEDBACKSLASH[]           = "%5C";
    39 static const char KENCODEDBACKSLASH[]           = "%5C";
    40 static const char KENCODEDDOUBLEQUOTE[]         = "%22";
    40 static const char KENCODEDDOUBLEQUOTE[]         = "%22";
   132       virtual void hide() {
   132       virtual void hide() {
   133            widget()->hide();
   133            widget()->hide();
   134       }
   134       }
   135 
   135 
   136       bool gesturesEnabled() const;
   136       bool gesturesEnabled() const;
   137       void setGesturesEnabled(bool value);
   137       void setGesturesEnabled(bool value); 
   138 
   138 
   139       bool enabled() const;
   139       bool enabled() const;
   140       void setEnabled(bool value);
   140       void setEnabled(bool value);
   141 
   141 
   142 
   142 
   171       void secureConnection(bool secure);
   171       void secureConnection(bool secure);
   172       void backEnabled(bool enabled);
   172       void backEnabled(bool enabled);
   173       void forwardEnabled(bool enabled);
   173       void forwardEnabled(bool enabled);
   174       void startingPanGesture(int);
   174       void startingPanGesture(int);
   175       void contentViewMouseEvent(QEvent::Type type);
   175       void contentViewMouseEvent(QEvent::Type type);
   176 	  void superPageShown(const QString &name);
   176 	    void superPageShown(const QString &name);
       
   177 	    void normalPageShown();
   177 #ifdef BEDROCK_TILED_BACKING_STORE
   178 #ifdef BEDROCK_TILED_BACKING_STORE
   178       void contextEvent(::WebViewEventContext* context);
   179       void contextEvent(::WebViewEventContext* context);
   179 #endif      
   180 #endif      
   180 
   181 
   181   public slots:
   182   public slots:
   207 
   208 
   208       // Show the current normal web page, ie. not a super page.
   209       // Show the current normal web page, ie. not a super page.
   209       void showNormalPage();
   210       void showNormalPage();
   210 
   211 
   211       void dump();
   212       void dump();
       
   213       void saveZoomDataAndRestoreAfterLoad();
   212 
   214 
   213   private slots:
   215   private slots:
   214     void updateZoom(qreal delta);
   216     void updateZoom(qreal delta);
   215     void onLoadStarted();
   217     void onLoadStarted();
   216     void onLoadFinished(bool ok);
   218     void onLoadFinished(bool ok);
   220     void pageCreated(WRT::WrtBrowserContainer * pg);
   222     void pageCreated(WRT::WrtBrowserContainer * pg);
   221     // Called by the page controller when changes a page.
   223     // Called by the page controller when changes a page.
   222     void pageChanged(WRT::WrtBrowserContainer * , WRT::WrtBrowserContainer *);
   224     void pageChanged(WRT::WrtBrowserContainer * , WRT::WrtBrowserContainer *);
   223 
   225 
   224 #ifdef BEDROCK_TILED_BACKING_STORE
   226 #ifdef BEDROCK_TILED_BACKING_STORE
   225     void handleContextEventObject(QWebHitTestResult* eventTarget);
   227     void handleContextEventObject(QWebHitTestResult* hitTest, QPointF position);
   226     void handleViewScrolled(QPoint& scrollPos, QPoint& delta);
   228     void handleViewScrolled(QPoint& scrollPos, QPoint& delta);
   227 #endif
   229 #endif
   228   protected:
   230   protected:
   229 #ifdef BEDROCK_TILED_BACKING_STORE
   231 #ifdef BEDROCK_TILED_BACKING_STORE
   230     QGraphicsWidget* webWidgetConst();
   232     QGraphicsWidget* webWidgetConst();
   232     GWebContentViewWidget *webWidgetConst() const { return m_widget; }
   234     GWebContentViewWidget *webWidgetConst() const { return m_widget; }
   233 #endif
   235 #endif
   234     ChromeWidget *chrome() { return m_chrome; }
   236     ChromeWidget *chrome() { return m_chrome; }
   235     void updateWebPage(WRT::WrtBrowserContainer * pg);
   237     void updateWebPage(WRT::WrtBrowserContainer * pg);
   236     void changeContentViewZoomInfo(WRT::WrtBrowserContainer* newPage);
   238     void changeContentViewZoomInfo(WRT::WrtBrowserContainer* newPage);
   237 
   239     void triggerZoomInAction();
   238   protected:
   240     void triggerZoomOutAction();
       
   241 
   239 #ifdef BEDROCK_TILED_BACKING_STORE
   242 #ifdef BEDROCK_TILED_BACKING_STORE
   240     WebContentViewWidget* m_widget;
   243     WebContentViewWidget* m_widget;
   241 #else
   244 #else
   242     GWebContentViewWidget *m_widget;
   245     GWebContentViewWidget *m_widget;
   243 #endif
   246 #endif
   266     QTimer *m_timer;
   269     QTimer *m_timer;
   267     qreal m_value;
   270     qreal m_value;
   268     bool m_gesturesEnabled;
   271     bool m_gesturesEnabled;
   269     bool m_enabled;
   272     bool m_enabled;
   270     qreal m_savedZoomValueInView;
   273     qreal m_savedZoomValueInView;
       
   274     bool m_firstLoadHack;
       
   275     WebPageData* m_savedZoomData;
   271   };
   276   };
   272 
   277 
   273 }
   278 }
   274 
   279 
   275 #endif // GWebContentView_H
   280 #endif // GWebContentView_H