sl@0
|
1 |
/*
|
sl@0
|
2 |
* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
|
sl@0
|
3 |
* All rights reserved.
|
sl@0
|
4 |
* This component and the accompanying materials are made available
|
sl@0
|
5 |
* under the terms of "Eclipse Public License v1.0"
|
sl@0
|
6 |
* which accompanies this distribution, and is available
|
sl@0
|
7 |
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
|
sl@0
|
8 |
*
|
sl@0
|
9 |
* Initial Contributors:
|
sl@0
|
10 |
* Nokia Corporation - initial contribution.
|
sl@0
|
11 |
*
|
sl@0
|
12 |
* Contributors:
|
sl@0
|
13 |
*
|
sl@0
|
14 |
* Description:
|
sl@0
|
15 |
*
|
sl@0
|
16 |
*/
|
sl@0
|
17 |
|
sl@0
|
18 |
#include "T_ActiveRConsoleRead.h"
|
sl@0
|
19 |
|
sl@0
|
20 |
const TInt KDefaultTimeout =10000000;
|
sl@0
|
21 |
const TUint8 KWhite =0xFF;
|
sl@0
|
22 |
const TUint8 KBlack =0x00;
|
sl@0
|
23 |
|
sl@0
|
24 |
/*@{*/
|
sl@0
|
25 |
_LIT(KFldTimeout, "timeout");
|
sl@0
|
26 |
_LIT(KFldErrorMargin, "errorMargin");
|
sl@0
|
27 |
_LIT(KFldTests, "tests");
|
sl@0
|
28 |
|
sl@0
|
29 |
|
sl@0
|
30 |
_LIT(KFldEventType, "eventType%d");
|
sl@0
|
31 |
_LIT(KFldEventOccurance, "eventOccurance%d");
|
sl@0
|
32 |
_LIT(KFldDataVerify, "dataVerify%d");
|
sl@0
|
33 |
_LIT(KFldDataDraw, "dataDraw%d");
|
sl@0
|
34 |
_LIT(KFldExitKeyCode, "exitKeyCode");
|
sl@0
|
35 |
_LIT(KFldExitRectangle, "exitRectangle");
|
sl@0
|
36 |
|
sl@0
|
37 |
|
sl@0
|
38 |
_LIT(KFldKeyCode, "keyCode%d");
|
sl@0
|
39 |
_LIT(KFldPoint, "point%d");
|
sl@0
|
40 |
_LIT(KFldRect, "rect%d");
|
sl@0
|
41 |
_LIT(KFldColourWhite, "white");
|
sl@0
|
42 |
_LIT(KFldColourBlack, "black");
|
sl@0
|
43 |
|
sl@0
|
44 |
|
sl@0
|
45 |
//format fields
|
sl@0
|
46 |
_LIT(KLogUnexpectedEvent, "Unexpected event. Expected %d Actual %d Index %d");
|
sl@0
|
47 |
_LIT(KLogUnexpectedKeyCode, "Unexpected key code %d");
|
sl@0
|
48 |
_LIT(KLogUnexpectedPoint, "Unexpected point (%d,%d)");
|
sl@0
|
49 |
_LIT(KLogEvent, "Event %d");
|
sl@0
|
50 |
_LIT(KLogKey, "Key %d");
|
sl@0
|
51 |
|
sl@0
|
52 |
/*@}*/
|
sl@0
|
53 |
//This represents a NULL attribute
|
sl@0
|
54 |
_LIT(KEnumNull, "");
|
sl@0
|
55 |
|
sl@0
|
56 |
// TRawEvent
|
sl@0
|
57 |
_LIT(KNone, "ENone");
|
sl@0
|
58 |
_LIT(KPointerMove, "EPointerMove");
|
sl@0
|
59 |
_LIT(KPointerSwitchOn, "EPointerSwitchOn");
|
sl@0
|
60 |
_LIT(KKeyDown, "EKeyDown");
|
sl@0
|
61 |
_LIT(KKeyUp, "EKeyUp");
|
sl@0
|
62 |
_LIT(KRedraw, "ERedraw");
|
sl@0
|
63 |
_LIT(KSwitchOn, "ESwitchOn");
|
sl@0
|
64 |
_LIT(KActive, "EActive");
|
sl@0
|
65 |
_LIT(KInactive, "EInactive");
|
sl@0
|
66 |
_LIT(KUpdateModifiers, "EUpdateModifiers");
|
sl@0
|
67 |
_LIT(KButton1Down, "EButton1Down");
|
sl@0
|
68 |
_LIT(KButton1Up, "EButton1Up");
|
sl@0
|
69 |
_LIT(KButton2Down, "EButton2Down");
|
sl@0
|
70 |
_LIT(KButton2Up, "EButton2Up");
|
sl@0
|
71 |
_LIT(KButton3Down, "EButton3Down");
|
sl@0
|
72 |
_LIT(KButton3Up, "EButton3Up");
|
sl@0
|
73 |
_LIT(KSwitchOff, "ESwitchOff");
|
sl@0
|
74 |
_LIT(KKeyRepeat, "EKeyRepeat");
|
sl@0
|
75 |
_LIT(KCaseOpen, "ECaseOpen");
|
sl@0
|
76 |
_LIT(KCaseClose, "ECaseClose");
|
sl@0
|
77 |
_LIT(KRestartSystem, "ERestartSystem");
|
sl@0
|
78 |
const CDataWrapperBase::TEnumEntryTable CT_ActiveRConsoleRead::iEnumRawEventTable [] =
|
sl@0
|
79 |
{
|
sl@0
|
80 |
/** Enum as a descriptor Enum integar value
|
sl@0
|
81 |
* In this case these enums represent TRawEvents
|
sl@0
|
82 |
*
|
sl@0
|
83 |
*
|
sl@0
|
84 |
*/
|
sl@0
|
85 |
// Enum as a descriptor Enum
|
sl@0
|
86 |
KNone, TRawEvent::ENone,
|
sl@0
|
87 |
KPointerMove, TRawEvent::EPointerMove,
|
sl@0
|
88 |
KPointerSwitchOn, TRawEvent::EPointerSwitchOn,
|
sl@0
|
89 |
KKeyDown, TRawEvent::EKeyDown,
|
sl@0
|
90 |
KKeyUp, TRawEvent::EKeyUp,
|
sl@0
|
91 |
KRedraw, TRawEvent::ERedraw,
|
sl@0
|
92 |
KSwitchOn, TRawEvent::ESwitchOn,
|
sl@0
|
93 |
KActive, TRawEvent::EActive,
|
sl@0
|
94 |
KInactive, TRawEvent::EInactive,
|
sl@0
|
95 |
KUpdateModifiers, TRawEvent::EUpdateModifiers,
|
sl@0
|
96 |
KButton1Down, TRawEvent::EButton1Down,
|
sl@0
|
97 |
KButton1Up, TRawEvent::EButton1Up,
|
sl@0
|
98 |
KButton2Down, TRawEvent::EButton2Down,
|
sl@0
|
99 |
KButton2Up, TRawEvent::EButton2Up,
|
sl@0
|
100 |
KButton3Down, TRawEvent::EButton3Down,
|
sl@0
|
101 |
KButton3Up, TRawEvent::EButton3Up,
|
sl@0
|
102 |
KSwitchOff, TRawEvent::ESwitchOff,
|
sl@0
|
103 |
KKeyRepeat, TRawEvent::EKeyRepeat,
|
sl@0
|
104 |
KCaseOpen, TRawEvent::ECaseOpen,
|
sl@0
|
105 |
KCaseClose, TRawEvent::ECaseClose,
|
sl@0
|
106 |
KRestartSystem, TRawEvent::ERestartSystem,
|
sl@0
|
107 |
KEnumNull, -1,
|
sl@0
|
108 |
};
|
sl@0
|
109 |
|
sl@0
|
110 |
// TKeyCode
|
sl@0
|
111 |
_LIT(KKeyNull, "EKeyNull");
|
sl@0
|
112 |
_LIT(KKeyBell, "EKeyBell");
|
sl@0
|
113 |
_LIT(KKeyBackspace, "EKeyBackspace");
|
sl@0
|
114 |
_LIT(KKeyTab, "EKeyTab");
|
sl@0
|
115 |
_LIT(KKeyLineFeed, "EKeyLineFeed");
|
sl@0
|
116 |
_LIT(KKeyVerticalTab, "EKeyVerticalTab");
|
sl@0
|
117 |
_LIT(KKeyFormFeed, "EKeyFormFeed");
|
sl@0
|
118 |
_LIT(KKeyEnter, "EKeyEnter");
|
sl@0
|
119 |
_LIT(KKeyEscape, "EKeyEscape");
|
sl@0
|
120 |
_LIT(KKeySpace, "EKeySpace");
|
sl@0
|
121 |
_LIT(KKeyDelete, "EKeyDelete");
|
sl@0
|
122 |
_LIT(KKeyPrintScreen, "EKeyPrintScreen");
|
sl@0
|
123 |
_LIT(KKeyPause, "EKeyPause");
|
sl@0
|
124 |
_LIT(KKeyHome, "EKeyHome");
|
sl@0
|
125 |
_LIT(KKeyEnd, "EKeyEnd");
|
sl@0
|
126 |
_LIT(KKeyPageUp, "EKeyPageUp");
|
sl@0
|
127 |
_LIT(KKeyPageDown, "EKeyPageDown");
|
sl@0
|
128 |
_LIT(KKeyInsert, "EKeyInsert");
|
sl@0
|
129 |
_LIT(KKeyLeftArrow, "EKeyLeftArrow");
|
sl@0
|
130 |
_LIT(KKeyRightArrow, "EKeyRightArrow");
|
sl@0
|
131 |
_LIT(KKeyUpArrow, "EKeyUpArrow");
|
sl@0
|
132 |
_LIT(KKeyDownArrow, "EKeyDownArrow");
|
sl@0
|
133 |
_LIT(KKeyLeftShift, "EKeyLeftShift");
|
sl@0
|
134 |
_LIT(KKeyRightShift, "EKeyRightShift");
|
sl@0
|
135 |
_LIT(KKeyLeftAlt, "EKeyLeftAlt");
|
sl@0
|
136 |
_LIT(KKeyRightAlt, "EKeyRightAlt");
|
sl@0
|
137 |
_LIT(KKeyLeftCtrl, "EKeyLeftCtrl");
|
sl@0
|
138 |
_LIT(KKeyRightCtrl, "EKeyRightCtrl");
|
sl@0
|
139 |
_LIT(KKeyLeftFunc, "EKeyLeftFunc");
|
sl@0
|
140 |
_LIT(KKeyRightFunc, "EKeyRightFunc");
|
sl@0
|
141 |
_LIT(KKeyCapsLock, "EKeyCapsLock");
|
sl@0
|
142 |
_LIT(KKeyNumLock, "EKeyNumLock");
|
sl@0
|
143 |
_LIT(KKeyScrollLock, "EKeyScrollLock");
|
sl@0
|
144 |
_LIT(KKeyF1, "EKeyF1");
|
sl@0
|
145 |
_LIT(KKeyF2, "EKeyF2");
|
sl@0
|
146 |
_LIT(KKeyF3, "EKeyF3");
|
sl@0
|
147 |
_LIT(KKeyF4, "EKeyF4");
|
sl@0
|
148 |
_LIT(KKeyF5, "EKeyF5");
|
sl@0
|
149 |
_LIT(KKeyF6, "EKeyF6");
|
sl@0
|
150 |
_LIT(KKeyF7, "EKeyF7");
|
sl@0
|
151 |
_LIT(KKeyF8, "EKeyF8");
|
sl@0
|
152 |
_LIT(KKeyF9, "EKeyF9");
|
sl@0
|
153 |
_LIT(KKeyF10, "EKeyF10");
|
sl@0
|
154 |
_LIT(KKeyF11, "EKeyF11");
|
sl@0
|
155 |
_LIT(KKeyF12, "EKeyF12");
|
sl@0
|
156 |
_LIT(KKeyF13, "EKeyF13");
|
sl@0
|
157 |
_LIT(KKeyF14, "EKeyF14");
|
sl@0
|
158 |
_LIT(KKeyF15, "EKeyF15");
|
sl@0
|
159 |
_LIT(KKeyF16, "EKeyF16");
|
sl@0
|
160 |
_LIT(KKeyF17, "EKeyF17");
|
sl@0
|
161 |
_LIT(KKeyF18, "EKeyF18");
|
sl@0
|
162 |
_LIT(KKeyF19, "EKeyF19");
|
sl@0
|
163 |
_LIT(KKeyF20, "EKeyF20");
|
sl@0
|
164 |
_LIT(KKeyF21, "EKeyF21");
|
sl@0
|
165 |
_LIT(KKeyF22, "EKeyF22");
|
sl@0
|
166 |
_LIT(KKeyF23, "EKeyF23");
|
sl@0
|
167 |
_LIT(KKeyF24, "EKeyF24");
|
sl@0
|
168 |
_LIT(KKeyOff, "EKeyOff");
|
sl@0
|
169 |
_LIT(KKeyIncContrast, "EKeyIncContrast");
|
sl@0
|
170 |
_LIT(KKeyDecContrast, "EKeyDecContrast");
|
sl@0
|
171 |
_LIT(KKeyBacklightOn, "EKeyBacklightOn");
|
sl@0
|
172 |
_LIT(KKeyBacklightOff, "EKeyBacklightOff");
|
sl@0
|
173 |
_LIT(KKeyBacklightToggle, "EKeyBacklightToggle");
|
sl@0
|
174 |
_LIT(KKeySliderDown, "EKeySliderDown");
|
sl@0
|
175 |
_LIT(KKeySliderUp, "EKeySliderUp");
|
sl@0
|
176 |
_LIT(KKeyMenu, "EKeyMenu");
|
sl@0
|
177 |
_LIT(KKeyDictaphonePlay, "EKeyDictaphonePlay");
|
sl@0
|
178 |
_LIT(KKeyDictaphoneStop, "EKeyDictaphoneStop");
|
sl@0
|
179 |
_LIT(KKeyDictaphoneRecord, "EKeyDictaphoneRecord");
|
sl@0
|
180 |
_LIT(KKeyHelp, "EKeyHelp");
|
sl@0
|
181 |
_LIT(KKeyDial, "EKeyDial");
|
sl@0
|
182 |
_LIT(KKeyScreenDimension0, "EKeyScreenDimension0");
|
sl@0
|
183 |
_LIT(KKeyScreenDimension1, "EKeyScreenDimension1");
|
sl@0
|
184 |
_LIT(KKeyScreenDimension2, "EKeyScreenDimension2");
|
sl@0
|
185 |
_LIT(KKeyScreenDimension3, "EKeyScreenDimension3");
|
sl@0
|
186 |
_LIT(KKeyIncVolume, "EKeyIncVolume");
|
sl@0
|
187 |
_LIT(KKeyDecVolume, "EKeyDecVolume");
|
sl@0
|
188 |
_LIT(KKeyDevice0, "EKeyDevice0");
|
sl@0
|
189 |
_LIT(KKeyDevice1, "EKeyDevice1");
|
sl@0
|
190 |
_LIT(KKeyDevice2, "EKeyDevice2");
|
sl@0
|
191 |
_LIT(KKeyDevice3, "EKeyDevice3");
|
sl@0
|
192 |
_LIT(KKeyDevice4, "EKeyDevice4");
|
sl@0
|
193 |
_LIT(KKeyDevice5, "EKeyDevice5");
|
sl@0
|
194 |
_LIT(KKeyDevice6, "EKeyDevice6");
|
sl@0
|
195 |
_LIT(KKeyDevice7, "EKeyDevice7");
|
sl@0
|
196 |
_LIT(KKeyDevice8, "EKeyDevice8");
|
sl@0
|
197 |
_LIT(KKeyDevice9, "EKeyDevice9");
|
sl@0
|
198 |
_LIT(KKeyDeviceA, "EKeyDeviceA");
|
sl@0
|
199 |
_LIT(KKeyDeviceB, "EKeyDeviceB");
|
sl@0
|
200 |
_LIT(KKeyDeviceC, "EKeyDeviceC");
|
sl@0
|
201 |
_LIT(KKeyDeviceD, "EKeyDeviceD");
|
sl@0
|
202 |
_LIT(KKeyDeviceE, "EKeyDeviceE");
|
sl@0
|
203 |
_LIT(KKeyDeviceF, "EKeyDeviceF");
|
sl@0
|
204 |
_LIT(KKeyApplication0, "EKeyApplication0");
|
sl@0
|
205 |
_LIT(KKeyApplication1, "EKeyApplication1");
|
sl@0
|
206 |
_LIT(KKeyApplication2, "EKeyApplication2");
|
sl@0
|
207 |
_LIT(KKeyApplication3, "EKeyApplication3");
|
sl@0
|
208 |
_LIT(KKeyApplication4, "EKeyApplication4");
|
sl@0
|
209 |
_LIT(KKeyApplication5, "EKeyApplication5");
|
sl@0
|
210 |
_LIT(KKeyApplication6, "EKeyApplication6");
|
sl@0
|
211 |
_LIT(KKeyApplication7, "EKeyApplication7");
|
sl@0
|
212 |
_LIT(KKeyApplication8, "EKeyApplication8");
|
sl@0
|
213 |
_LIT(KKeyApplication9, "EKeyApplication9");
|
sl@0
|
214 |
_LIT(KKeyApplicationA, "EKeyApplicationA");
|
sl@0
|
215 |
_LIT(KKeyApplicationB, "EKeyApplicationB");
|
sl@0
|
216 |
_LIT(KKeyApplicationC, "EKeyApplicationC");
|
sl@0
|
217 |
_LIT(KKeyApplicationD, "EKeyApplicationD");
|
sl@0
|
218 |
_LIT(KKeyApplicationE, "EKeyApplicationE");
|
sl@0
|
219 |
_LIT(KKeyApplicationF, "EKeyApplicationF");
|
sl@0
|
220 |
_LIT(KKeyYes, "EKeyYes");
|
sl@0
|
221 |
_LIT(KKeyNo, "EKeyNo");
|
sl@0
|
222 |
_LIT(KKeyIncBrightness, "EKeyIncBrightness");
|
sl@0
|
223 |
_LIT(KKeyDecBrightness, "EKeyDecBrightness");
|
sl@0
|
224 |
_LIT(KKeyKeyboardExtend, "EKeyKeyboardExtend");
|
sl@0
|
225 |
_LIT(KKeyDevice10, "EKeyDevice10");
|
sl@0
|
226 |
_LIT(KKeyDevice11, "EKeyDevice11");
|
sl@0
|
227 |
_LIT(KKeyDevice12, "EKeyDevice12");
|
sl@0
|
228 |
_LIT(KKeyDevice13, "EKeyDevice13");
|
sl@0
|
229 |
_LIT(KKeyDevice14, "EKeyDevice14");
|
sl@0
|
230 |
_LIT(KKeyDevice15, "EKeyDevice15");
|
sl@0
|
231 |
_LIT(KKeyDevice16, "EKeyDevice16");
|
sl@0
|
232 |
_LIT(KKeyDevice17, "EKeyDevice17");
|
sl@0
|
233 |
_LIT(KKeyDevice18, "EKeyDevice18");
|
sl@0
|
234 |
_LIT(KKeyDevice19, "EKeyDevice19");
|
sl@0
|
235 |
_LIT(KKeyDevice1A, "EKeyDevice1A");
|
sl@0
|
236 |
_LIT(KKeyDevice1B, "EKeyDevice1B");
|
sl@0
|
237 |
_LIT(KKeyDevice1C, "EKeyDevice1C");
|
sl@0
|
238 |
_LIT(KKeyDevice1D, "EKeyDevice1D");
|
sl@0
|
239 |
_LIT(KKeyDevice1E, "EKeyDevice1E");
|
sl@0
|
240 |
_LIT(KKeyDevice1F, "EKeyDevice1F");
|
sl@0
|
241 |
_LIT(KKeyApplication10, "EKeyApplication10");
|
sl@0
|
242 |
_LIT(KKeyApplication11, "EKeyApplication11");
|
sl@0
|
243 |
_LIT(KKeyApplication12, "EKeyApplication12");
|
sl@0
|
244 |
_LIT(KKeyApplication13, "EKeyApplication13");
|
sl@0
|
245 |
_LIT(KKeyApplication14, "EKeyApplication14");
|
sl@0
|
246 |
_LIT(KKeyApplication15, "EKeyApplication15");
|
sl@0
|
247 |
_LIT(KKeyApplication16, "EKeyApplication16");
|
sl@0
|
248 |
_LIT(KKeyApplication17, "EKeyApplication17");
|
sl@0
|
249 |
_LIT(KKeyApplication18, "EKeyApplication18");
|
sl@0
|
250 |
_LIT(KKeyApplication19, "EKeyApplication19");
|
sl@0
|
251 |
_LIT(KKeyApplication1A, "EKeyApplication1A");
|
sl@0
|
252 |
_LIT(KKeyApplication1B, "EKeyApplication1B");
|
sl@0
|
253 |
_LIT(KKeyApplication1C, "EKeyApplication1C");
|
sl@0
|
254 |
_LIT(KKeyApplication1D, "EKeyApplication1D");
|
sl@0
|
255 |
_LIT(KKeyApplication1E, "EKeyApplication1E");
|
sl@0
|
256 |
_LIT(KKeyApplication1F, "EKeyApplication1F");
|
sl@0
|
257 |
_LIT(KKeyDevice20, "EKeyDevice20");
|
sl@0
|
258 |
_LIT(KKeyDevice21, "EKeyDevice21");
|
sl@0
|
259 |
_LIT(KKeyDevice22, "EKeyDevice22");
|
sl@0
|
260 |
_LIT(KKeyDevice23, "EKeyDevice23");
|
sl@0
|
261 |
_LIT(KKeyDevice24, "EKeyDevice24");
|
sl@0
|
262 |
_LIT(KKeyDevice25, "EKeyDevice25");
|
sl@0
|
263 |
_LIT(KKeyDevice26, "EKeyDevice26");
|
sl@0
|
264 |
_LIT(KKeyDevice27, "EKeyDevice27");
|
sl@0
|
265 |
_LIT(KKeyApplication20, "EKeyApplication20");
|
sl@0
|
266 |
_LIT(KKeyApplication21, "EKeyApplication21");
|
sl@0
|
267 |
_LIT(KKeyApplication22, "EKeyApplication22");
|
sl@0
|
268 |
_LIT(KKeyApplication23, "EKeyApplication23");
|
sl@0
|
269 |
_LIT(KKeyApplication24, "EKeyApplication24");
|
sl@0
|
270 |
_LIT(KKeyApplication25, "EKeyApplication25");
|
sl@0
|
271 |
_LIT(KKeyApplication26, "EKeyApplication26");
|
sl@0
|
272 |
_LIT(KKeyApplication27, "EKeyApplication27");
|
sl@0
|
273 |
const CDataWrapperBase::TEnumEntryTable CT_ActiveRConsoleRead::iEnumKeyCodeTable [] =
|
sl@0
|
274 |
{
|
sl@0
|
275 |
// Enum as a descriptor Enum
|
sl@0
|
276 |
KKeyNull, EKeyNull,
|
sl@0
|
277 |
KKeyBell, EKeyBell,
|
sl@0
|
278 |
KKeyBackspace, EKeyBackspace,
|
sl@0
|
279 |
KKeyTab, EKeyTab,
|
sl@0
|
280 |
KKeyLineFeed, EKeyLineFeed,
|
sl@0
|
281 |
KKeyVerticalTab, EKeyVerticalTab,
|
sl@0
|
282 |
KKeyFormFeed, EKeyFormFeed,
|
sl@0
|
283 |
KKeyEnter, EKeyEnter,
|
sl@0
|
284 |
KKeyEscape, EKeyEscape,
|
sl@0
|
285 |
KKeySpace, EKeySpace,
|
sl@0
|
286 |
KKeyDelete, EKeyDelete,
|
sl@0
|
287 |
KKeyPrintScreen, EKeyPrintScreen,
|
sl@0
|
288 |
KKeyPause, EKeyPause,
|
sl@0
|
289 |
KKeyHome, EKeyHome,
|
sl@0
|
290 |
KKeyEnd, EKeyEnd,
|
sl@0
|
291 |
KKeyPageUp, EKeyPageUp,
|
sl@0
|
292 |
KKeyPageDown, EKeyPageDown,
|
sl@0
|
293 |
KKeyInsert, EKeyInsert,
|
sl@0
|
294 |
KKeyLeftArrow, EKeyLeftArrow,
|
sl@0
|
295 |
KKeyRightArrow, EKeyRightArrow,
|
sl@0
|
296 |
KKeyUpArrow, EKeyUpArrow,
|
sl@0
|
297 |
KKeyDownArrow, EKeyDownArrow,
|
sl@0
|
298 |
KKeyLeftShift, EKeyLeftShift,
|
sl@0
|
299 |
KKeyRightShift, EKeyRightShift,
|
sl@0
|
300 |
KKeyLeftAlt, EKeyLeftAlt,
|
sl@0
|
301 |
KKeyRightAlt, EKeyRightAlt,
|
sl@0
|
302 |
KKeyLeftCtrl, EKeyLeftCtrl,
|
sl@0
|
303 |
KKeyRightCtrl, EKeyRightCtrl,
|
sl@0
|
304 |
KKeyLeftFunc, EKeyLeftFunc,
|
sl@0
|
305 |
KKeyRightFunc, EKeyRightFunc,
|
sl@0
|
306 |
KKeyCapsLock, EKeyCapsLock,
|
sl@0
|
307 |
KKeyNumLock, EKeyNumLock,
|
sl@0
|
308 |
KKeyScrollLock, EKeyScrollLock,
|
sl@0
|
309 |
KKeyF1, EKeyF1,
|
sl@0
|
310 |
KKeyF2, EKeyF2,
|
sl@0
|
311 |
KKeyF3, EKeyF3,
|
sl@0
|
312 |
KKeyF4, EKeyF4,
|
sl@0
|
313 |
KKeyF5, EKeyF5,
|
sl@0
|
314 |
KKeyF6, EKeyF6,
|
sl@0
|
315 |
KKeyF7, EKeyF7,
|
sl@0
|
316 |
KKeyF8, EKeyF8,
|
sl@0
|
317 |
KKeyF9, EKeyF9,
|
sl@0
|
318 |
KKeyF10, EKeyF10,
|
sl@0
|
319 |
KKeyF11, EKeyF11,
|
sl@0
|
320 |
KKeyF12, EKeyF12,
|
sl@0
|
321 |
KKeyF13, EKeyF13,
|
sl@0
|
322 |
KKeyF14, EKeyF14,
|
sl@0
|
323 |
KKeyF15, EKeyF15,
|
sl@0
|
324 |
KKeyF16, EKeyF16,
|
sl@0
|
325 |
KKeyF17, EKeyF17,
|
sl@0
|
326 |
KKeyF18, EKeyF18,
|
sl@0
|
327 |
KKeyF19, EKeyF19,
|
sl@0
|
328 |
KKeyF20, EKeyF20,
|
sl@0
|
329 |
KKeyF21, EKeyF21,
|
sl@0
|
330 |
KKeyF22, EKeyF22,
|
sl@0
|
331 |
KKeyF23, EKeyF23,
|
sl@0
|
332 |
KKeyF24, EKeyF24,
|
sl@0
|
333 |
KKeyOff, EKeyOff,
|
sl@0
|
334 |
KKeyIncContrast, EKeyIncContrast,
|
sl@0
|
335 |
KKeyDecContrast, EKeyDecContrast,
|
sl@0
|
336 |
KKeyBacklightOn, EKeyBacklightOn,
|
sl@0
|
337 |
KKeyBacklightOff, EKeyBacklightOff,
|
sl@0
|
338 |
KKeyBacklightToggle, EKeyBacklightToggle,
|
sl@0
|
339 |
KKeySliderDown, EKeySliderDown,
|
sl@0
|
340 |
KKeySliderUp, EKeySliderUp,
|
sl@0
|
341 |
KKeyMenu, EKeyMenu,
|
sl@0
|
342 |
KKeyDictaphonePlay, EKeyDictaphonePlay,
|
sl@0
|
343 |
KKeyDictaphoneStop, EKeyDictaphoneStop,
|
sl@0
|
344 |
KKeyDictaphoneRecord, EKeyDictaphoneRecord,
|
sl@0
|
345 |
KKeyHelp, EKeyHelp,
|
sl@0
|
346 |
KKeyDial, EKeyDial,
|
sl@0
|
347 |
KKeyScreenDimension0, EKeyScreenDimension0,
|
sl@0
|
348 |
KKeyScreenDimension1, EKeyScreenDimension1,
|
sl@0
|
349 |
KKeyScreenDimension2, EKeyScreenDimension2,
|
sl@0
|
350 |
KKeyScreenDimension3, EKeyScreenDimension3,
|
sl@0
|
351 |
KKeyIncVolume, EKeyIncVolume,
|
sl@0
|
352 |
KKeyDecVolume, EKeyDecVolume,
|
sl@0
|
353 |
KKeyDevice0, EKeyDevice0,
|
sl@0
|
354 |
KKeyDevice1, EKeyDevice1,
|
sl@0
|
355 |
KKeyDevice2, EKeyDevice2,
|
sl@0
|
356 |
KKeyDevice3, EKeyDevice3,
|
sl@0
|
357 |
KKeyDevice4, EKeyDevice4,
|
sl@0
|
358 |
KKeyDevice5, EKeyDevice5,
|
sl@0
|
359 |
KKeyDevice6, EKeyDevice6,
|
sl@0
|
360 |
KKeyDevice7, EKeyDevice7,
|
sl@0
|
361 |
KKeyDevice8, EKeyDevice8,
|
sl@0
|
362 |
KKeyDevice9, EKeyDevice9,
|
sl@0
|
363 |
KKeyDeviceA, EKeyDeviceA,
|
sl@0
|
364 |
KKeyDeviceB, EKeyDeviceB,
|
sl@0
|
365 |
KKeyDeviceC, EKeyDeviceC,
|
sl@0
|
366 |
KKeyDeviceD, EKeyDeviceD,
|
sl@0
|
367 |
KKeyDeviceE, EKeyDeviceE,
|
sl@0
|
368 |
KKeyDeviceF, EKeyDeviceF,
|
sl@0
|
369 |
KKeyApplication0, EKeyApplication0,
|
sl@0
|
370 |
KKeyApplication1, EKeyApplication1,
|
sl@0
|
371 |
KKeyApplication2, EKeyApplication2,
|
sl@0
|
372 |
KKeyApplication3, EKeyApplication3,
|
sl@0
|
373 |
KKeyApplication4, EKeyApplication4,
|
sl@0
|
374 |
KKeyApplication5, EKeyApplication5,
|
sl@0
|
375 |
KKeyApplication6, EKeyApplication6,
|
sl@0
|
376 |
KKeyApplication7, EKeyApplication7,
|
sl@0
|
377 |
KKeyApplication8, EKeyApplication8,
|
sl@0
|
378 |
KKeyApplication9, EKeyApplication9,
|
sl@0
|
379 |
KKeyApplicationA, EKeyApplicationA,
|
sl@0
|
380 |
KKeyApplicationB, EKeyApplicationB,
|
sl@0
|
381 |
KKeyApplicationC, EKeyApplicationC,
|
sl@0
|
382 |
KKeyApplicationD, EKeyApplicationD,
|
sl@0
|
383 |
KKeyApplicationE, EKeyApplicationE,
|
sl@0
|
384 |
KKeyApplicationF, EKeyApplicationF,
|
sl@0
|
385 |
KKeyYes, EKeyYes,
|
sl@0
|
386 |
KKeyNo, EKeyNo,
|
sl@0
|
387 |
KKeyIncBrightness, EKeyIncBrightness,
|
sl@0
|
388 |
KKeyDecBrightness, EKeyDecBrightness,
|
sl@0
|
389 |
KKeyKeyboardExtend, EKeyKeyboardExtend,
|
sl@0
|
390 |
KKeyDevice10, EKeyDevice10,
|
sl@0
|
391 |
KKeyDevice11, EKeyDevice11,
|
sl@0
|
392 |
KKeyDevice12, EKeyDevice12,
|
sl@0
|
393 |
KKeyDevice13, EKeyDevice13,
|
sl@0
|
394 |
KKeyDevice14, EKeyDevice14,
|
sl@0
|
395 |
KKeyDevice15, EKeyDevice15,
|
sl@0
|
396 |
KKeyDevice16, EKeyDevice16,
|
sl@0
|
397 |
KKeyDevice17, EKeyDevice17,
|
sl@0
|
398 |
KKeyDevice18, EKeyDevice18,
|
sl@0
|
399 |
KKeyDevice19, EKeyDevice19,
|
sl@0
|
400 |
KKeyDevice1A, EKeyDevice1A,
|
sl@0
|
401 |
KKeyDevice1B, EKeyDevice1B,
|
sl@0
|
402 |
KKeyDevice1C, EKeyDevice1C,
|
sl@0
|
403 |
KKeyDevice1D, EKeyDevice1D,
|
sl@0
|
404 |
KKeyDevice1E, EKeyDevice1E,
|
sl@0
|
405 |
KKeyDevice1F, EKeyDevice1F,
|
sl@0
|
406 |
KKeyApplication10, EKeyApplication10,
|
sl@0
|
407 |
KKeyApplication11, EKeyApplication11,
|
sl@0
|
408 |
KKeyApplication12, EKeyApplication12,
|
sl@0
|
409 |
KKeyApplication13, EKeyApplication13,
|
sl@0
|
410 |
KKeyApplication14, EKeyApplication14,
|
sl@0
|
411 |
KKeyApplication15, EKeyApplication15,
|
sl@0
|
412 |
KKeyApplication16, EKeyApplication16,
|
sl@0
|
413 |
KKeyApplication17, EKeyApplication17,
|
sl@0
|
414 |
KKeyApplication18, EKeyApplication18,
|
sl@0
|
415 |
KKeyApplication19, EKeyApplication19,
|
sl@0
|
416 |
KKeyApplication1A, EKeyApplication1A,
|
sl@0
|
417 |
KKeyApplication1B, EKeyApplication1B,
|
sl@0
|
418 |
KKeyApplication1C, EKeyApplication1C,
|
sl@0
|
419 |
KKeyApplication1D, EKeyApplication1D,
|
sl@0
|
420 |
KKeyApplication1E, EKeyApplication1E,
|
sl@0
|
421 |
KKeyApplication1F, EKeyApplication1F,
|
sl@0
|
422 |
KKeyDevice20, EKeyDevice20,
|
sl@0
|
423 |
KKeyDevice21, EKeyDevice21,
|
sl@0
|
424 |
KKeyDevice22, EKeyDevice22,
|
sl@0
|
425 |
KKeyDevice23, EKeyDevice23,
|
sl@0
|
426 |
KKeyDevice24, EKeyDevice24,
|
sl@0
|
427 |
KKeyDevice25, EKeyDevice25,
|
sl@0
|
428 |
KKeyDevice26, EKeyDevice26,
|
sl@0
|
429 |
KKeyDevice27, EKeyDevice27,
|
sl@0
|
430 |
KKeyApplication20, EKeyApplication20,
|
sl@0
|
431 |
KKeyApplication21, EKeyApplication21,
|
sl@0
|
432 |
KKeyApplication22, EKeyApplication22,
|
sl@0
|
433 |
KKeyApplication23, EKeyApplication23,
|
sl@0
|
434 |
KKeyApplication24, EKeyApplication24,
|
sl@0
|
435 |
KKeyApplication25, EKeyApplication25,
|
sl@0
|
436 |
KKeyApplication26, EKeyApplication26,
|
sl@0
|
437 |
KKeyApplication27, EKeyApplication27,
|
sl@0
|
438 |
KEnumNull, -1,
|
sl@0
|
439 |
};
|
sl@0
|
440 |
|
sl@0
|
441 |
_LIT(KEEventOccuranceOnce, "EEventOccuranceOnce");
|
sl@0
|
442 |
_LIT(KEEventOccuranceZeroOrMore, "EEventOccuranceZeroOrMore");
|
sl@0
|
443 |
_LIT(KEEventOccuranceOneOrMore, "EEventOccuranceOneOrMore");
|
sl@0
|
444 |
const CDataWrapperBase::TEnumEntryTable CT_ActiveRConsoleRead::iEnumEventOccuranceTable[] =
|
sl@0
|
445 |
{
|
sl@0
|
446 |
// Enum as a descriptor Enum
|
sl@0
|
447 |
KEEventOccuranceOnce, CT_ActiveRConsoleRead::EEventOccuranceOnce,
|
sl@0
|
448 |
KEEventOccuranceZeroOrMore, CT_ActiveRConsoleRead::EEventOccuranceZeroOrMore,
|
sl@0
|
449 |
KEEventOccuranceOneOrMore, CT_ActiveRConsoleRead::EEventOccuranceOneOrMore,
|
sl@0
|
450 |
KEnumNull, -1,
|
sl@0
|
451 |
};
|
sl@0
|
452 |
/*@}*/
|
sl@0
|
453 |
|
sl@0
|
454 |
//////////////////////////////////////////////////////////////////////
|
sl@0
|
455 |
// Construction/Destruction
|
sl@0
|
456 |
//////////////////////////////////////////////////////////////////////
|
sl@0
|
457 |
|
sl@0
|
458 |
CT_ActiveRConsoleRead* CT_ActiveRConsoleRead::NewL(CDataWrapperBase& aDataWrapperBase)
|
sl@0
|
459 |
{
|
sl@0
|
460 |
CT_ActiveRConsoleRead* self=new (ELeave) CT_ActiveRConsoleRead(aDataWrapperBase);
|
sl@0
|
461 |
CleanupStack::PushL(self);
|
sl@0
|
462 |
self->ConstructL();
|
sl@0
|
463 |
CleanupStack::Pop(self);
|
sl@0
|
464 |
return self;
|
sl@0
|
465 |
}
|
sl@0
|
466 |
|
sl@0
|
467 |
|
sl@0
|
468 |
CT_ActiveRConsoleRead::CT_ActiveRConsoleRead(CDataWrapperBase& aDataWrapperBase)
|
sl@0
|
469 |
: CActiveCallbackBase(aDataWrapperBase,EPriorityStandard)
|
sl@0
|
470 |
, iColourValueBlack(0)
|
sl@0
|
471 |
, iColourValueWhite(0)
|
sl@0
|
472 |
, iEventIndex(0)
|
sl@0
|
473 |
, iEventCount(0)
|
sl@0
|
474 |
, iTimeOut(0)
|
sl@0
|
475 |
, iErrorMargin(0)
|
sl@0
|
476 |
, iHasExitKeyCode(EFalse)
|
sl@0
|
477 |
, iHasExitRectangle(EFalse)
|
sl@0
|
478 |
, iExitKeyCode(0)
|
sl@0
|
479 |
, iTestIndex(0)
|
sl@0
|
480 |
, iNumberOfTests(0)
|
sl@0
|
481 |
, iHasExpectedKeyCode(EFalse)
|
sl@0
|
482 |
, iHasExpectedRectangle(EFalse)
|
sl@0
|
483 |
, iExpectedKeyCode(0)
|
sl@0
|
484 |
{
|
sl@0
|
485 |
}
|
sl@0
|
486 |
|
sl@0
|
487 |
|
sl@0
|
488 |
CT_ActiveRConsoleRead::~CT_ActiveRConsoleRead()
|
sl@0
|
489 |
/**
|
sl@0
|
490 |
* Public destructor
|
sl@0
|
491 |
*/
|
sl@0
|
492 |
{
|
sl@0
|
493 |
DestroyData();
|
sl@0
|
494 |
}
|
sl@0
|
495 |
|
sl@0
|
496 |
void CT_ActiveRConsoleRead::DestroyData()
|
sl@0
|
497 |
{
|
sl@0
|
498 |
iEvent.Reset();
|
sl@0
|
499 |
iEvent.Close();
|
sl@0
|
500 |
}
|
sl@0
|
501 |
|
sl@0
|
502 |
TBool CT_ActiveRConsoleRead::KickStartL(const TDesC& aSection, const TInt aAsyncErrorIndex, RConsole& aConsole)
|
sl@0
|
503 |
/**
|
sl@0
|
504 |
* Kick Start the object and set up intials
|
sl@0
|
505 |
* @param aSection The section in the ini containing data for the command
|
sl@0
|
506 |
* @param aAsyncErrorIndex Command index for async calls to return errors to
|
sl@0
|
507 |
* @param aConsole The RConsole object
|
sl@0
|
508 |
*/
|
sl@0
|
509 |
{
|
sl@0
|
510 |
TBuf<KMaxTestExecuteCommandLength> tempStore;
|
sl@0
|
511 |
iSection.Set(aSection);
|
sl@0
|
512 |
|
sl@0
|
513 |
iColourValueBlack =KBlack;
|
sl@0
|
514 |
iColourValueWhite =KWhite;
|
sl@0
|
515 |
iDataWrapperBase.GetUint8FromConfig(iSection, KFldColourBlack(), iColourValueBlack);
|
sl@0
|
516 |
iDataWrapperBase.GetUint8FromConfig(iSection, KFldColourWhite(), iColourValueWhite);
|
sl@0
|
517 |
|
sl@0
|
518 |
iTimeOut=KDefaultTimeout;
|
sl@0
|
519 |
iDataWrapperBase.GetIntFromConfig(iSection, KFldTimeout(), iTimeOut);
|
sl@0
|
520 |
|
sl@0
|
521 |
iErrorMargin=0;
|
sl@0
|
522 |
iDataWrapperBase.GetIntFromConfig(iSection, KFldErrorMargin(), iErrorMargin);
|
sl@0
|
523 |
|
sl@0
|
524 |
iHasExitKeyCode=iDataWrapperBase.GetHexFromConfig(iSection, KFldExitKeyCode(), iExitKeyCode);
|
sl@0
|
525 |
|
sl@0
|
526 |
iHasExitRectangle=iDataWrapperBase.GetRectFromConfig(iSection, KFldExitRectangle(), iExitRectangle);
|
sl@0
|
527 |
if ( iHasExitRectangle )
|
sl@0
|
528 |
{
|
sl@0
|
529 |
// Draw rectangle
|
sl@0
|
530 |
TInt height =Abs(iExitRectangle.iBr.iY-iExitRectangle.iTl.iY);
|
sl@0
|
531 |
TInt width =Abs(iExitRectangle.iBr.iX-iExitRectangle.iTl.iX);
|
sl@0
|
532 |
CDrawUtils::DrawSquareUtility(iExitRectangle.iTl, height, width, iColourValueWhite);
|
sl@0
|
533 |
}
|
sl@0
|
534 |
|
sl@0
|
535 |
iEvent.Reset();
|
sl@0
|
536 |
|
sl@0
|
537 |
TEventConfig config;
|
sl@0
|
538 |
TInt eventIndex=0;
|
sl@0
|
539 |
TBool dataOk=ETrue;
|
sl@0
|
540 |
TBool moreData=ETrue;
|
sl@0
|
541 |
while ( moreData )
|
sl@0
|
542 |
{
|
sl@0
|
543 |
tempStore.Format(KFldEventType, ++eventIndex);
|
sl@0
|
544 |
moreData=iDataWrapperBase.GetEnumFromConfig(iSection, tempStore, iEnumRawEventTable, config.iEventType);
|
sl@0
|
545 |
if ( moreData )
|
sl@0
|
546 |
{
|
sl@0
|
547 |
tempStore.Format(KFldEventOccurance, eventIndex);
|
sl@0
|
548 |
TInt eventOccurance=EEventOccuranceOnce;
|
sl@0
|
549 |
iDataWrapperBase.GetEnumFromConfig(iSection, tempStore, iEnumEventOccuranceTable, eventOccurance);
|
sl@0
|
550 |
config.iEventOccurance=(TEventOccurance)eventOccurance;
|
sl@0
|
551 |
|
sl@0
|
552 |
tempStore.Format(KFldDataVerify, eventIndex);
|
sl@0
|
553 |
config.iDataVerify=EFalse;
|
sl@0
|
554 |
iDataWrapperBase.GetBoolFromConfig(iSection, tempStore, config.iDataVerify);
|
sl@0
|
555 |
|
sl@0
|
556 |
tempStore.Format(KFldDataDraw, eventIndex);
|
sl@0
|
557 |
config.iDataDraw=EFalse;
|
sl@0
|
558 |
iDataWrapperBase.GetBoolFromConfig(iSection, tempStore, config.iDataDraw);
|
sl@0
|
559 |
|
sl@0
|
560 |
iEvent.AppendL(config);
|
sl@0
|
561 |
dataOk=ETrue;
|
sl@0
|
562 |
}
|
sl@0
|
563 |
}
|
sl@0
|
564 |
|
sl@0
|
565 |
// If -1 then we have an umlimited number of test(s) that completes with an exit event
|
sl@0
|
566 |
// which can be an exit key code or a pen event in the exit rectangle
|
sl@0
|
567 |
iNumberOfTests=-1;
|
sl@0
|
568 |
iDataWrapperBase.GetIntFromConfig(iSection, KFldTests(), iNumberOfTests);
|
sl@0
|
569 |
|
sl@0
|
570 |
if ( dataOk )
|
sl@0
|
571 |
{
|
sl@0
|
572 |
iTestIndex=0;
|
sl@0
|
573 |
dataOk=KickNext(aAsyncErrorIndex, aConsole);
|
sl@0
|
574 |
}
|
sl@0
|
575 |
|
sl@0
|
576 |
return dataOk;
|
sl@0
|
577 |
}
|
sl@0
|
578 |
|
sl@0
|
579 |
TBool CT_ActiveRConsoleRead::KickNext(const TInt aAsyncErrorIndex, RConsole& aConsole)
|
sl@0
|
580 |
{
|
sl@0
|
581 |
TInt testing=(iTestIndex<iNumberOfTests) || (iNumberOfTests==-1);
|
sl@0
|
582 |
|
sl@0
|
583 |
if ( testing )
|
sl@0
|
584 |
{
|
sl@0
|
585 |
TBuf<KMaxTestExecuteCommandLength> tempStore;
|
sl@0
|
586 |
iEventIndex=0;
|
sl@0
|
587 |
iEventCount=0;
|
sl@0
|
588 |
iHasExpectedKeyCode=EFalse;
|
sl@0
|
589 |
iHasExpectedRectangle=EFalse;
|
sl@0
|
590 |
|
sl@0
|
591 |
++iTestIndex;
|
sl@0
|
592 |
|
sl@0
|
593 |
tempStore.Format(KFldKeyCode, iTestIndex);
|
sl@0
|
594 |
iHasExpectedKeyCode=iDataWrapperBase.GetHexFromConfig(iSection, tempStore, iExpectedKeyCode);
|
sl@0
|
595 |
|
sl@0
|
596 |
tempStore.Format(KFldPoint, iTestIndex);
|
sl@0
|
597 |
TPoint point;
|
sl@0
|
598 |
if ( iDataWrapperBase.GetPointFromConfig(iSection, tempStore, point) )
|
sl@0
|
599 |
{
|
sl@0
|
600 |
iHasExpectedRectangle=ETrue;
|
sl@0
|
601 |
iExpectedRectangle.SetRect(point.iX-iErrorMargin, point.iY-iErrorMargin, point.iX+iErrorMargin, point.iY+iErrorMargin);
|
sl@0
|
602 |
}
|
sl@0
|
603 |
|
sl@0
|
604 |
tempStore.Format(KFldRect, iTestIndex);
|
sl@0
|
605 |
TRect rect;
|
sl@0
|
606 |
if ( iDataWrapperBase.GetRectFromConfig(iSection, tempStore, rect) )
|
sl@0
|
607 |
{
|
sl@0
|
608 |
iHasExpectedRectangle=ETrue;
|
sl@0
|
609 |
iExpectedRectangle=rect;
|
sl@0
|
610 |
}
|
sl@0
|
611 |
|
sl@0
|
612 |
if ( iHasExpectedRectangle )
|
sl@0
|
613 |
{
|
sl@0
|
614 |
// Draw boundary
|
sl@0
|
615 |
TInt height =Abs(iExpectedRectangle.iBr.iY-iExpectedRectangle.iTl.iY);
|
sl@0
|
616 |
TInt width =Abs(iExpectedRectangle.iBr.iX-iExpectedRectangle.iTl.iX);
|
sl@0
|
617 |
CDrawUtils::DrawSquareOutLineUtility(iExpectedRectangle.iTl,height,width,iColourValueWhite);
|
sl@0
|
618 |
}
|
sl@0
|
619 |
|
sl@0
|
620 |
Kick(aAsyncErrorIndex, aConsole);
|
sl@0
|
621 |
}
|
sl@0
|
622 |
|
sl@0
|
623 |
return testing;
|
sl@0
|
624 |
}
|
sl@0
|
625 |
|
sl@0
|
626 |
void CT_ActiveRConsoleRead::Kick(const TInt aAsyncErrorIndex, RConsole& aConsole)
|
sl@0
|
627 |
/**
|
sl@0
|
628 |
* Kick the object
|
sl@0
|
629 |
*/
|
sl@0
|
630 |
{
|
sl@0
|
631 |
iDataWrapperBase.INFO_PRINTF1(_L("issuing kick"));
|
sl@0
|
632 |
aConsole.Read(iKey, iStatus);//wait for user input
|
sl@0
|
633 |
CActiveCallbackBase::Activate(aAsyncErrorIndex, iTimeOut);
|
sl@0
|
634 |
}
|
sl@0
|
635 |
|
sl@0
|
636 |
TBool CT_ActiveRConsoleRead::VerifyDataAndKick(const TInt aAsyncErrorIndex, RConsole& aConsole)
|
sl@0
|
637 |
{
|
sl@0
|
638 |
TInt eventType=iKey.Type();
|
sl@0
|
639 |
iDataWrapperBase.INFO_PRINTF2(KLogEvent, eventType);
|
sl@0
|
640 |
|
sl@0
|
641 |
// Do we ignore the event
|
sl@0
|
642 |
TBool moreToDo=!ExitEvent();
|
sl@0
|
643 |
TBool eventOk=EFalse;
|
sl@0
|
644 |
|
sl@0
|
645 |
TEventConfig config=iEvent[iEventIndex];
|
sl@0
|
646 |
while ( iEventIndex<iEvent.Count() && !eventOk && moreToDo )
|
sl@0
|
647 |
{
|
sl@0
|
648 |
config=iEvent[iEventIndex];
|
sl@0
|
649 |
if ( eventType==config.iEventType )
|
sl@0
|
650 |
{
|
sl@0
|
651 |
++iEventCount;
|
sl@0
|
652 |
eventOk=ETrue;
|
sl@0
|
653 |
iDataWrapperBase.INFO_PRINTF3(_L("Events type match Expected=%d, Actual=%d"), config.iEventType,eventType);
|
sl@0
|
654 |
}
|
sl@0
|
655 |
else
|
sl@0
|
656 |
{
|
sl@0
|
657 |
switch(config.iEventOccurance)
|
sl@0
|
658 |
{
|
sl@0
|
659 |
case EEventOccuranceOnce:
|
sl@0
|
660 |
iDataWrapperBase.ERR_PRINTF4(KLogUnexpectedEvent, config.iEventType, eventType, iEventIndex);
|
sl@0
|
661 |
iDataWrapperBase.SetBlockResult(EFail);
|
sl@0
|
662 |
moreToDo=EFalse;
|
sl@0
|
663 |
break;
|
sl@0
|
664 |
case EEventOccuranceZeroOrMore:
|
sl@0
|
665 |
// If the event may not occur then go to the next one
|
sl@0
|
666 |
++iEventIndex;
|
sl@0
|
667 |
iEventCount=0;
|
sl@0
|
668 |
break;
|
sl@0
|
669 |
case EEventOccuranceOneOrMore:
|
sl@0
|
670 |
if(iEventCount==0)
|
sl@0
|
671 |
{
|
sl@0
|
672 |
iDataWrapperBase.ERR_PRINTF4(KLogUnexpectedEvent, config.iEventType, eventType, iEventIndex);
|
sl@0
|
673 |
iDataWrapperBase.SetBlockResult(EFail);
|
sl@0
|
674 |
moreToDo=EFalse;
|
sl@0
|
675 |
}
|
sl@0
|
676 |
else
|
sl@0
|
677 |
{
|
sl@0
|
678 |
++iEventIndex;
|
sl@0
|
679 |
iEventCount=0;
|
sl@0
|
680 |
}
|
sl@0
|
681 |
break;
|
sl@0
|
682 |
}
|
sl@0
|
683 |
}
|
sl@0
|
684 |
}
|
sl@0
|
685 |
|
sl@0
|
686 |
if ( eventOk )
|
sl@0
|
687 |
{
|
sl@0
|
688 |
if ( config.iDataDraw )
|
sl@0
|
689 |
{
|
sl@0
|
690 |
DrawData();
|
sl@0
|
691 |
}
|
sl@0
|
692 |
|
sl@0
|
693 |
if ( config.iDataVerify )
|
sl@0
|
694 |
{
|
sl@0
|
695 |
if ( iHasExpectedRectangle )
|
sl@0
|
696 |
{
|
sl@0
|
697 |
TPoint point=iKey.MousePos();
|
sl@0
|
698 |
if ( !iExpectedRectangle.Contains(point) )
|
sl@0
|
699 |
{
|
sl@0
|
700 |
iDataWrapperBase.ERR_PRINTF3(KLogUnexpectedPoint, point.iX, point.iY);
|
sl@0
|
701 |
iDataWrapperBase.SetBlockResult(EFail);
|
sl@0
|
702 |
}
|
sl@0
|
703 |
}
|
sl@0
|
704 |
|
sl@0
|
705 |
if ( iHasExpectedKeyCode )
|
sl@0
|
706 |
{
|
sl@0
|
707 |
TKeyCode keyCode=iKey.Code();
|
sl@0
|
708 |
if ( keyCode!=iExpectedKeyCode )
|
sl@0
|
709 |
{
|
sl@0
|
710 |
iDataWrapperBase.ERR_PRINTF2(KLogUnexpectedKeyCode, keyCode);
|
sl@0
|
711 |
iDataWrapperBase.SetBlockResult(EFail);
|
sl@0
|
712 |
}
|
sl@0
|
713 |
else
|
sl@0
|
714 |
{
|
sl@0
|
715 |
iDataWrapperBase.INFO_PRINTF3(_L("keycodes match as expected:%d, actual:%d"), iExpectedKeyCode,keyCode);
|
sl@0
|
716 |
}
|
sl@0
|
717 |
}
|
sl@0
|
718 |
}
|
sl@0
|
719 |
|
sl@0
|
720 |
if ( config.iEventOccurance==EEventOccuranceOnce )
|
sl@0
|
721 |
{
|
sl@0
|
722 |
++iEventIndex;
|
sl@0
|
723 |
iEventCount=0;
|
sl@0
|
724 |
}
|
sl@0
|
725 |
if ( iEventIndex>=iEvent.Count() )
|
sl@0
|
726 |
{
|
sl@0
|
727 |
moreToDo=KickNext(aAsyncErrorIndex, aConsole);
|
sl@0
|
728 |
}
|
sl@0
|
729 |
else
|
sl@0
|
730 |
{
|
sl@0
|
731 |
// Event can occur multiple times
|
sl@0
|
732 |
Kick(aAsyncErrorIndex, aConsole);
|
sl@0
|
733 |
}
|
sl@0
|
734 |
}
|
sl@0
|
735 |
|
sl@0
|
736 |
return moreToDo;
|
sl@0
|
737 |
}
|
sl@0
|
738 |
|
sl@0
|
739 |
TConsoleKey CT_ActiveRConsoleRead::GetConsoleKey()
|
sl@0
|
740 |
{
|
sl@0
|
741 |
return iKey;
|
sl@0
|
742 |
}
|
sl@0
|
743 |
|
sl@0
|
744 |
TBool CT_ActiveRConsoleRead::ExitEvent()
|
sl@0
|
745 |
/**
|
sl@0
|
746 |
* Exit the testcase if certain scenarios are hit
|
sl@0
|
747 |
*
|
sl@0
|
748 |
*
|
sl@0
|
749 |
*/
|
sl@0
|
750 |
{
|
sl@0
|
751 |
TBool exitEvent=EFalse;
|
sl@0
|
752 |
|
sl@0
|
753 |
iDataWrapperBase.INFO_PRINTF2(_L("checking if we are an exit event:%d"),iKey.Type() );
|
sl@0
|
754 |
|
sl@0
|
755 |
switch (iKey.Type() )
|
sl@0
|
756 |
{
|
sl@0
|
757 |
case TRawEvent::ENone:
|
sl@0
|
758 |
break;
|
sl@0
|
759 |
case TRawEvent::EPointerMove:
|
sl@0
|
760 |
case TRawEvent::EButton1Down:
|
sl@0
|
761 |
break;
|
sl@0
|
762 |
case TRawEvent::EButton1Up:
|
sl@0
|
763 |
if ( iHasExitRectangle )
|
sl@0
|
764 |
{
|
sl@0
|
765 |
exitEvent=iExitRectangle.Contains(iKey.MousePos());
|
sl@0
|
766 |
}
|
sl@0
|
767 |
break;
|
sl@0
|
768 |
case TRawEvent::EButton2Down:
|
sl@0
|
769 |
break;
|
sl@0
|
770 |
case TRawEvent::EButton2Up:
|
sl@0
|
771 |
break;
|
sl@0
|
772 |
case TRawEvent::EButton3Down:
|
sl@0
|
773 |
break;
|
sl@0
|
774 |
case TRawEvent::EButton3Up:
|
sl@0
|
775 |
break;
|
sl@0
|
776 |
case TRawEvent::EKeyDown:
|
sl@0
|
777 |
break;
|
sl@0
|
778 |
case TRawEvent::EKeyUp:
|
sl@0
|
779 |
if ( iHasExitKeyCode )
|
sl@0
|
780 |
{
|
sl@0
|
781 |
iDataWrapperBase.INFO_PRINTF2(KLogKey, TInt (iKey.Code()));
|
sl@0
|
782 |
if ( !iKey.Code()==TKeyCode(iExitKeyCode) )
|
sl@0
|
783 |
{
|
sl@0
|
784 |
iDataWrapperBase.ERR_PRINTF3(_L("Test failed due to user feedback :actual key %d, expected key %d"), TInt(iKey.Code()), iExitKeyCode);
|
sl@0
|
785 |
iDataWrapperBase.SetBlockResult(EFail);
|
sl@0
|
786 |
}
|
sl@0
|
787 |
exitEvent=ETrue;
|
sl@0
|
788 |
}
|
sl@0
|
789 |
break;
|
sl@0
|
790 |
case TRawEvent::EKeyRepeat:
|
sl@0
|
791 |
break;
|
sl@0
|
792 |
default:
|
sl@0
|
793 |
break;
|
sl@0
|
794 |
}
|
sl@0
|
795 |
|
sl@0
|
796 |
return exitEvent;
|
sl@0
|
797 |
}
|
sl@0
|
798 |
|
sl@0
|
799 |
void CT_ActiveRConsoleRead::DrawData()
|
sl@0
|
800 |
{
|
sl@0
|
801 |
switch (iKey.Type() )
|
sl@0
|
802 |
{
|
sl@0
|
803 |
case TRawEvent::ENone:
|
sl@0
|
804 |
break;
|
sl@0
|
805 |
case TRawEvent::EPointerMove:
|
sl@0
|
806 |
case TRawEvent::EButton1Down:
|
sl@0
|
807 |
case TRawEvent::EButton1Up:
|
sl@0
|
808 |
case TRawEvent::EButton2Down:
|
sl@0
|
809 |
case TRawEvent::EButton2Up:
|
sl@0
|
810 |
case TRawEvent::EButton3Down:
|
sl@0
|
811 |
case TRawEvent::EButton3Up:
|
sl@0
|
812 |
// Draw the point
|
sl@0
|
813 |
CDrawUtils::ColourFillUtility(iColourValueBlack, iKey.MousePos());
|
sl@0
|
814 |
break;
|
sl@0
|
815 |
case TRawEvent::EKeyDown:
|
sl@0
|
816 |
break;
|
sl@0
|
817 |
case TRawEvent::EKeyUp:
|
sl@0
|
818 |
break;
|
sl@0
|
819 |
case TRawEvent::EKeyRepeat:
|
sl@0
|
820 |
break;
|
sl@0
|
821 |
default:
|
sl@0
|
822 |
break;
|
sl@0
|
823 |
}
|
sl@0
|
824 |
}
|