src/hbinput/inputwidgets/hbinputmodeindicator.cpp
changeset 1 f7ac710697a9
parent 0 16d8024aca5e
child 2 06ff229162e9
equal deleted inserted replaced
0:16d8024aca5e 1:f7ac710697a9
    62 void HbInputModeIndicatorPrivate::updatePrediction()
    62 void HbInputModeIndicatorPrivate::updatePrediction()
    63 {
    63 {
    64     const QString predictionOnIcon("qtg_mono_predictive_text_on");
    64     const QString predictionOnIcon("qtg_mono_predictive_text_on");
    65     const QString predictionOffIcon("qtg_mono_predictive_text_off");
    65     const QString predictionOffIcon("qtg_mono_predictive_text_off");
    66 
    66 
    67     if (HbInputSettingProxy::instance()->predictiveInputStatus()) {
    67     //Do not update the indicator if prediction is not allowed in the editor  even though
       
    68     //prediction is active.
       
    69     if (HbInputSettingProxy::instance()->predictiveInputStatusForActiveKeyboard() &&  mFocusObject && 
       
    70                                      mFocusObject->editorInterface().isPredictionAllowed()) {
    68         mButton.setIcon(HbIcon(predictionOnIcon));
    71         mButton.setIcon(HbIcon(predictionOnIcon));
    69     } else {
    72     } else {
    70         mButton.setIcon(HbIcon(predictionOffIcon));
    73         mButton.setIcon(HbIcon(predictionOffIcon));
    71     }
    74     }
    72 }
    75 }
    83 
    86 
    84 \sa HbEditorInterface
    87 \sa HbEditorInterface
    85 */
    88 */
    86 
    89 
    87 /*!
    90 /*!
    88 Constructor.
    91 \deprecated HbInputModeIndicator::HbInputModeIndicator(HbTouchKeypadButton&, QGraphicsWidget*)
    89 @param button the keypad button which shows input mode icon
    92     is deprecated. Use (upcoming) version without HbTouchKeypadButton parameter.
    90 @param parent parent of the widget.
       
    91 */
    93 */
    92 HbInputModeIndicator::HbInputModeIndicator(HbTouchKeypadButton& button, QGraphicsWidget* parent)
    94 HbInputModeIndicator::HbInputModeIndicator(HbTouchKeypadButton& button, QGraphicsWidget* parent)
    93     : QObject(parent)
    95     : QObject(parent)
    94 {
    96 {
    95     mPrivate = new HbInputModeIndicatorPrivate(button);
    97     mPrivate = new HbInputModeIndicatorPrivate(button);
    96     if (mPrivate->mFocusObject) {
    98     if (mPrivate->mFocusObject) {
    97         connect( &mPrivate->mFocusObject->editorInterface(), SIGNAL(modified()), this, SLOT(updateIndicator()));
    99         connect( &mPrivate->mFocusObject->editorInterface(), SIGNAL(modified()), this, SLOT(updateIndicator()));
    98     }
   100     }
    99     connect(HbInputSettingProxy::instance(), SIGNAL(predictiveInputStateChanged(int)), this, SLOT(udpdatePredictionStatus(int)));
   101     connect(HbInputSettingProxy::instance(), SIGNAL(predictiveInputStateChanged(HbKeyboardSettingFlags, bool)), this, SLOT(updatePredictionStatus(HbKeyboardSettingFlags, bool)));
   100     updateIndicator(); // check mode of current editor
   102     updateIndicator(); // check mode of current editor
   101 }
   103 }
   102 
   104 
   103 /*!
   105 /*!
   104 Destroys the widget.
   106 Destroys the widget.
   128 
   130 
   129     mPrivate->updatePrediction();
   131     mPrivate->updatePrediction();
   130 }
   132 }
   131 
   133 
   132 /*!
   134 /*!
       
   135 \deprecated HbInputModeIndicator::udpdatePredictionStatus(int)
       
   136     is deprecated. Use updatePredictionStatus(bool) instead.
       
   137 
   133 Updates prediction status.
   138 Updates prediction status.
   134 */
   139 */
   135 void HbInputModeIndicator::udpdatePredictionStatus(int newStatus)
   140 void HbInputModeIndicator::udpdatePredictionStatus(int newStatus)
   136 {
   141 {
   137    Q_UNUSED(newStatus);
   142     Q_UNUSED(newStatus);
   138    mPrivate->updatePrediction();
   143 }
       
   144 
       
   145 /*!
       
   146 Updates prediction status.
       
   147 */
       
   148 void HbInputModeIndicator::updatePredictionStatus(HbKeyboardSettingFlags keyboardType, bool newStatus)
       
   149 {
       
   150     Q_UNUSED(keyboardType);
       
   151     Q_UNUSED(newStatus);
       
   152     mPrivate->updatePrediction();
   139 }
   153 }
   140 
   154 
   141 // End of file
   155 // End of file
       
   156