|
1 /* |
|
2 * Copyright (c) 2006-2007 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: Defination for peninput server |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef C_CPENINPUTANIMOBJ_H |
|
20 #define C_CPENINPUTANIMOBJ_H |
|
21 |
|
22 #include "rpeninputanim.h" |
|
23 |
|
24 #ifdef RD_TACTILE_FEEDBACK |
|
25 class TTactileFeedbackArea; |
|
26 #endif // RD_TACTILE_FEEDBACK |
|
27 |
|
28 class TAnimCmd; //animation command class |
|
29 |
|
30 /** |
|
31 * An active object implementing high level interface for pen input animation |
|
32 * |
|
33 * |
|
34 * @since S60 v4.0 |
|
35 */ |
|
36 class CPeninputAnimObj : public CActive |
|
37 { |
|
38 public: |
|
39 /** |
|
40 * factory creator. |
|
41 * |
|
42 * @since S60 v4.0 |
|
43 * @aSpriteMember The sprite member assigned to the sprite |
|
44 */ |
|
45 static CPeninputAnimObj* NewL(TSpriteMember& aSpriteMember); |
|
46 |
|
47 /** |
|
48 * Destructor |
|
49 * |
|
50 * @since S60 v4.0 |
|
51 */ |
|
52 ~CPeninputAnimObj(); |
|
53 |
|
54 /** |
|
55 * From CActive |
|
56 * Called when there is event in the queue |
|
57 * |
|
58 * @since S60 v4.0 |
|
59 */ |
|
60 void RunL(); |
|
61 |
|
62 /** |
|
63 * From CActive |
|
64 * will be called if RunL leaves |
|
65 * |
|
66 * @since S60 v4.0 |
|
67 * @param aError The error number |
|
68 */ |
|
69 TInt RunError(TInt aError); |
|
70 |
|
71 /** |
|
72 * From CActive |
|
73 * will be called when Cancel is issued |
|
74 * |
|
75 * @since S60 v4.0 |
|
76 */ |
|
77 void DoCancel(); |
|
78 |
|
79 //new function |
|
80 /** |
|
81 * Add UI activation command to AO scheduler |
|
82 * |
|
83 * @since S60 v4.0 |
|
84 * @aUiFalg The ui activation flag |
|
85 * @aWaitFlag Flag indicates whther this command should be pended for user response |
|
86 * @return ETrue if command added successfully. |
|
87 */ |
|
88 TBool AddActivationCmd(TBool aUiFlag, TBool aPendingFlag); |
|
89 |
|
90 /** |
|
91 * Add UI size change command to AO scheduler |
|
92 * |
|
93 * @since S60 v4.0 |
|
94 * @aSize The new UI size |
|
95 * @return ETrue if command added successfully. |
|
96 */ |
|
97 TBool AddChangeSizeCmd(const TSize& aSize); |
|
98 |
|
99 /** |
|
100 * Add set UI position command to AO scheduler |
|
101 * |
|
102 * @since S60 v4.0 |
|
103 * @aPt The new UI position |
|
104 * @return ETrue if command added successfully. |
|
105 */ |
|
106 TBool AddSetPosCmd(const TPoint& aPt); |
|
107 |
|
108 /** |
|
109 * Add change sprite display mode command to AO scheduler |
|
110 * |
|
111 * @since S60 v4.0 |
|
112 * @aMember The sprite member to be changed |
|
113 * @return ETrue if command added successfully. |
|
114 */ |
|
115 TBool AddChangeDispModeCmd(TSpriteMember& aMember); |
|
116 |
|
117 /** |
|
118 * Add update UI command to AO scheduler |
|
119 * |
|
120 * @since S60 v4.0 |
|
121 * @aRect The rect to be updated |
|
122 * @aUpdateFlag The full sprite updating flag. ETrue if whole sprite is updated. |
|
123 * @return ETrue if command added successfully. |
|
124 */ |
|
125 TBool AddUpdateUiCmd(const TRect& aRect, TBool aUpdateFlag); |
|
126 |
|
127 /** |
|
128 * |
|
129 * @since S60 v4.0 |
|
130 * @aArea The pointer which point to 1st TUpdateArea that need to be updated |
|
131 * @aNum The count of TUpdateArea that need to be udpated |
|
132 * @return ETrue if command added successfully. |
|
133 */ |
|
134 TBool AddUpdateUiCmd(TUpdateArea *aArea, TInt aNum); |
|
135 |
|
136 /** |
|
137 * Add capture pointer command to AO scheduler |
|
138 * |
|
139 * @since S60 v4.0 |
|
140 * @aFlag The capture flag |
|
141 * @return ETrue if command added successfully. |
|
142 */ |
|
143 TBool AddCapturePointerCmd(TBool aFlag, TInt aCaptureCtrlID); |
|
144 |
|
145 |
|
146 /** |
|
147 * Add simulate event command to AO scheduler |
|
148 * |
|
149 * @since S60 v4.0 |
|
150 * @aEvent The event |
|
151 * @return ETrue if command added successfully. |
|
152 */ |
|
153 TBool AddSimulateEventCmd(const TRawEvent& aEvent); |
|
154 |
|
155 /** |
|
156 * Execute simulate event command |
|
157 * |
|
158 * @aEvent The event |
|
159 * @return ETrue if command added successfully. |
|
160 */ |
|
161 TBool ExecuteSimulateEventCmd( const TRawEvent& aEvent ); |
|
162 |
|
163 /** |
|
164 * Add flush window session command |
|
165 * |
|
166 * @since S60 v4.0 |
|
167 * @return ETrue if command added successfully. |
|
168 */ |
|
169 TBool AddFlushSessionCmd(); |
|
170 |
|
171 /** |
|
172 * Excecute one pending command. Command may be pending due to waiting |
|
173 * for user response. |
|
174 * |
|
175 * @since S60 v4.0 |
|
176 */ |
|
177 void ExeOnePendingAnimCmd(); |
|
178 |
|
179 #ifdef RD_TACTILE_FEEDBACK |
|
180 /** |
|
181 * Add register feedback area command |
|
182 * |
|
183 * @since S60 v4.0 |
|
184 * @param aArea The feedback area data. |
|
185 * @return ETrue if command added successfully. |
|
186 */ |
|
187 TBool AddRegisterFeedbackAreaCmd(const TTactileFeedbackArea& aArea,TBool aCmdFlag); |
|
188 |
|
189 // The API is not open yet |
|
190 // TBool AddRegisterFeedbackAreaCmd(const RArray<TTactileFeedbackArea>& aAreaList); |
|
191 /** |
|
192 * Add de-register feedback area command |
|
193 * |
|
194 * @since S60 v4.0 |
|
195 * @param aArea The feedback area data. |
|
196 * @return ETrue if command added successfully. |
|
197 */ |
|
198 TBool AddDeRegisterFeedbackAreaCmd(const TTactileFeedbackArea& aArea,TBool aCmdFlag); |
|
199 |
|
200 /** |
|
201 * Add register feedback area command |
|
202 * |
|
203 * @since S60 v4.0 |
|
204 * @param aArea The feedback area data. |
|
205 * @return ETrue if command added successfully. |
|
206 */ |
|
207 TBool AddChangeFeedbackAreaCmd(const TTactileFeedbackArea& aArea,TBool aCmdFlag); |
|
208 |
|
209 /** |
|
210 * Add register feedback area command |
|
211 * |
|
212 * @since S60 v4.0 |
|
213 * @param aArea The feedback area data. |
|
214 * @return ETrue if command added successfully. |
|
215 */ |
|
216 TBool AddChangeFeedbackTypeCmd(const TTactileFeedbackArea& aArea,TBool aCmdFlag); |
|
217 #endif // RD_TACTILE_FEEDBACK |
|
218 |
|
219 TBool AddEnalbeSpriteCmd(TBool aFlag); |
|
220 |
|
221 RWindowGroup& WindowGroup(); |
|
222 |
|
223 void OnExiting(); |
|
224 |
|
225 void GetDSAState(TBool& aState); |
|
226 private: |
|
227 /** |
|
228 * Default constructor. |
|
229 * |
|
230 * @since S60 v4.0 |
|
231 */ |
|
232 CPeninputAnimObj(TSpriteMember& aSpriteMember); |
|
233 |
|
234 /** |
|
235 * 2nd phase constructor. |
|
236 * |
|
237 * @since S60 v4.0 |
|
238 */ |
|
239 void ConstructL(); |
|
240 |
|
241 /** |
|
242 * execute animation command. |
|
243 * |
|
244 * @since S60 v4.0 |
|
245 */ |
|
246 void ExecuteAnimCommand(); |
|
247 |
|
248 /** |
|
249 * Add an animation command to scheduler. |
|
250 * |
|
251 * @since S60 v4.0 |
|
252 */ |
|
253 void AddAnimCommand(TAnimCmd* aCmd); |
|
254 |
|
255 /** |
|
256 * Set animation object active, let this object to be scheduled by AO scheduler. |
|
257 * |
|
258 * @since S60 v4.0 |
|
259 */ |
|
260 void SetObjActive(); |
|
261 |
|
262 /** |
|
263 * construct pen input animation module. |
|
264 * |
|
265 * @since S60 v4.0 |
|
266 */ |
|
267 TInt ConstructAnimL(); |
|
268 |
|
269 //RWindowGroup& WindowGroup(); |
|
270 |
|
271 private: |
|
272 /** |
|
273 * Polymorphic sprite animation dll |
|
274 */ |
|
275 RAnimDll iAnimDll; |
|
276 |
|
277 /** |
|
278 * Sprite animation client side interface |
|
279 */ |
|
280 RPeninputAnim iAnim; |
|
281 |
|
282 /** |
|
283 * Sprite used by sprite anim |
|
284 */ |
|
285 RWsSprite iSprite; |
|
286 |
|
287 /** |
|
288 * Sprite member belongs to the sprite. |
|
289 */ |
|
290 TSpriteMember& iSpriteMember; |
|
291 |
|
292 /** |
|
293 * Animation command array. |
|
294 */ |
|
295 RPointerArray<TAnimCmd> iAnimCmd; |
|
296 |
|
297 /** |
|
298 * Window server session |
|
299 */ |
|
300 RWsSession iWsSession; |
|
301 |
|
302 /** |
|
303 * Window group for sprite anim |
|
304 */ |
|
305 RWindowGroup iWindowGroup; |
|
306 |
|
307 TBool iOnExiting; |
|
308 }; |
|
309 |
|
310 #endif //C_CPENINPUTANIMOBJ_H |