|
1 // Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies). |
|
2 // All rights reserved. |
|
3 // This component and the accompanying materials are made available |
|
4 // under the terms of "Eclipse Public License v1.0" |
|
5 // which accompanies this distribution, and is available |
|
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
7 // |
|
8 // Initial Contributors: |
|
9 // Nokia Corporation - initial contribution. |
|
10 // |
|
11 // Contributors: |
|
12 // |
|
13 // Description: |
|
14 // |
|
15 |
|
16 /** |
|
17 @file |
|
18 @test |
|
19 @internalComponent - Internal Symbian test code |
|
20 */ |
|
21 |
|
22 #ifndef __KEYBOARDLOGGER_H |
|
23 #define __KEYBOARDLOGGER_H |
|
24 |
|
25 |
|
26 #include "appfwk_test_AppUi.h" |
|
27 |
|
28 //String literal to represent test step name.\n |
|
29 _LIT(KKeyboardLoggerStep, "KeyboardLogger"); |
|
30 |
|
31 |
|
32 class CTstControl; |
|
33 |
|
34 |
|
35 /************************************************************* |
|
36 ** |
|
37 ** TTstOverflowIgnorer |
|
38 ** |
|
39 *************************************************************/ |
|
40 /* |
|
41 An overflow handler for a 16-bit descriptor. |
|
42 */ |
|
43 class TTstOverflowIgnorer : public TDes16Overflow |
|
44 { |
|
45 public: |
|
46 virtual void Overflow(TDes16& aDescriptor); |
|
47 }; |
|
48 |
|
49 |
|
50 /************************************************************* |
|
51 ** |
|
52 ** CTstControl |
|
53 ** |
|
54 *************************************************************/ |
|
55 /*! |
|
56 The class is used to instantiate a control to receive pointer drag and move events.\n |
|
57 The ability of Fep to handle these events is tested using the control class.\n |
|
58 */ |
|
59 class CTstControl : public CCoeControl |
|
60 { |
|
61 public: |
|
62 CTstControl(); |
|
63 static CTstControl* NewL(); |
|
64 virtual ~CTstControl(); |
|
65 void ConstructL(); |
|
66 private: |
|
67 class CClearer : public CTimer |
|
68 { |
|
69 public: |
|
70 static CClearer* NewL(CTstControl& aControl); |
|
71 private: |
|
72 CClearer(CTstControl& aControl); |
|
73 // from CActive (via CTimer) |
|
74 virtual void RunL(); |
|
75 private: |
|
76 CTstControl& iControl; |
|
77 }; |
|
78 private: |
|
79 // from CCoeControl |
|
80 virtual TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent, TEventCode aEventCode); |
|
81 virtual TCoeInputCapabilities InputCapabilities() const; |
|
82 virtual void Draw(const TRect& aRect) const; |
|
83 private: |
|
84 CFont* iFont; |
|
85 RArray<TKeyEvent> iArrayOfKeyDownEvents; |
|
86 RArray<TKeyEvent> iArrayOfKeyEvents; |
|
87 RArray<TKeyEvent> iArrayOfKeyUpEvents; |
|
88 CClearer* iClearer; |
|
89 private: |
|
90 friend class CClearer; |
|
91 }; |
|
92 |
|
93 |
|
94 /************************************************************* |
|
95 ** |
|
96 ** CTestKeyBoardLoggerUi |
|
97 ** |
|
98 *************************************************************/ |
|
99 |
|
100 class CTestKeyBoardLoggerUi : public CTestAppUi |
|
101 { |
|
102 public: |
|
103 CTestKeyBoardLoggerUi(CTmsTestStep* aStep) : |
|
104 CTestAppUi(aStep, KNullDesC) |
|
105 { |
|
106 } |
|
107 ~CTestKeyBoardLoggerUi(); |
|
108 void ConstructL(); |
|
109 void SendEventToWindowGroups(TWsEvent& aEvent); |
|
110 protected: |
|
111 CTstControl* iControl; |
|
112 protected: |
|
113 virtual void RunTestStepL(TInt aStep); |
|
114 }; |
|
115 |
|
116 |
|
117 /************************************************************* |
|
118 ** |
|
119 ** CTestKeyboardLoggerStep |
|
120 ** |
|
121 *************************************************************/ |
|
122 |
|
123 class CTestKeyboardLoggerStep : public CTmsTestStep |
|
124 { |
|
125 public: |
|
126 CTestKeyboardLoggerStep(); |
|
127 ~CTestKeyboardLoggerStep(); |
|
128 virtual TVerdict doTestStepL(); |
|
129 void ConstructAppL(CEikonEnv* aCoe); |
|
130 }; |
|
131 |
|
132 #endif |
|
133 |
|
134 |