From 0f0c9993bee1678b6ec01905b7acad87f54f91fa Mon Sep 17 00:00:00 2001 From: hausmann Date: Wed, 7 Nov 2007 14:31:16 +0000 Subject: [PATCH] Moved QWebFrame::selectedText() to QWebPage::selectedText(). 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 | 5 ----- WebKit/qt/Api/qwebframe.h | 1 - WebKit/qt/Api/qwebpage.cpp | 5 +++++ WebKit/qt/Api/qwebpage.h | 4 +++- WebKit/qt/ChangeLog | 14 ++++++++++++++ 5 files changed, 22 insertions(+), 7 deletions(-) diff --git a/WebKit/qt/Api/qwebframe.cpp b/WebKit/qt/Api/qwebframe.cpp index 5b24f73e45d1..51812a4cd442 100644 --- a/WebKit/qt/Api/qwebframe.cpp +++ b/WebKit/qt/Api/qwebframe.cpp @@ -192,11 +192,6 @@ QWebPage * QWebFrame::page() const return d->page; } -QString QWebFrame::selectedText() const -{ - return d->frame->selectedText(); -} - QList QWebFrame::childFrames() const { QList rc; diff --git a/WebKit/qt/Api/qwebframe.h b/WebKit/qt/Api/qwebframe.h index 7d0d12a9616b..20356d2a8c18 100644 --- a/WebKit/qt/Api/qwebframe.h +++ b/WebKit/qt/Api/qwebframe.h @@ -59,7 +59,6 @@ public: QString markup() const; QString innerText() const; QString renderTreeDump() const; - QString selectedText() const; QString title() const; QString name() const; diff --git a/WebKit/qt/Api/qwebpage.cpp b/WebKit/qt/Api/qwebpage.cpp index 3998458485c2..c3b57bb0038a 100644 --- a/WebKit/qt/Api/qwebpage.cpp +++ b/WebKit/qt/Api/qwebpage.cpp @@ -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; diff --git a/WebKit/qt/Api/qwebpage.h b/WebKit/qt/Api/qwebpage.h index 5bb094dc3d60..dfa3cf6f9898 100644 --- a/WebKit/qt/Api/qwebpage.h +++ b/WebKit/qt/Api/qwebpage.h @@ -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(); /** diff --git a/WebKit/qt/ChangeLog b/WebKit/qt/ChangeLog index 5958f0d232b8..03af3c50f092 100644 --- a/WebKit/qt/ChangeLog +++ b/WebKit/qt/ChangeLog @@ -1,3 +1,17 @@ +2007-11-07 Simon Hausmann + + 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 Reviewed by Lars. -- 2.36.0