61 #include <hbinputbutton.h> |
64 #include <hbinputbutton.h> |
62 #include <HbSwipeGesture> |
65 #include <HbSwipeGesture> |
63 #include <HbTapGesture> |
66 #include <HbTapGesture> |
64 #include <HbSelectionDialog> |
67 #include <HbSelectionDialog> |
65 #include <HbListWidgetItem> |
68 #include <HbListWidgetItem> |
|
69 |
66 #include "hbinputvirtualrocker.h" |
70 #include "hbinputvirtualrocker.h" |
67 #include "hbinputvkbwidget.h" |
|
68 #include "hbinputvkbwidget_p.h" |
|
69 #include "hbinputsettinglist.h" |
71 #include "hbinputsettinglist.h" |
70 #include "hbinputmodeindicator.h" |
72 #include "hbinputmodeindicator.h" |
71 #include <hbfeedbackmanager.h> |
73 #include <hbfeedbackmanager.h> |
72 #include "hbinputsmileypicker.h" |
74 #include "hbinputsmileypicker.h" |
73 #include "hbinputscreenshotwidget.h" |
75 #include "hbinputscreenshotwidget.h" |
93 with a finger. This class also implements background drawing for touch keypads. |
95 with a finger. This class also implements background drawing for touch keypads. |
94 */ |
96 */ |
95 |
97 |
96 /// @cond |
98 /// @cond |
97 |
99 |
98 inline HbWidget* hbwidget_cast(QGraphicsItem *item) |
100 inline HbWidget *hbwidget_cast(QGraphicsItem *item) |
99 { |
101 { |
100 if( item->isWidget() && static_cast<QGraphicsWidget*>(item)->inherits("HbWidget") ) { |
102 if (item->isWidget() && static_cast<QGraphicsWidget *>(item)->inherits("HbWidget")) { |
101 return static_cast<HbWidget*>(item); |
103 return static_cast<HbWidget *>(item); |
102 } |
104 } |
103 return 0; |
105 return 0; |
104 } |
106 } |
105 |
107 |
106 HbInputVkbWidgetPrivate::HbInputVkbWidgetPrivate() |
108 HbInputVkbWidgetPrivate::HbInputVkbWidgetPrivate() |
107 : mOwner(0), |
109 : mOwner(0), |
108 mMode(EModeAbc), |
110 mMode(EModeAbc), |
109 mKeymap(0), |
111 mKeymap(0), |
110 mModifiers(0), |
112 mModifiers(0), |
111 mInputModeIndicator(0), |
113 mInputModeIndicator(0), |
112 mSettingList(0), |
114 mSettingList(0), |
113 mButtonLayout(0), |
115 mButtonLayout(0), |
114 mRocker(0), |
116 mRocker(0), |
115 mBackgroundDrawer(0), |
117 mBackgroundDrawer(0), |
116 mIconDrawer(0), |
118 mIconDrawer(0), |
117 mMainWinConnected(false), |
119 mMainWinConnected(false), |
118 mShowRocker(false), |
120 mShowRocker(false), |
119 mLayout(0), |
121 mLayout(0), |
120 mCurrentHost(0), |
122 mCurrentHost(0), |
121 mDrawbackground(true), |
123 mDrawbackground(true), |
122 mMouseButtonPressedDown(false), |
124 mMouseButtonPressedDown(false), |
123 mFlickDirection(HbInputVkbWidget::HbFlickDirectionNone), |
125 mFlickDirection(HbInputVkbWidget::HbFlickDirectionNone), |
124 mSmileyPicker(0), |
126 mSmileyPicker(0), |
125 mScreenshotWidget(0), |
127 mScreenshotWidget(0), |
126 mScreenshotTimeLine(250), |
128 mScreenshotTimeLine(250), |
127 mMostRecentlyAccessedButton(0), |
129 mMostRecentlyAccessedButton(0), |
128 mMostRecentlyClickedLocation(0.0,0.0), |
130 mMostRecentlyClickedLocation(0.0, 0.0), |
129 mFocusedObject(0), |
131 mFocusedObject(0), |
130 mFlickAnimation(false), |
132 mFlickAnimation(false), |
131 mSettingsListOpen(false), |
133 mSettingsListOpen(false), |
132 mAnimateWhenDialogCloses(false), |
134 mAnimateWhenDialogCloses(false), |
133 mKeyboardSize(HbQwerty4x10), |
135 mKeyboardSize(HbQwerty4x10), |
134 mCloseHandleHeight(0), |
136 mCloseHandleHeight(0), |
135 mCloseHandle(0), |
137 mCloseHandle(0), |
136 mSettingView(0), |
138 mSettingView(0), |
137 mCurrentView(0), |
139 mCurrentView(0), |
138 mKeyboardDimmed(false), |
140 mKeyboardDimmed(false), |
139 mImSelectionDialog(0) |
141 mImSelectionDialog(0), |
|
142 mSettingWidget(0) |
140 { |
143 { |
141 mScreenshotTimeLine.setUpdateInterval(16); |
144 mScreenshotTimeLine.setUpdateInterval(16); |
142 } |
145 } |
143 |
146 |
144 |
147 |
175 } |
179 } |
176 |
180 |
177 void HbInputVkbWidgetPrivate::init() |
181 void HbInputVkbWidgetPrivate::init() |
178 { |
182 { |
179 Q_Q(HbInputVkbWidget); |
183 Q_Q(HbInputVkbWidget); |
180 |
184 q->setFlag(QGraphicsItem::ItemHasNoContents, false); |
181 HbInputButtonGroup *buttonGroup = static_cast<HbInputButtonGroup*>(q->contentItem()); |
185 |
182 QObject::connect(buttonGroup,SIGNAL(aboutToActivateCustomAction(HbAction*)), |
186 mRocker = new HbInputVirtualRocker(); |
183 q,SIGNAL(aboutToActivateCustomAction(HbAction*))); |
187 HbInputButtonGroup *buttonGroup = static_cast<HbInputButtonGroup *>(q->contentItem()); |
184 |
188 QObject::connect(buttonGroup, SIGNAL(aboutToActivateCustomAction(HbAction *)), |
185 mRocker = new HbInputVirtualRocker(q); |
189 q, SIGNAL(aboutToActivateCustomAction(HbAction *))); |
|
190 |
186 mRocker->setObjectName("VirtualRocker"); |
191 mRocker->setObjectName("VirtualRocker"); |
187 QSizeF rockerSize(HbRockerWidth, HbRockerWidth); |
192 QSizeF rockerSize(HbRockerWidth, HbRockerWidth); |
188 mRocker->resize(rockerSize); |
193 mRocker->resize(rockerSize); |
189 mRocker->setMinimumSize(HbRockerWidth, HbRockerWidth); |
194 mRocker->setMinimumSize(HbRockerWidth, HbRockerWidth); |
190 mRocker->setMaximumSize(HbRockerWidth*20, HbRockerWidth*20); |
195 mRocker->setMaximumSize(HbRockerWidth * 20, HbRockerWidth * 20); |
|
196 if (q->mainWindow()) { |
|
197 q->mainWindow()->scene()->addItem(mRocker); |
|
198 } |
191 |
199 |
192 QObject::connect(mRocker, SIGNAL(rockerDirection(int, HbInputVirtualRocker::RockerSelectionMode)), |
200 QObject::connect(mRocker, SIGNAL(rockerDirection(int, HbInputVirtualRocker::RockerSelectionMode)), |
193 q, SIGNAL(rockerDirection(int, HbInputVirtualRocker::RockerSelectionMode))); |
201 q, SLOT(_q_handleRockerChange(int, HbInputVirtualRocker::RockerSelectionMode))); |
194 |
202 |
195 mRocker->setVisible(false); |
203 mRocker->setVisible(false); |
196 |
204 |
197 mBackgroundDrawer = new HbFrameDrawer(); |
205 mBackgroundDrawer = new HbFrameDrawer(); |
198 mBackgroundDrawer->setFrameGraphicsName(backgroundGraphics); |
206 mBackgroundDrawer->setFrameGraphicsName(backgroundGraphics); |
305 |
313 |
306 void HbInputVkbWidgetPrivate::updateButtons() |
314 void HbInputVkbWidgetPrivate::updateButtons() |
307 { |
315 { |
308 Q_Q(HbInputVkbWidget); |
316 Q_Q(HbInputVkbWidget); |
309 |
317 |
310 HbInputButtonGroup *buttonGroup = static_cast<HbInputButtonGroup*>(q->contentItem()); |
318 HbInputButtonGroup *buttonGroup = static_cast<HbInputButtonGroup *>(q->contentItem()); |
311 if (buttonGroup) { |
319 if (buttonGroup) { |
312 int key = 0; |
320 int key = 0; |
313 QList<HbInputButton*> buttons = buttonGroup->buttons(); |
321 QList<HbInputButton *> buttons = buttonGroup->buttons(); |
314 for (int i = 0; i < buttons.count(); ++i) { |
322 for (int i = 0; i < buttons.count(); ++i) { |
315 if (keyCode(i) == HbInputButton::ButtonKeyCodeCharacter) { |
323 if (keyCode(i) == HbInputButton::ButtonKeyCodeCharacter) { |
316 HbInputButton *item = buttons.at(i); |
324 HbInputButton *item = buttons.at(i); |
317 |
325 |
318 const HbKeyboardMap *keyboardMap = mKeymap->keyboard(q->keyboardType()); |
326 const HbKeyboardMap *keyboardMap = mKeymap->keyboard(q->keyboardType()); |
319 if (keyboardMap && key < keyboardMap->keys.count() && keyboardMap->keys.at(key)->characters(mModifiers)!= QString("")) { |
327 if (keyboardMap && key < keyboardMap->keys.count() && keyboardMap->keys.at(key)->characters(mModifiers) != QString("")) { |
320 QString keydata = keyboardMap->keys.at(key)->characters(mModifiers); |
328 QString keydata = keyboardMap->keys.at(key)->characters(mModifiers); |
321 item->setText(keydata.at(0), HbInputButton::ButtonTextIndexPrimary); |
329 item->setText(keydata.at(0), HbInputButton::ButtonTextIndexPrimary); |
322 |
330 |
323 QString mappedCharacters; |
331 QString mappedCharacters; |
324 keydata.append(keyboardMap->keys.at(key)->characters(mModifiers | HbModifierFnPressed)); |
332 keydata.append(keyboardMap->keys.at(key)->characters(mModifiers | HbModifierFnPressed)); |
378 mScreenshotWidget->setGeometry(q->geometry()); |
379 mScreenshotWidget->setGeometry(q->geometry()); |
379 q->mainWindow()->scene()->addItem(mScreenshotWidget); |
380 q->mainWindow()->scene()->addItem(mScreenshotWidget); |
380 } |
381 } |
381 |
382 |
382 QPointF position = q->pos(); |
383 QPointF position = q->pos(); |
383 QRectF rect = QRectF(position.x(), position.y()+ mCloseHandleHeight, q->boundingRect().width(), q->boundingRect().height()- mCloseHandleHeight); |
384 QRectF rect = QRectF(position.x(), position.y() + mCloseHandleHeight, q->boundingRect().width(), q->boundingRect().height() - mCloseHandleHeight); |
384 QTransform rotateTrans; |
385 QTransform rotateTrans; |
385 rotateTrans = q->mainWindow()->viewportTransform(); |
386 rotateTrans = q->mainWindow()->viewportTransform(); |
386 QRectF transRect = rotateTrans.mapRect(rect); |
387 QRectF transRect = rotateTrans.mapRect(rect); |
387 QPixmap pixmap; |
388 QPixmap pixmap; |
388 pixmap = QPixmap::grabWidget(q->mainWindow(), (int)transRect.x(), (int)transRect.y(), (int)transRect.width(), (int)transRect.height()); |
389 pixmap = QPixmap::grabWidget(q->mainWindow(), (int)transRect.x(), (int)transRect.y(), (int)transRect.width(), (int)transRect.height()); |
427 } |
428 } |
428 |
429 |
429 return ret; |
430 return ret; |
430 } |
431 } |
431 |
432 |
|
433 void HbInputVkbWidgetPrivate::showInputMethodSelectionDialog() |
|
434 { |
|
435 Q_Q(HbInputVkbWidget); |
|
436 |
|
437 delete mImSelectionDialog; |
|
438 mImSelectionDialog = new HbSelectionDialog(); |
|
439 |
|
440 mImSelectionDialog->setObjectName("Input method dialog"); |
|
441 |
|
442 // Make sure the language dialog never steals focus. |
|
443 mImSelectionDialog->setFlag(QGraphicsItem::ItemIsPanel, true); |
|
444 mImSelectionDialog->setActive(false); |
|
445 |
|
446 QList<HbInputMethodDescriptor> customList = HbInputMethod::listCustomInputMethods(); |
|
447 |
|
448 QList<HbListWidgetItem *> listItems; |
|
449 HbListWidgetItem *item = new HbListWidgetItem(); |
|
450 QString methodName("Default"); |
|
451 item->setText(methodName); |
|
452 listItems.append(item); |
|
453 |
|
454 foreach(const HbInputMethodDescriptor &descriptor, customList) { |
|
455 QString displayName = descriptor.displayName(); |
|
456 if (displayName.length() == 0) { |
|
457 displayName = QString("Unknown"); |
|
458 } |
|
459 item = new HbListWidgetItem(); |
|
460 item->setText(displayName); |
|
461 listItems.append(item); |
|
462 } |
|
463 mImSelectionDialog->setWidgetItems(listItems, true); |
|
464 mImSelectionDialog->setSelectionMode(HbAbstractItemView::SingleSelection); |
|
465 mImSelectionDialog->setDismissPolicy(HbPopup::NoDismiss); |
|
466 mImSelectionDialog->setModal(true); |
|
467 |
|
468 q->connect(mImSelectionDialog, SIGNAL(finished(HbAction *)), q, SLOT(_q_inputMethodSelectionDialogFinished(HbAction *))); |
|
469 |
|
470 mImSelectionDialog->open(); |
|
471 } |
|
472 |
|
473 void HbInputVkbWidgetPrivate::_q_inputMethodSelectionDialogFinished(HbAction *action) |
|
474 { |
|
475 Q_UNUSED(action); |
|
476 |
|
477 QList<QVariant> selectedItems = mImSelectionDialog->selectedItems(); |
|
478 if (selectedItems.count()) { |
|
479 HbInputMethodDescriptor result; |
|
480 int selection = selectedItems.first().toInt(); |
|
481 if (selection == 0) { |
|
482 result.setDefault(); |
|
483 } else { |
|
484 QList<HbInputMethodDescriptor> customList = HbInputMethod::listCustomInputMethods(); |
|
485 if (customList.count() <= selection) { |
|
486 result = customList[selection-1]; |
|
487 } |
|
488 } |
|
489 |
|
490 if (!result.isEmpty() && mOwner) { |
|
491 // Set as active custom input method. |
|
492 HbInputSettingProxy::instance()->setPreferredInputMethod(Qt::Horizontal, result); |
|
493 HbInputSettingProxy::instance()->setPreferredInputMethod(Qt::Vertical, result); |
|
494 // And finally activate immediately. |
|
495 mOwner->activateInputMethod(result); |
|
496 } |
|
497 } |
|
498 } |
|
499 |
|
500 void HbInputVkbWidgetPrivate::_q_handleRockerChange(int direction, HbInputVirtualRocker::RockerSelectionMode selectionMode) |
|
501 { |
|
502 Q_Q(HbInputVkbWidget); |
|
503 |
|
504 if (direction == HbInputVirtualRocker::HbRockerDirectionRelease) { |
|
505 q->setKeyboardDimmed(false); |
|
506 } else if (direction == HbInputVirtualRocker::HbRockerDirectionPress || |
|
507 direction == HbInputVirtualRocker::HbRockerDirectionDoubleClick) { |
|
508 q->setKeyboardDimmed(true); |
|
509 } |
|
510 emit q->rockerDirection(direction, selectionMode); |
|
511 } |
|
512 |
432 QChar HbInputVkbWidgetPrivate::numberCharacterBoundToKey(int key) |
513 QChar HbInputVkbWidgetPrivate::numberCharacterBoundToKey(int key) |
433 { |
514 { |
434 QChar numChr; |
515 QChar numChr; |
435 if (!mKeymap || !mOwner) { |
516 if (!mKeymap || !mOwner) { |
436 return numChr; |
517 return numChr; |
437 } |
518 } |
438 |
519 |
439 HbInputFocusObject *focusObject = mOwner->focusObject(); |
520 HbInputFocusObject *focusObject = mOwner->focusObject(); |
440 if (!focusObject) { |
521 if (!focusObject) { |
441 return numChr; |
522 return numChr; |
442 } |
523 } |
443 HbInputLanguage language = mKeymap->language(); |
524 HbInputLanguage language = mKeymap->language(); |
444 if (language.language() != (QLocale::Language)0) { |
525 if (language.language() != (QLocale::Language)0) { |
445 HbInputDigitType digitType = HbInputUtils::inputDigitType(language); |
526 HbInputDigitType digitType = HbInputUtils::inputDigitType(language); |
446 |
527 |
447 // In number editors, show the native digits only when both device and writing languages are same, |
528 // In number editors, show the native digits only when both device and writing languages are same, |
448 // else show latin digits |
529 // else show latin digits |
449 if (focusObject->editorInterface().isNumericEditor()) { |
530 if (focusObject->editorInterface().isNumericEditor()) { |
450 QLocale::Language systemLanguage = QLocale::system().language(); |
531 QLocale::Language systemLanguage = QLocale::system().language(); |
451 if (language.language() != systemLanguage) { |
532 if (language.language() != systemLanguage) { |
452 digitType = HbDigitTypeLatin; |
533 digitType = HbDigitTypeLatin; |
453 } |
534 } |
454 } |
535 } |
455 |
536 |
456 HbKeyboardType keyboardType = mOwner->inputState().keyboard(); |
537 HbKeyboardType keyboardType = mOwner->inputState().keyboard(); |
457 |
538 |
458 if (keyboardType == HbKeyboardVirtual12Key) { |
539 if (keyboardType == HbKeyboardVirtual12Key) { |
459 numChr = HbInputUtils::findFirstNumberCharacterBoundToKey( |
540 numChr = HbInputUtils::findFirstNumberCharacterBoundToKey( |
460 mKeymap->keyboard(keyboardType)->keys.at(key), |
541 mKeymap->keyboard(keyboardType)->keys.at(key), |
461 language, digitType); |
542 language, digitType); |
462 } else if (keyboardType == HbKeyboardVirtualQwerty) { |
543 } else if (keyboardType == HbKeyboardVirtualQwerty) { |
463 switch (digitType) { |
544 switch (digitType) { |
464 case HbDigitTypeLatin: |
545 case HbDigitTypeLatin: |
465 numChr = HB_DIGIT_LATIN_START_VALUE + key; |
546 numChr = HB_DIGIT_LATIN_START_VALUE + key; |
466 break; |
547 break; |
479 } |
560 } |
480 } |
561 } |
481 return numChr; |
562 return numChr; |
482 } |
563 } |
483 |
564 |
484 void HbInputVkbWidgetPrivate::showInputMethodSelectionDialog() |
565 void HbInputVkbWidgetPrivate::_q_settingsClosed(HbAction* action) |
485 { |
566 { |
|
567 Q_UNUSED(action); |
486 Q_Q(HbInputVkbWidget); |
568 Q_Q(HbInputVkbWidget); |
487 |
569 |
488 delete mImSelectionDialog; |
570 q->settingsClosed(); |
489 mImSelectionDialog = new HbSelectionDialog(); |
|
490 |
|
491 mImSelectionDialog->setObjectName("Input method dialog"); |
|
492 |
|
493 // Make sure the language dialog never steals focus. |
|
494 mImSelectionDialog->setFlag(QGraphicsItem::ItemIsPanel, true); |
|
495 mImSelectionDialog->setActive(false); |
|
496 |
|
497 QList<HbInputMethodDescriptor> customList = HbInputMethod::listCustomInputMethods(); |
|
498 |
|
499 QList<HbListWidgetItem*> listItems; |
|
500 HbListWidgetItem* item = new HbListWidgetItem(); |
|
501 QString methodName("Default"); |
|
502 item->setText(methodName); |
|
503 listItems.append(item); |
|
504 |
|
505 foreach (HbInputMethodDescriptor descriptor, customList) { |
|
506 QString displayName = descriptor.displayName(); |
|
507 if (displayName.length() == 0) { |
|
508 displayName = QString("Unknown"); |
|
509 } |
|
510 item = new HbListWidgetItem(); |
|
511 item->setText(displayName); |
|
512 listItems.append(item); |
|
513 } |
|
514 mImSelectionDialog->setWidgetItems(listItems, true); |
|
515 mImSelectionDialog->setSelectionMode(HbAbstractItemView::SingleSelection); |
|
516 mImSelectionDialog->setDismissPolicy(HbPopup::NoDismiss); |
|
517 mImSelectionDialog->setModal(true); |
|
518 |
|
519 q->connect(mImSelectionDialog, SIGNAL(finished(HbAction*)), q, SLOT(_q_inputMethodSelectionDialogFinished(HbAction*))); |
|
520 |
|
521 mImSelectionDialog->open(); |
|
522 } |
|
523 |
|
524 void HbInputVkbWidgetPrivate::_q_inputMethodSelectionDialogFinished(HbAction *action) |
|
525 { |
|
526 Q_UNUSED(action); |
|
527 |
|
528 QList<QVariant> selectedItems = mImSelectionDialog->selectedItems(); |
|
529 if (selectedItems.count()) { |
|
530 HbInputMethodDescriptor result; |
|
531 int selection = selectedItems.first().toInt(); |
|
532 if (selection == 0) { |
|
533 result.setDefault(); |
|
534 } else { |
|
535 QList<HbInputMethodDescriptor> customList = HbInputMethod::listCustomInputMethods(); |
|
536 if (customList.count() <= selection) { |
|
537 result = customList[selection-1]; |
|
538 } |
|
539 } |
|
540 |
|
541 if (!result.isEmpty() && mOwner) { |
|
542 mOwner->activateInputMethod(result); |
|
543 } |
|
544 } |
|
545 } |
571 } |
546 |
572 |
547 /// @endcond |
573 /// @endcond |
548 |
574 |
549 /*! |
575 /*! |
550 Costructs the object. |
576 Costructs the object. |
551 */ |
577 */ |
552 HbInputVkbWidget::HbInputVkbWidget(QGraphicsItem* parent) |
578 HbInputVkbWidget::HbInputVkbWidget(QGraphicsItem *parent) |
553 : HbWidget(*new HbInputVkbWidgetPrivate, parent) |
579 : HbWidget(*new HbInputVkbWidgetPrivate, parent) |
554 { |
580 { |
555 Q_D(HbInputVkbWidget); |
581 Q_D(HbInputVkbWidget); |
556 d->q_ptr = this; |
582 d->q_ptr = this; |
557 d->initLayout(); |
583 d->initLayout(); |
558 d->init(); |
584 d->init(); |
559 |
585 |
560 setFocusPolicy(Qt::ClickFocus); |
586 setFocusPolicy(Qt::ClickFocus); |
561 setPos(QPointF(0,0)); |
587 setPos(QPointF(0, 0)); |
562 |
588 |
563 #ifdef HB_EFFECTS |
589 #ifdef HB_EFFECTS |
564 HbEffect::disable(this); |
590 HbEffect::disable(this); |
565 #endif // HB_EFFECTS |
591 #endif // HB_EFFECTS |
566 |
592 |
875 QPointF position; |
901 QPointF position; |
876 HbPopup::Placement placement; |
902 HbPopup::Placement placement; |
877 d->settingListPosition(position, placement); |
903 d->settingListPosition(position, placement); |
878 d->mSettingList->setPreferredPos(position, placement); |
904 d->mSettingList->setPreferredPos(position, placement); |
879 d->mSettingList->updateSettingList(); |
905 d->mSettingList->updateSettingList(); |
880 d->mSettingList->open(this, SLOT(settingsClosed())); |
906 d->mSettingList->open(this, SLOT(_q_settingsClosed(HbAction*))); |
881 } |
907 } |
882 |
908 |
883 /*! |
909 /*! |
884 Slot which is called when settings list is closed. |
910 Slot which is called when settings list is closed. |
885 */ |
911 */ |
886 void HbInputVkbWidget::settingsClosed() |
912 void HbInputVkbWidget::settingsClosed() |
887 { |
913 { |
888 Q_D(HbInputVkbWidget); |
914 Q_D(HbInputVkbWidget); |
889 |
915 |
890 HbInputButtonGroup *buttonGroup = static_cast<HbInputButtonGroup*>(contentItem()); |
916 HbInputButtonGroup *buttonGroup = static_cast<HbInputButtonGroup *>(contentItem()); |
891 if (buttonGroup) { |
917 if (buttonGroup) { |
892 HbInputButton *item = buttonGroup->button(HbInputButton::ButtonKeyCodeSettings); |
918 HbInputButton *item = buttonGroup->button(HbInputButton::ButtonKeyCodeSettings); |
893 if (item) { |
919 if (item) { |
894 item->setState(HbInputButton::ButtonStateReleased); |
920 item->setState(HbInputButton::ButtonStateReleased); |
895 buttonGroup->setButton(item, HbInputButton::ButtonKeyCodeSettings); |
921 buttonGroup->setButton(item, HbInputButton::ButtonKeyCodeSettings); |
896 } |
922 } |
897 } |
923 } |
898 |
924 |
899 d->mSettingsListOpen = false; |
925 d->mSettingsListOpen = false; |
900 if ( d->mAnimateWhenDialogCloses ) { |
926 if (d->mAnimateWhenDialogCloses) { |
901 animKeyboardChange(); |
927 animKeyboardChange(); |
902 d->mAnimateWhenDialogCloses = false; |
928 d->mAnimateWhenDialogCloses = false; |
903 } else if(d->mScreenshotTimeLine.state() != QTimeLine::Running) { |
929 } else if (d->mScreenshotTimeLine.state() != QTimeLine::Running) { |
904 keypadLanguageChangeFinished(); |
930 keypadLanguageChangeFinished(); |
905 } |
931 } |
906 } |
932 } |
907 |
933 |
908 /*! |
934 /*! |
935 vkbHost->closeKeypad(); |
961 vkbHost->closeKeypad(); |
936 } |
962 } |
937 |
963 |
938 closeSettingList(); |
964 closeSettingList(); |
939 hide(); |
965 hide(); |
940 |
966 if(!d->mSettingView) { |
941 d->mSettingView = new HbView(this); |
967 d->mSettingView = new HbView(this); |
|
968 HbAction *backAction = new HbAction(Hb::BackNaviAction, d->mSettingView); |
|
969 backAction->setText(tr("Back")); |
|
970 connect(backAction, SIGNAL(triggered(bool)), this, SLOT(closeSettingsView())); |
|
971 d->mSettingView->setNavigationAction(backAction); |
|
972 HbDataForm *dataForm = new HbDataForm(); |
|
973 d->mSettingView->setWidget(dataForm); |
|
974 d->mSettingWidget = new HbInputSettingWidget(dataForm, d->mSettingView); |
|
975 } |
|
976 d->mSettingWidget->initializeWidget(); |
942 HbInputRegionCollector::instance()->attach(d->mSettingView); |
977 HbInputRegionCollector::instance()->attach(d->mSettingView); |
943 d->mSettingView->setTitle(tr("Input Settings")); |
978 d->mSettingView->setTitle(tr("Input Settings")); |
944 mainWindow()->addView(d->mSettingView); |
979 mainWindow()->addView(d->mSettingView); |
945 |
|
946 HbAction *backAction = new HbAction(Hb::BackNaviAction, d->mSettingView); |
|
947 backAction->setText(tr("Back")); |
|
948 connect(backAction, SIGNAL(triggered(bool)), this, SLOT(closeSettingsView())); |
|
949 d->mSettingView->setNavigationAction(backAction); |
|
950 |
|
951 HbDataForm *dataForm = new HbDataForm(); |
|
952 d->mSettingView->setWidget(dataForm); |
|
953 HbInputSettingWidget *settingWidget = new HbInputSettingWidget(dataForm, d->mSettingView); |
|
954 settingWidget->initializeWidget(); |
|
955 |
|
956 d->mCurrentView = mainWindow()->currentView(); |
980 d->mCurrentView = mainWindow()->currentView(); |
957 mainWindow()->clearFocus(); |
981 mainWindow()->clearFocus(); |
958 mainWindow()->setCurrentView(d->mSettingView); |
982 mainWindow()->setCurrentView(d->mSettingView); |
959 } |
983 } |
960 |
984 |
1318 emit flickEvent(d->mFlickDirection); |
1361 emit flickEvent(d->mFlickDirection); |
1319 d->mCurrentHost->openKeypad(d->mCurrentHost->activeKeypad(), d->mOwner); |
1362 d->mCurrentHost->openKeypad(d->mCurrentHost->activeKeypad(), d->mOwner); |
1320 } else { |
1363 } else { |
1321 d->mFlickDirection = (HbInputVkbWidget::HbFlickDirection)gesture->sceneHorizontalDirection(); |
1364 d->mFlickDirection = (HbInputVkbWidget::HbFlickDirection)gesture->sceneHorizontalDirection(); |
1322 // horizontal swipes |
1365 // horizontal swipes |
1323 if (d->mFlickAnimation){ |
1366 if (d->mFlickAnimation) { |
1324 animKeyboardChange(); |
1367 animKeyboardChange(); |
1325 } |
1368 } |
1326 emit flickEvent(d->mFlickDirection); |
1369 emit flickEvent(d->mFlickDirection); |
1327 } |
1370 } |
1328 } |
1371 } |
1329 } else if(HbTapGesture *gesture = qobject_cast<HbTapGesture *>(event->gesture(Qt::TapGesture))) { |
1372 } else if (HbTapGesture *gesture = qobject_cast<HbTapGesture *>(event->gesture(Qt::TapGesture))) { |
1330 if (gesture->state() == Qt::GestureFinished) { |
1373 if (gesture->state() == Qt::GestureFinished) { |
1331 // if keypad is minimized, open it |
1374 // if keypad is minimized, open it |
1332 if (d->mCurrentHost && d->mCurrentHost->keypadStatus() == HbVkbHost::HbVkbStatusMinimized ) { |
1375 if (d->mCurrentHost && d->mCurrentHost->keypadStatus() == HbVkbHost::HbVkbStatusMinimized) { |
1333 d->mCurrentHost->openKeypad(this, d->mOwner); |
1376 d->mCurrentHost->openKeypad(this, d->mOwner); |
1334 } |
1377 } |
1335 } |
1378 } |
1336 } |
1379 } |
1337 } |
1380 } |
1338 |
1381 |
1339 #include "moc_hbinputvkbwidget.cpp" |
1382 #include "moc_hbinputvkbwidget.cpp" |
|
1383 |
1340 // End of file |
1384 // End of file |