src/hbcore/inputfw/hbinputsettingproxy.cpp
changeset 21 4633027730f5
parent 6 c3690ec91ef8
child 23 e6ad4ef83b23
equal deleted inserted replaced
7:923ff622b8b9 21:4633027730f5
    33 #include <QSharedMemory>
    33 #include <QSharedMemory>
    34 #include <QVector>
    34 #include <QVector>
    35 #include <QDir>
    35 #include <QDir>
    36 
    36 
    37 #include "hbinputmodecache_p.h"
    37 #include "hbinputmodecache_p.h"
       
    38 #include "hbinputmethod.h"
    38 #include "hbinputfilter.h"
    39 #include "hbinputfilter.h"
    39 
    40 
    40 #ifdef Q_OS_SYMBIAN
    41 #ifdef Q_OS_SYMBIAN
    41 
    42 
    42 #define HBI_BASE_PATH QString("\\resource\\plugins")
    43 #define HBI_BASE_PATH QString("\\resource\\plugins")
   224     bool wasLoaded = load();
   225     bool wasLoaded = load();
   225 
   226 
   226     HbSettingProxyInternalData *prData = proxyData();
   227     HbSettingProxyInternalData *prData = proxyData();
   227     if (prData) {
   228     if (prData) {
   228         prData->iReferences = 0;
   229         prData->iReferences = 0;
   229         prData->iOrientationChangeCompleted = true;
       
   230         // Default values, real ones should be set by calling initializeOrientation()
       
   231         prData->iScreenOrientation = Qt::Vertical;
       
   232 
   230 
   233         if (!wasLoaded) {
   231         if (!wasLoaded) {
   234             // There was no permanent storage version, so initialize to defaults.
   232             // There was no permanent storage version, so initialize to defaults.
   235             prData->iVersion = HbProxyDataRequiredVersion;
   233             prData->iVersion = HbProxyDataRequiredVersion;
   236             prData->iGlobalPrimaryInputLanguage = HbInputLanguage(QLocale::English, QLocale::UnitedKingdom);
   234             prData->iGlobalPrimaryInputLanguage = HbInputLanguage(QLocale::English, QLocale::UnitedKingdom);
   237             prData->iGlobalSecondaryInputLanguage = QLocale::Language(0);
   235             prData->iGlobalSecondaryInputLanguage = QLocale::Language(0);                  
   238             prData->iActiveKeyboard = HbKeyboardVirtual12Key;
       
   239             prData->iTouchKeyboard = HbKeyboardVirtual12Key;
       
   240             prData->iHwKeyboard = HbKeyboardQwerty;
       
   241             prData->iPredictiveInputState = (HbKeyboardSettingFlags)HbKeyboardSetting12key | HbKeyboardSettingQwerty;
   236             prData->iPredictiveInputState = (HbKeyboardSettingFlags)HbKeyboardSetting12key | HbKeyboardSettingQwerty;
   242             prData->iDigitType = HbDigitTypeLatin;
   237             prData->iDigitType = HbDigitTypeLatin;
   243             prData->iQwertyTextCasing = true;
   238             prData->iQwertyTextCasing = true;
   244             prData->iQwertyCharacterPreview = true;
   239             prData->iQwertyCharacterPreview = true;
   245             prData->iRegionalCorrectionStatus = true;
   240             prData->iRegionalCorrectionStatus = true;
       
   241             prData->iFlipStatus = false;
   246             prData->iKeypressTimeout = 1000;
   242             prData->iKeypressTimeout = 1000;
   247             prData->iAutocompletion = (HbKeyboardSettingFlags)(HbKeyboardSetting12key | HbKeyboardSettingQwerty);
   243             prData->iAutocompletion = (HbKeyboardSettingFlags)(HbKeyboardSetting12key | HbKeyboardSettingQwerty);
   248             prData->iTypingCorrectionLevel = HbTypingCorrectionLevelHigh;
   244             prData->iTypingCorrectionLevel = HbTypingCorrectionLevelHigh;
   249             prData->iPrimaryCandidateMode = HbPrimaryCandidateModeBestPrediction;
   245             prData->iPrimaryCandidateMode = HbPrimaryCandidateModeBestPrediction;
   250             prData->iPreferredMethodHorizontal = HbInputMethodDescriptor();
   246             prData->iPreferredMethodHorizontal = HbInputMethodDescriptor();
   251             prData->iPreferredMethodHorizontal.setData(QByteArray());
   247             prData->iPreferredMethodHorizontal.setData(QByteArray());
   252             prData->iPreferredMethodVertical = HbInputMethodDescriptor();
   248             prData->iPreferredMethodVertical = HbInputMethodDescriptor();
   253             prData->iPreferredMethodVertical.setData(QByteArray());
   249             prData->iPreferredMethodVertical.setData(QByteArray());
       
   250             prData->iHwrSpeed = HbHwrSpeedNormal;
       
   251             prData->iCangjieMode = HbCangjieNormal;
   254         }
   252         }
   255     }
   253     }
   256     unlock();
   254     unlock();
   257 }
   255 }
   258 
   256 
   269         if (ldData) {
   267         if (ldData) {
   270             if (ldData->iVersion == HbProxyDataRequiredVersion) {
   268             if (ldData->iVersion == HbProxyDataRequiredVersion) {
   271 
   269 
   272                 HbSettingProxyInternalData *prData = proxyData();
   270                 HbSettingProxyInternalData *prData = proxyData();
   273                 memcpy((void *)prData, (void *)ldData, sizeof(HbSettingProxyInternalData));
   271                 memcpy((void *)prData, (void *)ldData, sizeof(HbSettingProxyInternalData));
   274                 prData->iActiveKeyboard = ldData->iActiveKeyboard;
       
   275 
   272 
   276                 // Temporarily like this, will be moved as part of shared data later...
   273                 // Temporarily like this, will be moved as part of shared data later...
   277                 int numItems = 0;
   274                 int numItems = 0;
   278                 file.read((char *)&numItems, sizeof(int));
   275                 file.read((char *)&numItems, sizeof(int));
   279                 iTopScs.clear();
   276                 iTopScs.clear();
   338 HbSettingProxyInternalData *HbInputSettingProxyPrivate::proxyData() const
   335 HbSettingProxyInternalData *HbInputSettingProxyPrivate::proxyData() const
   339 {
   336 {
   340     return static_cast<HbSettingProxyInternalData *>(iSharedMemory->data());
   337     return static_cast<HbSettingProxyInternalData *>(iSharedMemory->data());
   341 }
   338 }
   342 
   339 
   343 void HbInputSettingProxyPrivate::flipToggle()
   340 Qt::Orientation HbInputSettingProxyPrivate::inputFrameworkScreenOrientation() const
   344 {
   341 {
   345     setFlipStatus(!flipStatus());
   342     HbInputMethod *activeInputMethod = HbInputMethod::activeInputMethod();
   346 }
   343     if (activeInputMethod && activeInputMethod->focusObject()) {
   347 
   344         return activeInputMethod->focusObject()->orientation();
   348 bool HbInputSettingProxyPrivate::flipStatus()
   345     }
   349 {
   346 
   350     HbSettingProxyInternalData *prData = proxyData();
   347     return Qt::Horizontal;
   351     return prData->iFlipStatus;
       
   352 }
       
   353 
       
   354 void HbInputSettingProxyPrivate::setFlipStatus(bool flipStatus)
       
   355 {
       
   356     HbSettingProxyInternalData *prData = proxyData();
       
   357     prData->iFlipStatus = flipStatus;
       
   358 
       
   359     handleDeviceSpecificOriantationAndFlipChange();
       
   360 }
       
   361 
       
   362 void HbInputSettingProxyPrivate::handleDeviceSpecificOriantationAndFlipChange()
       
   363 {
       
   364     HbKeyboardType  keyboard = HbKeyboardNone;
       
   365 
       
   366     if (HbInputSettingProxy::instance()->screenOrientation() == Qt::Vertical) {
       
   367         keyboard = HbKeyboardVirtual12Key;
       
   368     } else {
       
   369         if (flipStatus()) {
       
   370             keyboard = HbKeyboardQwerty;
       
   371         } else {
       
   372             keyboard = HbKeyboardVirtualQwerty;
       
   373         }
       
   374     }
       
   375 
       
   376     HbInputSettingProxy::instance()->setActiveKeyboard(keyboard);
       
   377 }
   348 }
   378 
   349 
   379 /// @endcond
   350 /// @endcond
   380 
   351 
   381 /*!
   352 /*!
   420 /*!
   391 /*!
   421 Toggles prediction mode
   392 Toggles prediction mode
   422 */
   393 */
   423 void HbInputSettingProxy::togglePrediction()
   394 void HbInputSettingProxy::togglePrediction()
   424 {
   395 {
   425     if (activeKeyboard() & HbQwertyKeyboardMask) {
   396     HbInputMethod *im = HbInputMethod::activeInputMethod();
   426         setPredictiveInputStatus(HbKeyboardSettingQwerty, !predictiveInputStatus(HbKeyboardSettingQwerty));
   397     if (im) {
   427     } else {
   398         HbInputState state = im->inputState();
   428         setPredictiveInputStatus(HbKeyboardSetting12key, !predictiveInputStatus(HbKeyboardSetting12key));
   399         if (state.keyboard() & HbQwertyKeyboardMask) {
       
   400             setPredictiveInputStatus(HbKeyboardSettingQwerty, !predictiveInputStatus(HbKeyboardSettingQwerty));
       
   401         } else {
       
   402             setPredictiveInputStatus(HbKeyboardSetting12key, !predictiveInputStatus(HbKeyboardSetting12key));
       
   403         }
   429     }
   404     }
   430 }
   405 }
   431 
   406 
   432 /*!
   407 /*!
   433 Setting proxy emits a signal when any of the monitored settings changes. This
   408 Setting proxy emits a signal when any of the monitored settings changes. This
   448 {
   423 {
   449     if (aObserver) {
   424     if (aObserver) {
   450         connect(this, SIGNAL(globalInputLanguageChanged(const HbInputLanguage &)), aObserver, SLOT(globalInputLanguageChanged(const HbInputLanguage &)));
   425         connect(this, SIGNAL(globalInputLanguageChanged(const HbInputLanguage &)), aObserver, SLOT(globalInputLanguageChanged(const HbInputLanguage &)));
   451         connect(this, SIGNAL(globalSecondaryInputLanguageChanged(const HbInputLanguage &)), aObserver, SLOT(globalSecondaryInputLanguageChanged(const HbInputLanguage &)));
   426         connect(this, SIGNAL(globalSecondaryInputLanguageChanged(const HbInputLanguage &)), aObserver, SLOT(globalSecondaryInputLanguageChanged(const HbInputLanguage &)));
   452         connect(this, SIGNAL(activeKeyboardChanged(HbKeyboardType)), aObserver, SLOT(activeKeyboardChanged(HbKeyboardType)));
   427         connect(this, SIGNAL(activeKeyboardChanged(HbKeyboardType)), aObserver, SLOT(activeKeyboardChanged(HbKeyboardType)));
   453         connect(this, SIGNAL(orientationAboutToChange()), aObserver, SLOT(orientationAboutToChange()));
       
   454         connect(this, SIGNAL(orientationChanged(Qt::Orientation)), aObserver, SLOT(orientationChanged(Qt::Orientation)));
       
   455     }
   428     }
   456 }
   429 }
   457 
   430 
   458 /*!
   431 /*!
   459 Disconnects given object from the setting proxy.
   432 Disconnects given object from the setting proxy.
   464 {
   437 {
   465     if (aObserver) {
   438     if (aObserver) {
   466         disconnect(this, SIGNAL(globalInputLanguageChanged(const HbInputLanguage &)), aObserver, SLOT(globalInputLanguageChanged(const HbInputLanguage &)));
   439         disconnect(this, SIGNAL(globalInputLanguageChanged(const HbInputLanguage &)), aObserver, SLOT(globalInputLanguageChanged(const HbInputLanguage &)));
   467         disconnect(this, SIGNAL(globalSecondaryInputLanguageChanged(const HbInputLanguage &)), aObserver, SLOT(globalSecondaryInputLanguageChanged(const HbInputLanguage &)));
   440         disconnect(this, SIGNAL(globalSecondaryInputLanguageChanged(const HbInputLanguage &)), aObserver, SLOT(globalSecondaryInputLanguageChanged(const HbInputLanguage &)));
   468         disconnect(this, SIGNAL(activeKeyboardChanged(HbKeyboardType)), aObserver, SLOT(activeKeyboardChanged(HbKeyboardType)));
   441         disconnect(this, SIGNAL(activeKeyboardChanged(HbKeyboardType)), aObserver, SLOT(activeKeyboardChanged(HbKeyboardType)));
   469         disconnect(this, SIGNAL(orientationAboutToChange()), aObserver, SLOT(orientationAboutToChange()));
       
   470         disconnect(this, SIGNAL(orientationChanged(Qt::Orientation)), aObserver, SLOT(orientationChanged(Qt::Orientation)));
       
   471     }
   442     }
   472 }
   443 }
   473 
   444 
   474 /*!
   445 /*!
   475 Returns active input language. This is system wide value, an editor and input state machine may override this by defining
   446 Returns active input language. This is system wide value, an editor and input state machine may override this by defining
   522     aListOfAvailableKeyboards.append(HbKeyboard12Key);
   493     aListOfAvailableKeyboards.append(HbKeyboard12Key);
   523     aListOfAvailableKeyboards.append(HbKeyboardQwerty);
   494     aListOfAvailableKeyboards.append(HbKeyboardQwerty);
   524 }
   495 }
   525 
   496 
   526 /*!
   497 /*!
       
   498 \deprecated HbInputSettingProxy::activeHwKeyboard() const
       
   499     is deprecated. Use HbInputSettingProxy::activeKeyboard(Qt::Orientation) instead.
   527 Returns active hardware keyboard type.
   500 Returns active hardware keyboard type.
   528 
       
   529 \sa setActiveHwKeyboard
       
   530 \sa activeTouchKeyboard
       
   531 */
   501 */
   532 HbKeyboardType HbInputSettingProxy::activeHwKeyboard() const
   502 HbKeyboardType HbInputSettingProxy::activeHwKeyboard() const
   533 {
   503 {
   534     Q_D(const HbInputSettingProxy);
   504     return HbKeyboardNone;
   535     HbKeyboardType res = HbKeyboardNone;
   505 }
   536 
   506 
   537     HbSettingProxyInternalData *prData = d->proxyData();
   507 /*!
   538     if (prData) {
   508 \deprecated HbInputSettingProxy::activeTouchKeyboard() const
   539         res = prData->iHwKeyboard;
   509     is deprecated. Use HbInputSettingProxy::activeKeyboard(Qt::Orientation) instead.
       
   510 Returns active touch keyboard type.
       
   511 */
       
   512 HbKeyboardType HbInputSettingProxy::activeTouchKeyboard() const
       
   513 {
       
   514     return HbKeyboardNone;
       
   515 }
       
   516 
       
   517 void HbInputSettingProxy::setHwrWritingSpeed(HbHwrWritingSpeed speed)
       
   518 {
       
   519     Q_D(HbInputSettingProxy);
       
   520     HbSettingProxyInternalData *prData = d->proxyData();
       
   521     if (prData) {
       
   522         bool notify = false;
       
   523         d->lock();
       
   524         if (prData->iHwrSpeed != speed) {
       
   525             prData->iHwrSpeed = speed;
       
   526             notify = true;
       
   527         }
       
   528         d->unlock();
       
   529         if (notify) {
       
   530             emit hwrWritingSpeedChanged(speed);
       
   531         }
       
   532     }
       
   533 }
       
   534 
       
   535 HbHwrWritingSpeed HbInputSettingProxy::hwrWritingSpeed() const
       
   536 {
       
   537     Q_D(const HbInputSettingProxy);
       
   538     HbHwrWritingSpeed res = HbHwrSpeedNormal;
       
   539 
       
   540     HbSettingProxyInternalData *prData = d->proxyData();
       
   541     if (prData) {
       
   542         res = prData->iHwrSpeed;
   540     }
   543     }
   541 
   544 
   542     return res;
   545     return res;
   543 }
   546 }
   544 
   547 
   545 /*!
   548 void HbInputSettingProxy::setDetailedCangjieMode(HbCangjieDetailMode cangjieDetail)
   546 Returns active touch keyboard type.
   549 {
   547 
   550     Q_D(HbInputSettingProxy);
   548 \sa setActiveTouchKeyboard
   551     HbSettingProxyInternalData *prData = d->proxyData();
   549 \sa activeHwKeyboard
   552     if (prData) {
   550 */
   553         bool notify = false;
   551 HbKeyboardType HbInputSettingProxy::activeTouchKeyboard() const
   554         d->lock();
   552 {
   555         if (prData->iCangjieMode != cangjieDetail) {
   553     Q_D(const HbInputSettingProxy);
   556             prData->iCangjieMode = cangjieDetail;
   554     HbKeyboardType res = HbKeyboardNone;
   557             notify = true;
   555 
   558         }
   556     HbSettingProxyInternalData *prData = d->proxyData();
   559         d->unlock();
   557     if (prData) {
   560         if (notify) {
   558         res = prData->iTouchKeyboard;
   561             emit detailedCangjieModeChanged(cangjieDetail);
       
   562         }
       
   563     }
       
   564 }
       
   565 
       
   566 HbCangjieDetailMode HbInputSettingProxy::detailedCangjieMode() const
       
   567 {
       
   568     Q_D(const HbInputSettingProxy);
       
   569     HbCangjieDetailMode res = HbCangjieNormal;
       
   570 
       
   571     HbSettingProxyInternalData *prData = d->proxyData();
       
   572     if (prData) {
       
   573         res = prData->iCangjieMode;
   559     }
   574     }
   560 
   575 
   561     return res;
   576     return res;
   562 }
   577 }
   563 
   578 
   564 /*!
   579 /*!
   565 Returns active keyboard type.
   580 \deprecated HbInputSettingProxy::activeKeyboard() const
   566 
   581     is deprecated. Use HbInputSettingProxy::activeKeyboard(Qt::Orientation) instead.
   567 \sa setActiveKeyboard
       
   568 */
   582 */
   569 HbKeyboardType HbInputSettingProxy::activeKeyboard() const
   583 HbKeyboardType HbInputSettingProxy::activeKeyboard() const
   570 {
   584 {
   571     Q_D(const HbInputSettingProxy);
   585     Q_D(const HbInputSettingProxy);
   572     HbKeyboardType res = HbKeyboardNone;
   586     return activeKeyboard(d->inputFrameworkScreenOrientation());
   573 
   587 }
   574     HbSettingProxyInternalData *prData = d->proxyData();
   588 
   575     if (prData) {
   589 /*!
   576         res = prData->iActiveKeyboard;
   590 Returns active keyboard for given screen oriention.
   577     }
   591 */
   578 
   592 HbKeyboardType HbInputSettingProxy::activeKeyboard(Qt::Orientation orientation) const
   579     return res;
   593 {
       
   594     Q_D(const HbInputSettingProxy);
       
   595 
       
   596     if (orientation == Qt::Horizontal) {
       
   597         HbSettingProxyInternalData *prData = d->proxyData();
       
   598         if (prData) {
       
   599             d->lock();
       
   600             if (prData->iFlipStatus == true) {
       
   601                 return HbKeyboardHardwareLandcape;
       
   602             }
       
   603             d->unlock();
       
   604         }
       
   605         return HbKeyboardTouchLandscape;
       
   606     } else {
       
   607         return HbKeyboardTouchPortrait;
       
   608     }
   580 }
   609 }
   581 
   610 
   582 /*!
   611 /*!
   583 Returns the preferred input method for given screen orientation. Initially this value is empty
   612 Returns the preferred input method for given screen orientation. Initially this value is empty
   584 and the framework will resolve the default handler.
   613 and the framework will resolve the default handler.
   604 
   633 
   605     return result;
   634     return result;
   606 }
   635 }
   607 
   636 
   608 /*!
   637 /*!
   609 Returns the preferred input method for current screen orientation. Initially this value is empty
   638 \deprecated HbInputSettingProxy::preferredInputMethod() const
   610 and the framework will resolve the default handler.
   639     is deprecated. Use HbInputSettingProxy::preferredInputMethod(Qt::Orientation) const instead.
   611 
       
   612 \sa setPreferredInputMethod
       
   613 */
   640 */
   614 HbInputMethodDescriptor HbInputSettingProxy::preferredInputMethod() const
   641 HbInputMethodDescriptor HbInputSettingProxy::preferredInputMethod() const
   615 {
   642 {
   616     Q_D(const HbInputSettingProxy);
   643     Q_D(const HbInputSettingProxy);
   617 
   644 
   618     HbInputMethodDescriptor result;
   645     HbInputMethodDescriptor result;
   619 
   646 
   620     HbSettingProxyInternalData *prData = d->proxyData();
   647     HbSettingProxyInternalData *prData = d->proxyData();
   621     if (prData) {
   648     if (prData) {
   622         d->lock();
   649         d->lock();
   623         if (prData->iScreenOrientation == Qt::Horizontal) {
   650         if (d->inputFrameworkScreenOrientation() == Qt::Horizontal) {
   624             result = prData->iPreferredMethodHorizontal.descriptor();
   651             result = prData->iPreferredMethodHorizontal.descriptor();
   625         } else {
   652         } else {
   626             result = prData->iPreferredMethodVertical.descriptor();
   653             result = prData->iPreferredMethodVertical.descriptor();
   627         }
   654         }
   628         d->unlock();
   655         d->unlock();
   727         }
   754         }
   728     }
   755     }
   729 }
   756 }
   730 
   757 
   731 /*!
   758 /*!
   732 Sets active hardware keyboard type. Will emit signal activeHwKeyboardChanged if keyboard is changed.
   759 \deprecated HbInputSettingProxy::setActiveHwKeyboard(HbKeyboardType)
   733 
   760     is deprecated.
   734 \sa activeHwKeyboard
       
   735 \sa activeTouchKeyboard
       
   736 \sa setActiveTouchKeyboard
       
   737 \sa setActiveHwKeyboard
       
   738 */
   761 */
   739 void HbInputSettingProxy::setActiveHwKeyboard(HbKeyboardType keyboard)
   762 void HbInputSettingProxy::setActiveHwKeyboard(HbKeyboardType keyboard)
   740 {
   763 {
   741     Q_D(HbInputSettingProxy);
   764     Q_UNUSED(keyboard);
   742     HbSettingProxyInternalData *prData = d->proxyData();
   765 }
   743     if (prData) {
   766 
   744         bool notify = false;
   767 /*!
   745         d->lock();
   768 \deprecated HbInputSettingProxy::setActiveTouchKeyboard(HbKeyboardType)
   746         if (prData->iHwKeyboard != keyboard) {
   769     is deprecated.
   747             prData->iHwKeyboard = keyboard;
       
   748             notify = true;
       
   749         }
       
   750         d->unlock();
       
   751         if (notify) {
       
   752             emit activeHwKeyboardChanged(keyboard);
       
   753         }
       
   754     }
       
   755 }
       
   756 
       
   757 /*!
       
   758 Sets active touch keyboard type. Will emit signal activeTouchKeyboardChanged keyboard is changed.
       
   759 
       
   760 \sa activeTouchKeyboard
       
   761 \sa activeHwKeyboard
       
   762 \sa setActiveTouchKeyboard
       
   763 \sa setActiveHwKeyboard
       
   764 */
   770 */
   765 void HbInputSettingProxy::setActiveTouchKeyboard(HbKeyboardType keyboard)
   771 void HbInputSettingProxy::setActiveTouchKeyboard(HbKeyboardType keyboard)
   766 {
   772 {
   767     Q_D(HbInputSettingProxy);
   773     Q_UNUSED(keyboard);
   768     HbSettingProxyInternalData *prData = d->proxyData();
   774 }
   769     if (prData) {
   775 
   770         bool notify = false;
   776 /*!
   771         d->lock();
   777 \deprecated HbInputSettingProxy::setActiveKeyboard(HbKeyboardType)
   772         if (prData->iTouchKeyboard != keyboard) {
   778     is deprecated.
   773             prData->iTouchKeyboard = keyboard;
       
   774             notify = true;
       
   775         }
       
   776         d->unlock();
       
   777         if (notify) {
       
   778             emit activeTouchKeyboardChanged(keyboard);
       
   779         }
       
   780     }
       
   781 }
       
   782 
       
   783 /*!
       
   784 Sets active keyboard type. Will emit signal activeKeyboardChanged if keyboard is changed.
       
   785 
       
   786 \sa activeKeyboard
       
   787 \sa activeHwKeyboard
       
   788 \sa setactiveKeyboard
       
   789 \sa setActiveHwKeyboard
       
   790 */
   779 */
   791 void HbInputSettingProxy::setActiveKeyboard(HbKeyboardType keyboard)
   780 void HbInputSettingProxy::setActiveKeyboard(HbKeyboardType keyboard)
   792 {
   781 {
   793     Q_D(HbInputSettingProxy);
   782     Q_UNUSED(keyboard);
   794     HbSettingProxyInternalData *prData = d->proxyData();
       
   795     if (prData) {
       
   796         bool notify = false;
       
   797         d->lock();
       
   798         if (prData->iActiveKeyboard != keyboard) {
       
   799             prData->iActiveKeyboard = keyboard;
       
   800             notify = true;
       
   801         }
       
   802         d->unlock();
       
   803         if (notify) {
       
   804             emit activeKeyboardChanged(keyboard);
       
   805         }
       
   806     }
       
   807 }
   783 }
   808 
   784 
   809 /*!
   785 /*!
   810 Returns the status of predictive input feature. Returns true if any one of given
   786 Returns the status of predictive input feature. Returns true if any one of given
   811 keyboard types has the prediction enabled. An editor instance may still forbid
   787 keyboard types has the prediction enabled. An editor instance may still forbid
   867     Q_D(const HbInputSettingProxy);
   843     Q_D(const HbInputSettingProxy);
   868     bool res = false;
   844     bool res = false;
   869 
   845 
   870     HbSettingProxyInternalData *prData = d->proxyData();
   846     HbSettingProxyInternalData *prData = d->proxyData();
   871     if (prData) {
   847     if (prData) {
   872         if (activeKeyboard() & HbQwertyKeyboardMask) {
   848         HbInputMethod *im = HbInputMethod::activeInputMethod();
   873             res = prData->iPredictiveInputState & HbKeyboardSettingQwerty;
   849         if (im) {
       
   850             HbInputState state = im->inputState();
       
   851             if (state.keyboard() & HbQwertyKeyboardMask) {
       
   852                 res = prData->iPredictiveInputState & HbKeyboardSettingQwerty;
       
   853             } else {
       
   854                 res = prData->iPredictiveInputState & HbKeyboardSetting12key;
       
   855             }
       
   856          }
       
   857     }
       
   858 
       
   859     return res;
       
   860 }
       
   861 
       
   862 /*!
       
   863 Sets the status of predictive text input feature for active keyboard.
       
   864 
       
   865 \sa predictiveInputStatusForActiveKeyboard
       
   866 */
       
   867 void HbInputSettingProxy::setPredictiveInputStatusForActiveKeyboard(bool newStatus)
       
   868 {
       
   869     HbInputMethod *im = HbInputMethod::activeInputMethod();
       
   870     if (im) {
       
   871         HbInputState state = im->inputState();
       
   872         if (state.keyboard() & HbQwertyKeyboardMask) {
       
   873             setPredictiveInputStatus(HbKeyboardSettingQwerty, newStatus);
   874         } else {
   874         } else {
   875             res = prData->iPredictiveInputState & HbKeyboardSetting12key;
   875             setPredictiveInputStatus(HbKeyboardSetting12key, newStatus);
   876         }
   876         }
   877     }
       
   878 
       
   879     return res;
       
   880 }
       
   881 
       
   882 /*!
       
   883 Sets the status of predictive text input feature for active keyboard.
       
   884 
       
   885 \sa predictiveInputStatusForActiveKeyboard
       
   886 */
       
   887 void HbInputSettingProxy::setPredictiveInputStatusForActiveKeyboard(bool newStatus)
       
   888 {
       
   889     if (activeKeyboard() & HbQwertyKeyboardMask) {
       
   890         setPredictiveInputStatus(HbKeyboardSettingQwerty, newStatus);
       
   891     } else {
       
   892         setPredictiveInputStatus(HbKeyboardSetting12key, newStatus);
       
   893     }
   877     }
   894 }
   878 }
   895 
   879 
   896 /*!
   880 /*!
   897 Returns path to a writable location that should be used as a base storage folder for
   881 Returns path to a writable location that should be used as a base storage folder for
  1153 {
  1137 {
  1154     Q_UNUSED(inputMethod)
  1138     Q_UNUSED(inputMethod)
  1155 }
  1139 }
  1156 
  1140 
  1157 /*!
  1141 /*!
  1158 Returns the current screen orientation in settings
  1142 \deprecated HbInputSettingProxy::screenOrientation()
       
  1143     is deprecated. Use HbInputFocusObject::screenOrientation() instead.
  1159 */
  1144 */
  1160 Qt::Orientation HbInputSettingProxy::screenOrientation()
  1145 Qt::Orientation HbInputSettingProxy::screenOrientation()
  1161 {
  1146 {
  1162     Q_D(HbInputSettingProxy);
  1147     Q_D(HbInputSettingProxy);
  1163 
  1148     return d->inputFrameworkScreenOrientation();
  1164     Qt::Orientation orientation = Qt::Vertical;
  1149 }
  1165     HbSettingProxyInternalData *prData = d->proxyData();
  1150 
  1166     if (prData) {
  1151 /*!
  1167         orientation = prData->iScreenOrientation;
  1152 \deprecated HbInputSettingProxy::setScreenOrientation(Qt::Orientation)
  1168     }
  1153     is deprecated.
  1169     return orientation;
       
  1170 }
       
  1171 
       
  1172 /*!
       
  1173 Sets the current screen orientation in settings. This completes orientation change
       
  1174 started with notifyScreenOrientationChange. Nothing is done, If
       
  1175  notifyScreenOrientationChange has not been called before calling this.
       
  1176 */
  1154 */
  1177 void HbInputSettingProxy::setScreenOrientation(Qt::Orientation screenOrientation)
  1155 void HbInputSettingProxy::setScreenOrientation(Qt::Orientation screenOrientation)
  1178 {
  1156 {
  1179     Q_D(HbInputSettingProxy);
  1157     Q_UNUSED(screenOrientation);
  1180 
  1158 }
  1181     HbSettingProxyInternalData *prData = d->proxyData();
  1159 
  1182     if (prData) {
  1160 /*!
  1183         d->lock();
  1161 \deprecated HbInputSettingProxy::notifyScreenOrientationChange()
  1184         if (prData->iOrientationChangeCompleted) {
  1162     is deprecated.
  1185             d->unlock();
       
  1186             return;
       
  1187         }
       
  1188         prData->iScreenOrientation = screenOrientation;
       
  1189         d->unlock();
       
  1190 
       
  1191         // notify everyone that the orientation has changed.
       
  1192         d->handleDeviceSpecificOriantationAndFlipChange();
       
  1193         emit orientationChanged(screenOrientation);
       
  1194 
       
  1195         // set orientation change operation completed.
       
  1196         d->lock();
       
  1197         prData->iOrientationChangeCompleted = true;
       
  1198         d->unlock();
       
  1199     }
       
  1200 }
       
  1201 
       
  1202 /*!
       
  1203 Starts screen orientation change sequence. Emits orientationAboutToChange signal
       
  1204 and set internal orientation change flag to true. Whoever calls this
       
  1205 method, must also complete the orientation change sequence by calling setScreenOrientation.
       
  1206 Generally this mechanims is connected to operating system level screen orientation attribute
       
  1207 begind the scenes and there is no need to call this directly from application or input
       
  1208 method.
       
  1209 */
  1163 */
  1210 void HbInputSettingProxy::notifyScreenOrientationChange()
  1164 void HbInputSettingProxy::notifyScreenOrientationChange()
  1211 {
  1165 {
  1212     Q_D(HbInputSettingProxy);
  1166 }
  1213 
  1167 
  1214     HbSettingProxyInternalData *prData = d->proxyData();
  1168 /*!
  1215     if (prData) {
  1169 \deprecated HbInputSettingProxy::orientationChangeCompleted() const
  1216         bool notify = false;
  1170     is deprecated.
  1217         d->lock();
       
  1218         if (prData->iOrientationChangeCompleted) {
       
  1219             prData->iOrientationChangeCompleted = false;
       
  1220             notify = true;
       
  1221         }
       
  1222         d->unlock();
       
  1223         if (notify) {
       
  1224             emit orientationAboutToChange();
       
  1225         }
       
  1226     }
       
  1227     
       
  1228 }
       
  1229 
       
  1230 /*!
       
  1231 Returns true if the orientation change is completed
       
  1232 */
  1171 */
  1233 bool HbInputSettingProxy::orientationChangeCompleted() const
  1172 bool HbInputSettingProxy::orientationChangeCompleted() const
  1234 {
  1173 {
  1235     Q_D(const HbInputSettingProxy);
  1174     return false;
  1236 
  1175 }
  1237     bool completed = true;
  1176 
  1238     HbSettingProxyInternalData *prData = d->proxyData();
  1177 /*!
  1239     if (prData) {
  1178 \deprecated HbInputSettingProxy::initializeOrientation(Qt::Orientation)
  1240         completed = prData->iOrientationChangeCompleted;
  1179     is deprecated.
  1241     }
       
  1242     return completed;
       
  1243 }
       
  1244 
       
  1245 /*!
       
  1246 Method for initializing orientation state of the input framework. Needed only on
       
  1247 framework level, should not be called by applications.
       
  1248 */
  1180 */
  1249 void HbInputSettingProxy::initializeOrientation(Qt::Orientation screenOrientation)
  1181 void HbInputSettingProxy::initializeOrientation(Qt::Orientation screenOrientation)
  1250 {
  1182 {
  1251     Q_D(HbInputSettingProxy);
  1183     Q_UNUSED(screenOrientation);
  1252 
       
  1253     // call handleDeviceSpecificOriantationAndFlipChange method
       
  1254     HbSettingProxyInternalData *prData = d->proxyData();
       
  1255     if (prData) {
       
  1256         d->lock();
       
  1257         prData->iScreenOrientation = screenOrientation;
       
  1258         if (screenOrientation == Qt::Vertical) {
       
  1259             prData->iActiveKeyboard = HbKeyboardVirtual12Key;
       
  1260         } else {
       
  1261             prData->iActiveKeyboard = HbKeyboardVirtualQwerty;
       
  1262         }
       
  1263         d->unlock();
       
  1264     }
       
  1265 }
  1184 }
  1266 
  1185 
  1267 /*!
  1186 /*!
  1268 Returns the status of regional input correction feature.
  1187 Returns the status of regional input correction feature.
  1269 
  1188