diff options
author | Marko Kenttala <ext-marko.r.kenttala@nokia.com> | 2012-06-28 07:43:35 (GMT) |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-07-02 23:10:12 (GMT) |
commit | 2da55509d4344ed56ad8243b496398779fc3c98a (patch) | |
tree | 09f321ded25ac8f200cbf02b6fa8b614dc2b959f | |
parent | ddb84a72901c180f709fae1782051a8e8a8d46d4 (diff) | |
download | Qt-2da55509d4344ed56ad8243b496398779fc3c98a.zip Qt-2da55509d4344ed56ad8243b496398779fc3c98a.tar.gz Qt-2da55509d4344ed56ad8243b496398779fc3c98a.tar.bz2 |
Enable smiley support for Symbian editors
Added enabling of CEikEdwin::EAvkonEnableSmileySupport flag for normal
Symbian editors so that smiley/emoticon button or menu is enabled.
Change-Id: I0b9f6205ca1521fc54d3b688ccd1225823263aac
Reviewed-by: Juha Kukkonen <ext-juha.kukkonen@nokia.com>
Reviewed-by: Jaakko Helanti <ext-jaakko.helanti@nokia.com>
Reviewed-by: Kalle Lehtonen <kalle.ju.lehtonen@nokia.com>
-rw-r--r-- | src/gui/inputmethod/qcoefepinputcontext_p.h | 3 | ||||
-rw-r--r-- | src/gui/inputmethod/qcoefepinputcontext_s60.cpp | 20 |
2 files changed, 22 insertions, 1 deletions
diff --git a/src/gui/inputmethod/qcoefepinputcontext_p.h b/src/gui/inputmethod/qcoefepinputcontext_p.h index f8e6fec..d799378 100644 --- a/src/gui/inputmethod/qcoefepinputcontext_p.h +++ b/src/gui/inputmethod/qcoefepinputcontext_p.h @@ -225,6 +225,9 @@ private: CAknExtendedInputCapabilities *m_extendedInputCapabilities; + QScopedPointer<CAknEdwinFormAccessor> m_formAccessor; + QScopedPointer<CEikEdwin> m_dummyEditor; + friend class tst_QInputContext; }; diff --git a/src/gui/inputmethod/qcoefepinputcontext_s60.cpp b/src/gui/inputmethod/qcoefepinputcontext_s60.cpp index 151d3cc..b6ca59a 100644 --- a/src/gui/inputmethod/qcoefepinputcontext_s60.cpp +++ b/src/gui/inputmethod/qcoefepinputcontext_s60.cpp @@ -434,7 +434,9 @@ QCoeFepInputContext::QCoeFepInputContext(QObject *parent) m_splitViewPreviousWindowStates(Qt::WindowNoState), m_splitViewPreviousFocusItem(0), m_ccpu(0), - m_extendedInputCapabilities(0) + m_extendedInputCapabilities(0), + m_formAccessor(0), + m_dummyEditor(0) { m_fepState->SetObjectProvider(this); int defaultFlags = EAknEditorFlagDefault; @@ -476,6 +478,14 @@ QCoeFepInputContext::QCoeFepInputContext(QObject *parent) m_pasteAction->setSoftKeyRole(QAction::NegativeSoftKey); connect(m_copyAction, SIGNAL(triggered()), this, SLOT(copy())); connect(m_pasteAction, SIGNAL(triggered()), this, SLOT(paste())); + + // Use dummy editor to enable smiley support by default + m_dummyEditor.reset(new CEikEdwin()); + TRAPD(err, m_dummyEditor->ConstructL(CEikEdwin::EAvkonEnableSmileySupport)); + if (!err) { + m_formAccessor.reset(new CAknEdwinFormAccessor(m_dummyEditor.data())); + m_fepState->SetFormAccessor(m_formAccessor.data()); + } } QCoeFepInputContext::~QCoeFepInputContext() @@ -1328,6 +1338,8 @@ void QCoeFepInputContext::applyHints(Qt::InputMethodHints hints) } m_fepState->SetNumericKeymap(static_cast<TAknEditorNumericKeymap>(flags)); + bool enableSmileys = false; + if (hints & ImhUrlCharactersOnly) { // URL characters is everything except space, so a superset of the other restrictions m_fepState->SetSpecialCharacterTableResourceId(R_AVKON_URL_SPECIAL_CHARACTER_TABLE_DIALOG); @@ -1335,10 +1347,16 @@ void QCoeFepInputContext::applyHints(Qt::InputMethodHints hints) m_fepState->SetSpecialCharacterTableResourceId(R_AVKON_EMAIL_ADDR_SPECIAL_CHARACTER_TABLE_DIALOG); } else if (needsCharMap) { m_fepState->SetSpecialCharacterTableResourceId(R_AVKON_SPECIAL_CHARACTER_TABLE_DIALOG); + enableSmileys = !(hints & ImhHiddenText); } else { m_fepState->SetSpecialCharacterTableResourceId(0); } + if (enableSmileys) + m_dummyEditor->AddFlagToUserFlags(CEikEdwin::EAvkonEnableSmileySupport); + else + m_dummyEditor->RemoveFlagFromUserFlags(CEikEdwin::EAvkonEnableSmileySupport); + if (hints & ImhHiddenText) { m_textCapabilities = TCoeInputCapabilities::EAllText | TCoeInputCapabilities::ESecretText; } else { |