src/hbcore/inputfw/hbinputmethod.cpp
changeset 2 06ff229162e9
parent 1 f7ac710697a9
child 3 11d3954df52a
equal deleted inserted replaced
1:f7ac710697a9 2:06ff229162e9
   231 {
   231 {
   232     secondaryInputLanguageChanged(newLanguage);
   232     secondaryInputLanguageChanged(newLanguage);
   233 }
   233 }
   234 
   234 
   235 /*!
   235 /*!
   236 \deprecated HbInputMethod::activeHwKeyboardChanged(HbKeyboardType)
       
   237     is deprecated.
       
   238 */
       
   239 void HbInputMethod::activeHwKeyboardChanged(HbKeyboardType newKeyboard)
       
   240 {
       
   241     Q_UNUSED(newKeyboard);
       
   242     Q_D(HbInputMethod);
       
   243 
       
   244     // Do here whatever needs to be done on HbInputMethod level, then
       
   245     // call virtual ActiveKeyboardChanged() in case plugin needs to do something.
       
   246     // ...
       
   247     d->refreshState();
       
   248 }
       
   249 
       
   250 /*!
       
   251 \deprecated HbInputMethod::activeTouchKeyboardChanged(HbKeyboardType)
       
   252     is deprecated.
       
   253 */
       
   254 void HbInputMethod::activeTouchKeyboardChanged(HbKeyboardType newKeyboard)
       
   255 {
       
   256     Q_UNUSED(newKeyboard);
       
   257     Q_D(HbInputMethod);
       
   258 
       
   259     d->refreshState();
       
   260 }
       
   261 
       
   262 /*!
       
   263 This slot is connected to the setting proxy activeKeyboard attribute. It will
   236 This slot is connected to the setting proxy activeKeyboard attribute. It will
   264 activate proper state when the signal is received.
   237 activate proper state when the signal is received.
   265 */
   238 */
   266 void HbInputMethod::activeKeyboardChanged(HbKeyboardType newKeyboard)
   239 void HbInputMethod::activeKeyboardChanged(HbKeyboardType newKeyboard)
   267 {
   240 {
   282         }
   255         }
   283     }
   256     }
   284 }
   257 }
   285 
   258 
   286 /*!
   259 /*!
   287 \deprecated HbInputMethod::predictiveInputStateChanged(int newStatus)
       
   288     is deprecated.
       
   289 */
       
   290 void HbInputMethod::predictiveInputStateChanged(int newStatus)
       
   291 {
       
   292     Q_UNUSED(newStatus);
       
   293 }
       
   294 
       
   295 /*!
       
   296 \deprecated HbInputMethod::predictiveInputStateChanged(HbKeyboardSettingFlags, bool)
       
   297     is deprecated.
       
   298 */
       
   299 void HbInputMethod::predictiveInputStateChanged(HbKeyboardSettingFlags keyboardType, bool newState)
       
   300 {
       
   301     Q_UNUSED(keyboardType);
       
   302     Q_UNUSED(newState);
       
   303 }
       
   304 
       
   305 /*!
       
   306 The framework calls this method when an input capable widget receives UI focus. This is empty
   260 The framework calls this method when an input capable widget receives UI focus. This is empty
   307 default implementation and the inheriting class should override it.
   261 default implementation and the inheriting class should override it.
   308 
   262 
   309 \sa focusLost
   263 \sa focusLost
   310 */
   264 */
   371     // Check whether the editor has read-only constraint and reject focus
   325     // Check whether the editor has read-only constraint and reject focus
   372     // if so.
   326     // if so.
   373     bool readOnly = false;
   327     bool readOnly = false;
   374     if (HbEditorInterface::isConnected(widget)) {
   328     if (HbEditorInterface::isConnected(widget)) {
   375         HbEditorInterface eInt(widget);
   329         HbEditorInterface eInt(widget);
   376         if (eInt.constraints() & HbEditorConstraintIgnoreFocus) {
   330         if (eInt.inputConstraints() & HbEditorConstraintIgnoreFocus) {
   377             readOnly = true;
   331             readOnly = true;
   378         }
   332         }
   379     }
   333     }
   380 
   334 
   381     // Focusing widget doesn't have input capabilities
   335     // Focusing widget doesn't have input capabilities
   424 }
   378 }
   425 
   379 
   426 /*!
   380 /*!
   427 Checks if the destroyed widget is currently focused and clears the focus
   381 Checks if the destroyed widget is currently focused and clears the focus
   428 if needed. This method should not be overridden.
   382 if needed. This method should not be overridden.
   429 
       
   430 \sa focusObjectDestroyed
       
   431 */
   383 */
   432 void HbInputMethod::widgetDestroyed(QWidget* widget)
   384 void HbInputMethod::widgetDestroyed(QWidget* widget)
   433 {
   385 {
   434     Q_D(HbInputMethod);
   386     Q_D(HbInputMethod);
   435 
   387 
   436     if (d->mFocusObject && d->mFocusObject->object() == widget) {
   388     if (d->mFocusObject && d->mFocusObject->object() == widget) {
   437         releaseFocus();
   389         delete d->mFocusObject;
   438     }
   390         d->mFocusObject = 0;
   439 }
       
   440 
       
   441 /*!
       
   442 \deprecated HbInputMethod::focusObjectDestroyed(const HbInputFocusObject*)
       
   443     is deprecated.
       
   444 */
       
   445 void HbInputMethod::focusObjectDestroyed(const HbInputFocusObject* focusObject)
       
   446 {
       
   447     Q_D(HbInputMethod);
       
   448 
       
   449     if (focusObject && focusObject == d->mFocusObject) {
       
   450         releaseFocus();
       
   451     }
   391     }
   452 }
   392 }
   453 
   393 
   454 /*!
   394 /*!
   455 Graphics item based editors (or any other object that implements
   395 Graphics item based editors (or any other object that implements
   524         }
   464         }
   525     }
   465     }
   526 }
   466 }
   527 
   467 
   528 /*!
   468 /*!
   529 \deprecated HbInputMethod::receiveText(const QString&)
       
   530     is deprecated.
       
   531 */
       
   532 void HbInputMethod::receiveText(const QString& string)
       
   533 {
       
   534     Q_UNUSED(string);
       
   535 }
       
   536 
       
   537 /*!
       
   538 \deprecated HbInputMethod::candidatePopupClosed(int closingKey)
       
   539     is deprecated.
       
   540 */
       
   541 void HbInputMethod::candidatePopupClosed(int closingKey)
       
   542 {
       
   543     Q_UNUSED(closingKey);
       
   544     // Empty default implementation
       
   545 }
       
   546 
       
   547 /*!
       
   548 The framework calls this method when device-wide input language changes.
   469 The framework calls this method when device-wide input language changes.
   549 The base class implementation is empty so any input method interested in
   470 The base class implementation is empty so any input method interested in
   550 language switch events should implement it. Note that this method reports
   471 language switch events should implement it. Note that this method reports
   551 change in system wide input language. Local input language in active editor
   472 change in system wide input language. Local input language in active editor
   552 may still remain same.
   473 may still remain same.
   566 */
   487 */
   567 void HbInputMethod::secondaryInputLanguageChanged(const HbInputLanguage &aNewLanguage)
   488 void HbInputMethod::secondaryInputLanguageChanged(const HbInputLanguage &aNewLanguage)
   568 {
   489 {
   569     // Empty default implementation.
   490     // Empty default implementation.
   570     Q_UNUSED(aNewLanguage);
   491     Q_UNUSED(aNewLanguage);
   571 }
       
   572 
       
   573 /*!
       
   574 \deprecated HbInputMethod::predictiveInputStatusChanged(int newStatus)
       
   575     is deprecated.
       
   576 */
       
   577 void HbInputMethod::predictiveInputStatusChanged(int newStatus)
       
   578 {
       
   579     Q_UNUSED(newStatus);
       
   580     // Empty default implementation.
       
   581 }
   492 }
   582 
   493 
   583 /*!
   494 /*!
   584 Returns true if given input mode is allowed in active editor.
   495 Returns true if given input mode is allowed in active editor.
   585 */
   496 */
   723         inputStateActivated(d->mInputState);
   634         inputStateActivated(d->mInputState);
   724     }
   635     }
   725 }
   636 }
   726 
   637 
   727 /*!
   638 /*!
   728 \deprecated HbInputMethod::releaseFocus()
       
   729     is deprecated.
       
   730 */
       
   731 void HbInputMethod::releaseFocus()
       
   732 {
       
   733     Q_D(HbInputMethod);
       
   734 
       
   735     delete d->mFocusObject;
       
   736     d->mFocusObject = 0;
       
   737 }
       
   738 
       
   739 /*!
       
   740 Receives the screen orientation signal. Will determine correct input state for new
   639 Receives the screen orientation signal. Will determine correct input state for new
   741 orientation and find state handler for it.
   640 orientation and find state handler for it.
   742 */
   641 */
   743 void HbInputMethod::orientationChanged(Qt::Orientation orientation)
   642 void HbInputMethod::orientationChanged(Qt::Orientation orientation)
   744 {
   643 {
   826 void HbInputMethod::forceUnfocus()
   725 void HbInputMethod::forceUnfocus()
   827 {
   726 {
   828     HbInputMethod* active = activeInputMethod();
   727     HbInputMethod* active = activeInputMethod();
   829 
   728 
   830     if (active) {
   729     if (active) {
   831         active->focusLost(false);
   730         active->focusLost(false);       
   832         active->releaseFocus();
       
   833         delete active->d_ptr->mFocusObject;
   731         delete active->d_ptr->mFocusObject;
   834         active->d_ptr->mFocusObject = 0;
   732         active->d_ptr->mFocusObject = 0;
   835     }
   733     }
   836 }
   734 }
   837 
   735 
   870 When an editor becomes focused, the framework connects its destroyed signal
   768 When an editor becomes focused, the framework connects its destroyed signal
   871 to this slot and it takes care of closing the input and resetting the input method.
   769 to this slot and it takes care of closing the input and resetting the input method.
   872 */
   770 */
   873 void HbInputMethod::editorDeleted(QObject *obj)
   771 void HbInputMethod::editorDeleted(QObject *obj)
   874 {
   772 {
       
   773     Q_D(HbInputMethod);
   875     Q_UNUSED(obj);
   774     Q_UNUSED(obj);
   876 
   775 
   877     focusLost();
   776     focusLost();
   878     releaseFocus();
   777 
       
   778     delete d->mFocusObject;
       
   779     d->mFocusObject = 0;
       
   780 
   879     reset();
   781     reset();
   880 }
   782 }
   881 
   783 
   882 /*!
       
   883 \deprecated HbInputMethod::orientationContextSwitchInProgress()
       
   884     is deprecated.
       
   885 */
       
   886 bool HbInputMethod::orientationContextSwitchInProgress()
       
   887 {
       
   888     Q_D(HbInputMethod);
       
   889     return d->mIsOrientationContextSwitchInProgress;
       
   890 }
       
   891 
       
   892 // End of file
   784 // End of file
   893 
   785