Created
January 5, 2012 13:37
-
-
Save kenchris/1565292 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
commit d63b4bb28948669cf882787e24de8f4e6c82481a | |
Author: Kenneth Rohde Christiansen <kenneth@webkit.org> | |
Date: Thu Jan 5 13:54:16 2012 +0100 | |
[Qt] Implement QQuickWebView::inputMethodQuery | |
Reviewed by NOBODY (OOPS!). | |
Implement the non-Maliit dependent parts of inputMethodQuery. | |
* UIProcess/API/qt/qquickwebview.cpp: | |
(QQuickWebView::inputMethodQuery): | |
* UIProcess/API/qt/qquickwebview_p.h: | |
diff --git a/Source/WebKit2/ChangeLog b/Source/WebKit2/ChangeLog | |
index bd50155..0565c9f 100644 | |
--- a/Source/WebKit2/ChangeLog | |
+++ b/Source/WebKit2/ChangeLog | |
@@ -1,3 +1,15 @@ | |
+2012-01-05 Kenneth Rohde Christiansen <kenneth@webkit.org> | |
+ | |
+ [Qt] Implement QQuickWebView::inputMethodQuery | |
+ | |
+ Reviewed by NOBODY (OOPS!). | |
+ | |
+ Implement the non-Maliit dependent parts of inputMethodQuery. | |
+ | |
+ * UIProcess/API/qt/qquickwebview.cpp: | |
+ (QQuickWebView::inputMethodQuery): | |
+ * UIProcess/API/qt/qquickwebview_p.h: | |
+ | |
2012-01-05 Carlos Garcia Campos <cgarcia@igalia.com> | |
[GTK] Add methods to get/set the WebView zoom level to WebKit2 GTK+ API | |
diff --git a/Source/WebKit2/UIProcess/API/qt/qquickwebview.cpp b/Source/WebKit2/UIProcess/API/qt/qquickwebview.cpp | |
index 4dbf938..9adbd22 100644 | |
--- a/Source/WebKit2/UIProcess/API/qt/qquickwebview.cpp | |
+++ b/Source/WebKit2/UIProcess/API/qt/qquickwebview.cpp | |
@@ -833,6 +833,31 @@ QString QQuickWebView::title() const | |
return d->webPageProxy->pageTitle(); | |
} | |
+QVariant QQuickWebView::inputMethodQuery(Qt::InputMethodQuery property) const | |
+{ | |
+ Q_D(const QQuickWebView); | |
+ const EditorState& state = d->webPageProxy->editorState(); | |
+ | |
+ switch(property) { | |
+ case Qt::ImCursorRectangle: | |
+ return QRectF(state.microFocus); | |
+ case Qt::ImFont: | |
+ return QVariant(); | |
+ case Qt::ImCursorPosition: | |
+ return QVariant(static_cast<int>(state.cursorPosition)); | |
+ case Qt::ImAnchorPosition: | |
+ return QVariant(static_cast<int>(state.anchorPosition)); | |
+ case Qt::ImSurroundingText: | |
+ return QString(state.surroundingText); | |
+ case Qt::ImCurrentSelection: | |
+ return QString(state.selectedText); | |
+ case Qt::ImMaximumTextLength: | |
+ return QVariant(); // No limit. | |
+ default: | |
+ return QVariant(); | |
+ } | |
+} | |
+ | |
QQuickWebViewExperimental* QQuickWebView::experimental() const | |
{ | |
return m_experimental; | |
diff --git a/Source/WebKit2/UIProcess/API/qt/qquickwebview_p.h b/Source/WebKit2/UIProcess/API/qt/qquickwebview_p.h | |
index 420453d..f1b4cbb 100644 | |
--- a/Source/WebKit2/UIProcess/API/qt/qquickwebview_p.h | |
+++ b/Source/WebKit2/UIProcess/API/qt/qquickwebview_p.h | |
@@ -87,6 +87,8 @@ public: | |
bool loading() const; | |
bool canReload() const; | |
+ virtual QVariant inputMethodQuery(Qt::InputMethodQuery property) const; | |
+ | |
QQuickWebPage* page(); | |
QQuickWebViewExperimental* experimental() const; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment