summaryrefslogtreecommitdiffstats
path: root/src/gui/kernel
diff options
context:
space:
mode:
authoraxis <qt-info@nokia.com>2011-01-03 10:54:35 (GMT)
committeraxis <qt-info@nokia.com>2011-01-14 10:47:03 (GMT)
commit32f3fcd9ab19f66cb435e6a8830ce54ccf13885a (patch)
tree85a02791aa8bdd2c5490c96fdd9fa4e31f720904 /src/gui/kernel
parent003995384b06d3663c3a9c42a97c32f960a8e92f (diff)
downloadQt-32f3fcd9ab19f66cb435e6a8830ce54ccf13885a.zip
Qt-32f3fcd9ab19f66cb435e6a8830ce54ccf13885a.tar.gz
Qt-32f3fcd9ab19f66cb435e6a8830ce54ccf13885a.tar.bz2
Added Symbian implementation of keyboard language functions.
More specifically, QApplication::keyboardInputLocale() and QApplication::keyboardInputDirection(). Task: QTBUG-15600 RevBy: Sami Merila
Diffstat (limited to 'src/gui/kernel')
-rw-r--r--src/gui/kernel/qapplication_s60.cpp9
-rw-r--r--src/gui/kernel/qkeymapper_p.h1
-rw-r--r--src/gui/kernel/qkeymapper_s60.cpp32
3 files changed, 42 insertions, 0 deletions
diff --git a/src/gui/kernel/qapplication_s60.cpp b/src/gui/kernel/qapplication_s60.cpp
index 7f157a1..3df40d7 100644
--- a/src/gui/kernel/qapplication_s60.cpp
+++ b/src/gui/kernel/qapplication_s60.cpp
@@ -1546,6 +1546,8 @@ void qt_init(QApplicationPrivate * /* priv */, int)
repository = 0;
#endif
+ qt_keymapper_private()->updateInputLanguage();
+
#ifdef QT_KEYPAD_NAVIGATION
if (touch) {
QApplicationPrivate::navigationMode = Qt::NavigationModeNone;
@@ -2086,6 +2088,13 @@ int QApplicationPrivate::symbianProcessWsEvent(const QSymbianEvent *symbianEvent
}
break;
#endif
+
+#ifdef Q_WS_S60
+ case KEikInputLanguageChange:
+ qt_keymapper_private()->updateInputLanguage();
+ break;
+#endif
+
default:
break;
}
diff --git a/src/gui/kernel/qkeymapper_p.h b/src/gui/kernel/qkeymapper_p.h
index 38f141e..98d8eec 100644
--- a/src/gui/kernel/qkeymapper_p.h
+++ b/src/gui/kernel/qkeymapper_p.h
@@ -213,6 +213,7 @@ public:
int mapS60ScanCodesToQt(TUint s60key);
int mapQtToS60Key(int qtKey);
int mapQtToS60ScanCodes(int qtKey);
+ void updateInputLanguage();
#endif
};
diff --git a/src/gui/kernel/qkeymapper_s60.cpp b/src/gui/kernel/qkeymapper_s60.cpp
index d019c0f..c3a2c51 100644
--- a/src/gui/kernel/qkeymapper_s60.cpp
+++ b/src/gui/kernel/qkeymapper_s60.cpp
@@ -40,7 +40,11 @@
****************************************************************************/
#include "private/qkeymapper_p.h"
+#include <private/qcore_symbian_p.h>
#include <e32keys.h>
+#include <e32cmn.h>
+#include <centralrepository.h>
+#include <biditext.h>
QT_BEGIN_NAMESPACE
@@ -214,4 +218,32 @@ int QKeyMapperPrivate::mapQtToS60ScanCodes(int qtKey)
}
return res;
}
+
+void QKeyMapperPrivate::updateInputLanguage()
+{
+#ifdef Q_WS_S60
+ TInt err;
+ CRepository *repo;
+ const TUid KCRUidAknFep = TUid::Uid(0x101F876D);
+ const TUint32 KAknFepInputTxtLang = 0x00000005;
+ TRAP(err, repo = CRepository::NewL(KCRUidAknFep));
+ if (err != KErrNone)
+ return;
+
+ TInt symbianLang;
+ err = repo->Get(KAknFepInputTxtLang, symbianLang);
+ delete repo;
+ if (err != KErrNone)
+ return;
+
+ QString qtLang = QString::fromAscii(qt_symbianLocaleName(symbianLang));
+ keyboardInputLocale = QLocale(qtLang);
+ keyboardInputDirection = (TBidiText::ScriptDirectionality(TLanguage(symbianLang)) == TBidiText::ERightToLeft)
+ ? Qt::RightToLeft : Qt::LeftToRight;
+#else
+ keyboardInputLocale = QLocale();
+ keyboardInputDirection = Qt::LeftToRight;
+#endif
+}
+
QT_END_NAMESPACE