|
1 /**************************************************************************** |
|
2 ** |
|
3 ** Copyright (C) 2008-2010 Nokia Corporation and/or its subsidiary(-ies). |
|
4 ** All rights reserved. |
|
5 ** Contact: Nokia Corporation (developer.feedback@nokia.com) |
|
6 ** |
|
7 ** This file is part of the HbInput module of the UI Extensions for Mobile. |
|
8 ** |
|
9 ** GNU Lesser General Public License Usage |
|
10 ** This file may be used under the terms of the GNU Lesser General Public |
|
11 ** License version 2.1 as published by the Free Software Foundation and |
|
12 ** appearing in the file LICENSE.LGPL included in the packaging of this file. |
|
13 ** Please review the following information to ensure the GNU Lesser General |
|
14 ** Public License version 2.1 requirements will be met: |
|
15 ** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. |
|
16 ** |
|
17 ** In addition, as a special exception, Nokia gives you certain additional |
|
18 ** rights. These rights are described in the Nokia Qt LGPL Exception |
|
19 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. |
|
20 ** |
|
21 ** If you have questions regarding the use of this file, please contact |
|
22 ** Nokia at developer.feedback@nokia.com. |
|
23 ** |
|
24 ****************************************************************************/ |
|
25 |
|
26 #ifndef HB_INPUT_VKB_WIDGET_PRIVATE_H |
|
27 #define HB_INPUT_VKB_WIDGET_PRIVATE_H |
|
28 |
|
29 // |
|
30 // W A R N I N G |
|
31 // ------------- |
|
32 // |
|
33 // This file is not part of the Hb Inputs API. It exists purely as an |
|
34 // implementation detail. This header file may change from version to |
|
35 // version without notice, or even be removed. |
|
36 // |
|
37 #include <QSignalMapper> |
|
38 #include <QPointer> |
|
39 #include <QTime> |
|
40 #include <QTimeLine> |
|
41 |
|
42 #include "hbinputdef.h" |
|
43 #include "hbwidget_p.h" |
|
44 #include "hbinputvkbwidget.h" |
|
45 |
|
46 const QString settingsIcon("qtg_mono_settings"); |
|
47 const QString inputMethodIcon("qtg_mono_virtual_input"); |
|
48 const QString predictionOnIcon("qtg_mono_predictive_text_on"); |
|
49 const QString predictionOffIcon("qtg_mono_predictive_text_off"); |
|
50 |
|
51 class QTimeLine; |
|
52 class QBitmap; |
|
53 class QPixmap; |
|
54 class QGraphicsGridLayout; |
|
55 class HbInputVirtualRocker; |
|
56 class HbPushButton; |
|
57 class HbFrameDrawer; |
|
58 class QAction; |
|
59 class HbStackedWidget; |
|
60 class HbVkbHost; |
|
61 class HbTouchKeypadButton; |
|
62 class HbInputModeIndicator; |
|
63 class HbKeymap; |
|
64 class HbInputSmileyPicker; |
|
65 class HbInputMethod; |
|
66 class QGraphicsLinearLayout; |
|
67 class HbInputScreenshotWidget; |
|
68 class HbInputFocusObject; |
|
69 class HbInputSettingList; |
|
70 |
|
71 const qreal VerticalSpacing = 0.0, HorizontalSpacing = 0.0; //vertical and horizontal spacing for buttons in layout |
|
72 |
|
73 class HB_INPUT_PRIVATE_EXPORT HbInputVkbWidgetPrivate : public HbWidgetPrivate |
|
74 { |
|
75 Q_DECLARE_PUBLIC(HbInputVkbWidget) |
|
76 |
|
77 public: |
|
78 enum HbQwertyKeyboardSize |
|
79 { |
|
80 HbQwerty4x10, |
|
81 HbQwerty4x11 |
|
82 }; |
|
83 HbInputVkbWidgetPrivate(); |
|
84 virtual ~HbInputVkbWidgetPrivate(); |
|
85 virtual void init(); |
|
86 |
|
87 virtual int keyCode(int buttonId); |
|
88 virtual int keyCode(HbTouchKeypadButton *button); |
|
89 |
|
90 virtual void handleStandardButtonPress(int aButtonId); |
|
91 virtual void handleStandardButtonRelease(int aButtonId); |
|
92 |
|
93 virtual void addCustomButtonToLayout( HbTouchKeypadButton* button, |
|
94 int index); |
|
95 |
|
96 void redirectMousePressEvent(QGraphicsSceneMouseEvent *aEvent); |
|
97 void redirectMouseReleaseEvent(QGraphicsSceneMouseEvent *aEvent); |
|
98 |
|
99 virtual void applyEditorConstraints(); |
|
100 |
|
101 virtual void setRockerPosition(); |
|
102 |
|
103 void captureScreenshot(); |
|
104 void updateMouseHitItem(HbTouchKeypadButton *button, QPointF position); |
|
105 void normalizeProbabilities(QList<HbKeyPressProbability> &allProbableKeys); |
|
106 |
|
107 bool isSmileysEnabled(); |
|
108 bool isKeyboardDimmed(); |
|
109 |
|
110 friend class HbTouchKeypadButton; |
|
111 friend class HbInputUsedSymbolPane; |
|
112 |
|
113 public: |
|
114 HbInputVkbWidget *q_ptr; |
|
115 HbInputMethod *mOwner; |
|
116 bool mIsKeypadOn; |
|
117 |
|
118 HbKeypadMode mMode; |
|
119 const HbKeymap *mKeymap; |
|
120 |
|
121 HbModifiers mModifiers; |
|
122 |
|
123 HbInputModeIndicator* mInputModeIndicator; |
|
124 |
|
125 QPointer<HbTouchKeypadButton> mApplicationButton; |
|
126 QPointer<HbAction> mApplicationButtonAction; |
|
127 QPointer<HbTouchKeypadButton> mSettingsButton; |
|
128 QPointer<HbInputSettingList> mSettingList; |
|
129 |
|
130 QGraphicsGridLayout* mButtonLayout; |
|
131 |
|
132 QSignalMapper *mPressMapper; |
|
133 QSignalMapper *mReleaseMapper; |
|
134 QSignalMapper *mActionMapper; |
|
135 |
|
136 HbInputVirtualRocker *mRocker; |
|
137 |
|
138 HbFrameDrawer *mBackgroundDrawer; |
|
139 HbFrameDrawer *mIconDrawer; |
|
140 |
|
141 bool mMainWinConnected; |
|
142 bool mShowRocker; |
|
143 QGraphicsLinearLayout *mLayout; |
|
144 QPointer<HbVkbHost> mCurrentHost; |
|
145 bool mDrawbackground; |
|
146 QTime mMousePressTime; |
|
147 bool mMouseButtonPressedDown; |
|
148 HbInputVkbWidget::HbFlickDirection mFlickDirection; |
|
149 HbInputSmileyPicker *mSmileyPicker; |
|
150 |
|
151 HbInputScreenshotWidget* mScreenshotWidget; |
|
152 QTimeLine mScreenshotTimeLine; |
|
153 HbTouchKeypadButton *mMostRecentlyAccessedButton; |
|
154 QPointF mMostRecentlyClickedLocation; |
|
155 HbInputFocusObject *mFocusedObject; |
|
156 bool mFlickAnimation; |
|
157 bool mSettingsListOpen; |
|
158 bool mAnimateWhenDialogCloses; |
|
159 HbQwertyKeyboardSize mKeyboardSize; |
|
160 int mCloseHandleHeight; |
|
161 QGraphicsWidget *mCloseHandle; |
|
162 bool mKeyboardDimmed; |
|
163 }; |
|
164 |
|
165 #endif //HB_INPUT_VKB_WIDGET_PRIVATE_H |
|
166 |
|
167 // End of file |