summaryrefslogtreecommitdiffstats
path: root/src/gui/kernel/qkeymapper_s60.cpp
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/qkeymapper_s60.cpp
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/qkeymapper_s60.cpp')
-rw-r--r--src/gui/kernel/qkeymapper_s60.cpp32
1 files changed, 32 insertions, 0 deletions
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