src/hbcore/vkbhosts/hbabstractvkbhost.cpp
changeset 30 80e4d18b72f5
parent 28 b7da29130b0e
equal deleted inserted replaced
28:b7da29130b0e 30:80e4d18b72f5
    29 #include "hbinputvirtualkeyboard.h"
    29 #include "hbinputvirtualkeyboard.h"
    30 #include "hbinputsettingproxy.h"
    30 #include "hbinputsettingproxy.h"
    31 #include "hbinputvkbhostbridge.h"
    31 #include "hbinputvkbhostbridge.h"
    32 #include "hbinputmethod.h"
    32 #include "hbinputmethod.h"
    33 #include "hbdeviceprofile.h"
    33 #include "hbdeviceprofile.h"
       
    34 #include "hbscrollarea.h"
    34 #include "hbmainwindow.h"
    35 #include "hbmainwindow.h"
    35 #include "hbpopup.h"
    36 #include "hbpopup.h"
    36 #include "hbview.h"
    37 #include "hbview.h"
    37 #include "hbwidgetfeedback.h"
    38 #include "hbwidgetfeedback.h"
    38 #include "hbinstance.h"
    39 #include "hbinstance.h"
    40 #include <QTextEdit>
    41 #include <QTextEdit>
    41 
    42 
    42 const int HbAnimationTime = 200;
    43 const int HbAnimationTime = 200;
    43 const qreal HbHeightVerticalFactor = 0.5;
    44 const qreal HbHeightVerticalFactor = 0.5;
    44 const qreal HbHeightHorizFactor = 0.7;
    45 const qreal HbHeightHorizFactor = 0.7;
       
    46 const qreal HbEditorExtraMargin = 17.0;
    45 
    47 
    46 const QString KHandWritingName("Handwriting");
    48 const QString KHandWritingName("Handwriting");
    47 // see hbpopup.cpp for this
    49 // see hbpopup.cpp for this
    48 extern const char* KPositionManagedByVKB;
    50 extern const char* KPositionManagedByVKB;
    49 
    51 
    50 /// @cond
    52 /// @cond
    51 
    53 
    52 HbVkbHostContainerWidget::HbVkbHostContainerWidget(QObject *containterWidget)
    54 HbVkbHostContainerWidget::HbVkbHostContainerWidget(QObject *containerWidget)
    53     : mContainerWidget(containterWidget)
    55 {
    54 {
    56     mGraphicsObject = qobject_cast<QGraphicsObject*>(containerWidget);
    55 }
    57     if (!mGraphicsObject) {
    56 
    58         mWidget = qobject_cast<QWidget*>(containerWidget);
    57 // sets container widgets position to new position.
    59     }
       
    60 }
       
    61 
       
    62 /*!
       
    63 \internal
       
    64 Sets container widgets position to new position.
       
    65 */
    58 void HbVkbHostContainerWidget::setPos(QPointF newPosition)
    66 void HbVkbHostContainerWidget::setPos(QPointF newPosition)
    59 {
    67 {
    60     if (mContainerWidget) {
    68     if (mGraphicsObject) {
    61         QGraphicsObject *graphicsObject = qobject_cast<QGraphicsObject *>(mContainerWidget);
    69         mGraphicsObject->setPos(newPosition);
    62         if (graphicsObject) {
    70         return;
    63             graphicsObject->setPos(newPosition);
    71     }
    64             return;
    72 
    65         }
    73     if (mWidget) {
    66 
       
    67         QWidget *qWidget = qobject_cast<QWidget *>(mContainerWidget);
       
    68         if (qWidget) {
       
    69 #ifdef Q_WS_WIN
    74 #ifdef Q_WS_WIN
    70             QPoint finalPosition = newPosition.toPoint();
    75         QPoint finalPosition = newPosition.toPoint();
    71             finalPosition -= qWidget->geometry().topLeft() - qWidget->frameGeometry().topLeft();
    76         finalPosition -= mWidget->geometry().topLeft() - mWidget->frameGeometry().topLeft();
    72             qWidget->move(finalPosition);
    77         mWidget->move(finalPosition);
    73 #else
    78 #else
    74             qWidget->move(newPosition.toPoint());
    79         mWidget->move(newPosition.toPoint());
    75 #endif
    80 #endif
    76             return;
    81         return;
    77         }
    82     }
    78     }
    83 }
    79 }
    84 
    80 
    85 /*!
    81 // returns the global position, if container widget is a QGraphicsObject, it returns
    86 \internal
    82 // scene position. In case the widget is QWidget it returns global co-ordinates
    87 Returns the global position, if container widget is a QGraphicsObject, it returns
       
    88 scene position. In case the widget is QWidget it returns global co-ordinates
       
    89 */
    83 QPointF HbVkbHostContainerWidget::pos()
    90 QPointF HbVkbHostContainerWidget::pos()
    84 {
    91 {
    85     if (mContainerWidget) {
    92     if (mGraphicsObject) {
    86         QGraphicsObject *graphicsObject = qobject_cast<QGraphicsObject *>(mContainerWidget);
    93         return mGraphicsObject->pos();
    87         if (graphicsObject) {
    94     }
    88             return graphicsObject->pos();;
    95 
    89         }
    96     if (mWidget) {
    90 
    97         return mWidget->mapToGlobal(QPoint(0, 0));
    91         QWidget *qWidget = qobject_cast<QWidget *>(mContainerWidget);
       
    92         if (qWidget) {
       
    93             return qWidget->mapToGlobal(QPoint(0, 0));
       
    94         }
       
    95     }
    98     }
    96 
    99 
    97     return QPointF(0, 0);
   100     return QPointF(0, 0);
    98 }
   101 }
    99 
   102 
   100 // returns the bounding rect in global co-ordinate, if container widget is a QGraphicsObject
   103 /*!
   101 // it returns in scene co-ordinate, incase widget is QWidget it returns in global co-ordinate
   104 \internal
       
   105 Returns the bounding rect in global co-ordinate, if container widget is a QGraphicsObject
       
   106 it returns in scene co-ordinate, incase widget is QWidget it returns in global co-ordinate
       
   107 */
   102 QRectF HbVkbHostContainerWidget::sceneBoundingRect()
   108 QRectF HbVkbHostContainerWidget::sceneBoundingRect()
   103 {
   109 {
   104     if (mContainerWidget) {
   110     if (mGraphicsObject) {
   105         QGraphicsObject *graphicsObject = qobject_cast<QGraphicsObject *>(mContainerWidget);
   111         return mGraphicsObject->sceneBoundingRect();
   106         if (graphicsObject) {
   112     }
   107             return graphicsObject->sceneBoundingRect();;
   113 
   108         }
   114     if (mWidget) {
   109 
   115         return QRectF(mWidget->mapToGlobal(QPoint(0, 0)), mWidget->size());
   110         QWidget *qWidget = qobject_cast<QWidget *>(mContainerWidget);
       
   111         if (qWidget) {
       
   112             return QRectF(qWidget->mapToGlobal(QPoint(0, 0)), qWidget->size());
       
   113         }
       
   114     }
   116     }
   115 
   117 
   116     return QRectF(0, 0, 0, 0);
   118     return QRectF(0, 0, 0, 0);
   117 }
   119 }
   118 
   120 
   119 // connect container specific signals here.
   121 /*!
       
   122 \internal
       
   123 Connects ontainer specific signals.
       
   124 */
   120 void HbVkbHostContainerWidget::connectSignals(QObject *receiver)
   125 void HbVkbHostContainerWidget::connectSignals(QObject *receiver)
   121 {
   126 {
   122     if (qobject_cast<QGraphicsObject *> (mContainerWidget)) {
   127     if (mGraphicsObject) {
   123         QObject::connect(mContainerWidget, SIGNAL(yChanged()),
   128         QObject::connect(mGraphicsObject, SIGNAL(yChanged()),
   124                          receiver, SLOT(ensureCursorVisibility()));
   129                          receiver, SLOT(ensureCursorVisibility()));
   125     }
   130     }
   126 
   131 
   127     HbPopup *popup = qobject_cast<HbPopup *>(mContainerWidget);
   132     HbPopup *popup = qobject_cast<HbPopup *>(mGraphicsObject);
   128     if (popup) {
   133     if (popup) {
   129         QObject::connect(popup, SIGNAL(aboutToHide()), receiver, SLOT(containerAboutToClose()));
   134         QObject::connect(popup, SIGNAL(aboutToHide()), receiver, SLOT(_q_containerAboutToClose()));
   130     }
   135     }
   131 
   136 
   132     HbView *view = qobject_cast<HbView *>(mContainerWidget);
   137     HbView *view = qobject_cast<HbView *>(mGraphicsObject);
   133     if (view) {
   138     if (view) {
   134         QObject::connect(view->mainWindow(), SIGNAL(currentViewChanged(HbView *)),
   139         QObject::connect(view->mainWindow(), SIGNAL(currentViewChanged(HbView *)),
   135                          receiver, SLOT(currentViewChanged(HbView *)));
   140                          receiver, SLOT(_q_containerAboutToClose()));
   136     }
   141     }
   137 }
   142 }
   138 
   143 
   139 // disconnect container specific signals here.
   144 /*!
       
   145 \internal
       
   146 Disconnects container specific signals.
       
   147 */
   140 void HbVkbHostContainerWidget::disconnectSignals(QObject *receiver)
   148 void HbVkbHostContainerWidget::disconnectSignals(QObject *receiver)
   141 {
   149 {
   142     if (qobject_cast<QGraphicsObject *> (mContainerWidget)) {
   150     if (mGraphicsObject) {
   143         QObject::disconnect(mContainerWidget, SIGNAL(yChanged()),
   151         QObject::disconnect(mGraphicsObject, SIGNAL(yChanged()),
   144                             receiver, SLOT(ensureCursorVisibility()));
   152                             receiver, SLOT(ensureCursorVisibility()));
   145     }
   153     }
   146 
   154 
   147     HbPopup *popup = qobject_cast<HbPopup *>(mContainerWidget);
   155     HbPopup *popup = qobject_cast<HbPopup *>(mGraphicsObject);
   148     if (popup) {
   156     if (popup) {
   149         QObject::disconnect(popup, SIGNAL(aboutToHide()), receiver, SLOT(containerAboutToClose()));
   157         QObject::disconnect(popup, SIGNAL(aboutToHide()), receiver, SLOT(_q_containerAboutToClose()));
   150     }
   158     }
   151 
   159 
   152     HbPopup *view = qobject_cast<HbPopup *>(mContainerWidget);
   160     HbPopup *view = qobject_cast<HbPopup *>(mGraphicsObject);
   153     if (view) {
   161     if (view) {
   154         QObject::disconnect(view->mainWindow(), SIGNAL(currentViewChanged(HbView *)),
   162         QObject::disconnect(view->mainWindow(), SIGNAL(currentViewChanged(HbView *)),
   155                             receiver, SLOT(currentViewChanged(HbView *)));
   163                             receiver, SLOT(_q_containerAboutToClose()));
   156     }
   164     }
   157 }
   165 }
   158 
   166 
   159 /// @endcond
   167 /// @endcond
   160 
   168 
   161 /*!
   169 /*!
   162 \proto
   170 \proto
       
   171 @hbcore
   163 \class HbAbstractVkbHost
   172 \class HbAbstractVkbHost
   164 \brief Base class for HbCore's virtual keyboard hosts.
   173 \brief Base class for HbCore's virtual keyboard hosts.
   165 
   174 
   166 This class contains common code for HbCore's virtual keyboard hosts.
   175 This class contains common code for HbCore's virtual keyboard hosts.
   167 */
   176 */
   192 HbAbstractVkbHostPrivate::~HbAbstractVkbHostPrivate()
   201 HbAbstractVkbHostPrivate::~HbAbstractVkbHostPrivate()
   193 {
   202 {
   194     delete mContainerWidget;
   203     delete mContainerWidget;
   195 }
   204 }
   196 
   205 
       
   206 /*!
       
   207 \internal
       
   208 Initializes starting values to parameters needed for running the keypad and
       
   209 container widget animation effects.
       
   210 */
   197 void HbAbstractVkbHostPrivate::prepareAnimationsCommon()
   211 void HbAbstractVkbHostPrivate::prepareAnimationsCommon()
   198 {
   212 {
   199     if (mContainerWidget->widgetObject() && mKeypad) {
   213     if (mContainerWidget && mContainerWidget->widgetObject() && mKeypad) {
   200         // If the keyboard is not already open, remember the original position.
   214         // If the keyboard is not already open, remember the original position.
   201         // That is where the container will eventually be returned to.
   215         // That is where the container will eventually be returned to.
   202         if (mKeypadStatus == HbVkbHost::HbVkbStatusClosed) {
   216         if (mKeypadStatus == HbVkbHost::HbVkbStatusClosed) {
   203             mOriginalContainerPosition = mContainerWidget->pos();
   217             mOriginalContainerPosition = mContainerWidget->pos();
   204         }
   218         }
   210         mContainerMovementStartingPoint = mContainerWidget->pos();
   224         mContainerMovementStartingPoint = mContainerWidget->pos();
   211         mKeypadMovementStartingPoint = mKeypad->pos();
   225         mKeypadMovementStartingPoint = mKeypad->pos();
   212     }
   226     }
   213 
   227 
   214     mScreenSize = screenSize();
   228     mScreenSize = screenSize();
   215 }
   229 
   216 
   230     // Make sure that the editor is completely visible inside a scrol area.
   217 // TODO: could be in vkb geometry engine
   231     ensureVisibilityInsideScrollArea();
       
   232 }
       
   233 
       
   234 /*!
       
   235 \internal
       
   236 Sets up view and focus object variables.
       
   237 */
   218 bool HbAbstractVkbHostPrivate::getViewAndFocusObjects(HbView*& currentView, HbInputFocusObject*& focusObject)
   238 bool HbAbstractVkbHostPrivate::getViewAndFocusObjects(HbView*& currentView, HbInputFocusObject*& focusObject)
   219 {    
   239 {
   220     if (!mKeypad || !mInputMethod || !mContainerWidget ) {
   240     if (!mKeypad || !mInputMethod || !mContainerWidget ) {
   221         return false;
   241         return false;
   222     }
   242     }
   223 
   243 
   224     HbMainWindow* window = mainWindow();
   244     HbMainWindow* window = mainWindow();
   237     }
   257     }
   238 
   258 
   239     return true;
   259     return true;
   240 }
   260 }
   241 
   261 
       
   262 /*!
       
   263 \internal
       
   264 Sets up the container widget animation effect.
       
   265 */
   242 bool HbAbstractVkbHostPrivate::prepareContainerAnimation(HbVkbHost::HbVkbStatus status)
   266 bool HbAbstractVkbHostPrivate::prepareContainerAnimation(HbVkbHost::HbVkbStatus status)
   243 {
   267 {
   244     // Init and check main objects
   268     // Init and check main objects
   245     HbView* currentView = NULL;
   269     HbView* currentView = 0;
   246     HbInputFocusObject* focusObject = NULL;
   270     HbInputFocusObject* focusObject = 0;
   247     if (!getViewAndFocusObjects(currentView, focusObject)) {
   271     if (!getViewAndFocusObjects(currentView, focusObject)) {
   248         return false;
   272         return false;
   249     }
   273     }
   250 
   274 
   251     // Init parameters before calling...
   275     // Init parameters before calling...
   252     QSizeF keypadSize = mKeypad->size();
   276     QSizeF keypadSize = mKeypad->size();
   253     QRectF viewRect = currentView->sceneBoundingRect();
   277     QRectF viewRect = currentView->sceneBoundingRect();
       
   278     bool isPopupType = qobject_cast<HbPopup *>(mContainerWidget->widgetObject()) != NULL;
   254     bool vkbOpen = mKeypadStatus == HbVkbHost::HbVkbStatusOpened;
   279     bool vkbOpen = mKeypadStatus == HbVkbHost::HbVkbStatusOpened;
   255     bool titlebarVisible = currentView->isItemVisible(Hb::TitleBarItem);
   280     bool titlebarVisible = currentView->isItemVisible(Hb::TitleBarItem);
   256     bool statusbarVisible = currentView->isItemVisible(Hb::StatusBarItem);
   281     bool statusbarVisible = currentView->isItemVisible(Hb::StatusBarItem);
   257     QRectF containerRect = mContainerWidget->sceneBoundingRect();
   282     QRectF containerRect = mContainerWidget->sceneBoundingRect();
   258     QRectF editorRect = focusObject->editorGeometry();
   283     QRectF editorRect = focusObject->editorGeometry();
   262         // Initialize geometry calculation unit to handle all geometry calculations.
   287         // Initialize geometry calculation unit to handle all geometry calculations.
   263         HbVkbGeometryLogicPrivate unit = HbVkbGeometryLogicPrivate(
   288         HbVkbGeometryLogicPrivate unit = HbVkbGeometryLogicPrivate(
   264                 mScreenSize,
   289                 mScreenSize,
   265                 keypadSize,
   290                 keypadSize,
   266                 viewRect,
   291                 viewRect,
       
   292                 isPopupType,
   267                 vkbOpen,
   293                 vkbOpen,
   268                 titlebarVisible,
   294                 titlebarVisible,
   269                 statusbarVisible,
   295                 statusbarVisible,
   270                 containerRect,
   296                 containerRect,
   271                 editorRect,
   297                 editorRect,
   275     }
   301     }
   276 
   302 
   277     return false;
   303     return false;
   278 }
   304 }
   279 
   305 
       
   306 /*!
       
   307 \internal
       
   308 Sets up the keypad widget animation effect.
       
   309 */
   280 bool HbAbstractVkbHostPrivate::prepareKeypadAnimation(HbVkbHost::HbVkbStatus status)
   310 bool HbAbstractVkbHostPrivate::prepareKeypadAnimation(HbVkbHost::HbVkbStatus status)
   281 {
   311 {
   282     if (status == HbVkbHost::HbVkbStatusOpened) {
   312     if (mKeypad) {
   283         if (mKeypadStatus == HbVkbHost::HbVkbStatusClosed) {
   313         if (status == HbVkbHost::HbVkbStatusOpened) {
   284             // Set up keyboard open animation.
   314             if (mKeypadStatus == HbVkbHost::HbVkbStatusClosed) {
   285             mKeypadMovementStartingPoint.setY(mScreenSize.height());
   315                 // Set up keyboard open animation.
   286             mKeypadMovementVector.setY(-mKeypad->size().height());
   316                 mKeypadMovementStartingPoint.setY(mScreenSize.height());
   287             if (!disableCursorShift()) {
   317                 mKeypadMovementVector.setY(-mKeypad->size().height());
   288                 // Initialize keypad position
   318                 if (!disableCursorShift()) {
   289                 mKeypad->setPos(mKeypadMovementStartingPoint);
   319                     // Initialize keypad position
       
   320                     mKeypad->setPos(mKeypadMovementStartingPoint);
       
   321                 }
       
   322                 return true;
       
   323             } else if (mKeypadStatus == HbVkbHost::HbVkbStatusMinimized && mCallback) {
       
   324                 mKeypadMovementVector.setY(-(mKeypad->size().height() - mCallback->minimizedKeyboardSize().height()));
       
   325                 return true;
   290             }
   326             }
       
   327         } else {
       
   328             // It is going to be closed.
       
   329             mKeypadMovementVector = QPointF(0, mKeypad->size().height());
   291             return true;
   330             return true;
   292         } else if (mKeypadStatus == HbVkbHost::HbVkbStatusMinimized && mCallback) {
   331         }
   293             mKeypadMovementVector.setY(-(mKeypad->size().height() - mCallback->minimizedKeyboardSize().height()));
       
   294             return true;
       
   295         }
       
   296     } else if (status == HbVkbHost::HbVkbStatusMinimized && mCallback) {
       
   297         mKeypadMovementVector = QPointF(0, mKeypad->size().height() - mCallback->minimizedKeyboardSize().height());
       
   298         return true;
       
   299     } else {
       
   300         // It is going to be closed.
       
   301         mKeypadMovementVector = QPointF(0, mKeypad->size().height());
       
   302         return true;
       
   303     }
   332     }
   304 
   333 
   305     return false;
   334     return false;
   306 }
   335 }
   307 
   336 
       
   337 /*!
       
   338 \internal
       
   339 Sets up all the animation effects.
       
   340 */
   308 bool HbAbstractVkbHostPrivate::prepareAnimations(HbVkbHost::HbVkbStatus status)
   341 bool HbAbstractVkbHostPrivate::prepareAnimations(HbVkbHost::HbVkbStatus status)
   309 {
   342 {
   310     prepareAnimationsCommon();
   343     prepareAnimationsCommon();
   311 
   344 
   312     bool containerResult = prepareContainerAnimation(status);
   345     bool containerResult = prepareContainerAnimation(status);
   321     }
   354     }
   322 
   355 
   323     return (containerResult | prepareKeypadAnimation(status));
   356     return (containerResult | prepareKeypadAnimation(status));
   324 }
   357 }
   325 
   358 
       
   359 /*!
       
   360 \internal
       
   361 Connects orientation change, view switching and possible other related signals.
       
   362 */
   326 void HbAbstractVkbHostPrivate::connectSignals()
   363 void HbAbstractVkbHostPrivate::connectSignals()
   327 {
   364 {
   328     mContainerWidget->connectSignals(q_ptr);
   365     mContainerWidget->connectSignals(q_ptr);
   329 
   366 
   330     // global signal not specific to any containter widget, can be connected now.
   367     // global signal not specific to any containter widget, can be connected now.
   334         q_ptr->connect(mainWindow, SIGNAL(orientationChanged(Qt::Orientation)), q_ptr, SLOT(orientationChanged(Qt::Orientation)));
   371         q_ptr->connect(mainWindow, SIGNAL(orientationChanged(Qt::Orientation)), q_ptr, SLOT(orientationChanged(Qt::Orientation)));
   335         q_ptr->connect(mainWindow, SIGNAL(aboutToChangeView(HbView *, HbView *)), q_ptr, SLOT(aboutToChangeView(HbView *, HbView *)));
   372         q_ptr->connect(mainWindow, SIGNAL(aboutToChangeView(HbView *, HbView *)), q_ptr, SLOT(aboutToChangeView(HbView *, HbView *)));
   336     }
   373     }
   337 }
   374 }
   338 
   375 
       
   376 /*!
       
   377 \internal
       
   378 Disconnects orientation change, view switching and possible other related signals.
       
   379 */
   339 void HbAbstractVkbHostPrivate::disconnectSignals()
   380 void HbAbstractVkbHostPrivate::disconnectSignals()
   340 {
   381 {
   341     mContainerWidget->disconnectSignals(q_ptr);
   382     mContainerWidget->disconnectSignals(q_ptr);
   342 
   383 
   343     // global signal not specific to any containter widget, can be connected now.
   384     // global signal not specific to any containter widget, can be connected now.
   347         q_ptr->disconnect(mainWindow, SIGNAL(orientationChanged(Qt::Orientation)), q_ptr, SLOT(orientationChanged(Qt::Orientation)));
   388         q_ptr->disconnect(mainWindow, SIGNAL(orientationChanged(Qt::Orientation)), q_ptr, SLOT(orientationChanged(Qt::Orientation)));
   348         q_ptr->disconnect(mainWindow, SIGNAL(aboutToChangeView(HbView *, HbView *)), q_ptr, SLOT(aboutToChangeView(HbView *, HbView *)));
   389         q_ptr->disconnect(mainWindow, SIGNAL(aboutToChangeView(HbView *, HbView *)), q_ptr, SLOT(aboutToChangeView(HbView *, HbView *)));
   349     }
   390     }
   350 }
   391 }
   351 
   392 
       
   393 /*!
       
   394 \internal
       
   395 Opens the keypad widget with animation effect.
       
   396 */
   352 void HbAbstractVkbHostPrivate::openKeypad()
   397 void HbAbstractVkbHostPrivate::openKeypad()
   353 {
   398 {
   354     if (mContainerWidget->widgetObject()) {
   399     if (mContainerWidget->widgetObject()) {
   355         HbMainWindow *mainWin = mainWindow();
   400         HbMainWindow *mainWin = mainWindow();
   356         if (mainWin && mKeypad) {
   401         if (mainWin && mKeypad) {
   358                 // Add keypad to scene if it is not already in there.
   403                 // Add keypad to scene if it is not already in there.
   359                 mainWin->scene()->addItem(mKeypad);
   404                 mainWin->scene()->addItem(mKeypad);
   360             }
   405             }
   361 
   406 
   362             if (mKeypadStatus != HbVkbHost::HbVkbStatusOpened) {
   407             if (mKeypadStatus != HbVkbHost::HbVkbStatusOpened) {
   363                 mCallback->aboutToOpen(q_ptr);
   408                 if (mCallback) {
       
   409                     mCallback->aboutToOpen(q_ptr);
       
   410                 }
   364                 q_ptr->resizeKeyboard(); // Make sure that the keyboard doesn't exceed given boundaries.
   411                 q_ptr->resizeKeyboard(); // Make sure that the keyboard doesn't exceed given boundaries.
   365             }
   412             }
   366 
   413 
   367             if (prepareAnimations(HbVkbHost::HbVkbStatusOpened)) {
   414             if (prepareAnimations(HbVkbHost::HbVkbStatusOpened)) {
   368                 // hide the title bar and status bar when opening the vkb
   415                 // hide the title bar and status bar when opening the vkb
   374             }
   421             }
   375         }
   422         }
   376     }
   423     }
   377 }
   424 }
   378 
   425 
       
   426 /*!
       
   427 \internal
       
   428 Closes the keypad with animation effect.
       
   429 */
   379 void HbAbstractVkbHostPrivate::closeKeypad()
   430 void HbAbstractVkbHostPrivate::closeKeypad()
   380 {
   431 {  
   381     // Since the keypad is already in a minimized state we should not play animation.
       
   382     if (mKeypadStatus == HbVkbHost::HbVkbStatusMinimized) {
       
   383         closeKeypadWithoutAnimation();
       
   384     }
       
   385 
       
   386     if (mKeypadStatus != HbVkbHost::HbVkbStatusClosed) {
   432     if (mKeypadStatus != HbVkbHost::HbVkbStatusClosed) {
   387         mCallback->aboutToClose(q_ptr);
   433         if (mCallback) {
       
   434             mCallback->aboutToClose(q_ptr);
       
   435         }
   388 
   436 
   389         if (prepareAnimations(HbVkbHost::HbVkbStatusClosed)) {
   437         if (prepareAnimations(HbVkbHost::HbVkbStatusClosed)) {
   390             // show the title bar and status bar when closing the vkb   
   438             // show the title bar and status bar when closing the vkb   
   391             setTitleAndStatusBarVisible(true);
   439             setTitleAndStatusBarVisible(true);
   392 
   440 
   394             mTimeLine.start();
   442             mTimeLine.start();
   395         }
   443         }
   396     }
   444     }
   397 }
   445 }
   398 
   446 
   399 void HbAbstractVkbHostPrivate::minimizeKeypad()
   447 /*!
   400 {
   448 \internal
   401     if (mCallback && mKeypadStatus != HbVkbHost::HbVkbStatusMinimized) {
   449 Opens the keypad widget without animation effect.
   402         mCallback->aboutToClose(q_ptr);
   450 */
   403         if (mContainerWidget->widgetObject()) {
       
   404             if (prepareAnimations(HbVkbHost::HbVkbStatusMinimized)) {
       
   405                 //show the title bar and status bar when minimizing the vkb     
       
   406                 setTitleAndStatusBarVisible(true);
       
   407 
       
   408                 mKeypadStatus = HbVkbHost::HbVkbStatusMinimized;
       
   409                 mTimeLine.start();
       
   410             }
       
   411         }
       
   412     }
       
   413 }
       
   414 
       
   415 void HbAbstractVkbHostPrivate::openKeypadWithoutAnimation()
   451 void HbAbstractVkbHostPrivate::openKeypadWithoutAnimation()
   416 {
   452 {
   417     HbMainWindow *mainWin = mainWindow();
   453     HbMainWindow *mainWin = mainWindow();
   418     if (mKeypadStatus != HbVkbHost::HbVkbStatusOpened && mKeypad && mContainerWidget->widgetObject() && mainWin) {
   454     if (mKeypadStatus != HbVkbHost::HbVkbStatusOpened && mKeypad && mContainerWidget->widgetObject() && mainWin) {
   419         if (mKeypad->scene() != mainWin->scene()) {
   455         if (mKeypad->scene() != mainWin->scene()) {
   420             // Add item to scene if it is not already in there.
   456             // Add item to scene if it is not already in there.
   421             mainWin->scene()->addItem(mKeypad);
   457             mainWin->scene()->addItem(mKeypad);
   422         }
   458         }
   423 
   459 
   424         if (mKeypadStatus != HbVkbHost::HbVkbStatusOpened) {
   460         if (mKeypadStatus != HbVkbHost::HbVkbStatusOpened) {
   425             mCallback->aboutToOpen(q_ptr);
   461             if (mCallback) {
       
   462                 mCallback->aboutToOpen(q_ptr);
       
   463             }
   426             q_ptr->resizeKeyboard(); // Make sure that the keyboard doesn't exceed given boundaries.
   464             q_ptr->resizeKeyboard(); // Make sure that the keyboard doesn't exceed given boundaries.
   427         }
   465         }
   428         if (prepareAnimations(HbVkbHost::HbVkbStatusOpened)) {
   466         if (prepareAnimations(HbVkbHost::HbVkbStatusOpened)) {
   429             // hide the title bar and status bar when opening the vkb       
   467             // hide the title bar and status bar when opening the vkb       
   430             setTitleAndStatusBarVisible(false);
   468             setTitleAndStatusBarVisible(false);
   436                 // Move the keypad
   474                 // Move the keypad
   437                 mKeypad->setPos(mKeypadMovementStartingPoint + mKeypadMovementVector);
   475                 mKeypad->setPos(mKeypadMovementStartingPoint + mKeypadMovementVector);
   438             }
   476             }
   439 
   477 
   440             mKeypadStatus = HbVkbHost::HbVkbStatusOpened;
   478             mKeypadStatus = HbVkbHost::HbVkbStatusOpened;
   441             mCallback->keyboardOpened(q_ptr);
   479             if (mCallback) {
   442         }
   480                 mCallback->keyboardOpened(q_ptr);
   443     }
       
   444 }
       
   445 
       
   446 void HbAbstractVkbHostPrivate::openMinimizedKeypad()
       
   447 {
       
   448     // No need of any animation as this minimized keypad is very small to be a candidate for an
       
   449     // animation.
       
   450     HbMainWindow *mainWin = mainWindow();
       
   451     if (mainWin && mKeypad && mContainerWidget->widgetObject()) {
       
   452         if (mKeypad->scene() != mainWin->scene()) {
       
   453             // Add item to scene if it is not already in there.
       
   454             mainWin->scene()->addItem(mKeypad);
       
   455         }
       
   456 
       
   457         if (mKeypadStatus != HbVkbHost::HbVkbStatusMinimized) {
       
   458             mCallback->aboutToOpen(q_ptr);
       
   459             q_ptr->resizeKeyboard(); // Make sure that the keyboard doesn't exceed given boundaries.
       
   460         }
       
   461 
       
   462         if (prepareAnimations(HbVkbHost::HbVkbStatusMinimized)) {
       
   463             if (!disableCursorShift()) {
       
   464                 mKeypad->setPos(0.0, mScreenSize.height() - mCallback->minimizedKeyboardSize().height());
       
   465             }
   481             }
   466             mKeypadStatus = HbVkbHost::HbVkbStatusMinimized;
   482         }
   467             mCallback->keyboardMinimized(q_ptr);
   483     }
   468         }
   484 }
   469     }
   485 
   470 }
   486 /*!
   471 
   487 \internal
       
   488 Closes the keypad widget without animating it.
       
   489 */
   472 void HbAbstractVkbHostPrivate::closeKeypadWithoutAnimation()
   490 void HbAbstractVkbHostPrivate::closeKeypadWithoutAnimation()
   473 {
   491 {
   474     if (mKeypadStatus != HbVkbHost::HbVkbStatusClosed && mKeypad) {
   492     if (mKeypadStatus != HbVkbHost::HbVkbStatusClosed && mKeypad && mCallback) {
   475         mCallback->aboutToClose(q_ptr);
   493         mCallback->aboutToClose(q_ptr);
       
   494 
   476         // show the title bar and status bar when closing the vkb
   495         // show the title bar and status bar when closing the vkb
   477         setTitleAndStatusBarVisible(true);
   496         setTitleAndStatusBarVisible(true);
   478 
   497 
   479         // Set original content widget position
   498         // Set original content widget position
   480         mKeypadStatus = HbVkbHost::HbVkbStatusClosed;
   499         mKeypadStatus = HbVkbHost::HbVkbStatusClosed;
   484             mContainerWidget->setPos(mOriginalContainerPosition);
   503             mContainerWidget->setPos(mOriginalContainerPosition);
   485             mContainerWidget->widgetObject()->setProperty(KPositionManagedByVKB, false );
   504             mContainerWidget->widgetObject()->setProperty(KPositionManagedByVKB, false );
   486         }
   505         }
   487 
   506 
   488         // Hide the keypad
   507         // Hide the keypad
   489         mKeypad->hide();
   508         mKeypad->hide();        
   490         mCallback->keyboardClosed(q_ptr);
   509         mCallback->keyboardClosed(q_ptr);
   491         mCallback = 0;
   510         mCallback = 0;
   492     }
   511     }
   493 }
   512 }
   494 
   513 
   495 void HbAbstractVkbHostPrivate::minimizeKeypadWithoutAnimation()
   514 /*!
   496 {
   515 \internal
   497     HbMainWindow *mainWin = mainWindow();
   516 Cancels the ongoing keypad animation and resets the timeline timer.
   498     if (mKeypadStatus != HbVkbHost::HbVkbStatusMinimized && mKeypad && mainWin) {
   517 */
   499         mCallback->aboutToClose(q_ptr);
       
   500         if (mKeypad->scene() != mainWin->scene()) {
       
   501             // Add item to scene if it is not already in there.
       
   502             mainWin->scene()->addItem(mKeypad);
       
   503         }
       
   504         // show the title bar and status bar when minimizing the vkb
       
   505         setTitleAndStatusBarVisible(true);
       
   506 
       
   507         mKeypadStatus = HbVkbHost::HbVkbStatusMinimized;
       
   508         if (!disableCursorShift()) {
       
   509             // Return the container widget to original position.
       
   510             mContainerWidget->setPos(mOriginalContainerPosition);
       
   511 
       
   512             // Set the keypad to minimized position.
       
   513             mKeypad->setPos(QPointF(0.0, mScreenSize.height() - mCallback->minimizedKeyboardSize().height()));
       
   514         }
       
   515     }
       
   516 }
       
   517 
       
   518 void HbAbstractVkbHostPrivate::cancelAnimationAndHideVkbWidget()
   518 void HbAbstractVkbHostPrivate::cancelAnimationAndHideVkbWidget()
   519 {
   519 {
   520     if (mTimeLine.state() == QTimeLine::Running) {
   520     if (mTimeLine.state() == QTimeLine::Running) {
   521         mTimeLine.stop();
   521         mTimeLine.stop();
   522 
   522 
   523         if (!disableCursorShift()) {
   523         if (!disableCursorShift() && mContainerWidget && mContainerWidget->widgetObject()) {
   524             mContainerWidget->setPos(mOriginalContainerPosition);
   524             mContainerWidget->setPos(mOriginalContainerPosition);
   525             mContainerWidget->widgetObject()->setProperty(KPositionManagedByVKB, false );
   525             mContainerWidget->widgetObject()->setProperty(KPositionManagedByVKB, false );
   526         }
   526         }
   527 
   527 
   528         if (mKeypad) {
   528         if (mKeypad) {
   536         HbVkbHostBridge::instance()->connectHost(0);
   536         HbVkbHostBridge::instance()->connectHost(0);
   537         mKeypadStatus = HbVkbHost::HbVkbStatusClosed;
   537         mKeypadStatus = HbVkbHost::HbVkbStatusClosed;
   538     }
   538     }
   539 }
   539 }
   540 
   540 
       
   541 /*!
       
   542 \internal
       
   543 Returns pointer to container's main window (if one exists).
       
   544 */
   541 HbMainWindow *HbAbstractVkbHostPrivate::mainWindow() const
   545 HbMainWindow *HbAbstractVkbHostPrivate::mainWindow() const
   542 {
   546 {
   543     HbWidget *hbWidget = qobject_cast<HbWidget *>(mContainerWidget->widgetObject());
   547     HbWidget *hbWidget = qobject_cast<HbWidget *>(mContainerWidget->widgetObject());
   544     if (hbWidget) {
   548     if (hbWidget) {
   545         return hbWidget->mainWindow();
   549         return hbWidget->mainWindow();
   553 
   557 
   554     // no mainwindow.
   558     // no mainwindow.
   555     return 0;
   559     return 0;
   556 }
   560 }
   557 
   561 
       
   562 /*!
       
   563 \internal
       
   564 Returns screen size.
       
   565 */
   558 QSizeF HbAbstractVkbHostPrivate::screenSize() const
   566 QSizeF HbAbstractVkbHostPrivate::screenSize() const
   559 {
   567 {
   560     HbMainWindow *mainWin = mainWindow();
   568     HbMainWindow *mainWin = mainWindow();
   561     QSizeF result = static_cast<QSizeF>(HbDeviceProfile::profile(mainWin).logicalSize());
   569     QSizeF result = static_cast<QSizeF>(HbDeviceProfile::profile(mainWin).logicalSize());
   562 
   570 
   591     if (mainWindow() && mainWindow()->orientation() == Qt::Horizontal && imName == KHandWritingName) {
   599     if (mainWindow() && mainWindow()->orientation() == Qt::Horizontal && imName == KHandWritingName) {
   592         return true;
   600         return true;
   593     }
   601     }
   594     return false;
   602     return false;
   595 }
   603 }
       
   604 
       
   605 /*!
       
   606 \internal
       
   607 Sets title and status bar visibility.
       
   608 */
   596 void HbAbstractVkbHostPrivate::setTitleAndStatusBarVisible(bool visible)
   609 void HbAbstractVkbHostPrivate::setTitleAndStatusBarVisible(bool visible)
   597 {
   610 {
   598     // should not change the title bar and status bar visibility when the keypad is opened from a popup
   611     // should not change the title bar and status bar visibility when the keypad is opened from a popup
   599     HbPopup *popup = qobject_cast<HbPopup *>(mContainerWidget->widgetObject());
   612     HbPopup *popup = qobject_cast<HbPopup *>(mContainerWidget->widgetObject());
   600     if (popup) {
   613     if (popup) {
   601         return;
   614         return;
   602     }
   615     }
   603 
   616 
       
   617     // Set flags to control view behaviour when visibility is changed
   604     HbMainWindow *mainWin = mainWindow();
   618     HbMainWindow *mainWin = mainWindow();
   605     if (!mainWin) {
   619     HbView *currentView;
       
   620 
       
   621     if (mainWin && (currentView = mainWin->currentView())) {
       
   622         // Get view flags to use
       
   623         HbView::HbViewFlags viewFlags = HbView::ViewFlagNone;
       
   624         getViewFlagsForVisibilityChange(viewFlags, visible, currentView);
       
   625         // Set the flags 
       
   626         currentView->setViewFlags(viewFlags);
       
   627     }
       
   628 }
       
   629 
       
   630 /*!
       
   631 \internal
       
   632 Specifies view flags to use when Title/Statusbar visibility changes. 
       
   633 Derived classes should override as appropriate
       
   634 */
       
   635 void HbAbstractVkbHostPrivate::getViewFlagsForVisibilityChange(HbView::HbViewFlags &viewFlags, bool visible, HbView *view)
       
   636 {
       
   637     if (!view) {
   606         return;
   638         return;
   607     }
   639     }
   608 
   640 
   609     HbView *currentView = mainWin->currentView();
   641     HbView::HbViewFlags flags = view->viewFlags();
   610     if (currentView) {
   642     HbView::HbViewFlags setFlags = HbView::ViewFlagNone;
   611         HbView::HbViewFlags flags = currentView->viewFlags();
   643 
   612 
   644     if (!visible) {
   613         HbView::HbViewFlags setFlags = HbView::ViewFlagNone;
   645         // Should set title and statur bar to not visible. 
   614         if (!visible) {
   646         // Check if they were visible before, and set a variable 
   615             if (!(flags & HbView::ViewTitleBarHidden)) {
   647         // to remember it was us who hid them.
   616                 setFlags |= HbView::ViewTitleBarHidden;
   648         if (!(flags & HbView::ViewTitleBarHidden)) {
   617                 mTitleBarHiddenByVkbHost = true;
   649             setFlags |= HbView::ViewTitleBarHidden;
       
   650             mTitleBarHiddenByVkbHost = true;
       
   651         }
       
   652         if (!(flags & HbView::ViewStatusBarHidden)) {
       
   653             setFlags |= HbView::ViewStatusBarHidden;
       
   654             mStatusBarHiddenByVkbHost = true;
       
   655         }
       
   656         if (mTitleBarHiddenByVkbHost || mStatusBarHiddenByVkbHost) {
       
   657             setFlags |= HbView::ViewDisableRelayout;
       
   658         }   
       
   659         // Return the original flags plus the ones we may have set
       
   660         viewFlags = (flags | setFlags);
       
   661     } else {
       
   662         // Title and status bar should become visible.
       
   663         // Check if we hid them and clear any flags we might have set before.
       
   664         if ((flags & HbView::ViewDisableRelayout) && 
       
   665             (mTitleBarHiddenByVkbHost || mStatusBarHiddenByVkbHost)) {
       
   666             setFlags |= HbView::ViewDisableRelayout;
       
   667         }
       
   668         if ((flags & HbView::ViewTitleBarHidden) && mTitleBarHiddenByVkbHost) {
       
   669             setFlags |= HbView::ViewTitleBarHidden;
       
   670             mTitleBarHiddenByVkbHost = false;
       
   671         }
       
   672         if ((flags & HbView::ViewStatusBarHidden) && mStatusBarHiddenByVkbHost) {
       
   673             setFlags |= HbView::ViewStatusBarHidden;
       
   674             mStatusBarHiddenByVkbHost = false;
       
   675         }
       
   676         // Return the original flags, clear the ones we have set before
       
   677         viewFlags = (flags & ~setFlags);
       
   678     }
       
   679 }
       
   680 
       
   681 /*!
       
   682 \internal
       
   683 Closes the keypad. This slot is connected to various signals from 
       
   684 different container classes.
       
   685 */
       
   686 void HbAbstractVkbHostPrivate::_q_containerAboutToClose()
       
   687 {
       
   688     Q_Q(HbAbstractVkbHost);
       
   689 
       
   690     q->closeKeypad();
       
   691 }
       
   692 
       
   693 /*!
       
   694 \internal
       
   695 Finds out if given editor is inside a scroll area and makes sure the cursor position is visible inside the
       
   696 scroll area.
       
   697 */
       
   698 void HbAbstractVkbHostPrivate::ensureVisibilityInsideScrollArea() const
       
   699 {
       
   700     if (mInputMethod && mInputMethod->focusObject()) {
       
   701         HbInputFocusObject *fo = mInputMethod->focusObject();
       
   702         HbScrollArea *scrollArea = 0;
       
   703 
       
   704         QGraphicsObject *graphicsObject = qobject_cast<QGraphicsObject *>(fo->object());
       
   705         if (graphicsObject) {
       
   706             for (QGraphicsWidget *parent = graphicsObject->parentWidget(); parent; parent = parent->parentWidget()) {
       
   707                 scrollArea = qobject_cast<HbScrollArea*>(parent);
       
   708                 if (scrollArea) {
       
   709                     break;
       
   710                 }
   618             }
   711             }
   619             if (!(flags & HbView::ViewStatusBarHidden)) {
   712         }
   620                 setFlags |= HbView::ViewStatusBarHidden;
   713 
   621                 mStatusBarHiddenByVkbHost = true;
   714         if (scrollArea && scrollArea->contentWidget()) {
   622             }
   715             QRectF scrollRect = scrollArea->sceneBoundingRect();
   623             if (mTitleBarHiddenByVkbHost || mStatusBarHiddenByVkbHost) {
   716             QRectF editorRect = fo->editorGeometry();
   624                 setFlags |= HbView::ViewDisableRelayout;
   717             if (!scrollRect.contains(editorRect) &&
   625             }   
   718                 scrollRect.intersects(editorRect)) {
   626             currentView->setViewFlags(flags | setFlags);
   719                 // The editor is half visible inside a scroll area.
   627         } else {
   720                 // Calculate how much the area needs to be scrolled
   628             if ((flags & HbView::ViewDisableRelayout) && (mTitleBarHiddenByVkbHost ||
   721                 // to make the cursor line visible inside the scroll
   629                 mStatusBarHiddenByVkbHost)) {
   722                 // area. The call scroll area's ensure visibility and
   630                 setFlags |= HbView::ViewDisableRelayout;
   723                 // return the calculated value (it needs to be factored in
   631             }
   724                 // to container animation calculations).                            
   632             if ((flags & HbView::ViewTitleBarHidden) && mTitleBarHiddenByVkbHost) {
   725                 if (editorRect.height() < scrollRect.height()) {
   633                 setFlags |= HbView::ViewTitleBarHidden;
   726                     // Whole editor rect fits into scroll area. Move it there.
   634                 mTitleBarHiddenByVkbHost = false;
   727                     if (editorRect.bottom() > scrollRect.bottom()) {
   635             }
   728                         // Scroll upwards.                    
   636             if ((flags & HbView::ViewStatusBarHidden) && mStatusBarHiddenByVkbHost) {
   729                         scrollArea->ensureVisible(scrollArea->contentWidget()->mapFromScene(editorRect.bottomLeft()), 0.0, HbEditorExtraMargin);
   637                 setFlags |= HbView::ViewStatusBarHidden;
   730                     } else {
   638                 mStatusBarHiddenByVkbHost = false;
   731                         // Scroll downwards.                        
   639             }
   732                         scrollArea->ensureVisible(scrollArea->contentWidget()->mapFromScene(editorRect.topLeft()), 0.0, HbEditorExtraMargin);
   640             currentView->setViewFlags(flags & ~setFlags);
   733                     }
   641         }
   734                 } else {
       
   735                     // Whole editor doesn't fit into scroll area. Used micro focus position instead.
       
   736                     QRectF microFocus = fo->microFocus();
       
   737                     if (microFocus.bottom() > scrollRect.bottom()) {
       
   738                         // Scroll upwards.
       
   739                         scrollArea->ensureVisible(scrollArea->contentWidget()->mapFromScene(microFocus.bottomLeft()), 0.0, HbEditorExtraMargin);
       
   740                     } else {
       
   741                         // Scroll downwards.
       
   742                         scrollArea->ensureVisible(scrollArea->contentWidget()->mapFromScene(microFocus.topLeft()), 0.0, HbEditorExtraMargin);
       
   743                     }
       
   744                 }
       
   745              }
       
   746          }
   642     }
   747     }
   643 }
   748 }
   644 
   749 
   645 /// @endcond
   750 /// @endcond
   646 
   751 
  1051 \deprecated HbAbstractVkbHost::minimizeKeypad(bool)
  1156 \deprecated HbAbstractVkbHost::minimizeKeypad(bool)
  1052     is deprecated.
  1157     is deprecated.
  1053 */
  1158 */
  1054 void HbAbstractVkbHost::minimizeKeypad(bool animationAllowed)
  1159 void HbAbstractVkbHost::minimizeKeypad(bool animationAllowed)
  1055 {
  1160 {
  1056     Q_D(HbAbstractVkbHost);
  1161     Q_UNUSED(animationAllowed);
  1057     if (d->mKeypadStatus != HbVkbStatusClosed && !d->mKeypadOperationOngoing) {
       
  1058         d->mKeypadOperationOngoing = true;
       
  1059 
       
  1060         if (animationAllowed) {
       
  1061             d->minimizeKeypad();
       
  1062         } else {
       
  1063             d->minimizeKeypadWithoutAnimation();
       
  1064         }
       
  1065 
       
  1066         d->mKeypadOperationOngoing = false;
       
  1067     }
       
  1068 }
  1162 }
  1069 
  1163 
  1070 /*!
  1164 /*!
  1071 \deprecated HbAbstractVkbHost::openMinimizedKeypad(HbVirtualKeyboard*, HbInputMethod*)
  1165 \deprecated HbAbstractVkbHost::openMinimizedKeypad(HbVirtualKeyboard*, HbInputMethod*)
  1072     is deprecated.
  1166     is deprecated.
  1073 */
  1167 */
  1074 void HbAbstractVkbHost::openMinimizedKeypad(HbVirtualKeyboard *vkb, HbInputMethod *owner)
  1168 void HbAbstractVkbHost::openMinimizedKeypad(HbVirtualKeyboard *vkb, HbInputMethod *owner)
  1075 {
  1169 {
  1076     Q_D(HbAbstractVkbHost);
  1170     Q_UNUSED(vkb);
  1077     d->mInputMethod = owner;
  1171     Q_UNUSED(owner);
  1078 
       
  1079     if (!d->mKeypadOperationOngoing) {
       
  1080         d->mKeypadOperationOngoing = true;
       
  1081 
       
  1082         if (d->mCallback != vkb || !d->mKeypad) {
       
  1083             // This keypad is opened for the first time or it was opened before but some other keypad
       
  1084             // was opened in between.
       
  1085             d->mCallback = vkb;
       
  1086             d->mKeypad = vkb->asGraphicsWidget();
       
  1087         }
       
  1088 
       
  1089         if (!d->mKeypad) {
       
  1090             // Keyboard widget creation failed for some reason, can't go on.
       
  1091             d->mCallback = 0;
       
  1092             return;
       
  1093         }
       
  1094 
       
  1095         d->openMinimizedKeypad();
       
  1096         d->connectSignals();
       
  1097         d->mKeypadOperationOngoing = false;
       
  1098     }
       
  1099 }
  1172 }
  1100 
  1173 
  1101 /*!
  1174 /*!
  1102 \reimp
  1175 \reimp
  1103 */
  1176 */
  1176             d->closeKeypadWithoutAnimation();
  1249             d->closeKeypadWithoutAnimation();
  1177             emit keypadClosed();
  1250             emit keypadClosed();
  1178         }
  1251         }
  1179     }
  1252     }
  1180 }
  1253 }
       
  1254 #include "moc_hbabstractvkbhost.cpp"
       
  1255 
  1181 // End of file
  1256 // End of file