src/hbinput/inputwidgets/hbinputvkbwidget.cpp
changeset 34 ed14f46c0e55
parent 7 923ff622b8b9
equal deleted inserted replaced
31:7516d6d86cf5 34:ed14f46c0e55
    43 #include <hbwidget.h>
    43 #include <hbwidget.h>
    44 #include <hbdialog.h>
    44 #include <hbdialog.h>
    45 #include <hbeffect.h>
    45 #include <hbeffect.h>
    46 #include <hbframedrawer.h>
    46 #include <hbframedrawer.h>
    47 #include <hbevent.h>
    47 #include <hbevent.h>
    48 #include <hbdataform.h>
       
    49 #include <hbinputregioncollector_p.h>
    48 #include <hbinputregioncollector_p.h>
    50 #include <hbfeedbackmanager.h>
    49 #include <hbfeedbackmanager.h>
    51 
    50 
    52 #include <hbinputmethod.h>
    51 #include <hbinputmethod.h>
    53 #include <hbinputsettingproxy.h>
    52 #include <hbinputsettingproxy.h>
    54 #include <hbinpututils.h>
    53 #include <hbinpututils.h>
    55 #include <hbinputdef.h>
    54 #include <hbinputdef.h>
    56 #include <hbinputvkbhost.h>
    55 #include <hbinputvkbhost.h>
    57 #include <hbinputvkbhostbridge.h>
    56 #include <hbinputvkbhostbridge.h>
    58 #include <hbinputsettingwidget.h>
       
    59 #include <hbinputcommondialogs.h>
    57 #include <hbinputcommondialogs.h>
    60 #include <hbinputkeymap.h>
    58 #include <hbinputkeymap.h>
    61 #include <hbinputkeymapfactory.h>
    59 #include <hbinputkeymapfactory.h>
    62 #include <hbwidgetfeedback.h>
    60 #include <hbwidgetfeedback.h>
    63 #include <hbinputpredictionfactory.h>
    61 #include <hbinputpredictionfactory.h>
    70 
    68 
    71 #include "hbinputsettinglist.h"
    69 #include "hbinputsettinglist.h"
    72 #include "hbinputmodeindicator.h"
    70 #include "hbinputmodeindicator.h"
    73 #include "hbinputsmileypicker.h"
    71 #include "hbinputsmileypicker.h"
    74 #include "hbinputscreenshotwidget.h"
    72 #include "hbinputscreenshotwidget.h"
       
    73 #include "hbinputsettingpopup.h"
    75 
    74 
    76 const int HB_DIGIT_LATIN_START_VALUE          = 0x0030;
    75 const int HB_DIGIT_LATIN_START_VALUE          = 0x0030;
    77 const int HB_DIGIT_ARABIC_INDIC_START_VALUE   = 0x0660;
    76 const int HB_DIGIT_ARABIC_INDIC_START_VALUE   = 0x0660;
    78 const int HB_DIGIT_EASTERN_ARABIC_START_VALUE = 0x06F0;
    77 const int HB_DIGIT_EASTERN_ARABIC_START_VALUE = 0x06F0;
    79 const int HB_DIGIT_DEVANAGARI_START_VALUE     = 0x0966;
    78 const int HB_DIGIT_DEVANAGARI_START_VALUE     = 0x0966;
    84 const qreal HbLandscapeSmileyPickerWidthInUnits = 83.4;
    83 const qreal HbLandscapeSmileyPickerWidthInUnits = 83.4;
    85 const qreal HbSmileyPickerMarginInUnits = 0.9;
    84 const qreal HbSmileyPickerMarginInUnits = 0.9;
    86 
    85 
    87 
    86 
    88 /*!
    87 /*!
    89 @proto
    88 @stable
    90 @hbinput
    89 @hbinput
    91 \class HbInputVkbWidget
    90 \class HbInputVkbWidget
    92 \brief A base class for touch keypads.
    91 \brief The HbInputVkbWidget class is a base class for touch keypads.
    93 
    92 
    94 This class implements default mechanisms for opening and closing touch keypads.
    93 This class implements default mechanisms for opening and closing touch keypads.
    95 It know how to operate in landscape and in portait modes and it know how
    94 It supports landscape and portrait modes, and splitting the view into
    96 implement split view -mechasnism for S60 QT UI's Hb library. It also implements
    95 the application and touch keypad sections. It also implements a closing mechanism
    97 closing mechansim, where used is able to close the touch keypad by sliding it downwards
    96 where the user can close the touch keypad by swiping it downwards with a finger.
    98 with a finger. This class also implements background drawing for touch keypads.
    97 This class also implements background drawing for touch keypads.
    99 */
    98 */
   100 
    99 
   101 /// @cond
   100 /// @cond
   102 
   101 
   103 inline HbWidget *hbwidget_cast(QGraphicsItem *item)
   102 inline HbWidget *hbwidget_cast(QGraphicsItem *item)
   130       mMostRecentlyAccessedButton(0),
   129       mMostRecentlyAccessedButton(0),
   131       mMostRecentlyClickedLocation(0.0, 0.0),
   130       mMostRecentlyClickedLocation(0.0, 0.0),
   132       mFocusedObject(0),
   131       mFocusedObject(0),
   133       mCurrentFocusedObject(0),
   132       mCurrentFocusedObject(0),
   134       mFlickAnimation(false),
   133       mFlickAnimation(false),
   135       mSettingsListOpen(false),
   134       mSettingsDialogsOpen(0),
   136       mAnimateWhenDialogCloses(false),
   135       mAnimateWhenDialogCloses(false),
   137       mKeyboardSize(HbQwerty4x10),
   136       mKeyboardSize(HbQwerty4x10),
   138       mCloseHandleHeight(0),
   137       mCloseHandleHeight(0),
   139       mCloseHandle(0),
   138       mCloseHandle(0),
   140       mSettingView(0),
       
   141       mCurrentView(0),
       
   142       mKeyboardDimmed(false),
   139       mKeyboardDimmed(false),
   143 	  mSettingWidget(0)
   140       mSettingPopup(0)
   144 {
   141 {
   145     mScreenshotTimeLine.setUpdateInterval(16);
   142     mScreenshotTimeLine.setUpdateInterval(16);
   146 }
   143 }
   147 
   144 
   148 
   145 
   272     q_ptr->mouseReleaseEvent(aEvent);
   269     q_ptr->mouseReleaseEvent(aEvent);
   273 }
   270 }
   274 
   271 
   275 void HbInputVkbWidgetPrivate::applyEditorConstraints()
   272 void HbInputVkbWidgetPrivate::applyEditorConstraints()
   276 {
   273 {
   277     // no default implementaiton as of now.
   274     // no default implementation for now.
   278 }
   275 }
   279 
   276 
   280 void HbInputVkbWidgetPrivate::updateKeyCodes()
   277 void HbInputVkbWidgetPrivate::updateKeyCodes()
   281 {
   278 {
   282     Q_Q(HbInputVkbWidget);
   279     Q_Q(HbInputVkbWidget);
   368     QRectF rect = QRectF(position.x(), position.y() + mCloseHandleHeight, q->boundingRect().width(), q->boundingRect().height() - mCloseHandleHeight);
   365     QRectF rect = QRectF(position.x(), position.y() + mCloseHandleHeight, q->boundingRect().width(), q->boundingRect().height() - mCloseHandleHeight);
   369     QTransform rotateTrans;
   366     QTransform rotateTrans;
   370     rotateTrans = q->mainWindow()->viewportTransform();
   367     rotateTrans = q->mainWindow()->viewportTransform();
   371     QRectF transRect = rotateTrans.mapRect(rect);
   368     QRectF transRect = rotateTrans.mapRect(rect);
   372     QPixmap pixmap;
   369     QPixmap pixmap;
   373     pixmap = QPixmap::grabWidget(q->mainWindow(), (int)transRect.x(), (int)transRect.y(), (int)transRect.width(), (int)transRect.height());
   370     pixmap = QPixmap::grabWidget(q->mainWindow(), (int)transRect.x(), (int)transRect.y()+2, (int)transRect.width(), (int)transRect.height());
   374     pixmap = pixmap.transformed(rotateTrans.inverted());
   371     pixmap = pixmap.transformed(rotateTrans.inverted());
       
   372     mScreenshotWidget->hide();
   375     mScreenshotWidget->setScreenshot(pixmap);
   373     mScreenshotWidget->setScreenshot(pixmap);
   376 }
   374 }
   377 
   375 
   378 
   376 
   379 void HbInputVkbWidgetPrivate::updateMouseHitItem(HbTouchKeypadButton *button, QPointF position)
   377 void HbInputVkbWidgetPrivate::updateMouseHitItem(HbTouchKeypadButton *button, QPointF position)
   419     Q_Q(HbInputVkbWidget);
   417     Q_Q(HbInputVkbWidget);
   420 
   418 
   421     if (!descriptor.isEmpty() && mOwner) {
   419     if (!descriptor.isEmpty() && mOwner) {
   422         // Set as active input method.
   420         // Set as active input method.
   423         HbInputSettingProxy::instance()->setPreferredInputMethod(q->mainWindow()->orientation(), descriptor, customData);
   421         HbInputSettingProxy::instance()->setPreferredInputMethod(q->mainWindow()->orientation(), descriptor, customData);
   424         // Activate immediately.
   422         if (HbInputSettingProxy::instance()->globalInputLanguage().language() == QLocale::Chinese &&
   425         mOwner->activateInputMethod(descriptor);
   423             q->mainWindow()->orientation() ==  Qt::Vertical) {
       
   424             HbInputLanguage primaryInputLanguage = HbInputSettingProxy::instance()->globalInputLanguage();
       
   425             mOwner->activateState(HbInputState(HbInputModeDefault,
       
   426                                    HbTextCaseAutomatic,
       
   427                                    HbKeyboardTouchPortrait,
       
   428                                    primaryInputLanguage));
       
   429             HbInputMethod::activeInputMethod()->activateInputMethod(descriptor);
       
   430         } else {
       
   431             // Activate immediately.
       
   432             mOwner->activateInputMethod(descriptor);
       
   433         }
   426     }
   434     }
   427 }
   435 }
   428 
   436 
   429 void HbInputVkbWidgetPrivate::_q_smileyPickerClosed()
   437 void HbInputVkbWidgetPrivate::_q_smileyPickerClosed()
   430 {
   438 {
   442 
   450 
   443     HbInputFocusObject *focusObject = mOwner->focusObject();
   451     HbInputFocusObject *focusObject = mOwner->focusObject();
   444     if (!focusObject) {
   452     if (!focusObject) {
   445         return numChr;
   453         return numChr;
   446     }
   454     }
       
   455 
   447     HbInputLanguage language = mKeymap->language();
   456     HbInputLanguage language = mKeymap->language();
   448     if (language.language()  != (QLocale::Language)0) {
   457     if (language.language()  != (QLocale::Language)0) {
   449         HbInputDigitType digitType = HbInputUtils::inputDigitType(language);
   458         HbInputDigitType digitType = HbInputUtils::inputDigitType(language);
   450 
   459 
   451         // In number editors, show the native digits only when both device and writing languages are same,
   460         // In number editors, show the native digits only when both device and writing languages are same,
   494 }
   503 }
   495 
   504 
   496 /// @endcond
   505 /// @endcond
   497 
   506 
   498 /*!
   507 /*!
   499 Costructs the object.
   508 \enum HbInputVkbWidget::HbFlickDirection
       
   509 Describes the direction of the flick (swipe) gesture. 
       
   510 */
       
   511 
       
   512 /*!
       
   513 \var HbInputVkbWidget::HbFlickDirectionNone
       
   514 No direction for a flick gesture. 
       
   515 */
       
   516 
       
   517 /*!
       
   518 \var HbInputVkbWidget::HbFlickDirectionLeft
       
   519 Flick gesture to the left. 
       
   520 */
       
   521 
       
   522 /*!
       
   523 \var HbInputVkbWidget::HbFlickDirectionRight
       
   524 Flick gesture to the right. 
       
   525 */
       
   526 
       
   527 /*!
       
   528 \var HbInputVkbWidget::HbFlickDirectionUp
       
   529 Flick gesture upwards.
       
   530 */
       
   531 
       
   532 /*!
       
   533 \var HbInputVkbWidget::HbFlickDirectionDown
       
   534 Flick gesture downwards. 
       
   535 */
       
   536 
       
   537 /*!
       
   538 \enum HbInputVkbWidget::HbVkbCloseMethod
       
   539 Describes the different closing methods for the virtual keyboard.
       
   540 */
       
   541 
       
   542 /*!
       
   543 \var HbInputVkbWidget::HbVkbCloseMethodButtonDrag
       
   544 Keypad closed by dragging a button.
       
   545 */
       
   546 
       
   547 /*!
       
   548 \var HbInputVkbWidget::HbVkbCloseMethodCloseButton
       
   549 Keypad closed with the close button.
       
   550 */
       
   551 
       
   552 /*!
       
   553 \var HbInputVkbWidget::HbVkbCloseMethodCloseButtonDrag
       
   554 Keypad closed with a button.
       
   555 */
       
   556 
       
   557 /*!
       
   558 \var HbInputVkbWidget::HbVkbCloseMethodCloseGesture
       
   559 Keypad closed with a downward flick (swipe) gesture.
       
   560 */
       
   561 
       
   562 /*!
       
   563 \enum HbInputVkbWidget::HbSctView
       
   564 Defines the view mode for the special character view.
       
   565 */
       
   566 
       
   567 /*!
       
   568 \var HbInputVkbWidget::HbSctViewSpecialCharacter
       
   569 View mode with the table of special characters.
       
   570 */
       
   571 
       
   572 /*!
       
   573 \var HbInputVkbWidget::HbSctViewSmiley
       
   574 View mode with the table of smileys.
       
   575 */
       
   576 
       
   577 /*!
       
   578 Constructor.
   500 */
   579 */
   501 HbInputVkbWidget::HbInputVkbWidget(QGraphicsItem *parent)
   580 HbInputVkbWidget::HbInputVkbWidget(QGraphicsItem *parent)
   502     : HbWidget(*new HbInputVkbWidgetPrivate, parent)
   581     : HbWidget(*new HbInputVkbWidgetPrivate, parent)
   503 {
   582 {
   504     Q_D(HbInputVkbWidget);
   583     Q_D(HbInputVkbWidget);
   519         d->mOwner = HbInputMethod::activeInputMethod();
   598         d->mOwner = HbInputMethod::activeInputMethod();
   520     }
   599     }
   521 }
   600 }
   522 
   601 
   523 /*!
   602 /*!
   524 Constructs the object.
   603 Constructor.
   525 */
   604 */
   526 HbInputVkbWidget::HbInputVkbWidget(HbInputVkbWidgetPrivate &dd, QGraphicsItem *parent)
   605 HbInputVkbWidget::HbInputVkbWidget(HbInputVkbWidgetPrivate &dd, QGraphicsItem *parent)
   527     : HbWidget(dd, parent)
   606     : HbWidget(dd, parent)
   528 {
   607 {
   529     Q_D(HbInputVkbWidget);
   608     Q_D(HbInputVkbWidget);
   537 #ifdef HB_EFFECTS
   616 #ifdef HB_EFFECTS
   538     HbEffect::disable(this);
   617     HbEffect::disable(this);
   539 #endif // HB_EFFECTS
   618 #endif // HB_EFFECTS
   540 
   619 
   541     setActive(false);
   620     setActive(false);
   542 }
   621     if (!d->mOwner) {
   543 
   622         d->mOwner = HbInputMethod::activeInputMethod();
   544 /*!
   623     }
   545 Destructs the object.
   624 }
       
   625 
       
   626 /*!
       
   627 Destructor.
   546 */
   628 */
   547 HbInputVkbWidget::~HbInputVkbWidget()
   629 HbInputVkbWidget::~HbInputVkbWidget()
   548 {
   630 {
   549 }
   631 }
   550 
   632 
   551 /*!
   633 /*!
   552 Vkb host calls this handler when the keypad open animation finishes.
   634 The virtual keyboard host calls this handler when the keypad open animation has finished.
       
   635 
       
   636 \sa HbVkbHost
   553 */
   637 */
   554 void HbInputVkbWidget::keyboardOpened(HbVkbHost *host)
   638 void HbInputVkbWidget::keyboardOpened(HbVkbHost *host)
   555 {
   639 {
   556     Q_D(HbInputVkbWidget);
   640     Q_D(HbInputVkbWidget);
   557 
   641 
   558     d->mCurrentHost = host;
   642     d->mCurrentHost = host;
   559     d->mFlickDirection = HbFlickDirectionNone;
   643     d->mFlickDirection = HbFlickDirectionNone;
   560 }
   644 }
   561 
   645 
   562 /*!
   646 /*!
   563 Vkb host calls this handler when the keyboard close animation has finished.
   647 The virtual keyboard host calls this handler when the keyboard close animation has finished.
   564 
   648 
   565 \sa HbVkbHost
   649 \sa HbVkbHost
   566 */
   650 */
   567 void HbInputVkbWidget::keyboardClosed(HbVkbHost *host)
   651 void HbInputVkbWidget::keyboardClosed(HbVkbHost *host)
   568 {
   652 {
   571 
   655 
   572     d->mFlickDirection = HbFlickDirectionNone;
   656     d->mFlickDirection = HbFlickDirectionNone;
   573 }
   657 }
   574 
   658 
   575 /*!
   659 /*!
   576 Vkb host calls this handler when the keyboard minimize animation has finished.
   660 Draws the widget. Parameters \a option and \a widget are not used. 
   577 
       
   578 \sa HbVkbHost
       
   579 */
       
   580 void HbInputVkbWidget::keyboardMinimized(HbVkbHost *host)
       
   581 {
       
   582     Q_UNUSED(host);
       
   583     Q_D(HbInputVkbWidget);
       
   584     d->mFlickDirection = HbFlickDirectionNone;
       
   585 }
       
   586 
       
   587 /*!
       
   588 The paint method. Draws the widget.
       
   589 */
   661 */
   590 void HbInputVkbWidget::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget)
   662 void HbInputVkbWidget::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget)
   591 {
   663 {
   592     Q_UNUSED(option);
   664     Q_UNUSED(option);
   593     Q_UNUSED(widget);
   665     Q_UNUSED(widget);
   606     d->mIconDrawer->paint(painter, rect);
   678     d->mIconDrawer->paint(painter, rect);
   607     painter->restore();
   679     painter->restore();
   608 }
   680 }
   609 
   681 
   610 /*!
   682 /*!
   611 Sets the content item which will fill the content area of this widget. Content item is
   683 Sets the content item that will fill the content area of this widget.
   612 a single input button group by default.
   684 The content item is a single input button group by default.
   613 If null is given then the old content item is deleted and content area is cleared.
   685 If \c null is given the old content item is deleted and the content area is cleared.
   614 Takes ownership of the given item.
   686 Takes ownership of the given item.
   615 
   687 
   616 \sa updateKeyCodes
       
   617 \sa updateButtons
       
   618 \sa setKeyboardDimmed
   688 \sa setKeyboardDimmed
   619 \sa probableKeypresses
   689 \sa probableKeypresses
   620 */
   690 */
   621 void HbInputVkbWidget::setContentItem(QGraphicsLayoutItem *item)
   691 void HbInputVkbWidget::setContentItem(QGraphicsLayoutItem *item)
   622 {
   692 {
   630         d->mLayout->addItem(item);
   700         d->mLayout->addItem(item);
   631     }
   701     }
   632 }
   702 }
   633 
   703 
   634 /*!
   704 /*!
   635 Returns current content item or null if not set.
   705 Returns the current content item or \c null if not set.
   636 Ownership is not transferred.
   706 Ownership is not transferred.
   637 */
   707 */
   638 QGraphicsLayoutItem *HbInputVkbWidget::contentItem() const
   708 QGraphicsLayoutItem *HbInputVkbWidget::contentItem() const
   639 {
   709 {
   640     Q_D(const HbInputVkbWidget);
   710     Q_D(const HbInputVkbWidget);
   645     }
   715     }
   646     return item;
   716     return item;
   647 }
   717 }
   648 
   718 
   649 /*!
   719 /*!
   650 \deprecated HbInputVkbWidget::setRockerVisible(bool)
   720 Returns the active keypad mode. Possible values are EModeAbc and EModeNumeric.
   651     is deprecated.
       
   652 
       
   653 Sets virtual rocker visibility.
       
   654 */
       
   655 void HbInputVkbWidget::setRockerVisible(bool visible)
       
   656 {
       
   657     Q_UNUSED(visible);
       
   658 }
       
   659 
       
   660 /*!
       
   661 \deprecated HbInputVkbWidget::isRockerVisible() const
       
   662     is deprecated.
       
   663 
       
   664 Returns true if virtual rocker is allowed to be visible.
       
   665 */
       
   666 bool HbInputVkbWidget::isRockerVisible() const
       
   667 {
       
   668     return false;
       
   669 }
       
   670 
       
   671 /*!
       
   672 Returns active keypad mode. Possible values are EModeAbc, EModeNumeric and EModeSct.
       
   673 */
   721 */
   674 HbKeypadMode HbInputVkbWidget::mode() const
   722 HbKeypadMode HbInputVkbWidget::mode() const
   675 {
   723 {
   676     Q_D(const HbInputVkbWidget);
   724     Q_D(const HbInputVkbWidget);
   677     return d->mMode;
   725     return d->mMode;
   678 }
   726 }
   679 
   727 
   680 /*!
   728 /*!
   681 Returns active keypad modifiers.
   729 Returns the active keypad modifiers as a set of flags for shift, chr, and fn keys
       
   730 (see details in file <tt>inputdef.h</tt>).
   682 */
   731 */
   683 HbModifiers HbInputVkbWidget::modifiers() const
   732 HbModifiers HbInputVkbWidget::modifiers() const
   684 {
   733 {
   685     Q_D(const HbInputVkbWidget);
   734     Q_D(const HbInputVkbWidget);
   686     return d->mModifiers;
   735     return d->mModifiers;
   687 }
   736 }
   688 
   737 
   689 /*!
   738 /*!
   690 Sets the keypad to given mode. Possible values are EModeAbc, EModeNumeric and EModeSct.
   739 Sets the keypad to given \a mode. Possible values are EModeAbc and EModeNumeric.
       
   740 \a modifiers is a set of flags for shift, chr, and fn keys (see details in file
       
   741 <tt>inputdef.h</tt>).
   691 */
   742 */
   692 void HbInputVkbWidget::setMode(HbKeypadMode mode, HbModifiers modifiers)
   743 void HbInputVkbWidget::setMode(HbKeypadMode mode, HbModifiers modifiers)
   693 {
   744 {
   694     Q_D(HbInputVkbWidget);
   745     Q_D(HbInputVkbWidget);
   695     d->mMode = mode;
   746     d->mMode = mode;
   708         d->mInputModeIndicator->updateIndicator();
   759         d->mInputModeIndicator->updateIndicator();
   709     }
   760     }
   710 }
   761 }
   711 
   762 
   712 /*!
   763 /*!
   713 Sets key map data object. Given key map data will be used as a source for button titles.
   764 Sets the keymap data object. The given keymap data will be used as a source for button titles.
   714 Usually the key map data for active input language is used.
   765 Usually the keymap data for the active input language is used.
   715 */
   766 */
   716 void HbInputVkbWidget::setKeymap(const HbKeymap *keymap)
   767 void HbInputVkbWidget::setKeymap(const HbKeymap *keymap)
   717 {
   768 {
   718     Q_D(HbInputVkbWidget);
   769     Q_D(HbInputVkbWidget);
   719     if (keymap) {
   770     if (keymap) {
   754     Q_D(HbInputVkbWidget);
   805     Q_D(HbInputVkbWidget);
   755 
   806 
   756     d->mCurrentHost = host;
   807     d->mCurrentHost = host;
   757 
   808 
   758     if (d->mSmileyPicker && d->mSmileyPicker->isVisible()) {
   809     if (d->mSmileyPicker && d->mSmileyPicker->isVisible()) {
   759         d->mSmileyPicker->hide();
   810         d->mSmileyPicker->close();
   760     }
   811     }
   761     if (d->mSettingList) {
   812     if (d->mSettingList) {
   762         d->mSettingList->close();
   813         d->mSettingList->close();
   763     }
   814     }
   764 }
   815 }
   773         buttonGroup->setEnabled(!dimmed);
   824         buttonGroup->setEnabled(!dimmed);
   774     }
   825     }
   775 }
   826 }
   776 
   827 
   777 /*!
   828 /*!
   778 Shows settings list
   829 Shows the setting list.
   779 */
   830 */
   780 void HbInputVkbWidget::showSettingList()
   831 void HbInputVkbWidget::showSettingList()
   781 {
   832 {
   782     Q_D(HbInputVkbWidget);
   833     Q_D(HbInputVkbWidget);
   783     HbPredictionFactory *predFactory = HbPredictionFactory::instance();
   834     HbPredictionFactory *predFactory = HbPredictionFactory::instance();
   784 
   835 
   785     d->mSettingsListOpen = true;
   836     d->mSettingsDialogsOpen++;
   786     d->captureScreenshot();
   837     d->captureScreenshot();
   787 
   838 
   788     if (!d->mSettingList) {
   839     if (!d->mSettingList) {
   789         d->mSettingList = new HbInputSettingList();
   840         d->mSettingList = new HbInputSettingList();
   790         connect(d->mSettingList, SIGNAL(inputSettingsButtonClicked()), this, SLOT(showSettingsView()));
   841         connect(d->mSettingList, SIGNAL(inputSettingsButtonClicked()), this, SLOT(showSettingsView()));
   799         } else {
   850         } else {
   800             d->mSettingList->setLanguageSelectionEnabled(true);
   851             d->mSettingList->setLanguageSelectionEnabled(true);
   801         }
   852         }
   802 
   853 
   803         if (focusObject->editorInterface().isPredictionAllowed() &&
   854         if (focusObject->editorInterface().isPredictionAllowed() &&
   804             predFactory->predictionEngineForLanguage(HbInputSettingProxy::instance()->globalInputLanguage())) {
   855             predFactory->predictionEngineForLanguage(d->mOwner->inputState().language())) {
   805             d->mSettingList->setPredictionSelectionEnabled(true);
   856             d->mSettingList->setPredictionSelectionEnabled(true);
   806         } else {
   857         } else {
   807             d->mSettingList->setPredictionSelectionEnabled(false);
   858             d->mSettingList->setPredictionSelectionEnabled(false);
   808         }
   859         }
   809     }
   860     }
   824     d->mSettingList->updateSettingList();
   875     d->mSettingList->updateSettingList();
   825     d->mSettingList->open(this, SLOT(_q_settingsClosed(HbAction*)));
   876     d->mSettingList->open(this, SLOT(_q_settingsClosed(HbAction*)));
   826 }
   877 }
   827 
   878 
   828 /*!
   879 /*!
   829 Slot which is called when settings list is closed.
   880 This slot is called when the setting list is closed.
   830 */
   881 */
   831 void HbInputVkbWidget::settingsClosed()
   882 void HbInputVkbWidget::settingsClosed()
   832 {
   883 {
   833     Q_D(HbInputVkbWidget);
   884     Q_D(HbInputVkbWidget);
   834 
       
   835     HbInputButtonGroup *buttonGroup = static_cast<HbInputButtonGroup *>(contentItem());
   885     HbInputButtonGroup *buttonGroup = static_cast<HbInputButtonGroup *>(contentItem());
   836     if (buttonGroup) {
   886     if (buttonGroup) {
   837         HbInputButton *item = buttonGroup->button(HbInputButton::ButtonKeyCodeSettings);
   887         HbInputButton *item = buttonGroup->button(HbInputButton::ButtonKeyCodeSettings);
   838         if (item) {
   888         if (item) {
   839             item->setState(HbInputButton::ButtonStateReleased);
   889             item->setState(HbInputButton::ButtonStateReleased);
   840             buttonGroup->setButton(item, HbInputButton::ButtonKeyCodeSettings);
   890             buttonGroup->setButton(item, HbInputButton::ButtonKeyCodeSettings);
   841         }
   891         }
   842     }
   892     }
   843 
   893     emit settingsListClosed();
   844     d->mSettingsListOpen = false;
   894     d->mSettingsDialogsOpen--;
   845     if (d->mAnimateWhenDialogCloses) {
   895     if (!d->mSettingsDialogsOpen){
   846         animKeyboardChange();
   896         if (d->mAnimateWhenDialogCloses) {
   847         d->mAnimateWhenDialogCloses = false;
   897             animKeyboardChange();
   848     } else if (d->mScreenshotTimeLine.state() != QTimeLine::Running) {
   898             d->mAnimateWhenDialogCloses = false;
   849         keypadLanguageChangeFinished();
   899         } else if (d->mScreenshotTimeLine.state() != QTimeLine::Running) {
   850     }
   900             keypadLanguageChangeFinished();
   851 }
   901         }
   852 
   902     }
   853 /*!
   903 }
   854 Closes settings list
   904 
       
   905 /*!
       
   906 Closes the setting list.
   855 */
   907 */
   856 void HbInputVkbWidget::closeSettingList()
   908 void HbInputVkbWidget::closeSettingList()
   857 {
   909 {
   858     Q_D(HbInputVkbWidget);
   910     Q_D(HbInputVkbWidget);
   859     d->mSettingList->close();
   911     d->mSettingList->close();
   860 }
   912 }
   861 
   913 
   862 /*!
   914 /*!
   863 Shows settings view
   915 Shows the Control Panel input settings content in a popup widget.
   864 */
   916 */
   865 void HbInputVkbWidget::showSettingsView()
   917 void HbInputVkbWidget::showSettingsView()
   866 {
   918 {
   867     Q_D(HbInputVkbWidget);
   919     Q_D(HbInputVkbWidget);
   868 
   920 
   869     /*
   921     d->mSettingsDialogsOpen++;
   870     Added for vanilla input
       
   871     When settings dialog is launched, keypad is not closed.
       
   872     */
       
   873     HbInputFocusObject *focusObject = 0;
       
   874     if (!d->mOwner || !(focusObject = d->mOwner->focusObject())) {
       
   875         return;
       
   876     }
       
   877     HbVkbHost *vkbHost = focusObject->editorInterface().vkbHost();
       
   878     if (vkbHost && vkbHost->keypadStatus() != HbVkbHost::HbVkbStatusClosed) {
       
   879         vkbHost->closeKeypad();
       
   880     }
       
   881     d->mCurrentFocusedObject = focusObject->object();
       
   882 
       
   883     closeSettingList();
   922     closeSettingList();
   884     if(!d->mSettingView) {
   923 
   885         d->mSettingView = new HbView(this);
   924     d->mSettingPopup = new HbInputSettingPopup();
   886         HbAction *backAction = new HbAction(Hb::BackNaviAction, d->mSettingView);
   925 
   887         backAction->setText(tr("Back"));
   926     connect(d->mSettingPopup, SIGNAL(dialogClosed()), this, SLOT(closeSettingsView()));
   888         connect(backAction, SIGNAL(triggered(bool)), this, SLOT(closeSettingsView()));
   927     d->mSettingPopup->show();
   889         d->mSettingView->setNavigationAction(backAction);
   928 }
   890         HbDataForm *dataForm = new HbDataForm();
   929 
   891         d->mSettingView->setWidget(dataForm);
   930 /*!
   892         d->mSettingWidget = new HbInputSettingWidget(dataForm, d->mSettingView);        
   931 Closes the input settings popup and returns to the previous view.
   893     }    
       
   894     d->mSettingWidget->initializeWidget();
       
   895     HbInputRegionCollector::instance()->attach(d->mSettingView);
       
   896     d->mSettingView->setTitle(tr("Input Settings"));
       
   897     mainWindow()->addView(d->mSettingView);
       
   898     d->mCurrentView = mainWindow()->currentView();
       
   899     mainWindow()->setCurrentView(d->mSettingView);
       
   900 }
       
   901 
       
   902 /*!
       
   903 Closes settings view and returns to previous view
       
   904 */
   932 */
   905 void HbInputVkbWidget::closeSettingsView()
   933 void HbInputVkbWidget::closeSettingsView()
   906 {
   934 {
   907     Q_D(HbInputVkbWidget);
   935     Q_D(HbInputVkbWidget);
   908 
   936     d->mSettingPopup->deleteLater();
   909     mainWindow()->setCurrentView(d->mCurrentView);
   937     d->mSettingPopup = 0;
   910     mainWindow()->removeView(d->mSettingView);
   938     d->mSettingsDialogsOpen--;
   911     if (d->mSettingView->scene()) {
   939     if (!d->mSettingsDialogsOpen){
   912         d->mSettingView->scene()->removeItem(d->mSettingView);
   940         if (d->mAnimateWhenDialogCloses) {
   913     }
   941             animKeyboardChange();
   914     HbInputRegionCollector::instance()->detach(d->mSettingView);
   942             d->mAnimateWhenDialogCloses = false;
   915     d->mSettingWidget->resetWidget();
   943         } else if (d->mScreenshotTimeLine.state() != QTimeLine::Running) {
   916 
   944             keypadLanguageChangeFinished();
   917     if (d->mCurrentFocusedObject) {
   945         }
   918         HbInputFocusObject *focusObject = new HbInputFocusObject(d->mCurrentFocusedObject);
       
   919         d->mOwner->setFocusObject(focusObject);
       
   920         d->mCurrentFocusedObject = 0;
       
   921     }
   946     }
   922 }
   947 }
   923 
   948 
   924 /*!
   949 /*!
   925 \deprecated HbInputVkbWidget::executeMethodDialog()
   950 \deprecated HbInputVkbWidget::executeMethodDialog()
   984 
  1009 
   985     return ret;
  1010     return ret;
   986 }
  1011 }
   987 
  1012 
   988 /*!
  1013 /*!
   989 \deprecated HbInputVkbWidget::rockerPosition()
  1014 Sets the status of the background drawing. This method can be used to optimize
   990     is deprecated.
  1015 virtual keyboard widget drawing. If it is known that the widget will cover
   991 
  1016 the whole virtual keyboard area and there are no places where the background
   992 Returns the virtual rocker position. The default position is in the middle
  1017 shows through, then the background drawing can be turned off to speed up
   993 of keypad button area.
  1018 the paint() function.
   994 */
       
   995 QPointF HbInputVkbWidget::rockerPosition()
       
   996 {
       
   997     return QPointF();
       
   998 }
       
   999 
       
  1000 /*!
       
  1001 Sets the status of the background drawing. This method can be used to
       
  1002 optimize vkb widget drawing. If it is known that the widget will cover whole
       
  1003 vkb area and there are no places where the background shows through, then the background
       
  1004 drawing can be turned off to speed up paint method.
       
  1005 */
  1019 */
  1006 void HbInputVkbWidget::setBackgroundDrawing(bool backgroundEnabled)
  1020 void HbInputVkbWidget::setBackgroundDrawing(bool backgroundEnabled)
  1007 {
  1021 {
  1008     Q_D(HbInputVkbWidget);
  1022     Q_D(HbInputVkbWidget);
  1009     d->mDrawbackground = backgroundEnabled;
  1023     d->mDrawbackground = backgroundEnabled;
  1010 }
  1024 }
  1011 
  1025 
  1012 
  1026 /*!
  1013 /*!
  1027 Returns all the possible keys that the user could have intended to press
  1014 Returns all possible keys that the user could have intended to press
  1028 for the last registered touch along with their corresponding probabilities.
  1015 for the last registered touch along with their corresponding probability.
       
  1016 */
  1029 */
  1017 QList<HbKeyPressProbability> HbInputVkbWidget::probableKeypresses()
  1030 QList<HbKeyPressProbability> HbInputVkbWidget::probableKeypresses()
  1018 {
  1031 {
  1019     QList<HbKeyPressProbability> probabilities;
  1032     QList<HbKeyPressProbability> probabilities;
  1020     HbInputButtonGroup *buttonGroup = static_cast<HbInputButtonGroup *>(contentItem());
  1033     HbInputButtonGroup *buttonGroup = static_cast<HbInputButtonGroup *>(contentItem());
  1023     }
  1036     }
  1024     return probabilities;
  1037     return probabilities;
  1025 }
  1038 }
  1026 
  1039 
  1027 /*!
  1040 /*!
  1028 Refines the bounding rect. This function is used for collision detection
  1041 Returns the bounding area of the widget as a graphical shape,
  1029 and hit test.
  1042 which can be used for collision detection and hit test.
  1030 */
  1043 */
  1031 QPainterPath HbInputVkbWidget::shape() const
  1044 QPainterPath HbInputVkbWidget::shape() const
  1032 {
  1045 {
  1033     QRectF rect = boundingRect();
  1046     QRectF rect = boundingRect();
  1034     QPainterPath path;
  1047     QPainterPath path;
  1035     path.addRect(rect);
  1048     path.addRect(rect);
  1036     return path;
  1049     return path;
  1037 }
  1050 }
  1038 
  1051 
  1039 /*!
  1052 /*!
  1040 \reimp
  1053 Shows the smiley picker widget.
  1041 */
       
  1042 QSizeF HbInputVkbWidget::minimizedKeyboardSize()
       
  1043 {
       
  1044     Q_D(HbInputVkbWidget);
       
  1045     return QSizeF(0.0, d->mCloseHandleHeight);
       
  1046 }
       
  1047 
       
  1048 /*!
       
  1049 Shows smiley picker widget.
       
  1050 */
  1054 */
  1051 void HbInputVkbWidget::showSmileyPicker(int rows, int columns)
  1055 void HbInputVkbWidget::showSmileyPicker(int rows, int columns)
  1052 {
  1056 {
  1053     Q_D(HbInputVkbWidget);
  1057     Q_D(HbInputVkbWidget);
  1054     if (!d->mOwner || !d->mOwner->focusObject()) {
  1058     if (!d->mOwner || !d->mOwner->focusObject()) {
  1068         // get the smiley list from editor interface smiley theme.
  1072         // get the smiley list from editor interface smiley theme.
  1069         QStringList smileys = focusObject->editorInterface().smileyTheme().smileys();
  1073         QStringList smileys = focusObject->editorInterface().smileyTheme().smileys();
  1070 
  1074 
  1071         if (!smileys.isEmpty()) {
  1075         if (!smileys.isEmpty()) {
  1072             d->mSmileyPicker = new HbInputSmileyPicker(rows, columns, 0, smileys);
  1076             d->mSmileyPicker = new HbInputSmileyPicker(rows, columns, 0, smileys);
       
  1077             // workaround start
       
  1078             QEvent event(QEvent::Polish);
       
  1079             QApplication::sendEvent(d->mSmileyPicker, &event);
       
  1080             // workaround end
  1073             d->mSmileyPicker->setObjectName("vkbwidget_smiley_picker");
  1081             d->mSmileyPicker->setObjectName("vkbwidget_smiley_picker");
  1074             connect(d->mSmileyPicker, SIGNAL(selected(QString)), this, SIGNAL(smileySelected(QString)));
  1082             connect(d->mSmileyPicker, SIGNAL(selected(QString)), this, SIGNAL(smileySelected(QString)));
  1075         }
  1083         }
  1076     }
  1084     }
  1077 
  1085 
  1097             buttonGroup->cancelButtonPress();
  1105             buttonGroup->cancelButtonPress();
  1098         }
  1106         }
  1099     }
  1107     }
  1100 }
  1108 }
  1101 
  1109 
       
  1110 /*!
       
  1111 Returns the direction of the flick (swipe) gesture.
       
  1112 */
  1102 HbInputVkbWidget::HbFlickDirection HbInputVkbWidget::flickDirection()
  1113 HbInputVkbWidget::HbFlickDirection HbInputVkbWidget::flickDirection()
  1103 {
  1114 {
  1104     Q_D(HbInputVkbWidget);
  1115     Q_D(HbInputVkbWidget);
  1105     return d->mFlickDirection;
  1116     return d->mFlickDirection;
  1106 }
  1117 }
  1107 
  1118 
  1108 /*!
  1119 /*!
  1109 Sends key event to owning input method.
  1120 Sends the key press event to the owning input method.
  1110 */
  1121 */
  1111 void HbInputVkbWidget::sendKeyPressEvent(const QKeyEvent &event)
  1122 void HbInputVkbWidget::sendKeyPressEvent(const QKeyEvent &event)
  1112 {
  1123 {
  1113     Q_D(HbInputVkbWidget);
  1124     Q_D(HbInputVkbWidget);
  1114 
  1125 
  1116         d->mOwner->filterEvent(&event);
  1127         d->mOwner->filterEvent(&event);
  1117     }
  1128     }
  1118 }
  1129 }
  1119 
  1130 
  1120 /*!
  1131 /*!
  1121 Sends key event to owning input method.
  1132 Sends the key double-press event to the owning input method.
  1122 */
  1133 */
  1123 void HbInputVkbWidget::sendKeyDoublePressEvent(const QKeyEvent &event)
  1134 void HbInputVkbWidget::sendKeyDoublePressEvent(const QKeyEvent &event)
  1124 {
  1135 {
  1125     Q_D(HbInputVkbWidget);
  1136     Q_D(HbInputVkbWidget);
  1126 
  1137 
  1128         d->mOwner->filterEvent(&event);
  1139         d->mOwner->filterEvent(&event);
  1129     }
  1140     }
  1130 }
  1141 }
  1131 
  1142 
  1132 /*!
  1143 /*!
  1133 Sends key event to owning input method.
  1144 Sends the key release event to the owning input method.
  1134 */
  1145 */
  1135 void HbInputVkbWidget::sendKeyReleaseEvent(const QKeyEvent &event)
  1146 void HbInputVkbWidget::sendKeyReleaseEvent(const QKeyEvent &event)
  1136 {
  1147 {
  1137     Q_D(HbInputVkbWidget);
  1148     Q_D(HbInputVkbWidget);
  1138 
  1149 
  1144         showSettingList();
  1155         showSettingList();
  1145     }
  1156     }
  1146 }
  1157 }
  1147 
  1158 
  1148 /*!
  1159 /*!
  1149 Sends key event to owning input method.
  1160 Sends the key long-press event to the owning input method.
  1150 */
  1161 */
  1151 void HbInputVkbWidget::sendLongPressEvent(const QKeyEvent &event)
  1162 void HbInputVkbWidget::sendLongPressEvent(const QKeyEvent &event)
  1152 {
  1163 {
  1153     Q_D(HbInputVkbWidget);
  1164     Q_D(HbInputVkbWidget);
  1154 
  1165 
  1156         d->mOwner->filterEvent(&event);
  1167         d->mOwner->filterEvent(&event);
  1157     }
  1168     }
  1158 }
  1169 }
  1159 
  1170 
  1160 /*!
  1171 /*!
  1161 Sends key event to owning input method.
  1172 Sends the key change event to the owning input method.
  1162 Releae event is ignored.
  1173 The release event is ignored, and the press event is handled.
  1163 */
  1174 */
  1164 void HbInputVkbWidget::sendKeyChangeEvent(const QKeyEvent &releaseEvent, const QKeyEvent &pressEvent)
  1175 void HbInputVkbWidget::sendKeyChangeEvent(const QKeyEvent &releaseEvent, const QKeyEvent &pressEvent)
  1165 {
  1176 {
  1166     Q_D(HbInputVkbWidget);
  1177     Q_D(HbInputVkbWidget);
  1167     Q_UNUSED(releaseEvent);
  1178     Q_UNUSED(releaseEvent);
  1169     if (d->mOwner) {
  1180     if (d->mOwner) {
  1170         d->mOwner->filterEvent(&pressEvent);
  1181         d->mOwner->filterEvent(&pressEvent);
  1171     }
  1182     }
  1172 }
  1183 }
  1173 
  1184 
       
  1185 /*!
       
  1186 Updates the animation shown when the keypad language is changed.
       
  1187 */
  1174 void HbInputVkbWidget::keypadLanguageChangeAnimationUpdate(qreal value)
  1188 void HbInputVkbWidget::keypadLanguageChangeAnimationUpdate(qreal value)
  1175 {
  1189 {
  1176     Q_D(HbInputVkbWidget);
  1190     Q_D(HbInputVkbWidget);
  1177 
  1191 
  1178     int direction = 1;
  1192     int direction = 1;
  1187         d->mScreenshotWidget->setPos(position.x() + direction * rect.width(), position.y());
  1201         d->mScreenshotWidget->setPos(position.x() + direction * rect.width(), position.y());
  1188         setPos(position);
  1202         setPos(position);
  1189     }
  1203     }
  1190 }
  1204 }
  1191 
  1205 
       
  1206 /*!
       
  1207 Cleans up at the end of an animation when the keypad language is changed. 
       
  1208 */
  1192 void HbInputVkbWidget::keypadLanguageChangeFinished()
  1209 void HbInputVkbWidget::keypadLanguageChangeFinished()
  1193 {
  1210 {
  1194     Q_D(HbInputVkbWidget);
  1211     Q_D(HbInputVkbWidget);
  1195     delete d->mScreenshotWidget;
  1212     delete d->mScreenshotWidget;
  1196     d->mScreenshotWidget = 0;
  1213     d->mScreenshotWidget = 0;
  1197     d->mFlickDirection = HbFlickDirectionNone;
  1214     d->mFlickDirection = HbFlickDirectionNone;
  1198 }
  1215 }
  1199 
  1216 
       
  1217 /*!
       
  1218 Controls the start of an animation when the keyboard is changed.
       
  1219 */
  1200 void HbInputVkbWidget::animKeyboardChange()
  1220 void HbInputVkbWidget::animKeyboardChange()
  1201 {
  1221 {
  1202     Q_D(HbInputVkbWidget);
  1222     Q_D(HbInputVkbWidget);
  1203     if (mainWindow()) {
  1223     if (mainWindow()) {
  1204         if (d->mSettingsListOpen) {
  1224         if (d->mSettingsDialogsOpen) {
  1205             d->mAnimateWhenDialogCloses = true;
  1225             d->mAnimateWhenDialogCloses = true;
  1206         } else {
  1226         } else {
  1207             if (!d->mAnimateWhenDialogCloses) {
  1227             if (!d->mAnimateWhenDialogCloses) {
  1208                 d->captureScreenshot();
  1228                 d->captureScreenshot();
  1209             }
  1229             }
  1210             connect(&d->mScreenshotTimeLine, SIGNAL(valueChanged(qreal)), this, SLOT(keypadLanguageChangeAnimationUpdate(qreal)));
  1230             connect(&d->mScreenshotTimeLine, SIGNAL(valueChanged(qreal)), this, SLOT(keypadLanguageChangeAnimationUpdate(qreal)));
  1211             connect(&d->mScreenshotTimeLine, SIGNAL(finished()), this, SLOT(keypadLanguageChangeFinished()));
  1231             connect(&d->mScreenshotTimeLine, SIGNAL(finished()), this, SLOT(keypadLanguageChangeFinished()));
       
  1232             d->mScreenshotWidget->show();
  1212             d->mScreenshotTimeLine.start();
  1233             d->mScreenshotTimeLine.start();
  1213         }
  1234         }
  1214     }
  1235     }
  1215 }
  1236 }
  1216 
  1237 
  1241     }
  1262     }
  1242     return sh;
  1263     return sh;
  1243 }
  1264 }
  1244 
  1265 
  1245 /*!
  1266 /*!
  1246 \reimp
  1267 Handles a change event.
  1247  */
  1268  */
  1248 void HbInputVkbWidget::changeEvent(QEvent *event)
  1269 void HbInputVkbWidget::changeEvent(QEvent *event)
  1249 {
  1270 {
  1250     Q_D(HbInputVkbWidget);
  1271     Q_D(HbInputVkbWidget);
  1251     if (event->type() == HbEvent::ThemeChanged) {
  1272     if (event->type() == HbEvent::ThemeChanged) {
  1254     }
  1275     }
  1255     HbWidget::changeEvent(event);
  1276     HbWidget::changeEvent(event);
  1256 }
  1277 }
  1257 
  1278 
  1258 /*!
  1279 /*!
  1259 \reimp
  1280 Handles gesture events.
  1260 */
  1281 */
  1261 void HbInputVkbWidget::gestureEvent(QGestureEvent *event)
  1282 void HbInputVkbWidget::gestureEvent(QGestureEvent *event)
  1262 {
  1283 {
  1263     Q_D(HbInputVkbWidget);
  1284     Q_D(HbInputVkbWidget);
       
  1285 
       
  1286     // Ignore gesture events if previous flick event is being handled
       
  1287     if (d->mFlickDirection != HbFlickDirectionNone) {
       
  1288         return;
       
  1289     }
  1264 
  1290 
  1265     if (HbSwipeGesture *gesture = qobject_cast<HbSwipeGesture *>(event->gesture(Qt::SwipeGesture))) {
  1291     if (HbSwipeGesture *gesture = qobject_cast<HbSwipeGesture *>(event->gesture(Qt::SwipeGesture))) {
  1266         if (gesture->state() == Qt::GestureFinished) {
  1292         if (gesture->state() == Qt::GestureFinished) {
  1267             HbWidgetFeedback::triggered(this, Hb::InstantFlicked);
       
  1268             // vertical swipes
  1293             // vertical swipes
  1269             if (gesture->sceneVerticalDirection() == QSwipeGesture::Down) {
  1294             if (gesture->sceneVerticalDirection() == QSwipeGesture::Down) {
  1270                 d->mFlickDirection = HbFlickDirectionDown;
  1295                 d->mFlickDirection = HbFlickDirectionDown;
       
  1296                 HbWidgetFeedback::triggered(this, Hb::InstantFlicked);
  1271                 emit flickEvent(d->mFlickDirection);
  1297                 emit flickEvent(d->mFlickDirection);
  1272                 emit keypadCloseEventDetected(HbVkbCloseMethodCloseGesture);
  1298                 emit keypadCloseEventDetected(HbVkbCloseMethodCloseGesture);
  1273             } else if (gesture->sceneVerticalDirection() == QSwipeGesture::Up) {
  1299             } else if (gesture->sceneVerticalDirection() != QSwipeGesture::Up) {
  1274                 d->mFlickDirection = HbFlickDirectionUp;
       
  1275                 emit flickEvent(d->mFlickDirection);
       
  1276                 d->mCurrentHost->openKeypad(d->mCurrentHost->activeKeypad(), d->mOwner);
       
  1277             } else {
       
  1278                 d->mFlickDirection = (HbInputVkbWidget::HbFlickDirection)gesture->sceneHorizontalDirection();
  1300                 d->mFlickDirection = (HbInputVkbWidget::HbFlickDirection)gesture->sceneHorizontalDirection();
  1279                 // horizontal swipes
  1301                 // horizontal swipes
  1280                 if (d->mFlickAnimation) {
  1302                 if (d->mFlickAnimation) {
  1281                     animKeyboardChange();
  1303                     animKeyboardChange();
  1282                 }
  1304                 }
  1283                 emit flickEvent(d->mFlickDirection);
  1305                 emit flickEvent(d->mFlickDirection);
       
  1306                 // If keyboard change is not animated, flick direction should
       
  1307                 // be set to none immediately since otherwise it won't be changed
       
  1308                 if (!d->mFlickAnimation) {
       
  1309                     d->mFlickDirection = HbFlickDirectionNone;
       
  1310                 }
  1284             }
  1311             }
  1285         }
  1312         }
  1286     } else if (HbTapGesture *gesture = qobject_cast<HbTapGesture *>(event->gesture(Qt::TapGesture))) {
  1313     }
  1287         if (gesture->state() == Qt::GestureFinished) {
  1314 }
  1288             // if keypad is minimized, open it
  1315 
  1289             if (d->mCurrentHost && d->mCurrentHost->keypadStatus() == HbVkbHost::HbVkbStatusMinimized) {
  1316 /*!
  1290                 d->mCurrentHost->openKeypad(this, d->mOwner);
  1317 Returns the icon drawer of the object.
  1291             }
  1318  */
  1292         }
  1319 HbFrameDrawer* HbInputVkbWidget::iconDrawer()
  1293     }
  1320 {
  1294 }
  1321     Q_D(HbInputVkbWidget);
  1295 
  1322     return d->mIconDrawer;
       
  1323 }
       
  1324 
       
  1325 /*!
       
  1326 \fn void HbInputVkbWidget::keypadCloseEventDetected(HbInputVkbWidget::HbVkbCloseMethod closeMethod)
       
  1327 This signal informs that a closing event for the touch keypad was detected.
       
  1328 */
       
  1329 
       
  1330 /*!
       
  1331 \fn void HbInputVkbWidget::flickEvent(HbInputVkbWidget::HbFlickDirection direction)
       
  1332 This signal is emitted when a flick (swipe) gesture is detected.
       
  1333 */
       
  1334 
       
  1335 /*!
       
  1336 \fn void HbInputVkbWidget::smileySelected(QString text)
       
  1337 This signal informs that a smiley was selected.
       
  1338 */
       
  1339 
       
  1340 /*!
       
  1341 \fn void HbInputVkbWidget::mouseMovedOutOfButton()
       
  1342 This signal informs that the mouse was moved out of the pressed button.
       
  1343 */
       
  1344 
       
  1345 /*!
       
  1346 \fn void HbInputVkbWidget::aboutToActivateCustomAction(HbAction *custAction)
       
  1347 This signal is emitted when the user presses the editor-specific custom button.
       
  1348 */
       
  1349 
       
  1350 /*!
       
  1351 \fn void HbInputVkbWidget::settingsListClosed()
       
  1352 This signal is emitted when the setting list is closed.
       
  1353 */
  1296 #include "moc_hbinputvkbwidget.cpp"
  1354 #include "moc_hbinputvkbwidget.cpp"
  1297 
  1355 
  1298 // End of file
  1356 // End of file