20 ** |
20 ** |
21 ** If you have questions regarding the use of this file, please contact |
21 ** If you have questions regarding the use of this file, please contact |
22 ** Nokia at developer.feedback@nokia.com. |
22 ** Nokia at developer.feedback@nokia.com. |
23 ** |
23 ** |
24 ****************************************************************************/ |
24 ****************************************************************************/ |
25 |
|
26 #ifndef HBABSTRACTVKBHOST_P_H |
25 #ifndef HBABSTRACTVKBHOST_P_H |
27 #define HBABSTRACTVKBHOST_P_H |
26 #define HBABSTRACTVKBHOST_P_H |
28 |
27 |
|
28 #include <QGraphicsObject> |
|
29 #include <QWidget> |
29 #include <QTimeLine> |
30 #include <QTimeLine> |
30 #include <QPointer> |
31 #include <QPointer> |
|
32 #include <QPointF> |
|
33 #include <QRectF> |
|
34 #include <QSizeF> |
|
35 |
|
36 #include "hbinputvkbhost.h" |
|
37 |
|
38 #include <hbview.h> |
31 |
39 |
32 class QGraphicsWidget; |
40 class QGraphicsWidget; |
33 class HbMainWindow; |
41 class HbMainWindow; |
34 class HbVirtualKeyboard; |
42 class HbVirtualKeyboard; |
35 class HbAbstractVkbHost; |
43 class HbAbstractVkbHost; |
36 class HbView; |
|
37 class HbInputFocusObject; |
44 class HbInputFocusObject; |
38 |
45 |
39 class HbPendingVkbHostCall |
46 class HbPendingVkbHostCall |
40 { |
47 { |
41 public: |
48 public: |
44 public: |
51 public: |
45 HbVirtualKeyboard *vkb; |
52 HbVirtualKeyboard *vkb; |
46 bool animationAllowed; |
53 bool animationAllowed; |
47 }; |
54 }; |
48 |
55 |
49 |
56 class HB_CORE_PRIVATE_EXPORT HbVkbHostContainerWidget |
50 // This class is to handle all the specific widget actions in an, |
|
51 // abstract way, put all such widget specific code in below class. |
|
52 class HbVkbHostContainerWidget |
|
53 { |
57 { |
54 public: |
58 public: |
55 HbVkbHostContainerWidget(QObject *containterWidget); |
59 HbVkbHostContainerWidget(QObject *containterWidget); |
56 void setPos(QPointF newPosition); |
60 void setPos(QPointF newPosition); |
57 QPointF pos(); |
61 QPointF pos(); |
58 QRectF sceneBoundingRect(); |
62 QRectF sceneBoundingRect(); |
59 QObject *widgetObject() { |
63 QObject *widgetObject() { |
60 return mContainerWidget; |
64 if (mGraphicsObject) { |
|
65 return mGraphicsObject.data(); |
|
66 } |
|
67 return mWidget.data(); |
61 } |
68 } |
62 void connectSignals(QObject *receiver); |
69 void connectSignals(QObject *receiver); |
63 void disconnectSignals(QObject *receiver); |
70 void disconnectSignals(QObject *receiver); |
|
71 |
64 private: |
72 private: |
65 QPointer<QObject> mContainerWidget; |
73 QPointer<QWidget> mWidget; |
|
74 QPointer<QGraphicsObject> mGraphicsObject; |
66 }; |
75 }; |
67 |
76 |
68 class HbAbstractVkbHostPrivate |
77 class HB_CORE_PRIVATE_EXPORT HbAbstractVkbHostPrivate |
69 { |
78 { |
|
79 Q_DECLARE_PUBLIC(HbAbstractVkbHost) |
70 public: |
80 public: |
71 HbAbstractVkbHostPrivate(HbAbstractVkbHost *myVkbHost, QObject *containerWidget); |
81 HbAbstractVkbHostPrivate(HbAbstractVkbHost *myVkbHost, QObject *containerWidget); |
72 virtual ~HbAbstractVkbHostPrivate(); |
82 virtual ~HbAbstractVkbHostPrivate(); |
73 |
83 |
74 virtual void openKeypad(); |
84 virtual void openKeypad(); |
75 virtual void closeKeypad(); |
85 virtual void closeKeypad(); |
76 virtual void minimizeKeypad(); |
|
77 virtual void openMinimizedKeypad(); |
|
78 virtual void openKeypadWithoutAnimation(); |
86 virtual void openKeypadWithoutAnimation(); |
79 virtual void closeKeypadWithoutAnimation(); |
87 virtual void closeKeypadWithoutAnimation(); |
80 virtual void minimizeKeypadWithoutAnimation(); |
|
81 virtual void cancelAnimationAndHideVkbWidget(); |
88 virtual void cancelAnimationAndHideVkbWidget(); |
82 virtual bool prepareContainerAnimation(HbVkbHost::HbVkbStatus status); |
89 virtual bool prepareContainerAnimation(HbVkbHost::HbVkbStatus status); |
83 virtual bool prepareKeypadAnimation(HbVkbHost::HbVkbStatus status); |
90 virtual bool prepareKeypadAnimation(HbVkbHost::HbVkbStatus status); |
84 |
91 |
85 void prepareAnimationsCommon(); |
92 void prepareAnimationsCommon(); |
91 HbMainWindow *mainWindow() const; |
98 HbMainWindow *mainWindow() const; |
92 QSizeF screenSize() const; |
99 QSizeF screenSize() const; |
93 bool disableCursorShift(); |
100 bool disableCursorShift(); |
94 void setTitleAndStatusBarVisible(bool visible); |
101 void setTitleAndStatusBarVisible(bool visible); |
95 bool getViewAndFocusObjects(HbView*& currentView, HbInputFocusObject*& focusObject); |
102 bool getViewAndFocusObjects(HbView*& currentView, HbInputFocusObject*& focusObject); |
|
103 virtual void getViewFlagsForVisibilityChange(HbView::HbViewFlags &viewFlags, bool visible, HbView *view); |
|
104 void _q_containerAboutToClose(); |
|
105 void ensureVisibilityInsideScrollArea() const; |
|
106 |
96 public: |
107 public: |
97 HbAbstractVkbHost *q_ptr; |
108 HbAbstractVkbHost *q_ptr; |
98 HbVirtualKeyboard *mCallback; |
109 HbVirtualKeyboard *mCallback; |
99 QPointer<QGraphicsWidget> mKeypad; |
110 QPointer<QGraphicsWidget> mKeypad; |
100 HbVkbHostContainerWidget *mContainerWidget; |
111 HbVkbHostContainerWidget *mContainerWidget; |
101 QSizeF mScreenSize; |
112 QSizeF mScreenSize; |
102 QTimeLine mTimeLine; |
113 QTimeLine mTimeLine; |
103 HbVkbHost::HbVkbStatus mKeypadStatus; |
114 HbVkbHost::HbVkbStatus mKeypadStatus; |
104 bool mKeypadOperationOngoing; |
115 bool mKeypadOperationOngoing; |
105 |
|
106 QPointF mOriginalContainerPosition; |
116 QPointF mOriginalContainerPosition; |
107 |
|
108 QPointF mContainerMovementStartingPoint; |
117 QPointF mContainerMovementStartingPoint; |
109 QPointF mContainerMovementVector; |
118 QPointF mContainerMovementVector; |
110 |
|
111 QPointF mKeypadMovementStartingPoint; |
119 QPointF mKeypadMovementStartingPoint; |
112 QPointF mKeypadMovementVector; |
120 QPointF mKeypadMovementVector; |
113 |
|
114 QPointer<HbInputMethod> mInputMethod; |
121 QPointer<HbInputMethod> mInputMethod; |
115 HbVkbHost::HbVkbStatus mKeypadStatusBeforeOrientationChange; |
122 HbVkbHost::HbVkbStatus mKeypadStatusBeforeOrientationChange; |
116 HbPendingVkbHostCall mPendingCall; |
123 HbPendingVkbHostCall mPendingCall; |
117 bool mTitleBarHiddenByVkbHost; |
124 bool mTitleBarHiddenByVkbHost; |
118 bool mStatusBarHiddenByVkbHost; |
125 bool mStatusBarHiddenByVkbHost; |
|
126 |
|
127 private: // For unit test. |
|
128 static HbAbstractVkbHostPrivate *d_ptr(HbAbstractVkbHost *host) { |
|
129 Q_ASSERT(host); |
|
130 return host->d_func(); |
|
131 } |
|
132 friend class TestHbAbstractVkbHostPrivate; |
119 }; |
133 }; |
120 |
134 |
121 #endif // HBABSTRACTVKBHOST_P_H |
135 #endif // HBABSTRACTVKBHOST_P_H |
122 |
136 |
123 // End of file |
137 // End of file |
124 |
|