src/hbinput/inputwidgets/hbinputhwtoolcluster.cpp
changeset 6 c3690ec91ef8
parent 2 06ff229162e9
child 30 80e4d18b72f5
equal deleted inserted replaced
5:627c4a0fd0e7 6:c3690ec91ef8
    20 **
    20 **
    21 ** If you have questions regarding the use of this file, please contact
    21 ** If you have questions regarding the use of this file, please contact
    22 ** Nokia at developer.feedback@nokia.com.
    22 ** Nokia at developer.feedback@nokia.com.
    23 **
    23 **
    24 ****************************************************************************/
    24 ****************************************************************************/
       
    25 #include "hbinputhwtoolcluster.h"
    25 
    26 
    26 #include <QGraphicsGridLayout>
    27 #include <QGraphicsGridLayout>
    27 
    28 
    28 #include <hbaction.h>
    29 #include <hbaction.h>
    29 #include <hbinputmethod.h>
    30 #include <hbinputmethod.h>
    34 #include <hbmainwindow.h>
    35 #include <hbmainwindow.h>
    35 #include <hbview.h>
    36 #include <hbview.h>
    36 #include <hbdataform.h>
    37 #include <hbdataform.h>
    37 
    38 
    38 #include "hbinputvkbwidget_p.h"
    39 #include "hbinputvkbwidget_p.h"
    39 #include "hbinputhwtoolcluster.h"
       
    40 #include "hbinputmodeindicator.h"
    40 #include "hbinputmodeindicator.h"
    41 
    41 
    42 const QString HbCustomButtonObjName = "Mini VKB custom button ";
    42 const QString HbCustomButtonObjName = "Mini VKB custom button ";
    43 
    43 
    44 const int HbMiniVirtualKeypadNumberOfColumn = 5;
    44 const int HbMiniVirtualKeypadNumberOfColumn = 5;
    79 /// @endcond
    79 /// @endcond
    80 
    80 
    81 /*!
    81 /*!
    82 Constructs the object.
    82 Constructs the object.
    83 */
    83 */
    84 HbHwToolCluster::HbHwToolCluster(HbInputMethod* owner,
    84 HbHwToolCluster::HbHwToolCluster(HbInputMethod *owner,
    85                                        QGraphicsItem* parent)
    85                                  QGraphicsItem *parent)
    86                                        : HbInputVkbWidget(*new HbHwToolClusterPrivate, parent)
    86     : HbInputVkbWidget(*new HbHwToolClusterPrivate, parent)
    87 {
    87 {
    88     if (0 == owner) {
    88     if (0 == owner) {
    89         return;
    89         return;
    90     }
    90     }
    91     Q_D(HbHwToolCluster);
    91     Q_D(HbHwToolCluster);
   134 
   134 
   135     QSizeF size = preferredKeyboardSize();
   135     QSizeF size = preferredKeyboardSize();
   136     qreal height = size.height() - HbCloseHandleHeight;
   136     qreal height = size.height() - HbCloseHandleHeight;
   137 
   137 
   138     qreal width = size.width() / (qreal)HbMiniVirtualKeypadNumberOfColumn;
   138     qreal width = size.width() / (qreal)HbMiniVirtualKeypadNumberOfColumn;
   139     for (int i=0; i < HbMiniVirtualKeypadNumberOfColumn ;i++) {
   139     for (int i = 0; i < HbMiniVirtualKeypadNumberOfColumn ; i++) {
   140         d->mButtonLayout->setColumnFixedWidth(i, width);
   140         d->mButtonLayout->setColumnFixedWidth(i, width);
   141     }
   141     }
   142     //There is only one row
   142     //There is only one row
   143     d->mButtonLayout->setRowFixedHeight(0, height);
   143     d->mButtonLayout->setRowFixedHeight(0, height);
   144 }
   144 }
   155         QSizeF ret;
   155         QSizeF ret;
   156         //Get the available keypad area from the VKB host
   156         //Get the available keypad area from the VKB host
   157         ret = d->mCurrentHost->keyboardArea();
   157         ret = d->mCurrentHost->keyboardArea();
   158         //Since this is a mini VKB, it has a lesser size than the available
   158         //Since this is a mini VKB, it has a lesser size than the available
   159         //area for the keypad.
   159         //area for the keypad.
   160         ret.setHeight(ret.height()/HbMiniVirtualKeypadReductionFactor);
   160         ret.setHeight(ret.height() / HbMiniVirtualKeypadReductionFactor);
   161         return ret;
   161         return ret;
   162     }
   162     }
   163 
   163 
   164     return ret;
   164     return ret;
   165 }
   165 }
   170 void HbHwToolCluster::showMethodDialog()
   170 void HbHwToolCluster::showMethodDialog()
   171 {
   171 {
   172     Q_D(HbHwToolCluster);
   172     Q_D(HbHwToolCluster);
   173 
   173 
   174     HbInputMethodDescriptor method
   174     HbInputMethodDescriptor method
   175         = HbInputCommonDialogs::showCustomInputMethodSelectionDialog(HbInputSettingProxy::instance()->globalInputLanguage());
   175     = HbInputCommonDialogs::showCustomInputMethodSelectionDialog(HbInputSettingProxy::instance()->globalInputLanguage());
   176     if (!method.isEmpty() && d->mOwner) {
   176     if (!method.isEmpty() && d->mOwner) {
   177         d->mOwner->activateInputMethod(method);
   177         d->mOwner->activateInputMethod(method);
   178     }
   178     }
   179 }
   179 }
   180 
   180