0
|
1 |
/*------------------------------------------------------------------
|
|
2 |
-
|
|
3 |
* Software Name : UserEmulator
|
|
4 |
* Version : v4.2.1309
|
|
5 |
*
|
|
6 |
* Copyright (c) 2009 France Telecom. All rights reserved.
|
|
7 |
* This software is distributed under the License
|
|
8 |
* "Eclipse Public License - v 1.0" the text of which is available
|
|
9 |
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
|
|
10 |
*
|
|
11 |
* Initial Contributors:
|
|
12 |
* France Telecom
|
|
13 |
*
|
|
14 |
* Contributors:
|
|
15 |
*------------------------------------------------------------------
|
|
16 |
-
|
|
17 |
* File Name: serverCtrl.h
|
|
18 |
*
|
|
19 |
* Created: 13/08/2009
|
|
20 |
* Author(s): Marcell Kiss
|
|
21 |
*
|
|
22 |
* Description:
|
|
23 |
* Declares Anim dll server side class
|
|
24 |
*------------------------------------------------------------------
|
|
25 |
-
|
|
26 |
*
|
|
27 |
*/
|
|
28 |
|
|
29 |
#ifndef SERVERCTRL_H__
|
|
30 |
#define SERVERCTRL_H__
|
|
31 |
|
|
32 |
// System Includes
|
|
33 |
#include <w32adll.h>
|
|
34 |
#include <f32file.h>
|
|
35 |
// User Includes
|
|
36 |
#include "CaptureKeyTimer.h"
|
|
37 |
#include "Constants.h"
|
|
38 |
// Constants
|
|
39 |
static const TInt KStepSize = 1;
|
|
40 |
static const TInt KAnimationReset = 1;
|
|
41 |
static const TInt KResolutionChange = 2;
|
|
42 |
|
|
43 |
// Class Declaration
|
|
44 |
|
|
45 |
/**
|
|
46 |
* Implements Anim dll server side class.
|
|
47 |
* Records event by OfferRawEvent callback function
|
|
48 |
*/
|
|
49 |
class CServerCtrl : public CWindowAnim, public MCaptureKeyTimerNotify
|
|
50 |
{
|
|
51 |
public:
|
|
52 |
/**
|
|
53 |
* Constructor
|
|
54 |
*/
|
|
55 |
CServerCtrl();
|
|
56 |
/**
|
|
57 |
* Destructor
|
|
58 |
*/
|
|
59 |
virtual ~CServerCtrl();
|
|
60 |
|
|
61 |
public:
|
|
62 |
/**
|
|
63 |
* Second phase constructor
|
|
64 |
* @param aArgs not used
|
|
65 |
* @param aHasFocus not used
|
|
66 |
*/
|
|
67 |
void ConstructL(TAny* aArgs, TBool aHasFocus);
|
|
68 |
/**
|
|
69 |
* For communication between client and server side.
|
|
70 |
* @param aCommand Command types (see TAnimCommands in clientcommander.h)
|
|
71 |
* @param aArgs Sent data from client side
|
|
72 |
* @return Integer code as a response
|
|
73 |
*/
|
|
74 |
TInt CommandReplyL(TInt aCommand, TAny* aArgs);
|
|
75 |
/**
|
|
76 |
* For communication between client and server side. This version is not used
|
|
77 |
* @param aCode code
|
|
78 |
* @return Integer code as a response
|
|
79 |
*/
|
|
80 |
TInt CommandReplyL(TInt aCode);
|
|
81 |
/**
|
|
82 |
* For communication between client and server side without response to client. This version is not used
|
|
83 |
* @param aCommand Command types (see TAnimCommands in clientcommander.h)(Not Used)
|
|
84 |
* @param aArgs Sent data from client side (Not Used)
|
|
85 |
*/
|
|
86 |
void Command(TInt aCommand, TAny* aArgs);
|
|
87 |
/**
|
|
88 |
* Not used
|
|
89 |
*/
|
|
90 |
void Redraw();
|
|
91 |
/**
|
|
92 |
* Not used
|
|
93 |
* @param aDT date time
|
|
94 |
*/
|
|
95 |
void Animate(TDateTime* aDT);
|
|
96 |
/**
|
|
97 |
* Not used
|
|
98 |
* @param aState not used
|
|
99 |
*/
|
|
100 |
void FocusChanged(TBool aState);
|
|
101 |
/**
|
|
102 |
* Callback function. Called when an event occurs (key press, pointer event, etc.)
|
|
103 |
* @param aRawEvent Type of the event
|
|
104 |
* @return ETrue if event is processed.
|
|
105 |
*/
|
|
106 |
TBool OfferRawEvent(const TRawEvent &aRawEvent);
|
|
107 |
/**
|
|
108 |
* Callback function. Counts seconds for long key presses
|
|
109 |
*/
|
|
110 |
void KeyTimerExpired();
|
|
111 |
|
|
112 |
private:
|
|
113 |
/**
|
|
114 |
* Inserts time interval between two events into the xml script
|
|
115 |
*/
|
|
116 |
void CheckTimerInsertWait();
|
|
117 |
/**
|
|
118 |
* Buffers and writes output to xml script
|
|
119 |
* @param aBuf The data to write to script
|
|
120 |
*/
|
|
121 |
void WriteFile(TDesC8& aBuf);
|
|
122 |
private:
|
|
123 |
/**
|
|
124 |
* File session for scripts
|
|
125 |
*/
|
|
126 |
RFs iFs;
|
|
127 |
/**
|
|
128 |
* Rfile object for scripts
|
|
129 |
*/
|
|
130 |
RFile iRFile;
|
|
131 |
/**
|
|
132 |
* Name and path of xml script. Received from client side
|
|
133 |
*/
|
|
134 |
TBuf<512> iKeyFilePath;
|
|
135 |
/**
|
|
136 |
* Timer active object for long key presses
|
|
137 |
*/
|
|
138 |
CCaptureKeyTimer* iCaptureKeyTimer;
|
|
139 |
/**
|
|
140 |
* Flag to sign if record started
|
|
141 |
*/
|
|
142 |
TBool iRecord;
|
|
143 |
/**
|
|
144 |
* Seconds while a key is pressed
|
|
145 |
*/
|
|
146 |
TUint32 iSecCounter;
|
|
147 |
/**
|
|
148 |
* Flag to sign that camera button is pressed (Insert screen shot command to xml script)
|
|
149 |
*/
|
|
150 |
TBool iCameraButtonPressed;
|
|
151 |
/**
|
|
152 |
* Name of foreground application when scamera button is pressed. Received from client side.
|
|
153 |
*/
|
|
154 |
TBuf8<256> iAppName;
|
|
155 |
/**
|
|
156 |
* Flag to sign delay. (It means waiting period until camre application closes)
|
|
157 |
*/
|
|
158 |
TBool iFirstDelay;
|
|
159 |
/**
|
|
160 |
* Flag to sign if screen reset is over and recording can start.
|
|
161 |
*/
|
|
162 |
TBool iIsEventEnabled;
|
|
163 |
/**
|
|
164 |
* Flag to sign if device is in landscape or portrait mode
|
|
165 |
*/
|
|
166 |
TBool iOrientation;
|
|
167 |
/**
|
|
168 |
* Buffer for xml script output. For performance reasons.
|
|
169 |
*/
|
|
170 |
HBufC8* iMainBuffer;
|
|
171 |
/**
|
|
172 |
* Actual number of events stored in the buffer
|
|
173 |
*/
|
|
174 |
TInt iWritePointer;
|
|
175 |
/**
|
|
176 |
* Time stamp of previous event
|
|
177 |
*/
|
|
178 |
TTime iWaitTimer;
|
|
179 |
/**
|
|
180 |
* Count of 'pressed' No buttons. (Screen reset)
|
|
181 |
*/
|
|
182 |
TInt iNoCount;
|
|
183 |
|
|
184 |
};
|
|
185 |
|
|
186 |
#endif // SERVERCTRL_H__
|
|
187 |
// End of File
|