Holger Hans Peter Freyther <holger.freyther@trolltech.com>
[WebKit-https.git] / WebKit / qt / Api / qwebframe_p.h
index f4061f5..6f38427 100644 (file)
 #include "qwebpage_p.h"
 
 #include "EventHandler.h"
-#include "FrameView.h"
 #include "KURL.h"
 #include "PlatformString.h"
 #include "wtf/RefPtr.h"
+#include "Frame.h"
 
 namespace WebCore
 {
-    class Element;
     class FrameLoaderClientQt;
-    class Frame;
     class FrameView;
     class HTMLFrameOwnerElement;
     class PlatformScrollbar;
@@ -62,30 +60,37 @@ class QWebFramePrivate
 public:
     QWebFramePrivate()
         : q(0)
+        , horizontalScrollBarPolicy(Qt::ScrollBarAsNeeded)
+        , verticalScrollBarPolicy(Qt::ScrollBarAsNeeded)
         , frameLoaderClient(0)
         , frame(0)
-        , frameView(0)
         , page(0)
-        , eventHandler(0)
-        , lastHoverElement(0)
+        , allowsScrolling(true)
+        , marginWidth(-1)
+        , marginHeight(-1)
         {}
     void init(QWebFrame *qframe, WebCore::Page *page,
               QWebFrameData *frameData);
 
-    QWebFrame *parentFrame();
+    inline QWebFrame *parentFrame() { return qobject_cast<QWebFrame*>(q->parent()); }
+
     WebCore::PlatformScrollbar *horizontalScrollBar() const;
     WebCore::PlatformScrollbar *verticalScrollBar() const;
 
-    inline QPoint pos() const
-    { return frameView->frameGeometry().topLeft(); }
+    Qt::ScrollBarPolicy horizontalScrollBarPolicy;
+    Qt::ScrollBarPolicy verticalScrollBarPolicy; 
+
+    static WebCore::Frame* core(QWebFrame*);
+    static QWebFrame* kit(WebCore::Frame*);
 
     QWebFrame *q;
     WebCore::FrameLoaderClientQt *frameLoaderClient;
-    WTF::RefPtr<WebCore::Frame> frame;
-    WTF::RefPtr<WebCore::FrameView> frameView;
+    WebCore::Frame *frame;
     QWebPage *page;
-    WebCore::EventHandler *eventHandler;
-    WebCore::Element *lastHoverElement;
+
+    bool allowsScrolling;
+    int marginWidth;
+    int marginHeight;
 };
 
 #endif