|
1 /* |
|
2 * Copyright (c) 2009 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: This file contains the header file of the |
|
15 * CUIEngineEvent. |
|
16 * |
|
17 */ |
|
18 |
|
19 #ifndef STIF_TFW_IF_EVENT_H |
|
20 #define STIF_TFW_IF_EVENT_H |
|
21 |
|
22 |
|
23 // INCLUDES |
|
24 #include <e32std.h> |
|
25 #include <e32base.h> |
|
26 #include <StifTestEventInterface.h> |
|
27 |
|
28 |
|
29 // CONSTANTS |
|
30 // None |
|
31 |
|
32 // MACROS |
|
33 // None |
|
34 |
|
35 // DATA TYPES |
|
36 // None |
|
37 |
|
38 // FUNCTION PROTOTYPES |
|
39 // None |
|
40 |
|
41 |
|
42 // FORWARD DECLARATIONS |
|
43 class CUIEngine; |
|
44 |
|
45 // CLASS DECLARATION |
|
46 |
|
47 // DESCRIPTION |
|
48 |
|
49 // CUIEngineEvent is a class that is used to run test cases using |
|
50 // STIF Test Framework. |
|
51 class CUIEngineEvent |
|
52 : public CActive |
|
53 { |
|
54 public: // Enumerations |
|
55 // None |
|
56 |
|
57 private: // Enumerations |
|
58 // Object state |
|
59 enum TEventState |
|
60 { |
|
61 EEventIdle, |
|
62 EEventRequested, |
|
63 EEventWait, |
|
64 EEventWaitCompleted, |
|
65 EEventReleased, |
|
66 }; |
|
67 |
|
68 public: // Constructors and destructor |
|
69 |
|
70 /** |
|
71 * NewL is two-phased constructor. |
|
72 */ |
|
73 static CUIEngineEvent* NewL( CUIEngine* aUIEngine ); |
|
74 |
|
75 /** |
|
76 * Destructor of CUIEngineEvent. |
|
77 */ |
|
78 ~CUIEngineEvent(); |
|
79 |
|
80 public: // New functions |
|
81 |
|
82 /** |
|
83 * Request request event. |
|
84 */ |
|
85 TInt Request( TDesC& aEventName, TUint32 aMaster, TUint32 aSlave ); |
|
86 |
|
87 /** |
|
88 * Release releases event. |
|
89 */ |
|
90 TInt Release(); |
|
91 |
|
92 /** |
|
93 * Return master id. |
|
94 */ |
|
95 TUint32 Master() const { return iMaster; } |
|
96 |
|
97 /** |
|
98 * Return event name. |
|
99 */ |
|
100 const TDesC& EventName() const { return iEvent.Name(); } |
|
101 |
|
102 |
|
103 public: // Functions from base classes |
|
104 |
|
105 /** |
|
106 * From CActive RunL handles request completion. |
|
107 */ |
|
108 void RunL(); |
|
109 |
|
110 /** |
|
111 * From CActive DoCancel handles request cancellation. |
|
112 */ |
|
113 void DoCancel(); |
|
114 |
|
115 /** |
|
116 * From CActive RunError handles error situations. |
|
117 */ |
|
118 TInt RunError( TInt aError ); |
|
119 |
|
120 protected: // New functions |
|
121 // None |
|
122 |
|
123 protected: // Functions from base classes |
|
124 // None |
|
125 |
|
126 private: // New functions |
|
127 |
|
128 /** |
|
129 * C++ default constructor. |
|
130 */ |
|
131 CUIEngineEvent( CUIEngine* aUIEngine ); |
|
132 |
|
133 /** |
|
134 * By default Symbian OS constructor is private. |
|
135 */ |
|
136 void ConstructL(); |
|
137 |
|
138 |
|
139 public: //Data |
|
140 // None |
|
141 |
|
142 protected: // Data |
|
143 // None |
|
144 |
|
145 private: // Data |
|
146 |
|
147 // CUIEngineEvent State |
|
148 TEventState iState; |
|
149 |
|
150 // Pointer to UIEngine |
|
151 CUIEngine* iUIEngine; |
|
152 |
|
153 // EventIf class for event control |
|
154 TEventIf iEvent; |
|
155 TEventIfPckg iEventPckg; |
|
156 |
|
157 // Master identifier |
|
158 TUint32 iMaster; |
|
159 |
|
160 // Slave identifier |
|
161 TUint32 iSlave; |
|
162 |
|
163 public: // Friend classes |
|
164 // None |
|
165 |
|
166 protected: // Friend classes |
|
167 // None |
|
168 |
|
169 private: // Friend classes |
|
170 // None |
|
171 |
|
172 }; |
|
173 |
|
174 |
|
175 |
|
176 #endif // STIF_TFW_IF_EVENT_H |
|
177 |
|
178 // End of File |