Skip to content

Commit 905cd09

Browse files
Marko KenttalaKalle Lehtonen
Marko Kenttala
authored and
Kalle Lehtonen
committed
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 <[email protected]> Reviewed-by: Jaakko Helanti <[email protected]> Reviewed-by: Kalle Lehtonen <[email protected]> (cherry picked from commit 2da5550) Reviewed-by: Roy Mickos <[email protected]>
1 parent dfd924f commit 905cd09

File tree

2 files changed

+22
-1
lines changed

2 files changed

+22
-1
lines changed

src/gui/inputmethod/qcoefepinputcontext_p.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -225,6 +225,9 @@ private slots:
225225

226226
CAknExtendedInputCapabilities *m_extendedInputCapabilities;
227227

228+
QScopedPointer<CAknEdwinFormAccessor> m_formAccessor;
229+
QScopedPointer<CEikEdwin> m_dummyEditor;
230+
228231
friend class tst_QInputContext;
229232
};
230233

src/gui/inputmethod/qcoefepinputcontext_s60.cpp

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -434,7 +434,9 @@ QCoeFepInputContext::QCoeFepInputContext(QObject *parent)
434434
m_splitViewPreviousWindowStates(Qt::WindowNoState),
435435
m_splitViewPreviousFocusItem(0),
436436
m_ccpu(0),
437-
m_extendedInputCapabilities(0)
437+
m_extendedInputCapabilities(0),
438+
m_formAccessor(0),
439+
m_dummyEditor(0)
438440
{
439441
m_fepState->SetObjectProvider(this);
440442
int defaultFlags = EAknEditorFlagDefault;
@@ -476,6 +478,14 @@ QCoeFepInputContext::QCoeFepInputContext(QObject *parent)
476478
m_pasteAction->setSoftKeyRole(QAction::NegativeSoftKey);
477479
connect(m_copyAction, SIGNAL(triggered()), this, SLOT(copy()));
478480
connect(m_pasteAction, SIGNAL(triggered()), this, SLOT(paste()));
481+
482+
// Use dummy editor to enable smiley support by default
483+
m_dummyEditor.reset(new CEikEdwin());
484+
TRAPD(err, m_dummyEditor->ConstructL(CEikEdwin::EAvkonEnableSmileySupport));
485+
if (!err) {
486+
m_formAccessor.reset(new CAknEdwinFormAccessor(m_dummyEditor.data()));
487+
m_fepState->SetFormAccessor(m_formAccessor.data());
488+
}
479489
}
480490

481491
QCoeFepInputContext::~QCoeFepInputContext()
@@ -1328,17 +1338,25 @@ void QCoeFepInputContext::applyHints(Qt::InputMethodHints hints)
13281338
}
13291339
m_fepState->SetNumericKeymap(static_cast<TAknEditorNumericKeymap>(flags));
13301340

1341+
bool enableSmileys = false;
1342+
13311343
if (hints & ImhUrlCharactersOnly) {
13321344
// URL characters is everything except space, so a superset of the other restrictions
13331345
m_fepState->SetSpecialCharacterTableResourceId(R_AVKON_URL_SPECIAL_CHARACTER_TABLE_DIALOG);
13341346
} else if (hints & ImhEmailCharactersOnly) {
13351347
m_fepState->SetSpecialCharacterTableResourceId(R_AVKON_EMAIL_ADDR_SPECIAL_CHARACTER_TABLE_DIALOG);
13361348
} else if (needsCharMap) {
13371349
m_fepState->SetSpecialCharacterTableResourceId(R_AVKON_SPECIAL_CHARACTER_TABLE_DIALOG);
1350+
enableSmileys = !(hints & ImhHiddenText);
13381351
} else {
13391352
m_fepState->SetSpecialCharacterTableResourceId(0);
13401353
}
13411354

1355+
if (enableSmileys)
1356+
m_dummyEditor->AddFlagToUserFlags(CEikEdwin::EAvkonEnableSmileySupport);
1357+
else
1358+
m_dummyEditor->RemoveFlagFromUserFlags(CEikEdwin::EAvkonEnableSmileySupport);
1359+
13421360
if (hints & ImhHiddenText) {
13431361
m_textCapabilities = TCoeInputCapabilities::EAllText | TCoeInputCapabilities::ESecretText;
13441362
} else {

0 commit comments

Comments
 (0)