Moved QWebFrame::selectedText() to QWebPage::selectedText().
authorhausmann <hausmann@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 7 Nov 2007 14:31:16 +0000 (14:31 +0000)
committerhausmann <hausmann@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 7 Nov 2007 14:31:16 +0000 (14:31 +0000)
The currently selected text is a property of the page as a whole.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@27553 268f45cc-cd09-0410-ab3c-d52691b4dbfc

WebKit/qt/Api/qwebframe.cpp
WebKit/qt/Api/qwebframe.h
WebKit/qt/Api/qwebpage.cpp
WebKit/qt/Api/qwebpage.h
WebKit/qt/ChangeLog

index 5b24f73e45d12a03b74a49ea7ac0dc6bf16971aa..51812a4cd44254e399f64b98227aec6dd412aac4 100644 (file)
@@ -192,11 +192,6 @@ QWebPage * QWebFrame::page() const
     return d->page;
 }
 
-QString QWebFrame::selectedText() const
-{
-    return d->frame->selectedText();
-}
-
 QList<QWebFrame*> QWebFrame::childFrames() const
 {
     QList<QWebFrame*> rc;
index 7d0d12a9616b61cf557d9d841d0b0ac7690253ed..20356d2a8c18eb838412d9a0568b5bd45da0fdb3 100644 (file)
@@ -59,7 +59,6 @@ public:
     QString markup() const;
     QString innerText() const;
     QString renderTreeDump() const;
-    QString selectedText() const;
     QString title() const;
     QString name() const;
 
index 3998458485c2a6c2fc1b444db650a9e26a5f8e6b..c3b57bb0038ae5eaddb62817d85d2f917654cee1 100644 (file)
@@ -628,6 +628,11 @@ void QWebPage::paste()
     webActionTriggered(Paste);
 }
 
+QString QWebPage::selectedText() const
+{
+    return d->page->focusController()->focusedOrMainFrame()->selectedText();
+}
+
 QAction *QWebPage::webAction(WebAction action) const
 {
     if (action == QWebPage::NoWebAction) return 0;
index 5bb094dc3d6055e01689ff83b59d4be2eb5cc64b..dfa3cf6f98985626fa96afb4f7d99f433a6ac21d 100644 (file)
@@ -53,6 +53,7 @@ class QWEBKIT_EXPORT QWebPage : public QWidget
     Q_OBJECT
 
     Q_PROPERTY(bool modified READ isModified)
+    Q_PROPERTY(QString selectedText READ selectedText)
 public:
     enum NavigationRequestResponse {
         AcceptNavigationRequest,
@@ -164,6 +165,8 @@ public:
     quint64 totalBytes() const;
     quint64 bytesReceived() const;
 
+    QString selectedText() const;
+
     QAction *webAction(WebAction action) const;
 
 public slots:
@@ -224,7 +227,6 @@ signals:
      */
     void iconLoaded();
 
-    // #### doesn't give you anything without a way to actually get the selection
     void selectionChanged();
 
     /**
index 5958f0d232b8a742822302d7b0b3e4e2ce3a46fc..03af3c50f092afb1ea3938b96cd9e692662678de 100644 (file)
@@ -1,3 +1,17 @@
+2007-11-07  Simon Hausmann  <hausmann@kde.org>
+
+        Reviewed by Lars.
+
+        Moved QWebFrame::selectedText() to QWebPage::selectedText().
+        
+        The currently selected text is a property of the page as a whole.
+
+        * Api/qwebframe.cpp:
+        * Api/qwebframe.h:
+        * Api/qwebpage.cpp:
+        (QWebPage::selectedText):
+        * Api/qwebpage.h:
+
 2007-11-07  Simon Hausmann  <hausmann@kde.org>
 
         Reviewed by Lars.