src/hbcore/inputfw/hbinputmethod.cpp
changeset 1 f7ac710697a9
parent 0 16d8024aca5e
child 2 06ff229162e9
equal deleted inserted replaced
0:16d8024aca5e 1:f7ac710697a9
    33 #include "hbinputsettingproxy.h"
    33 #include "hbinputsettingproxy.h"
    34 #include "hbinputcontextproxy_p.h"
    34 #include "hbinputcontextproxy_p.h"
    35 #include "hbinputfilter.h"
    35 #include "hbinputfilter.h"
    36 #include "hbinputmethodnull_p.h"
    36 #include "hbinputmethodnull_p.h"
    37 #include "hbinputpredictionfactory.h"
    37 #include "hbinputpredictionfactory.h"
       
    38 #include "hbinputextradictionaryfactory.h"
    38 #include "hbinputstandardfilters.h"
    39 #include "hbinputstandardfilters.h"
    39 #include "hbinpututils.h"
    40 #include "hbinpututils.h"
    40 #include "hbinputvkbhost.h"
    41 #include "hbinputvkbhost.h"
    41 
    42 
    42 /*!
    43 /*!
    44 @hbcore
    45 @hbcore
    45 \class HbInputMethod
    46 \class HbInputMethod
    46 \brief A base class for input method implementations.
    47 \brief A base class for input method implementations.
    47 
    48 
    48 HbInputMethod is the base class for input method implementations. It inherits from QInputContext,
    49 HbInputMethod is the base class for input method implementations. It inherits from QInputContext,
    49 connects to the input framework behind the scenes and provides focusing and other framework level 
    50 connects to the input framework behind the scenes and resolves correct input state handler when
    50 services.   
    51 an editor widget is focused.
    51 
    52 
    52 An internal framework class called HbInputModeCache scans through the system and looks for available HbInputMethod instances. It then forms a list of available input methods based on language
    53 An internal framework class called HbInputModeCache scans through the system and looks for
    53 and keyboard type. Input method plugin reports (on plugin level, as meta-data) which languages, keyboards and input modes that input method instance supports. Input mode cache then activates suitable
    54 available HbInputMethod instances. It then forms a list of input methods based on language
    54 input method depending on the situation. It can also switch active input method on the fly
    55 and keyboard type. Input method plugin reports (as plugin meta-data) which languages,
    55 when the focus switches between editors and the previously active input method is unable to 
    56 keyboards and input modes that plugin instance implements. Input mode cache then activates matching
       
    57 HbInputMethod depending on the editor properties. It switches the active input method on the fly
       
    58 when the focus switches between editors if the previous input method is unable to
    56 support newly focused editor.
    59 support newly focused editor.
    57 
    60 
    58 Custom input methods are a special class of input methods. Once a custom input method is
    61 Custom input methods are a special class of input methods. Once a custom input method is
    59 activated from UI, input mode cache stops resolving suitable input methods upon focus operations
    62 activated from UI, input mode cache stops resolving input methods upon focus operations
    60 and the custom input is ative in all editors until it is deactivated.
    63 and the custom input is active in all editors until it is deactivated.
    61 
    64 
    62 Following is the basic input framework program flow:
    65 Following is the basic input framework program flow:
    63 
    66 
    64 1. An editor gains input focus.
    67 1. An editor gains input focus.
    65 2  Input mode cache resolves correct mode handler and activates it.
    68 2  Input mode cache resolves correct mode handler and activates it.
    66 3. A virtual function HbInputMethod::focusReceived is called. At this point the input method
    69 3. A virtual function HbInputMethod::focusReceived is called. At this point the input method
    67    initializes whatever it needs to initialize in order to start the input operation (for example,
    70    initializes whatever it needs to initialize in order to start the input operation (for example,
    68    opens the virtual keyboard by using HbVkbHost API) and waits for user actions.
    71    opens the virtual keyboard by using HbVkbHost API) and waits for user actions.
    69 4. Text is written. The input method delivers results to the editor buffer by using HbInputFocusObject API.
    72 4. Text is written. The input method delivers results to the editor buffer by using HbInputFocusObject API.
    70    It can access editor attributes via HbEditorInterface API.
    73    It can access editor attributes via HbEditorInterface API.
    71 5. The active editor loses focus. At this point the input method receives a call to virtual function   
    74 5. The active editor loses focus. At this point the input method receives a call to virtual function
    72    HbInputMethod::focusLost and is expected to conclude any ongoing input operations and shut down active
    75    HbInputMethod::focusLost and is expected to conclude any ongoing input operations and shut down active
    73    UI elements (such as the virtual keyboard).   
    76    UI elements (such as the virtual keyboard).
    74 6. The input method waits for next focusReceived() call.
    77 6. The input method waits for next focusReceived() call.
    75 
    78 
    76 \sa QInputContext
    79 \sa QInputContext
    77 \sa HbInputFocusObject
    80 \sa HbInputFocusObject
    78 \sa HbEditorInterface
    81 \sa HbEditorInterface
    82 /*!
    85 /*!
    83 Constructs the object
    86 Constructs the object
    84 */
    87 */
    85 HbInputMethod::HbInputMethod() : d_ptr(new HbInputMethodPrivate(this))
    88 HbInputMethod::HbInputMethod() : d_ptr(new HbInputMethodPrivate(this))
    86 {
    89 {
    87     HbInputSettingProxy::instance()->connectObservingObject(this);  
    90     HbInputSettingProxy::instance()->connectObservingObject(this);
    88 }
    91 }
    89 
    92 
    90 /*!
    93 /*!
    91 Destructs the object
    94 Destructs the object
    92 */
    95 */
    96 
    99 
    97     delete d_ptr;
   100     delete d_ptr;
    98 }
   101 }
    99 
   102 
   100 /*!
   103 /*!
   101 Initializes the HbInputs framework. Each Qt application needs to call this
   104 Initializes the input framework.
   102 method once in order to connect to the HbInputs framework.
       
   103 */
   105 */
   104 bool HbInputMethod::initializeFramework(QApplication& app)
   106 bool HbInputMethod::initializeFramework(QApplication& app)
   105 {
   107 {
   106     // Activate singleton shutdown.
   108     // Activate singleton shutdown.
   107     connect(&app, SIGNAL(aboutToQuit()), HbInputModeCache::instance(), SLOT(shutdown()));
   109     connect(&app, SIGNAL(aboutToQuit()), HbInputModeCache::instance(), SLOT(shutdown()));
   108     connect(&app, SIGNAL(aboutToQuit()), HbInputSettingProxy::instance(), SLOT(shutdown()));
   110     connect(&app, SIGNAL(aboutToQuit()), HbInputSettingProxy::instance(), SLOT(shutdown()));
   109     connect(&app, SIGNAL(aboutToQuit()), HbPredictionFactory::instance(), SLOT(shutDown()));
   111     connect(&app, SIGNAL(aboutToQuit()), HbPredictionFactory::instance(), SLOT(shutDown()));
       
   112     connect(&app, SIGNAL(aboutToQuit()), HbExtraDictionaryFactory::instance(), SLOT(shutdown()));
   110 
   113 
   111     HbInputMethod *master = HbInputMethodNull::Instance();
   114     HbInputMethod *master = HbInputMethodNull::Instance();
   112 
   115 
   113     if (!master) {
   116     if (!master) {
   114         return false;
   117         return false;
   122 
   125 
   123     return true;
   126     return true;
   124 }
   127 }
   125 
   128 
   126 /*!
   129 /*!
   127 Returns active instance of HbInputMethod. There is always active HbInputMethod instance after
   130 Returns the active instance of HbInputMethod. There is always active HbInputMethod instance after
   128 InitializeFramework method has been called, even when there is no focused editor (in some cases it may
   131 InitializeFramework method has been called, even when there is no focused editor (in some cases it may
   129 be so called null input method). Normally this method is needed only for special cases, such as developing
   132 be so called null input method).
   130 and debugging framework level code, but it is made public for convenience.
       
   131 */
   133 */
   132 HbInputMethod* HbInputMethod::activeInputMethod()
   134 HbInputMethod* HbInputMethod::activeInputMethod()
   133 {
   135 {
   134     // First try, try app input context directly. It is possible that it is an instance
   136     // First try, try app input context directly. It is possible that it is an instance
   135     // of HbInputMethod that is installed directly there without framework knowing about it
   137     // of HbInputMethod that is installed directly there without framework knowing about it
   159 {
   161 {
   160     return HbInputModeCache::instance()->listCustomInputMethods();
   162     return HbInputModeCache::instance()->listCustomInputMethods();
   161 }
   163 }
   162 
   164 
   163 /*!
   165 /*!
   164 Activates given input method. input context is
   166 Activates given input method. Input context is
   165 switched to custom method. Returns false if input method was not found
   167 switched to custom method. Returns false if input method was not found
   166 or the framework was not able to activate it.
   168 or the framework was not able to activate it.
   167 */
   169 */
   168 bool HbInputMethod::activateInputMethod(const HbInputMethodDescriptor &inputMethod)
   170 bool HbInputMethod::activateInputMethod(const HbInputMethodDescriptor &inputMethod)
   169 {
   171 {
   185     }
   187     }
   186 
   188 
   187     return false;
   189     return false;
   188 }
   190 }
   189 
   191 
   190 
       
   191 /*!
   192 /*!
   192 This slot is called when the input language changes. The framework connects it
   193 This slot is called when the input language changes. The framework connects it
   193 to the input setting proxy. When the signal is received, the input method implementation
   194 to the input setting proxy. When the signal is received, the input method implementation
   194 is notified by calling inputLanguageChanged.
   195 is notified by calling inputLanguageChanged.
   195 
   196 
   196 \sa inputLanguageChanged
   197 \sa inputLanguageChanged
   197 \sa HbInputSettingProxy
   198 \sa HbInputSettingProxy
   198 */
   199 */
   199 void HbInputMethod::globalInputLanguageChanged(const HbInputLanguage &newLanguage)
   200 void HbInputMethod::globalInputLanguageChanged(const HbInputLanguage &newLanguage)
   200 { 
   201 {
   201     Q_D(HbInputMethod);
   202     Q_D(HbInputMethod);
   202 
   203 
   203     inputLanguageChanged(newLanguage);
   204     inputLanguageChanged(newLanguage);
   204 
   205 
   205     if (!isActiveMethod()) {
   206     if (!isActiveMethod()) {
   206         // Notify non-active input methods of language change, but check
   207         // Notify non-active input methods of language change, but check
   207         // if the method has promised to handle the new language only
   208         // if the method has promised to handle the new language only
   208         // in the active method
   209         // in the active method
   209         return;
   210         return;
   210     }
   211     }
   211    
   212 
   212     // Just behave as if this was the first focus operation
   213     // Just behave as if this was the first focus operation
   213     // to this editor.
   214     // to this editor.
   214     if (d->mFocusObject) { 
   215     if (d->mFocusObject) {
   215         HbInputState state;
   216         HbInputState state;
   216         editorRootState(state);  
   217         editorRootState(state);
   217         activateState(state);
   218         activateState(state);
   218     }
   219     }
   219 }
   220 }
   220 
   221 
   221 /*!
   222 /*!
   224 is notified by calling secondaryInputLanguageChanged.
   225 is notified by calling secondaryInputLanguageChanged.
   225 
   226 
   226 \sa secondaryInputLanguageChanged
   227 \sa secondaryInputLanguageChanged
   227 \sa HbInputSettingProxy
   228 \sa HbInputSettingProxy
   228 */
   229 */
   229 void HbInputMethod::globalSecondaryInputLanguageChanged(const HbInputLanguage &aNewLanguage)
   230 void HbInputMethod::globalSecondaryInputLanguageChanged(const HbInputLanguage &newLanguage)
   230 {
   231 {
   231     secondaryInputLanguageChanged(aNewLanguage);
   232     secondaryInputLanguageChanged(newLanguage);
   232 }
   233 }
   233 
   234 
   234 /*!
   235 /*!
   235 This slot is connected to the setting proxy hw keyboard attribute. It will
   236 \deprecated HbInputMethod::activeHwKeyboardChanged(HbKeyboardType)
   236 do refreshState() when the signal is received.
   237     is deprecated.
   237 */
   238 */
   238 void HbInputMethod::activeHwKeyboardChanged(HbKeyboardType newKeyboard)
   239 void HbInputMethod::activeHwKeyboardChanged(HbKeyboardType newKeyboard)
   239 {
   240 {
   240     Q_UNUSED(newKeyboard);
   241     Q_UNUSED(newKeyboard);
   241     Q_D(HbInputMethod);
   242     Q_D(HbInputMethod);
   245     // ...
   246     // ...
   246     d->refreshState();
   247     d->refreshState();
   247 }
   248 }
   248 
   249 
   249 /*!
   250 /*!
   250 This slot is connected to the setting proxy touch keyboard attribute. It will
   251 \deprecated HbInputMethod::activeTouchKeyboardChanged(HbKeyboardType)
   251 do refreshState() when the signal is received.
   252     is deprecated.
   252 */
   253 */
   253 void HbInputMethod::activeTouchKeyboardChanged(HbKeyboardType newKeyboard)
   254 void HbInputMethod::activeTouchKeyboardChanged(HbKeyboardType newKeyboard)
   254 {
   255 {
   255     Q_UNUSED(newKeyboard);
   256     Q_UNUSED(newKeyboard);
   256     Q_D(HbInputMethod);
   257     Q_D(HbInputMethod);
   257 
   258 
   258     d->refreshState();
   259     d->refreshState();
   259 }
   260 }
   260 
       
   261 
   261 
   262 /*!
   262 /*!
   263 This slot is connected to the setting proxy activeKeyboard attribute. It will
   263 This slot is connected to the setting proxy activeKeyboard attribute. It will
   264 activate proper state when the signal is received.
   264 activate proper state when the signal is received.
   265 */
   265 */
   268     if (!isActiveMethod()) {
   268     if (!isActiveMethod()) {
   269         return;
   269         return;
   270     }
   270     }
   271     Q_D(HbInputMethod);
   271     Q_D(HbInputMethod);
   272     d->mInputState.setKeyboard(newKeyboard);
   272     d->mInputState.setKeyboard(newKeyboard);
   273     HbInputMethod* stateHandler = d->findStateHandler(d->mInputState); 
   273     HbInputMethod* stateHandler = d->findStateHandler(d->mInputState);
   274     if (stateHandler) {
   274     if (stateHandler) {
   275         d->inputStateToEditor(d->mInputState);
   275         d->inputStateToEditor(d->mInputState);
   276         if (stateHandler != this) {
   276         if (stateHandler != this) {
   277             // Context switch needed.
   277             // Context switch needed.
   278             d->contextSwitch(stateHandler);
   278             d->contextSwitch(stateHandler);
   282         }
   282         }
   283     }
   283     }
   284 }
   284 }
   285 
   285 
   286 /*!
   286 /*!
   287 This slot is called when the predictive input state changes. The framework connects it
   287 \deprecated HbInputMethod::predictiveInputStateChanged(int newStatus)
   288 to the input setting proxy. When the signal is received, the input method implementation
   288     is deprecated.
   289 is notified by calling predictiveInputStatusChanged.
       
   290 
       
   291 \sa predictiveInputStatusChanged
       
   292 \sa HbInputSettingProxy
       
   293 */
   289 */
   294 void HbInputMethod::predictiveInputStateChanged(int newStatus)
   290 void HbInputMethod::predictiveInputStateChanged(int newStatus)
   295 {
   291 {
   296     // Do here whatever needs to be done on HbInputMethod level, then
   292     Q_UNUSED(newStatus);
   297     // call virtual predictiveInputStatusChanged() in case plugin needs to do something.
   293 }
   298     // ...
   294 
   299 
   295 /*!
   300     predictiveInputStatusChanged(newStatus);
   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);
   301 }
   303 }
   302 
   304 
   303 /*!
   305 /*!
   304 The framework calls this method when an input capable widget receives UI focus. This is empty
   306 The framework calls this method when an input capable widget receives UI focus. This is empty
   305 default implementation and the inheriting class should override it.
   307 default implementation and the inheriting class should override it.
   350 
   352 
   351     QInputContext::setFocusWidget(widget);
   353     QInputContext::setFocusWidget(widget);
   352 
   354 
   353     if (!widget) {
   355     if (!widget) {
   354         // Losing focus.
   356         // Losing focus.
   355         if (d->mFocusObject) { 
   357         if (d->mFocusObject) {
   356             focusLost(false);
   358             focusLost(false);
   357             delete d->mFocusObject;
   359             delete d->mFocusObject;
   358             d->mFocusObject = 0;
   360             d->mFocusObject = 0;
   359         }
   361         }
   360         return;
   362         return;
   382         if (d->mFocusObject) {
   384         if (d->mFocusObject) {
   383             focusLost();
   385             focusLost();
   384         }
   386         }
   385         return;
   387         return;
   386     }
   388     }
   387    
   389 
   388     if (d->mFocusObject) {
   390     if (d->mFocusObject) {
   389         if (d->mFocusObject->object() == widget) {
   391         if (d->mFocusObject->object() == widget) {
   390             // Focus remains in same widget, do nothing.
   392             // Focus remains in same widget, do nothing.
   391             return;
   393             return;
   392         } else {
   394         } else {
   435         releaseFocus();
   437         releaseFocus();
   436     }
   438     }
   437 }
   439 }
   438 
   440 
   439 /*!
   441 /*!
   440 Checks if the destroyed object is currently focused and clears the focus
   442 \deprecated HbInputMethod::focusObjectDestroyed(const HbInputFocusObject*)
   441 if needed.
   443     is deprecated.
   442 
       
   443 \sa widgetDestroyed
       
   444 */
   444 */
   445 void HbInputMethod::focusObjectDestroyed(const HbInputFocusObject* focusObject)
   445 void HbInputMethod::focusObjectDestroyed(const HbInputFocusObject* focusObject)
   446 {
   446 {
   447     Q_D(HbInputMethod);
   447     Q_D(HbInputMethod);
   448 
   448 
   452 }
   452 }
   453 
   453 
   454 /*!
   454 /*!
   455 Graphics item based editors (or any other object that implements
   455 Graphics item based editors (or any other object that implements
   456 HbInputFocusObject) send their focus events notifications through this method.
   456 HbInputFocusObject) send their focus events notifications through this method.
   457 Since Qt's QInputContext mechanism works only with QWidget based editors,
   457 
   458 this alternate focus channel is needed for objects belonging to a graphics scene
   458 Typically this method is called by HbInputContextProxy when it receives
   459 (in case of a graphics scene, the topmost QWidget that has focus is
   459 requestSoftwareInputPanel event.
   460 graphics view, not the the object inside the view). The ownership of
       
   461 incoming focus object is transferred to the input framework.
       
   462 
   460 
   463 \sa setFocusWidget
   461 \sa setFocusWidget
   464 \sa HbInputFocusObject
   462 \sa HbInputFocusObject
   465 */
   463 */
   466 void HbInputMethod::setFocusObject(HbInputFocusObject* focusObject)
   464 void HbInputMethod::setFocusObject(HbInputFocusObject* focusObject)
   490         if (d->mFocusObject != focusObject) {
   488         if (d->mFocusObject != focusObject) {
   491             delete focusObject;
   489             delete focusObject;
   492         }
   490         }
   493         return;
   491         return;
   494     }
   492     }
   495    
   493 
   496     bool refreshHost = false;
   494     bool refreshHost = false;
   497 
   495 
   498     // Delete previous focus object.
   496     // Delete previous focus object.
   499     if (d->mFocusObject) {
   497     if (d->mFocusObject) {
   500         refreshHost = true;
   498         refreshHost = true;
   526         }
   524         }
   527     }
   525     }
   528 }
   526 }
   529 
   527 
   530 /*!
   528 /*!
   531 The secondary channel uses this slot for inserting text active editor.
   529 \deprecated HbInputMethod::receiveText(const QString&)
       
   530     is deprecated.
   532 */
   531 */
   533 void HbInputMethod::receiveText(const QString& string)
   532 void HbInputMethod::receiveText(const QString& string)
   534 {
   533 {
   535     Q_D(HbInputMethod);
   534     Q_UNUSED(string);
   536 
   535 }
   537     if (isActiveMethod() && d->mFocusObject &&
   536 
   538         (d->editorConstraints() & HbEditorConstraintsNoSecondaryChannel) == 0) {
   537 /*!
   539         QList<QInputMethodEvent::Attribute> list;
   538 \deprecated HbInputMethod::candidatePopupClosed(int closingKey)
   540         QInputMethodEvent event(QString(), list);
   539     is deprecated.
   541         event.setCommitString(string);
       
   542         d->mFocusObject->sendEvent(event);
       
   543     }
       
   544 }
       
   545 
       
   546 /*!
       
   547 This slot is called when the candidate list popup is closed. The base
       
   548 class implementation is empty so any input method interested in
       
   549 candidate list close event should implement it.
       
   550 */
   540 */
   551 void HbInputMethod::candidatePopupClosed(int closingKey)
   541 void HbInputMethod::candidatePopupClosed(int closingKey)
   552 {
   542 {
   553     Q_UNUSED(closingKey);
   543     Q_UNUSED(closingKey);
   554     // Empty default implementation
   544     // Empty default implementation
   579     // Empty default implementation.
   569     // Empty default implementation.
   580     Q_UNUSED(aNewLanguage);
   570     Q_UNUSED(aNewLanguage);
   581 }
   571 }
   582 
   572 
   583 /*!
   573 /*!
   584 The framework calls this method when the predictive input status changes.
   574 \deprecated HbInputMethod::predictiveInputStatusChanged(int newStatus)
   585 The base class implementation is empty so any input method interested in
   575     is deprecated.
   586 prediction status events should implement it.
       
   587 */
   576 */
   588 void HbInputMethod::predictiveInputStatusChanged(int newStatus)
   577 void HbInputMethod::predictiveInputStatusChanged(int newStatus)
   589 {
   578 {
   590     Q_UNUSED(newStatus);
   579     Q_UNUSED(newStatus);
   591     // Empty default implementation.
   580     // Empty default implementation.
   616 void HbInputMethod::inputStateActivated(const HbInputState& newState)
   605 void HbInputMethod::inputStateActivated(const HbInputState& newState)
   617 {
   606 {
   618     Q_UNUSED(newState);
   607     Q_UNUSED(newState);
   619     // Empty default implementation.
   608     // Empty default implementation.
   620     if (this != HbInputMethodNull::Instance()) {
   609     if (this != HbInputMethodNull::Instance()) {
   621         qDebug("WARNING: inputStateActivated() default implementation called: Is that ok?");
   610         qWarning("WARNING: inputStateActivated() default implementation called: Is that ok?");
   622     }
   611     }
   623 }
   612 }
   624 
   613 
   625 /*!
   614 /*!
   626 Returns active input state.
   615 Returns active input state.
   633     Q_D(const HbInputMethod);
   622     Q_D(const HbInputMethod);
   634     return d->mInputState;
   623     return d->mInputState;
   635 }
   624 }
   636 
   625 
   637 /*!
   626 /*!
   638 Returns the first input state that should be activated when an editor is 
   627 Returns the first input state that should be activated when an editor is
   639 focused for the first time. The state is constructed from edirtor attributes and
   628 focused for the first time. The state is constructed from edirtor attributes and
   640 input settings.
   629 input settings.
   641 */
   630 */
   642 void HbInputMethod::editorRootState(HbInputState &result) const
   631 void HbInputMethod::editorRootState(HbInputState &result) const
   643 {
   632 {
   679         stateHandler = HbInputMethodNull::Instance();
   668         stateHandler = HbInputMethodNull::Instance();
   680     }
   669     }
   681 
   670 
   682     d->mInputState = state;
   671     d->mInputState = state;
   683 
   672 
   684     if (stateHandler != this) {     
   673     if (stateHandler != this) {
   685         stateHandler->d_ptr->mStateChangeInProgress = true;
   674         stateHandler->d_ptr->mStateChangeInProgress = true;
   686         // Context switch needed.
   675         // Context switch needed.
   687         d->inputStateToEditor(d->mInputState);        
   676         d->inputStateToEditor(d->mInputState);
   688         d->contextSwitch(stateHandler);
   677         d->contextSwitch(stateHandler);
   689         stateHandler->d_ptr->mStateChangeInProgress = false;
   678         stateHandler->d_ptr->mStateChangeInProgress = false;
   690     } else {         
   679     } else {
   691         // Same method handles new state, just report the state change.
   680         // Same method handles new state, just report the state change.
   692         d->inputStateToEditor(d->mInputState);
   681         d->inputStateToEditor(d->mInputState);
   693         inputStateActivated(d->mInputState);
   682         inputStateActivated(d->mInputState);
   694     }
   683     }
   695 
   684 
   734         inputStateActivated(d->mInputState);
   723         inputStateActivated(d->mInputState);
   735     }
   724     }
   736 }
   725 }
   737 
   726 
   738 /*!
   727 /*!
   739 Clears focus state from input method side. After calling this method,
   728 \deprecated HbInputMethod::releaseFocus()
   740 HbInputMethod instance thinks that it is not focused to any widget.
   729     is deprecated.
   741 The widget itself still remain focused to this input context.
       
   742 */
   730 */
   743 void HbInputMethod::releaseFocus()
   731 void HbInputMethod::releaseFocus()
   744 {
   732 {
   745     Q_D(HbInputMethod);
   733     Q_D(HbInputMethod);
   746 
   734 
   841 
   829 
   842     if (active) {
   830     if (active) {
   843         active->focusLost(false);
   831         active->focusLost(false);
   844         active->releaseFocus();
   832         active->releaseFocus();
   845         delete active->d_ptr->mFocusObject;
   833         delete active->d_ptr->mFocusObject;
   846         active->d_ptr->mFocusObject = 0;  
   834         active->d_ptr->mFocusObject = 0;
   847     }
   835     }
   848 }
   836 }
   849 
   837 
   850 /*!
   838 /*!
   851 Wrapper
   839 Wrapper.
   852 */
   840 */
   853 bool HbInputMethod::automaticTextCaseNeeded() const
   841 bool HbInputMethod::automaticTextCaseNeeded() const
   854 {
   842 {
   855     Q_D(const HbInputMethod);
   843     Q_D(const HbInputMethod);
   856     return d->automaticTextCaseNeeded();
   844     return d->automaticTextCaseNeeded();
   857 }
   845 }
   858 
   846 
   859 /*!
   847 /*!
   860 Wrapper
   848 Deep copies the input state back to editor interface.
   861 */
   849 */
   862 void HbInputMethod::inputStateToEditor(const HbInputState& source)
   850 void HbInputMethod::inputStateToEditor(const HbInputState& source)
   863 {
   851 {
   864     Q_D(HbInputMethod);
   852     Q_D(HbInputMethod);
   865     d->inputStateToEditor(source);
   853     d->inputStateToEditor(source);
   890     releaseFocus();
   878     releaseFocus();
   891     reset();
   879     reset();
   892 }
   880 }
   893 
   881 
   894 /*!
   882 /*!
   895 This function returns true if there is a context switch happening due to a orientation
   883 \deprecated HbInputMethod::orientationContextSwitchInProgress()
   896 switch.
   884     is deprecated.
   897 */
   885 */
   898 bool HbInputMethod::orientationContextSwitchInProgress()
   886 bool HbInputMethod::orientationContextSwitchInProgress()
   899 {
   887 {
   900     Q_D(HbInputMethod);
   888     Q_D(HbInputMethod);
   901     return d->mIsOrientationContextSwitchInProgress;
   889     return d->mIsOrientationContextSwitchInProgress;