telutils/dialpad/tsrc/dialpadtest/dialpadtestview.cpp
changeset 46 2fa1fa551b0b
parent 42 35488577e233
child 48 78df25012fda
--- a/telutils/dialpad/tsrc/dialpadtest/dialpadtestview.cpp	Mon Aug 23 15:50:31 2010 +0300
+++ b/telutils/dialpad/tsrc/dialpadtest/dialpadtestview.cpp	Fri Sep 03 13:59:20 2010 +0300
@@ -26,13 +26,15 @@
 #include <hblistwidgetitem.h>
 #include <hblineedit.h>
 #include <hbmessagebox.h>
+#include <hbinputsettingproxy.h>
+#include <hbextendedlocale.h>
 
 #include "dialpadtestview.h"
 #include "dialpad.h"
 #include "dialpadkeyhandler.h"
 
 DialpadTestView::DialpadTestView( HbMainWindow& mainWindow ) :
-    mMainWindow(mainWindow), mTapOutsideDismiss(0)
+    mMainWindow(mainWindow), mTapOutsideDismiss(0), mArabicMode(0), mArabicDigit(0)
 {
     setTitle("DialpadTest");
 
@@ -55,6 +57,10 @@
 
     menu()->addAction("Tap outside dismiss",this,SLOT(setTapOutsideDismiss()));
 
+    menu()->addAction("Arabic mode",this,SLOT(setArabicMode()));
+
+    menu()->addAction("Arabic digit",this,SLOT(setArabicDigit()));
+
     // create view widget (recent calls list mockup)
     createListWidget();
 
@@ -70,8 +76,7 @@
     mLongPressTimer->setSingleShot(true);
     connect(mLongPressTimer,SIGNAL(timeout()),this,SLOT(handleLongKeyPress()));
     
-    mKeyhandler = new DialpadKeyHandler(mDialpad, mMainWindow, this);
-    
+    // mKeyhandler = new DialpadKeyHandler(mDialpad, mMainWindow, this);
     mMainWindow.installEventFilter(this);
 }
 
@@ -225,3 +230,28 @@
     mTapOutsideDismiss = !mTapOutsideDismiss;
     mDialpad->setTapOutsideDismiss(mTapOutsideDismiss);
 }
+
+void DialpadTestView::setArabicMode()
+{
+    mArabicMode = !mArabicMode;
+
+    if (mArabicMode) {
+        HbInputLanguage lang(QLocale::Arabic);
+        HbInputSettingProxy::instance()->setGlobalInputLanguage(lang);
+    } else {
+        HbInputLanguage lang(QLocale::English, QLocale::UnitedKingdom);
+        HbInputSettingProxy::instance()->setGlobalInputLanguage(lang);
+    }
+}
+
+void DialpadTestView::setArabicDigit()
+{
+    mArabicDigit = !mArabicDigit;
+
+    if (mArabicDigit) {
+        HbExtendedLocale::system().setZeroDigit(ArabicIndicDigit);
+    } else {
+        HbExtendedLocale::system().setZeroDigit(WesternDigit);
+    }
+}
+