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_SPLITITUTUIMGRBASE_H
|
|
20 |
#define C_SPLITITUTUIMGRBASE_H
|
|
21 |
|
|
22 |
#include <e32base.h>
|
|
23 |
#include <PtiDefs.h>
|
|
24 |
|
|
25 |
class CSplitItutUiStateBase;
|
|
26 |
class MSplitItutLayoutContext;
|
|
27 |
class CSplitItutDataMgr;
|
|
28 |
class CFepUiBaseCtrl;
|
|
29 |
class CSplitItutWindowManager;
|
|
30 |
|
|
31 |
/**
|
|
32 |
* class CSplitItutUiMgrBase.
|
|
33 |
*
|
|
34 |
* Split itut ui manager base class.
|
|
35 |
*
|
|
36 |
* @lib peninputsplititut.lib
|
|
37 |
* @since S60 v5.0
|
|
38 |
*/
|
|
39 |
class CSplitItutUiMgrBase : public CBase
|
|
40 |
{
|
|
41 |
public:
|
|
42 |
enum TUiState
|
|
43 |
{
|
|
44 |
EStateNull,
|
|
45 |
// chinese ui state
|
|
46 |
EStateStandby,
|
|
47 |
EStateComposition,
|
|
48 |
EStatePredict,
|
|
49 |
// western ui state
|
|
50 |
EStateWesternStandby,
|
|
51 |
EStateSpelling
|
|
52 |
};
|
|
53 |
|
|
54 |
public:
|
|
55 |
/**
|
|
56 |
* standard c++ destructor.
|
|
57 |
*
|
|
58 |
* @since S60 v5.0
|
|
59 |
* @return None
|
|
60 |
*/
|
|
61 |
virtual ~CSplitItutUiMgrBase();
|
|
62 |
|
|
63 |
/**
|
|
64 |
* handle command
|
|
65 |
*
|
|
66 |
* @since S60 v5.0
|
|
67 |
* @param aCmd
|
|
68 |
* @param aData
|
|
69 |
* @return TBool
|
|
70 |
*/
|
|
71 |
virtual TInt HandleCommandL(TInt aCmd, TUint8* aData);
|
|
72 |
|
|
73 |
/**
|
|
74 |
* handle control event
|
|
75 |
*
|
|
76 |
* @since S60 v5.0
|
|
77 |
* @param aEventType
|
|
78 |
* @param aCtrl
|
|
79 |
* @param aEventData
|
|
80 |
* @return TBool
|
|
81 |
*/
|
|
82 |
virtual TBool HandleCtrlEventL( TInt aEventType,
|
|
83 |
CFepUiBaseCtrl* aCtrl,
|
|
84 |
const TDesC& aEventData);
|
|
85 |
|
|
86 |
/**
|
|
87 |
* set current state
|
|
88 |
*
|
|
89 |
* @since S60 v5.0
|
|
90 |
* @param aNewState
|
|
91 |
* @return None
|
|
92 |
*/
|
|
93 |
virtual void SetCurrentStateL(TUiState aNewState) = 0;
|
|
94 |
|
|
95 |
/**
|
|
96 |
* active ui
|
|
97 |
*
|
|
98 |
* @since S60 v5.0
|
|
99 |
* @return None
|
|
100 |
*/
|
|
101 |
virtual void ActivateUiL() = 0;
|
|
102 |
|
|
103 |
/**
|
|
104 |
* deactive ui
|
|
105 |
*
|
|
106 |
* @since S60 v5.0
|
|
107 |
* @return None
|
|
108 |
*/
|
|
109 |
virtual void DeactivateUI() = 0;
|
|
110 |
|
|
111 |
/**
|
|
112 |
* handle long press number key
|
|
113 |
*
|
|
114 |
* @since S60 v5.0
|
|
115 |
* @param aKey
|
|
116 |
* @return None
|
|
117 |
*/
|
|
118 |
virtual void HandleLongPressNumberKeyL(TPtiKey aKey);
|
|
119 |
|
|
120 |
/**
|
|
121 |
* Set number long press valit
|
|
122 |
*
|
|
123 |
* @since S60 v5.0
|
|
124 |
* @param aValid
|
|
125 |
* @return None
|
|
126 |
*/
|
|
127 |
inline void SetNumLongPressValid(TBool aValid);
|
|
128 |
|
|
129 |
/**
|
|
130 |
* get number long press valit
|
|
131 |
*
|
|
132 |
* @since S60 v5.0
|
|
133 |
* @return TBool
|
|
134 |
*/
|
|
135 |
inline TBool NumLongPressValid();
|
|
136 |
|
|
137 |
/**
|
|
138 |
* get layout context
|
|
139 |
*
|
|
140 |
* @since S60 v5.0
|
|
141 |
* @return layout context
|
|
142 |
*/
|
|
143 |
inline MSplitItutLayoutContext* LayoutContext();
|
|
144 |
|
|
145 |
/**
|
|
146 |
* get data mgr
|
|
147 |
*
|
|
148 |
* @since S60 v5.0
|
|
149 |
* @return data mgr
|
|
150 |
*/
|
|
151 |
inline CSplitItutDataMgr* DataMgr();
|
|
152 |
|
|
153 |
/**
|
|
154 |
* get current state
|
|
155 |
*
|
|
156 |
* @since S60 v5.0
|
|
157 |
* @return current state
|
|
158 |
*/
|
|
159 |
inline CSplitItutUiStateBase* CurrentState();
|
|
160 |
|
|
161 |
/**
|
|
162 |
* is control consumed
|
|
163 |
*
|
|
164 |
* @since S60 v5.0
|
|
165 |
* @return TBool
|
|
166 |
*/
|
|
167 |
inline TBool ClrConsumed();
|
|
168 |
|
|
169 |
/**
|
|
170 |
* set control consumed
|
|
171 |
*
|
|
172 |
* @since S60 v5.0
|
|
173 |
* @param aConsume
|
|
174 |
* @return None
|
|
175 |
*/
|
|
176 |
inline void SetClrConsume(TBool aConsume);
|
|
177 |
|
|
178 |
/**
|
|
179 |
* get ui manager
|
|
180 |
*
|
|
181 |
* @since S60 v5.0
|
|
182 |
* @return UI mgr
|
|
183 |
*/
|
|
184 |
inline CSplitItutWindowManager* UiManager();
|
|
185 |
|
|
186 |
protected:
|
|
187 |
/**
|
|
188 |
* C++ constructor
|
|
189 |
*
|
|
190 |
* @since S60 v5.0
|
|
191 |
* @return None
|
|
192 |
*/
|
|
193 |
CSplitItutUiMgrBase(MSplitItutLayoutContext* aContext,
|
|
194 |
CSplitItutDataMgr* aDataMgr,
|
|
195 |
CSplitItutWindowManager* aUiManager);
|
|
196 |
|
|
197 |
/**
|
|
198 |
* Symbian second-phase constructor
|
|
199 |
*
|
|
200 |
* @since S60 v5.0
|
|
201 |
* @return None
|
|
202 |
*/
|
|
203 |
virtual void ConstructL();
|
|
204 |
|
|
205 |
protected:
|
|
206 |
|
|
207 |
/**
|
|
208 |
* The layout context
|
|
209 |
* not own
|
|
210 |
*/
|
|
211 |
MSplitItutLayoutContext* iLayoutContext;
|
|
212 |
|
|
213 |
/**
|
|
214 |
* The data mgr
|
|
215 |
* not own
|
|
216 |
*/
|
|
217 |
CSplitItutDataMgr* iDataMgr;
|
|
218 |
|
|
219 |
/**
|
|
220 |
* current state
|
|
221 |
* not own
|
|
222 |
*/
|
|
223 |
CSplitItutUiStateBase* iCurrentState;
|
|
224 |
|
|
225 |
/**
|
|
226 |
* number long press valid
|
|
227 |
*/
|
|
228 |
TBool iNumLongPressValid;
|
|
229 |
|
|
230 |
/**
|
|
231 |
* control consume
|
|
232 |
*/
|
|
233 |
TBool iClrConsume;
|
|
234 |
|
|
235 |
/**
|
|
236 |
* UI mgr
|
|
237 |
* not own
|
|
238 |
*/
|
|
239 |
CSplitItutWindowManager* iUiMgr;
|
|
240 |
};
|
|
241 |
|
|
242 |
// ---------------------------------------------------------------------------
|
|
243 |
// CSplitItutUiMgrBase::LayoutContext
|
|
244 |
// ---------------------------------------------------------------------------
|
|
245 |
//
|
|
246 |
inline MSplitItutLayoutContext* CSplitItutUiMgrBase::LayoutContext()
|
|
247 |
{
|
|
248 |
return iLayoutContext;
|
|
249 |
}
|
|
250 |
|
|
251 |
// ---------------------------------------------------------------------------
|
|
252 |
// CSplitItutUiMgrBase::DataMgr
|
|
253 |
// ---------------------------------------------------------------------------
|
|
254 |
//
|
|
255 |
inline CSplitItutDataMgr* CSplitItutUiMgrBase::DataMgr()
|
|
256 |
{
|
|
257 |
return iDataMgr;
|
|
258 |
}
|
|
259 |
|
|
260 |
// ---------------------------------------------------------------------------
|
|
261 |
// CSplitItutUiMgrBase::CurrentState
|
|
262 |
// ---------------------------------------------------------------------------
|
|
263 |
//
|
|
264 |
inline CSplitItutUiStateBase* CSplitItutUiMgrBase::CurrentState()
|
|
265 |
{
|
|
266 |
return iCurrentState;
|
|
267 |
}
|
|
268 |
|
|
269 |
// ---------------------------------------------------------------------------
|
|
270 |
// CSplitItutUiMgrBase::SetNumLongPressValid
|
|
271 |
// ---------------------------------------------------------------------------
|
|
272 |
//
|
|
273 |
inline void CSplitItutUiMgrBase::SetNumLongPressValid(TBool aValid)
|
|
274 |
{
|
|
275 |
iNumLongPressValid = aValid;
|
|
276 |
}
|
|
277 |
|
|
278 |
// ---------------------------------------------------------------------------
|
|
279 |
// CSplitItutUiMgrBase::NumLongPressValid
|
|
280 |
// ---------------------------------------------------------------------------
|
|
281 |
//
|
|
282 |
inline TBool CSplitItutUiMgrBase::NumLongPressValid()
|
|
283 |
{
|
|
284 |
return iNumLongPressValid;
|
|
285 |
}
|
|
286 |
|
|
287 |
// ---------------------------------------------------------------------------
|
|
288 |
// CSplitItutUiMgrBase::ClrConsumed
|
|
289 |
// ---------------------------------------------------------------------------
|
|
290 |
//
|
|
291 |
inline TBool CSplitItutUiMgrBase::ClrConsumed()
|
|
292 |
{
|
|
293 |
return iClrConsume;
|
|
294 |
}
|
|
295 |
|
|
296 |
// ---------------------------------------------------------------------------
|
|
297 |
// CSplitItutUiMgrBase::SetClrConsume
|
|
298 |
// ---------------------------------------------------------------------------
|
|
299 |
//
|
|
300 |
inline void CSplitItutUiMgrBase::SetClrConsume(TBool aConsume)
|
|
301 |
{
|
|
302 |
iClrConsume = aConsume;
|
|
303 |
}
|
|
304 |
|
|
305 |
// ---------------------------------------------------------------------------
|
|
306 |
// CSplitItutUiMgrBase::UiManager
|
|
307 |
// ---------------------------------------------------------------------------
|
|
308 |
//
|
|
309 |
inline CSplitItutWindowManager* CSplitItutUiMgrBase::UiManager()
|
|
310 |
{
|
|
311 |
return iUiMgr;
|
|
312 |
}
|
|
313 |
|
|
314 |
#endif // C_SPLITITUTUIMGRBASE_H
|