44
|
1 |
/*
|
|
2 |
* Copyright (c) 2002-2005 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: drop-down list control
|
|
15 |
*
|
|
16 |
*/
|
|
17 |
|
|
18 |
|
|
19 |
#ifndef C_GENERICITUTWINDOW_H
|
|
20 |
#define C_GENERICITUTWINDOW_H
|
|
21 |
|
|
22 |
#include <peninputlayout.h>
|
|
23 |
#include <peninputpluginutils.h>
|
|
24 |
#include <peninputlayoutmultilineicf.h>
|
|
25 |
#include <peninputinputcontextfield.h>
|
|
26 |
|
|
27 |
#include <peninputlayoutvkb.h>
|
|
28 |
|
|
29 |
#include "peninputgenericitutwindowmanager.h"
|
|
30 |
#include "peninputgenericitutpropertysubscriber.h"
|
|
31 |
#include "peninputgenericitutlayoutcontext.h"
|
|
32 |
|
|
33 |
class CGenericItutDataMgr;
|
|
34 |
class CFepCtrlDropdownList;
|
|
35 |
class CPeninputLayoutInputmodelChoice;
|
|
36 |
class CFepLayoutScrollableList;
|
|
37 |
class CAknFepCtrlCommonBgCtrl;
|
|
38 |
class CPeninputCommonChoiceList;
|
|
39 |
class CPeninputSyncBitmapRotator;
|
|
40 |
|
|
41 |
const TInt KUnavailableID = -1;
|
|
42 |
|
|
43 |
class CGenericItutWindow : public CBase
|
|
44 |
{
|
|
45 |
private:
|
|
46 |
|
|
47 |
enum TButtonType
|
|
48 |
{
|
|
49 |
ERawKeyButton,
|
|
50 |
ECommonButton,
|
|
51 |
ERepeatButtonEx
|
|
52 |
};
|
|
53 |
|
|
54 |
enum TIndicatorAlign
|
|
55 |
{
|
|
56 |
EIndiAlignLeft,
|
|
57 |
EIndiAlignCenter,
|
|
58 |
EIndiAlignRight
|
|
59 |
};
|
|
60 |
public:
|
|
61 |
static CGenericItutWindow* NewL(CGenericItutWindowManager* aWindowMgr,
|
|
62 |
CGenericItutUiLayout* aLayoutOwner,
|
|
63 |
CGenericItutDataMgr* aDataMgr);
|
|
64 |
|
|
65 |
~CGenericItutWindow();
|
|
66 |
|
|
67 |
TInt OnAppEditorTextComing(const TFepInputContextFieldData& aData);
|
|
68 |
|
|
69 |
TInt PenInputType();
|
|
70 |
|
|
71 |
// from MITUTPropertySubscriber
|
|
72 |
void SetPropertyL( MItutPropertySubscriber::TItutProperty aPropertyName,
|
|
73 |
const TDesC& aPropertyValue);
|
|
74 |
|
|
75 |
TInt SizeChanged(TBool aIcfOverlap);
|
|
76 |
|
|
77 |
// from MItutLayoutContext
|
|
78 |
CFepUiBaseCtrl* Control(const TInt aCtrlId);
|
|
79 |
|
|
80 |
inline TBool IsSecretEdtior();
|
|
81 |
|
|
82 |
// drop down list
|
|
83 |
// stroke zhuyin spell ctrl
|
|
84 |
void CreateChineseSpecificCtrlsIfNeededL();
|
|
85 |
|
|
86 |
void EnterMatchSelectionState(TBool aOn);
|
|
87 |
|
|
88 |
void CalIndicatorRect(const TRect& aBoundRect,
|
|
89 |
TRect& aRealSize1,
|
|
90 |
TRect& aRealSize2,
|
|
91 |
TIndicatorAlign aAlign = EIndiAlignRight);
|
|
92 |
void ResetIndicatorL(CFepUiBaseCtrl* aIndicator);
|
|
93 |
|
|
94 |
void DisplayInputmodeSwitchL();
|
|
95 |
|
|
96 |
inline CFepLayoutMultiLineIcf* Icf();
|
|
97 |
inline CPeninputLayoutInputmodelChoice* InputModeSwitch();
|
|
98 |
inline CFepLayoutScrollableList* MatchSelection();
|
|
99 |
inline CVirtualKeyboard* ItutKeypad();
|
|
100 |
void SetPromptTextL(TUint8* aData);
|
|
101 |
|
|
102 |
|
|
103 |
void ConstructItutKeypadFromResourceL(TInt aResId);
|
|
104 |
|
|
105 |
void ConstructIcfFromResourceL();
|
|
106 |
void OnSkinChange();
|
|
107 |
void ApplyVariantLafDataL(TBool aResolutionChange = EFalse);
|
|
108 |
|
|
109 |
void SetIndicatorImageL(CFepUiBaseCtrl* aIndicator,
|
|
110 |
const TInt aImgID1,
|
|
111 |
const TInt aMaskID1,
|
|
112 |
const TInt aImgID2,
|
|
113 |
const TInt aMaskID2);
|
|
114 |
|
|
115 |
void ConstructSpellCtrlFromResourceL();
|
|
116 |
|
|
117 |
void UpdateIndicatorL(TUint8* aData);
|
|
118 |
|
|
119 |
inline CPeninputCommonChoiceList* EditorMenu();
|
|
120 |
|
|
121 |
void ShowEditorMenuL(TInt* aData);
|
|
122 |
|
|
123 |
void SetHardKeyOneSymbol(TUint8* aData);
|
|
124 |
void SetHardKeyOneSymbolL(TUint8* aData);
|
|
125 |
|
|
126 |
void HandleButtonResOnLangDirChange( TInt aControlId );
|
|
127 |
void HandleButtonResOnLangDirChangeL( TInt aControlId );
|
|
128 |
void IndiBubbleWithText();
|
|
129 |
void IndiBubbleWithoutText();
|
|
130 |
void UpdateIndiBubbleL( TUint8* aData );
|
|
131 |
void SetIndiBubbleImageL( const TInt aImgID1,
|
|
132 |
const TInt aMaskID1,
|
|
133 |
const TInt aImgID2,
|
|
134 |
const TInt aMaskID2 );
|
|
135 |
void SetIndiWithTextFlag( TBool aFlag );
|
|
136 |
void MsgBubbleForChinese();
|
|
137 |
void SetSpellDisplayContentL( TUint8* aData );
|
|
138 |
void CreateKoreanSpecificCtrlsIfNeededL();
|
|
139 |
private:
|
|
140 |
CGenericItutWindow(CGenericItutWindowManager* aWindowMgr,
|
|
141 |
CGenericItutUiLayout* aLayoutOwner,
|
|
142 |
CGenericItutDataMgr* aDataMgr);
|
|
143 |
|
|
144 |
void ConstructL();
|
|
145 |
|
|
146 |
// called when first time construct itut keypad
|
|
147 |
void CreateItutKeypadL();
|
|
148 |
|
|
149 |
void CreateLayoutIconL(TInt aMajorSkinId,
|
|
150 |
TInt aMinorSkinId,
|
|
151 |
const TDesC& aBmpFileName,
|
|
152 |
TInt aBmpId,
|
|
153 |
TInt aMaskBmpId,
|
|
154 |
CFbsBitmap*& aBmp,
|
|
155 |
CFbsBitmap*& aMaskBmp,
|
|
156 |
TSize aSize);
|
|
157 |
|
|
158 |
void CreateMatchSelectionCtrlL();
|
|
159 |
|
|
160 |
// aLeftTopPos: the offset of top most and left most key relative to keypad
|
|
161 |
CVirtualKey* CreateKeyL(TResourceReader& aReader,
|
|
162 |
TRect aKeyRect);
|
|
163 |
|
|
164 |
void ChangeVirtualKeyInfoL(TResourceReader& aReader,
|
|
165 |
CVirtualKey* aKey);
|
|
166 |
|
|
167 |
|
|
168 |
|
|
169 |
|
|
170 |
void CreateAllButtonL();
|
|
171 |
|
|
172 |
void CreateBackGroundControlL();
|
|
173 |
|
|
174 |
void CreateICFL();
|
|
175 |
|
|
176 |
void CreateDropdownListL();
|
|
177 |
|
|
178 |
|
|
179 |
|
|
180 |
void SetCtrlRect(CFepUiBaseCtrl* aCtrl, TInt aRectIdx);
|
|
181 |
|
|
182 |
void ResizeCandidateList(CFepCtrlDropdownList* aList, TInt aLTPosIdx, TBool aExpandable);
|
|
183 |
|
|
184 |
void CalculateFrameRects(const TRect aRect,
|
|
185 |
TRect& aOuterRect,
|
|
186 |
TRect& aInnerRect);
|
|
187 |
|
|
188 |
|
|
189 |
|
|
190 |
TRgb GetMatchListTextColor();
|
|
191 |
|
|
192 |
|
|
193 |
|
|
194 |
|
|
195 |
CAknFepCtrlCommonButton* CreateRawKeyButtonL(const TInt aControlId,
|
|
196 |
const TInt aCommand);
|
|
197 |
|
|
198 |
CAknFepCtrlCommonButton* CommonButtonControl(const TInt aControlId);
|
|
199 |
|
|
200 |
CAknFepCtrlCommonButton* CreateRepeatButtonL(const TInt aControlId,
|
|
201 |
const TInt aCommand);
|
|
202 |
|
|
203 |
CAknFepCtrlCommonButton* CreateCommonButtonL(const TInt aControlId);
|
|
204 |
|
|
205 |
|
|
206 |
CFepUiBaseCtrl* CreateButtonL(TButtonType aType,
|
|
207 |
const TInt aControlId,
|
|
208 |
const TInt aRectId,
|
|
209 |
const TInt aInnerRectId,
|
|
210 |
const TInt aResourceId,
|
|
211 |
const TInt aCommand = KUnavailableID);
|
|
212 |
|
|
213 |
TBool ControlSizeChanged(const TInt aControlId,
|
|
214 |
const TInt aRect,
|
|
215 |
const TInt aInnerRect,
|
|
216 |
TBool aIsReloadImages);
|
|
217 |
|
|
218 |
void AddControlL(CFepUiBaseCtrl* aControl);
|
|
219 |
|
|
220 |
void AddEditorMenuL();
|
|
221 |
|
|
222 |
TBool IsChineseMode();
|
|
223 |
void ConstructKeyImageFromResourceL( TInt aKeyImageResID );
|
|
224 |
|
|
225 |
void SetUnicodesForHardKey1(CVirtualKey* aKey, const TDesC& aMapData);
|
|
226 |
void SetUnicodesForHardKey1L(CVirtualKey* aKey, const TDesC& aMapData);
|
|
227 |
private:
|
|
228 |
CVirtualKeyboard* iStandardItutKp;
|
|
229 |
CFepLayoutMultiLineIcf* iICF;
|
|
230 |
|
|
231 |
CFepCtrlDropdownList* iSpellCandsList;
|
|
232 |
CFepCtrlDropdownList* iCandsList;
|
|
233 |
CFepCtrlDropdownList* iPuncCandsList;
|
|
234 |
|
|
235 |
CFepLayoutScrollableList* iMatchSelection;
|
|
236 |
|
|
237 |
CGenericItutDataMgr* iDataMgr;
|
|
238 |
|
|
239 |
TBool iPenDownOnNaviPane;
|
|
240 |
|
|
241 |
TBool iChnCtrlInited;
|
|
242 |
|
|
243 |
|
|
244 |
CPeninputLayoutInputmodelChoice* iInputModeSwitch;
|
|
245 |
|
|
246 |
CPeninputCommonChoiceList* iEditorMenu;
|
|
247 |
|
|
248 |
TBool iIsSecret;
|
|
249 |
TSize iIndicatorSize;
|
|
250 |
TSize iIndicatorTextSize;
|
|
251 |
TBool iImDimensionSet;
|
|
252 |
|
|
253 |
TInt iLastRawKeyDown;
|
|
254 |
TBool iRawKeyDown;
|
|
255 |
TBool iLastIsChinese;
|
|
256 |
|
|
257 |
TAknWindowLineLayout iBubbleSize;
|
|
258 |
TAknTextLineLayout iBubbleTextLayout;
|
|
259 |
CGenericItutUiLayout* iLayoutOwner;
|
|
260 |
CGenericItutWindowManager* iWindowMgr;
|
|
261 |
CAknFepCtrlCommonBgCtrl* iBackgroundCtrl;
|
|
262 |
CFepInputContextField* iSpell;
|
|
263 |
CPeninputSyncBitmapRotator* iBmpRotator;
|
|
264 |
TFepSymbolOfHardwareOne iSymbolData;
|
|
265 |
TBool iIndiWithText;
|
|
266 |
};
|
|
267 |
|
|
268 |
inline CFepLayoutMultiLineIcf* CGenericItutWindow::Icf()
|
|
269 |
{
|
|
270 |
return iICF;
|
|
271 |
}
|
|
272 |
|
|
273 |
inline CPeninputLayoutInputmodelChoice* CGenericItutWindow::InputModeSwitch()
|
|
274 |
{
|
|
275 |
return iInputModeSwitch;
|
|
276 |
}
|
|
277 |
|
|
278 |
inline CFepLayoutScrollableList* CGenericItutWindow::MatchSelection()
|
|
279 |
{
|
|
280 |
return iMatchSelection;
|
|
281 |
}
|
|
282 |
|
|
283 |
inline CVirtualKeyboard* CGenericItutWindow::ItutKeypad()
|
|
284 |
{
|
|
285 |
return iStandardItutKp;
|
|
286 |
}
|
|
287 |
|
|
288 |
inline CPeninputCommonChoiceList* CGenericItutWindow::EditorMenu()
|
|
289 |
{
|
|
290 |
return iEditorMenu;
|
|
291 |
}
|
|
292 |
|
|
293 |
#endif //C_GENERICITUTWINDOW_H
|