src/hbcore/inputfw/hbinputmethod.cpp
changeset 21 4633027730f5
parent 7 923ff622b8b9
child 23 e6ad4ef83b23
equal deleted inserted replaced
7:923ff622b8b9 21:4633027730f5
   326 {
   326 {
   327     secondaryInputLanguageChanged(newLanguage);
   327     secondaryInputLanguageChanged(newLanguage);
   328 }
   328 }
   329 
   329 
   330 /*!
   330 /*!
   331 This slot is connected to the setting proxy activeKeyboard attribute. It will
   331 \deprecated HbInputMethod::activeKeyboardChanged(HbKeyboardType)
   332 activate proper state when the signal is received.
   332     is deprecated. No need to call this outside of framework.
   333 */
   333 */
   334 void HbInputMethod::activeKeyboardChanged(HbKeyboardType newKeyboard)
   334 void HbInputMethod::activeKeyboardChanged(HbKeyboardType newKeyboard)
   335 {
   335 {
   336     if (!isActiveMethod() || !HbInputSettingProxy::instance()->orientationChangeCompleted()) {
   336     Q_UNUSED(newKeyboard);
   337         return;
       
   338     }
       
   339 
       
   340     Q_D(HbInputMethod);
       
   341 
       
   342     d->mInputState.setKeyboard(newKeyboard);
       
   343     HbInputMethod *stateHandler = d->findStateHandler(d->mInputState);
       
   344     if (stateHandler) {
       
   345         d->inputStateToEditor(d->mInputState);
       
   346         if (stateHandler != this) {
       
   347             // Context switch needed.
       
   348             d->contextSwitch(stateHandler);
       
   349         } else {
       
   350             // Same method handles new state, just report the state change.
       
   351             inputStateActivated(d->mInputState);
       
   352         }
       
   353     }
       
   354 }
   337 }
   355 
   338 
   356 /*!
   339 /*!
   357 The framework calls this method when an input capable widget receives UI focus. This is empty
   340 The framework calls this method when an input capable widget receives UI focus. This is empty
   358 default implementation and the inheriting class should override it.
   341 default implementation and the inheriting class should override it.
   471     }
   454     }
   472     delete d->mFocusObject;
   455     delete d->mFocusObject;
   473     d->mFocusObject = 0;
   456     d->mFocusObject = 0;
   474 
   457 
   475     // Attach focus.
   458     // Attach focus.
   476     d->mFocusObject = new HbInputFocusObject(widget);
   459     d->mFocusObject = d->createAndSetupFocusObject(widget);
   477     connect(widget, SIGNAL(destroyed(QObject *)), this, SLOT(editorDeleted(QObject *)));
   460     connect(widget, SIGNAL(destroyed(QObject *)), this, SLOT(editorDeleted(QObject *)));
       
   461     connect(d->mFocusObject, SIGNAL(aboutToChangeOrientation()), this, SLOT(_q_startOrientationSequence()));
       
   462     connect(d->mFocusObject, SIGNAL(orientationChanged()), this, SLOT(_q_endOrientationSequence()));
   478 
   463 
   479     d->setFocusCommon();
   464     d->setFocusCommon();
   480 
   465 
   481     // The focus jumped from one editor to another. Make sure that vkb host
   466     // The focus jumped from one editor to another. Make sure that vkb host
   482     // updates the situation correctly.
   467     // updates the situation correctly.
   554     }
   539     }
   555 
   540 
   556     // Attach focus.
   541     // Attach focus.
   557     d->mFocusObject = focusObject;
   542     d->mFocusObject = focusObject;
   558     connect(d->mFocusObject->object(), SIGNAL(destroyed(QObject *)), this, SLOT(editorDeleted(QObject *)));
   543     connect(d->mFocusObject->object(), SIGNAL(destroyed(QObject *)), this, SLOT(editorDeleted(QObject *)));
       
   544     connect(d->mFocusObject, SIGNAL(aboutToChangeOrientation()), this, SLOT(_q_startOrientationSequence()));
       
   545     connect(d->mFocusObject, SIGNAL(orientationChanged()), this, SLOT(_q_endOrientationSequence()));
   559 
   546 
   560     d->setFocusCommon();
   547     d->setFocusCommon();
   561 
   548 
   562     // The focus jumped from one editor to another. Make sure that vkb host
   549     // The focus jumped from one editor to another. Make sure that vkb host
   563     // updates the situation correctly.
   550     // updates the situation correctly.
   738         inputStateActivated(d->mInputState);
   725         inputStateActivated(d->mInputState);
   739     }
   726     }
   740 }
   727 }
   741 
   728 
   742 /*!
   729 /*!
   743 Receives the screen orientation signal. Will determine correct input state for new
   730 \deprecated HbInputMethod::orientationChanged(Qt::Orientation)
   744 orientation and find state handler for it.
   731     is deprecated. No need to call this from outside of the framework.
   745 */
   732 */
   746 void HbInputMethod::orientationChanged(Qt::Orientation orientation)
   733 void HbInputMethod::orientationChanged(Qt::Orientation orientation)
   747 {
   734 {
   748     Q_D(HbInputMethod);
       
   749     Q_UNUSED(orientation);
   735     Q_UNUSED(orientation);
   750 
   736 }
   751     if (d->mOldFocusObject) {
   737 
   752         setFocusObject(d->mOldFocusObject);
   738 /*!
   753         d->mOldFocusObject = 0;
   739 \deprecated HbInputMethod::orientationAboutToChange()
   754     }
   740     is deprecated. No need to call this from outside of the framework.
   755 
       
   756 }
       
   757 
       
   758 /*!
       
   759 This slot is connected to setting proxy's orientation change warning signal. The default
       
   760 base class implementation is empty.
       
   761 
       
   762 \sa HbInputSettingProxy
       
   763 */
   741 */
   764 void HbInputMethod::orientationAboutToChange()
   742 void HbInputMethod::orientationAboutToChange()
   765 {
   743 {
   766     Q_D(HbInputMethod);
       
   767 	if(isActiveMethod()) {
       
   768 		reset();
       
   769 	}
       
   770     d->inputStateToEditor(d->mInputState);
       
   771     if (d->mFocusObject) {
       
   772         d->mOldFocusObject = d->mFocusObject;
       
   773         d->mFocusObject = 0;
       
   774     }
       
   775     HbVkbHostBridge::instance()->closeKeypad(true);
       
   776 }
   744 }
   777 
   745 
   778 /*!
   746 /*!
   779 Returns active input language. Unlike setting proxy's global input language,
   747 Returns active input language. Unlike setting proxy's global input language,
   780 this method takes into account input state language and possible editor local language,
   748 this method takes into account input state language and possible editor local language,
   887 
   855 
   888     focusLost();
   856     focusLost();
   889     d->hideMainWindow();
   857     d->hideMainWindow();
   890     delete d->mFocusObject;
   858     delete d->mFocusObject;
   891     d->mFocusObject = 0;
   859     d->mFocusObject = 0;
       
   860     d->mFocusLocked = false;
   892 
   861 
   893     reset();
   862     reset();
   894 }
   863 }
   895 
   864 
   896 /*!
   865 /*!
   901 HbInputMethodDescriptor HbInputMethod::descriptor() const
   870 HbInputMethodDescriptor HbInputMethod::descriptor() const
   902 {
   871 {
   903     return HbInputModeCache::instance()->descriptor(this);
   872     return HbInputModeCache::instance()->descriptor(this);
   904 }
   873 }
   905 
   874 
       
   875 #include "moc_hbinputmethod.cpp"
       
   876 
   906 // End of file
   877 // End of file
   907 
   878