summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarko Kenttala <ext-marko.r.kenttala@nokia.com>2012-06-28 10:43:35 +0300
committerKalle Lehtonen <kalle.ju.lehtonen@nokia.com>2012-07-04 09:46:03 +0200
commit905cd09adb98b318e594881b22a6f178842aa74a (patch)
treef43e82872d521fb9e99001261b0dd998f598b520
parentdfd924f9a54c9528727c967429eea062dc51d2c0 (diff)
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> (cherry picked from commit 2da55509d4344ed56ad8243b496398779fc3c98a) Reviewed-by: Roy Mickos <ext-roy.mickos@nokia.com>
-rw-r--r--src/gui/inputmethod/qcoefepinputcontext_p.h3
-rw-r--r--src/gui/inputmethod/qcoefepinputcontext_s60.cpp20
2 files changed, 22 insertions, 1 deletions
diff --git a/src/gui/inputmethod/qcoefepinputcontext_p.h b/src/gui/inputmethod/qcoefepinputcontext_p.h
index f8e6fec0a4..d799378cf2 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 151d3cc79a..b6ca59a53a 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 {