|
1 /* |
|
2 * Copyright (c) 2009-2010 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: header of number mode symbol table. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef C_PENINPUTARABICFINGERHWRNUMSYMBOLTABLE_H |
|
20 #define C_PENINPUTARABICFINGERHWRNUMSYMBOLTABLE_H |
|
21 |
|
22 // INCLUDES |
|
23 #include <e32std.h> |
|
24 #include <e32base.h> |
|
25 #include <e32cmn.h> |
|
26 |
|
27 #include <peninputlayoutctrlgroup.h> |
|
28 |
|
29 // FORWARD DECLARATIONS |
|
30 class CAknFepCtrlEventButton; |
|
31 class CVirtualKeyboard; |
|
32 |
|
33 // CLASS DECLARATION |
|
34 |
|
35 /** |
|
36 * class CPeninputArabicFingerHwrNumSymbolTable. |
|
37 * |
|
38 * The symbol table control for arabic input |
|
39 * |
|
40 * @lib peninputfingerhwrar.lib |
|
41 * @since Symbian TB9.2 |
|
42 */ |
|
43 class CPeninputArabicFingerHwrNumSymbolTable : public CControlGroup |
|
44 { |
|
45 public: |
|
46 /** |
|
47 * Symbian constructor |
|
48 * |
|
49 * @since Symbian TB9.2 |
|
50 * @param aUiLayout The layout |
|
51 * @param aId The control id |
|
52 * @return pointer of created object. |
|
53 */ |
|
54 static CPeninputArabicFingerHwrNumSymbolTable* NewL( CFepUiLayout* aUiLayout, TInt aId ); |
|
55 |
|
56 /** |
|
57 * Symbian constructor |
|
58 * |
|
59 * @since Symbian TB9.2 |
|
60 * @param aUiLayout The layout |
|
61 * @param aId The control id |
|
62 * @return pointer of created object. |
|
63 */ |
|
64 static CPeninputArabicFingerHwrNumSymbolTable* NewLC( CFepUiLayout* aUiLayout, TInt aId ); |
|
65 |
|
66 /** |
|
67 * standard c++ destructor. |
|
68 * |
|
69 * @since Symbian TB9.2 |
|
70 */ |
|
71 ~CPeninputArabicFingerHwrNumSymbolTable(); |
|
72 |
|
73 public: |
|
74 /** |
|
75 * open the symbol table. |
|
76 * |
|
77 * @since Symbian TB9.2 |
|
78 * |
|
79 * @return None |
|
80 */ |
|
81 void OpenSymbolTable(); |
|
82 |
|
83 /** |
|
84 * cancel the popup. |
|
85 * |
|
86 * @since Symbian TB9.2 |
|
87 * @return None |
|
88 * |
|
89 */ |
|
90 void CloseSymbolTable(); |
|
91 |
|
92 /** |
|
93 * get visibility of popup. |
|
94 * @since Symbian TB9.2 |
|
95 * @return ETrue if the popup is visible |
|
96 */ |
|
97 TBool IsPopup(); |
|
98 |
|
99 /** |
|
100 * sizechanged |
|
101 * |
|
102 */ |
|
103 void SizeChanged(const TRect& aVirtualKeypadRect); |
|
104 |
|
105 /** |
|
106 * Load VKB image |
|
107 * |
|
108 */ |
|
109 void LoadVkbKeyImageL(TInt aResId, const TSize& aKeySize); |
|
110 |
|
111 /** |
|
112 * Load virutal Key and set key rects. |
|
113 * |
|
114 */ |
|
115 void LoadVirtualKeypadKeyL(const TInt aResId, const RArray<TRect>& aCellRects); |
|
116 |
|
117 /** |
|
118 * Return keypad control |
|
119 * |
|
120 */ |
|
121 inline CVirtualKeyboard* KeyPad(){return iNumKeypad;} |
|
122 |
|
123 /** |
|
124 * Construct from resource |
|
125 * This funciton will be called when the resource has changed for example skin was changed |
|
126 */ |
|
127 void ConstructFromResourceL(); |
|
128 |
|
129 /** |
|
130 * accept editor's number mapping restriction. |
|
131 * |
|
132 * @since S60 v5.0 |
|
133 * @param aNumMapping a string contains numbers and related char. max length is 16. |
|
134 * @return none |
|
135 */ |
|
136 void UpdateTableSymbol( const TDesC& aNumMapping ); |
|
137 |
|
138 /* |
|
139 * set arabic number mode. |
|
140 * @since s60 v5.2 |
|
141 * @param aIsNativeNumMode a flag to indicate whether it is native number mode. |
|
142 * @return none. |
|
143 */ |
|
144 void SetNativeNumMode(const TBool aIsNativeNumMode); |
|
145 |
|
146 /** |
|
147 * Update the virtual keys rect. |
|
148 * @since s60 5.2. |
|
149 * @param aCellRects keypad cell rects. |
|
150 * @return None. |
|
151 */ |
|
152 void UpdateAllVirtualKeysRect(const RArray<TRect> & aCellRects); |
|
153 protected: //virtuals from CControlGroup (CFepUiBaseCtrl) |
|
154 |
|
155 /** |
|
156 * From CControlGroup |
|
157 * Handle pointer down event |
|
158 * |
|
159 * @since Symbian TB9.2 |
|
160 * @param aPoint The point position relative the layout |
|
161 * @return The control which handles the event. |
|
162 */ |
|
163 CFepUiBaseCtrl* HandlePointerDownEventL(const TPoint& aPoint); |
|
164 |
|
165 /** |
|
166 * From CControlGroup |
|
167 * Handle pointer up event |
|
168 * |
|
169 * @since Symbian TB9.2 |
|
170 * @param aPoint The point position relative the layout |
|
171 * @return The control which handles the event. |
|
172 */ |
|
173 CFepUiBaseCtrl* HandlePointerUpEventL(const TPoint& aPoint); |
|
174 |
|
175 /** |
|
176 * From CControlGroup |
|
177 * Handle pointer move event |
|
178 * |
|
179 * @since S60 54.0 |
|
180 * @param aPoint The point position relative the layout |
|
181 * @return The control which handles the event. |
|
182 */ |
|
183 CFepUiBaseCtrl* HandlePointerMoveEventL(const TPoint& aPoint); |
|
184 |
|
185 /** |
|
186 * C++ constructor |
|
187 * |
|
188 * @since Symbian TB9.2 |
|
189 * @param aFepUiLayout A Ui Layout environment (CFepUiLayout) |
|
190 * @param aControlId Control id |
|
191 * @return none. |
|
192 */ |
|
193 CPeninputArabicFingerHwrNumSymbolTable(CFepUiLayout* aFepUiLayout, TInt aControlId); |
|
194 |
|
195 /** |
|
196 * Symbian second-phase constructor |
|
197 * |
|
198 * @since Symbian TB9.2 |
|
199 * @return None |
|
200 */ |
|
201 void ConstructL(); |
|
202 |
|
203 /** |
|
204 * create a virtual keypad |
|
205 * |
|
206 * @since Symbian TB9.2 |
|
207 * @return None |
|
208 */ |
|
209 void CreateVirtualKeypadL(); |
|
210 |
|
211 /** |
|
212 * Update the virtual key feedback |
|
213 * |
|
214 */ |
|
215 void UpdateAllVirtualKeysFeedback(); |
|
216 |
|
217 /** |
|
218 * Draw group control |
|
219 */ |
|
220 void Draw(); |
|
221 |
|
222 private: |
|
223 /** |
|
224 * Refresh the symbol table |
|
225 * |
|
226 */ |
|
227 void RefreshNumSymbolTable(); |
|
228 |
|
229 /** |
|
230 * Load background from resource |
|
231 * |
|
232 */ |
|
233 void LoadBackgroundFromResourceL(const TInt aResId); |
|
234 |
|
235 /* |
|
236 * map latin number to arabic number. |
|
237 */ |
|
238 TInt16 MapLatinNumAccordingToNumMode(TInt16 aUnicode); |
|
239 |
|
240 /** |
|
241 * Generate the char talbe according to the aNumMapping |
|
242 * |
|
243 */ |
|
244 HBufC* GenerateCharTable(const TDesC& aNumMapping); |
|
245 |
|
246 private: |
|
247 /** |
|
248 * multipage viritual keyboard |
|
249 * not own. |
|
250 */ |
|
251 CVirtualKeyboard* iNumKeypad; |
|
252 |
|
253 /** |
|
254 * visibility of popup list. |
|
255 */ |
|
256 TBool iPopupVisible; |
|
257 |
|
258 /* |
|
259 * Default number mode. |
|
260 */ |
|
261 TBool iIsNativeNumMode; |
|
262 }; |
|
263 |
|
264 #endif // C_PENINPUTARABICFINGERHWRNUMSYMBOLTABLE_H |