diff options
author | Qt Continuous Integration System <qt-info@nokia.com> | 2010-03-26 19:03:12 (GMT) |
---|---|---|
committer | Qt Continuous Integration System <qt-info@nokia.com> | 2010-03-26 19:03:12 (GMT) |
commit | 771f3ddf8c7b4fad2aa45a3d14b895cd9720a474 (patch) | |
tree | a7e3a63e7a9e8ab619bfdd3c381544cc98bc49de | |
parent | e5aae4591bb6a75d3c8cac42a566eff1a97e45b2 (diff) | |
parent | 0d5c68c7e4f31300ac6736203cea4f67e8b825b5 (diff) | |
download | Qt-771f3ddf8c7b4fad2aa45a3d14b895cd9720a474.zip Qt-771f3ddf8c7b4fad2aa45a3d14b895cd9720a474.tar.gz Qt-771f3ddf8c7b4fad2aa45a3d14b895cd9720a474.tar.bz2 |
Merge branch '4.6' of scm.dev.nokia.troll.no:qt/qt-s60-public into 4.6-integration
* '4.6' of scm.dev.nokia.troll.no:qt/qt-s60-public:
QInputContextFactory::languages implementation for Symbian.
-rw-r--r-- | src/gui/inputmethod/inputmethod.pri | 2 | ||||
-rw-r--r-- | src/gui/inputmethod/qinputcontextfactory.cpp | 47 |
2 files changed, 47 insertions, 2 deletions
diff --git a/src/gui/inputmethod/inputmethod.pri b/src/gui/inputmethod/inputmethod.pri index 6d9f748..02e3e57 100644 --- a/src/gui/inputmethod/inputmethod.pri +++ b/src/gui/inputmethod/inputmethod.pri @@ -26,6 +26,6 @@ mac:!embedded { symbian:contains(QT_CONFIG, s60) { HEADERS += inputmethod/qcoefepinputcontext_p.h SOURCES += inputmethod/qcoefepinputcontext_s60.cpp - LIBS += -lfepbase + LIBS += -lfepbase -lakninputlanguage } diff --git a/src/gui/inputmethod/qinputcontextfactory.cpp b/src/gui/inputmethod/qinputcontextfactory.cpp index 501a36e..d47e343 100644 --- a/src/gui/inputmethod/qinputcontextfactory.cpp +++ b/src/gui/inputmethod/qinputcontextfactory.cpp @@ -73,6 +73,7 @@ #endif #ifdef Q_WS_S60 #include "qcoefepinputcontext_p.h" +#include "akninputlanguageinfo.h" #endif #include "private/qfactoryloader_p.h" @@ -198,6 +199,42 @@ QStringList QInputContextFactory::keys() return result; } +#if defined(Q_WS_S60) +/*! + \internal + + This function contains pure Symbian exception handling code for + getting S60 language list. + Returned object ownership is transfered to caller. +*/ +static CAknInputLanguageList* s60LangListL() +{ + CAknInputLanguageInfo *langInfo = AknInputLanguageInfoFactory::CreateInputLanguageInfoL(); + CleanupStack::PushL(langInfo); + // In rare phone there is more than 7 languages installed -> use 7 as an array granularity + CAknInputLanguageList *langList = new (ELeave) CAknInputLanguageList(7); + CleanupStack::PushL(langList); + langInfo->AppendAvailableLanguagesL(langList); + CleanupStack::Pop(langList); + CleanupStack::PopAndDestroy(langInfo); + return langList; +} + +/*! + \internal + + This function utility function return S60 language list. + Returned object ownership is transfered to caller. +*/ +static CAknInputLanguageList* s60LangList() +{ + CAknInputLanguageList *langList = NULL; + TRAP_IGNORE(langList = s60LangListL()); + q_check_ptr(langList); + return langList; +} +#endif + /*! Returns the languages supported by the QInputContext object specified by \a key. @@ -229,7 +266,15 @@ QStringList QInputContextFactory::languages( const QString &key ) #endif #if defined(Q_WS_S60) if (key == QLatin1String("coefep")) - return QStringList(QString()); + { + CAknInputLanguageList *langList = s60LangList(); + int count = langList->Count(); + for (int i = 0; i < count; ++i) + { + result.append(QString(qt_symbianLocaleName(langList->At(i)->LanguageCode()))); + } + delete langList; + } #endif #if defined(QT_NO_LIBRARY) || defined(QT_NO_SETTINGS) Q_UNUSED(key); |