diff options
author | Lauri Malmi <ext-lauri.malmi@nokia.com> | 2012-05-15 06:54:25 (GMT) |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-05-21 22:07:13 (GMT) |
commit | 11a1383d54fd479c4fb3d2a96b847732a01dcce8 (patch) | |
tree | 3829da949bf3576609427f818343943f88e16ff2 /src/gui/inputmethod | |
parent | 185ccc152cbb4a8df9c8fe016a26156c3f6995d7 (diff) | |
download | Qt-11a1383d54fd479c4fb3d2a96b847732a01dcce8.zip Qt-11a1383d54fd479c4fb3d2a96b847732a01dcce8.tar.gz Qt-11a1383d54fd479c4fb3d2a96b847732a01dcce8.tar.bz2 |
Symbian: inputcontext reports pointer events to FEP during inline edit
QCoeFepInputContext::mouseHandler() must report pointer events to FEP
by calling CAknExtendedInputCapabilities::ReportEventL(
CAknExtendedInputCapabilities::MAknEventObserver::
EPointerEventReceived).
Based on this event FEP commits inline edit properly and sends
notification peninputserver/VKB. Earlier QCoeFepInputContext::
mouseHandler() called CCoeFep::CancelTransaction() direclty
which lead to inconsistent inline edit state between FEP and VKB.
Task-number: ou1cimx1#991638
Change-Id: I90641ffd5aed97b27f2ca2328c0296e14b12f319
Reviewed-by: Pasi Pentikäinen <ext-pasi.a.pentikainen@nokia.com>
Diffstat (limited to 'src/gui/inputmethod')
-rw-r--r-- | src/gui/inputmethod/inputmethod.pri | 2 | ||||
-rw-r--r-- | src/gui/inputmethod/qcoefepinputcontext_p.h | 4 | ||||
-rw-r--r-- | src/gui/inputmethod/qcoefepinputcontext_s60.cpp | 34 |
3 files changed, 35 insertions, 5 deletions
diff --git a/src/gui/inputmethod/inputmethod.pri b/src/gui/inputmethod/inputmethod.pri index d439438..6667def 100644 --- a/src/gui/inputmethod/inputmethod.pri +++ b/src/gui/inputmethod/inputmethod.pri @@ -26,6 +26,6 @@ mac:!embedded:!qpa { symbian:contains(QT_CONFIG, s60) { HEADERS += inputmethod/qcoefepinputcontext_p.h SOURCES += inputmethod/qcoefepinputcontext_s60.cpp - LIBS += -lfepbase -lakninputlanguage + LIBS += -lfepbase -lakninputlanguage -leikctl } diff --git a/src/gui/inputmethod/qcoefepinputcontext_p.h b/src/gui/inputmethod/qcoefepinputcontext_p.h index 1b62a25..f8e6fec 100644 --- a/src/gui/inputmethod/qcoefepinputcontext_p.h +++ b/src/gui/inputmethod/qcoefepinputcontext_p.h @@ -65,6 +65,8 @@ #include <aknedsts.h> #include <eikccpu.h> +class CAknExtendedInputCapabilities; + QT_BEGIN_NAMESPACE class QCoeFepInputMaskHandler @@ -221,6 +223,8 @@ private: QPointer<QWidget> m_lastFocusedEditor; QPointer<QObject> m_lastFocusedObject; + CAknExtendedInputCapabilities *m_extendedInputCapabilities; + friend class tst_QInputContext; }; diff --git a/src/gui/inputmethod/qcoefepinputcontext_s60.cpp b/src/gui/inputmethod/qcoefepinputcontext_s60.cpp index 5ced556..151d3cc 100644 --- a/src/gui/inputmethod/qcoefepinputcontext_s60.cpp +++ b/src/gui/inputmethod/qcoefepinputcontext_s60.cpp @@ -63,6 +63,7 @@ #include <coeinput.h> #include <w32std.h> #include <akndiscreetpopup.h> +#include <aknextendedinputcapabilities.h> #include <qtextedit.h> #include <qplaintextedit.h> @@ -432,7 +433,8 @@ QCoeFepInputContext::QCoeFepInputContext(QObject *parent) m_splitViewResizeBy(0), m_splitViewPreviousWindowStates(Qt::WindowNoState), m_splitViewPreviousFocusItem(0), - m_ccpu(0) + m_ccpu(0), + m_extendedInputCapabilities(0) { m_fepState->SetObjectProvider(this); int defaultFlags = EAknEditorFlagDefault; @@ -464,6 +466,8 @@ QCoeFepInputContext::QCoeFepInputContext(QObject *parent) pasteLabel = qt_TDesC2QString(*pasteBuf); CleanupStack::PopAndDestroy(pasteBuf); } + + m_extendedInputCapabilities = CAknExtendedInputCapabilities::NewL(); ) m_copyAction = new QAction(copyLabel, QApplication::desktop()); @@ -486,6 +490,7 @@ QCoeFepInputContext::~QCoeFepInputContext() delete m_fepState; delete m_ccpu; + delete m_extendedInputCapabilities; } void QCoeFepInputContext::reset() @@ -907,7 +912,22 @@ void QCoeFepInputContext::mouseHandler(int x, QMouseEvent *event) && (x > 0 && x < m_preeditString.length())) { m_pointerHandler->HandlePointerEventInInlineTextL(TPointerEvent::EButton1Up, 0, 0); } else { - commitCurrentString(true); + // Notify FEP about pointer event via CAknExtendedInputCapabilities::ReporEventL(). + // FEP will then commit the string and cancel inline edit state properly. + // FEP does not really use the pointer event parameter, so it is ok to pass NULL. + if (m_extendedInputCapabilities) { + TRAP_IGNORE( + m_extendedInputCapabilities->ReportEventL( + CAknExtendedInputCapabilities::MAknEventObserver::EPointerEventReceived, + NULL)); + } else { + // In practice m_extendedInputCapabilities should always exist. + // If it does not, commit current string directly here. + // This will cancel inline edit in FEP but VKB might still think that + // inline edit is ongoing. + commitCurrentString(true); + } + int pos = focusWidget()->inputMethodQuery(Qt::ImCursorPosition).toInt(); QList<QInputMethodEvent::Attribute> attributes; @@ -924,7 +944,9 @@ TCoeInputCapabilities QCoeFepInputContext::inputCapabilities() return TCoeInputCapabilities(TCoeInputCapabilities::ENone, 0, 0); } - return TCoeInputCapabilities(m_textCapabilities, this, 0); + TCoeInputCapabilities inputCapabilities(m_textCapabilities, this, 0); + inputCapabilities.SetObjectProvider(this); + return inputCapabilities; } void QCoeFepInputContext::resetSplitViewWidget(bool keepInputWidget) @@ -2115,8 +2137,12 @@ void QCoeFepInputContext::paste() QT_TRAP_THROWING(CcpuPasteL()); } -TTypeUid::Ptr QCoeFepInputContext::MopSupplyObject(TTypeUid /*id*/) +TTypeUid::Ptr QCoeFepInputContext::MopSupplyObject(TTypeUid id) { + if (m_extendedInputCapabilities + && id.iUid == CAknExtendedInputCapabilities::ETypeId) + return id.MakePtr(m_extendedInputCapabilities); + return TTypeUid::Null(); } |