Implement more functions for the Qt build
authorstaikos <staikos@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 29 Jan 2007 08:47:40 +0000 (08:47 +0000)
committerstaikos <staikos@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 29 Jan 2007 08:47:40 +0000 (08:47 +0000)
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@19211 268f45cc-cd09-0410-ab3c-d52691b4dbfc

WebKitQt/Api/qwebpage.cpp
WebKitQt/Api/qwebpage.h
WebKitQt/Api/qwebpagehistory.cpp
WebKitQt/Api/qwebpagehistory.h
WebKitQt/ChangeLog
WebKitQt/WebCoreSupport/ChromeClientQt.cpp
WebKitQt/WebCoreSupport/FrameLoaderClientQt.cpp

index 115a2df84f06aadf62caddac84d429698ac88fcd..9193afdd52055067ad2f83611d74504887482e6a 100644 (file)
@@ -174,5 +174,17 @@ void QWebPage::goToHistoryItem(const QWebHistoryItem &item)
     d->page->goToItem(item.d->item, FrameLoadTypeIndexedBackForward);
 }
 
+void QWebPage::javaScriptConsoleMessage(const QString& message, unsigned int lineNumber, const QString& sourceID)
+{
+}
+
+void QWebPage::statusTextChanged(const QString& text)
+{
+}
+
+void QWebPage::runJavaScriptAlert(QWebFrame *frame, const QString& msg)
+{
+}
+
 #include "qwebpage.moc"
 
index d02d685845a961ebb645dab9521ca105adc1df99..9c6d2ded5421fe4a47683169129b2a1138fb9977 100644 (file)
@@ -59,6 +59,12 @@ public:
 
     QUrl url() const;
 
+    virtual void javaScriptConsoleMessage(const QString& message, unsigned int lineNumber, const QString& sourceID);
+
+    virtual void statusTextChanged(const QString& text);
+
+    virtual void runJavaScriptAlert(QWebFrame *frame, const QString& msg);
+
 public slots:
     /**
      * Stops loading of the page, if loading.
index 7f9dd4dc7b9bf4af2fc14b95da14661ebeb0e79d..2e7e74bf7c1b3744bb752d513e5fe64c0d021a23 100644 (file)
@@ -128,6 +128,16 @@ QList<QWebHistoryItem> QWebPageHistory::forwardItems(int maxItems) const
     return ret;
 }
 
+bool QWebPageHistory::canGoBack() const
+{
+    return d->lst->backListCount() > 0;
+}
+
+bool QWebPageHistory::canGoForward() const
+{
+    return d->lst->forwardListCount() > 0;
+}
+
 void QWebPageHistory::goBack()
 {
     d->lst->goBack();
index dec18b470a39a8b5c34936057a2364b0a96d308b..0d722ef8c54c05b07f27e3b9f12b8112066be0a9 100644 (file)
@@ -125,6 +125,9 @@ public:
     QList<QWebHistoryItem> backItems(int maxItems) const;
     QList<QWebHistoryItem> forwardItems(int maxItems) const;
 
+    bool canGoBack() const;
+    bool canGoForward() const;
+
     void goBack();
     void goForward();
     void goToItem(QWebHistoryItem *item);
index af4f092d5cebe7dadaabdaa401c5978f8a51219d..71f7d5b415c29393c1839c9370590d1998ba593d 100644 (file)
@@ -1,3 +1,24 @@
+2007-01-29  George Staikos  <staikos@kde.org>
+
+        Reviewed by Zack.
+
+        Implement more functions
+
+        * Api/qwebpage.cpp:
+        (QWebPage::javaScriptConsoleMessage):
+        (QWebPage::statusTextChanged):
+        (QWebPage::runJavaScriptAlert):
+        * Api/qwebpage.h:
+        * Api/qwebpagehistory.cpp:
+        (QWebPageHistory::canGoBack):
+        (QWebPageHistory::canGoForward):
+        * Api/qwebpagehistory.h:
+        * WebCoreSupport/ChromeClientQt.cpp:
+        (WebCore::ChromeClientQt::addMessageToConsole):
+        (WebCore::ChromeClientQt::runJavaScriptAlert):
+        * WebCoreSupport/FrameLoaderClientQt.cpp:
+        (WebCore::FrameLoaderClientQt::shouldGoToHistoryItem):
+
 2007-01-26  George Staikos  <staikos@kde.org>
 
         Reviewed by Zack.
index c0951e9888300697d1302f1fb1cfe651d5fe4047..c9e5ee023bc97ef67ad36006022e70b6aa06818e 100644 (file)
@@ -209,7 +209,9 @@ void ChromeClientQt::setResizable(bool)
 void ChromeClientQt::addMessageToConsole(const String& message, unsigned int lineNumber,
                                          const String& sourceID)
 {
-    notImplemented();
+    QString x = message;
+    QString y = sourceID;
+    m_webPage->consoleMessage(x, lineNumber, y);
 }
 
 void ChromeClientQt::chromeDestroyed()
@@ -232,9 +234,10 @@ void ChromeClientQt::closeWindowSoon()
     notImplemented();
 }
 
-void ChromeClientQt::runJavaScriptAlert(Frame*, const String&)
+void ChromeClientQt::runJavaScriptAlert(Frame*, const String& msg)
 {
-    notImplemented();
+    QString x = msg;
+    m_webPage->runJavaScriptAlert(0, x);
 }
 
 bool ChromeClientQt::runJavaScriptConfirm(Frame*, const String&)
index bf72ae758fba9faa6dac93f1e15a05b8a840e734..9ffdc1aab6c44a77f8703f79a1f49154c2e6ba3d 100644 (file)
@@ -614,9 +614,11 @@ void FrameLoaderClientQt::updateGlobalHistoryForReload(const WebCore::KURL&)
     notImplemented();
 }
 
-bool FrameLoaderClientQt::shouldGoToHistoryItem(WebCore::HistoryItem*) const
+bool FrameLoaderClientQt::shouldGoToHistoryItem(WebCore::HistoryItem *item) const
 {
-    notImplemented();
+    if (item) {
+        return true;
+    }
     return false;
 }