diff options
-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(); } |