summaryrefslogtreecommitdiffstats
path: root/src/gui/kernel/qapplication_s60.cpp
diff options
context:
space:
mode:
authorSami Merila <sami.merila@nokia.com>2011-03-08 06:39:59 (GMT)
committerSami Merila <sami.merila@nokia.com>2011-03-08 06:39:59 (GMT)
commita8f7a5067e4c3d1e7ef87a7067e026e62eab5c17 (patch)
treebc04efcbb22519d833415515fde36a0e7f24b924 /src/gui/kernel/qapplication_s60.cpp
parent1224e6c3f7bbf361f0be2ff5116b5745cb98fb76 (diff)
downloadQt-a8f7a5067e4c3d1e7ef87a7067e026e62eab5c17.zip
Qt-a8f7a5067e4c3d1e7ef87a7067e026e62eab5c17.tar.gz
Qt-a8f7a5067e4c3d1e7ef87a7067e026e62eab5c17.tar.bz2
Support partial input mode
By default Symbian devices use fullscreen editing mode. However, in the latest AVKON releases a partial virtual keyboard is supported. Support the non-fullscreen editing mode from QCoeFepInputContext. The non-fullscreen editing mode is only supported for Symbian^3 and only for graphicsview-based solutions (QGraphicsView, QGraphicsWebView, QDeclarativeView, ...). When native side indicates that the keyboard opens, the graphicsview is possibly translated so that the text cursor position is ensured to be visible. When keyboard closes, the translation is removed. If the graphicsview contains vertical scrollbar, the whole view is resized to the area above the keyboard, since translating it, would move the upper part of the scrollbar out of screen area. There is a new exported private API to control when partial vkb is used. Task-number: QTBUG-16572 Reviewed-by: axis Reviewed-by: Mrudul Pendharkar Reviewed-by: Laszlo Agocs
Diffstat (limited to 'src/gui/kernel/qapplication_s60.cpp')
-rw-r--r--src/gui/kernel/qapplication_s60.cpp56
1 files changed, 56 insertions, 0 deletions
diff --git a/src/gui/kernel/qapplication_s60.cpp b/src/gui/kernel/qapplication_s60.cpp
index fb0c6b8..02560b3 100644
--- a/src/gui/kernel/qapplication_s60.cpp
+++ b/src/gui/kernel/qapplication_s60.cpp
@@ -96,6 +96,10 @@ QT_BEGIN_NAMESPACE
// Goom Events through Window Server
static const int KGoomMemoryLowEvent = 0x10282DBF;
static const int KGoomMemoryGoodEvent = 0x20026790;
+// Split view open/close events from AVKON
+static const int KSplitViewOpenEvent = 0x2001E2C0;
+static const int KSplitViewCloseEvent = 0x2001E2C1;
+
#if defined(QT_DEBUG)
static bool appNoGrab = false; // Grabbing enabled
@@ -1224,6 +1228,11 @@ void QSymbianControl::FocusChanged(TDrawNow /* aDrawNow */)
if (m_ignoreFocusChanged || (qwidget->windowType() & Qt::WindowType_Mask) == Qt::Desktop)
return;
+#ifdef Q_WS_S60
+ if (S60->splitViewLastWidget)
+ return;
+#endif
+
// Popups never get focused, but still receive the FocusChanged when they are hidden.
if (QApplicationPrivate::popupWidgets != 0
|| (qwidget->windowType() & Qt::Popup) == Qt::Popup)
@@ -1302,9 +1311,56 @@ void QSymbianControl::handleClientAreaChange()
}
}
+bool QSymbianControl::isSplitViewWidget(QWidget *widget) {
+ bool returnValue = true;
+ //Ignore events sent to non-active windows, not visible widgets and not parents of input widget.
+ if (!qwidget->isActiveWindow()
+ || !qwidget->isVisible()
+ || !qwidget->isAncestorOf(widget)) {
+
+ returnValue = false;
+ }
+ return returnValue;
+}
+
void QSymbianControl::HandleResourceChange(int resourceType)
{
switch (resourceType) {
+ case KSplitViewCloseEvent: //intentional fall-through
+ case KSplitViewOpenEvent: {
+#if !defined(QT_NO_IM) && defined(Q_WS_S60)
+
+ //Fetch widget getting the text input
+ QWidget *widget = QWidget::keyboardGrabber();
+ if (!widget) {
+ if (QApplicationPrivate::popupWidgets) {
+ widget = QApplication::activePopupWidget()->focusWidget();
+ if (!widget) {
+ widget = QApplication::activePopupWidget();
+ }
+ } else {
+ widget = QApplicationPrivate::focus_widget;
+ if (!widget) {
+ widget = qwidget;
+ }
+ }
+ }
+ if (widget) {
+ QCoeFepInputContext *ic = qobject_cast<QCoeFepInputContext *>(widget->inputContext());
+ if (!ic) {
+ ic = qobject_cast<QCoeFepInputContext *>(qApp->inputContext());
+ }
+ if (ic && isSplitViewWidget(widget)) {
+ if (resourceType == KSplitViewCloseEvent) {
+ ic->resetSplitViewWidget();
+ } else {
+ ic->ensureFocusWidgetVisible(widget);
+ }
+ }
+ }
+#endif // !defined(QT_NO_IM) && defined(Q_WS_S60)
+ }
+ break;
case KInternalStatusPaneChange:
handleClientAreaChange();
if (IsFocused() && IsVisible()) {