author | Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> |
Tue, 14 Sep 2010 22:59:08 +0300 | |
branch | RCL_3 |
changeset 46 | 5146369cfdc9 |
parent 45 | a9c0808a1095 |
permissions | -rw-r--r-- |
5 | 1 |
/* |
2 |
* Copyright (c) 2005-2006 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 the License "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: CSysInfoService class |
|
15 |
* |
|
16 |
*/ |
|
17 |
||
18 |
||
19 |
#ifndef __CSYSINFOSERVICE_H__ |
|
20 |
#define __CSYSINFOSERVICE_H__ |
|
21 |
||
22 |
// INCLUDES |
|
23 |
#include "sysinfo.h" |
|
24 |
#include "sysrequest.h" |
|
10
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
25 |
#include "imagingconfigmanager.h" |
45 | 26 |
#include <mmf\devvideo\devvideoplay.h > |
5 | 27 |
|
28 |
// FORWORD CLASS DECLARATION |
|
29 |
class CSysData; |
|
30 |
class CDeviceInfo; |
|
31 |
||
32 |
/** |
|
33 |
* @ref ISystemObserver |
|
34 |
* Client Observer interface to handle response from Asynchronous system requests. |
|
35 |
* |
|
36 |
* @param aResponse |
|
37 |
*/ |
|
38 |
||
39 |
class ISystemObserver |
|
40 |
{ |
|
41 |
public: |
|
42 |
/** |
|
43 |
* HandleResponseL () |
|
44 |
* Callback function to be implimented by client in order to handle asynchronous |
|
45 |
* response. |
|
46 |
* @param aEntity Entity |
|
47 |
* |
|
48 |
* @param aKey Key |
|
49 |
* |
|
50 |
* @param aOutput client owns output data. |
|
51 |
* |
|
52 |
* @param aTransID TransactionID associated with request. |
|
53 |
* |
|
54 |
* @param aType Asynchronous Response type. |
|
55 |
* |
|
56 |
* @param aError If any error occured in process of generating response. |
|
57 |
* |
|
58 |
*/ |
|
59 |
virtual void HandleResponseL(const TDesC& aEntity,const TDesC& aKey, |
|
60 |
CSysData* aOutput, TInt32 aTransID, |
|
61 |
TSysRequest::TRequestType aType, |
|
62 |
TInt aError=KErrNone) = 0; |
|
63 |
}; |
|
64 |
||
65 |
||
66 |
/** |
|
67 |
* @ref CSysInfoService is used to read and modify and system information |
|
68 |
* |
|
69 |
* @lib sysinfoservice |
|
70 |
* @since S60 3.2 |
|
71 |
* @version $Revision: 1.0 $ |
|
72 |
*/ |
|
73 |
||
74 |
NONSHARABLE_CLASS(CSysInfoService) : public CBase |
|
75 |
{ |
|
76 |
public: // Constructors and destructor |
|
77 |
||
78 |
/** |
|
79 |
* NewL() |
|
80 |
* Two-phased constructor. |
|
81 |
* Create a CSysInfoService object. |
|
82 |
* @return A pointer to the created instance of CSysInfoService. |
|
83 |
*/ |
|
84 |
IMPORT_C static CSysInfoService* NewL(); |
|
85 |
||
86 |
/** |
|
87 |
* Destructor. |
|
88 |
*/ |
|
89 |
~CSysInfoService(); |
|
90 |
||
91 |
private: |
|
92 |
||
93 |
/** |
|
94 |
* C++ default constructor. |
|
95 |
*/ |
|
96 |
CSysInfoService(); |
|
97 |
||
98 |
public: |
|
99 |
||
100 |
/** |
|
101 |
* GetInfoL () |
|
102 |
* Retrieves specified SA value synchronously. |
|
103 |
* User will provide SA and any input by aRequest argument. |
|
104 |
* |
|
105 |
* @param aEntity Entity of an system attribute. |
|
106 |
* |
|
107 |
* @param aKey Key of an system attribute. |
|
108 |
* |
|
109 |
* @param aOutput Retrived system attribute value. |
|
110 |
* |
|
111 |
* @param aInput Optional input data. |
|
112 |
* |
|
113 |
* @error @p KErrArgument if specified input SystemData is not associated with |
|
114 |
* system attribute. |
|
115 |
* @error @p KErrNotFound |
|
116 |
* if specified system attribute not found. |
|
117 |
* if Specified SA doesn't support this kind of operation |
|
118 |
* i.e request type. |
|
119 |
*/ |
|
120 |
||
121 |
IMPORT_C void GetInfoL( const TDesC& aEntity, const TDesC& aKey, |
|
122 |
CSysData*& aOutput, const CSysData* aInput=NULL ); |
|
123 |
||
124 |
/** |
|
125 |
* GetInfoL () |
|
126 |
* Retrieves specified SA value asynchronously. |
|
127 |
* User will provide SA and any input thru aRequest argument. |
|
128 |
* |
|
129 |
* @param aEntity Entity of an system attribute. |
|
130 |
* |
|
131 |
* @param aKey Key of an system attribute. |
|
132 |
* |
|
133 |
* @param aTransID TransactionID for async operation. |
|
134 |
* |
|
135 |
* @param aCallback Observer for handling async response. |
|
136 |
* |
|
137 |
* @param aInput Optional input data. |
|
138 |
* |
|
139 |
* @error @p KErrArgument |
|
140 |
* if specified input SystemData is not associated with |
|
141 |
* system attribute. |
|
142 |
* @error @p KErrNotFound |
|
143 |
* if specified system attribute not found. |
|
144 |
* if Specified SA doesn't support this kind of operation |
|
145 |
* i.e request type. |
|
146 |
* @error @p KErrAlreadyExists |
|
147 |
* if Transaction ID specified already exists. |
|
148 |
*/ |
|
149 |
||
150 |
IMPORT_C void GetInfoL( const TDesC& aEntity, const TDesC& aKey, |
|
151 |
TInt32 aTransID, ISystemObserver* aCallback, |
|
152 |
const CSysData* aInput=NULL ); |
|
153 |
||
154 |
/** |
|
155 |
* GetNotificationL () |
|
156 |
* Registers for notifications for a given SA. |
|
157 |
* User will provide SA and any input thru aRequest argument. |
|
158 |
* |
|
159 |
* @param aEntity Entity of an system attribute. |
|
160 |
* |
|
161 |
* @param aKey Key of an system attribute. |
|
162 |
* |
|
163 |
* @param aTransID TransactionID for async operation. |
|
164 |
* |
|
165 |
* @param aCallback Observer for handling async response. |
|
166 |
* |
|
167 |
* @param aInput Optional input data. |
|
168 |
* |
|
169 |
* @error @p KErrArgument |
|
170 |
* if specified input SystemData is not associated with |
|
171 |
* system attribute. |
|
172 |
* @error @p KErrNotFound |
|
173 |
* if specified system attribute not found. |
|
174 |
* if Specified SA doesn't support this kind of operation |
|
175 |
* i.e request type. |
|
176 |
* @error @p KErrAlreadyExists |
|
177 |
* if Transaction ID specified already exists. |
|
178 |
*/ |
|
179 |
||
180 |
IMPORT_C void GetNotificationL( const TDesC& aEntity, const TDesC& aKey, |
|
181 |
TInt32 aTransID, ISystemObserver* aCallback, |
|
182 |
const CSysData* aInput=NULL ); |
|
183 |
/** |
|
184 |
* SetInfoL() |
|
185 |
* Modifies system attribute value. |
|
186 |
* This API can be used to change system attribute value |
|
187 |
* synchronously/asynchronously, based on attribute specification. |
|
188 |
* |
|
189 |
* @param aEntity Entity of an system attribute. |
|
190 |
* |
|
191 |
* @param aKey Key of an system attribute. |
|
192 |
* |
|
193 |
* @param aInput Input data. |
|
194 |
* |
|
195 |
* @error @p KErrArgument |
|
196 |
* if specified input SystemData is not associated with |
|
197 |
* system attribute. |
|
198 |
* @error @p KErrNotFound |
|
199 |
* if specified system attribute not found. |
|
200 |
* if Specified SA doesn't support this kind of operation |
|
201 |
* i.e request type. |
|
202 |
* @error @p KErrAlreadyExists |
|
203 |
* if Transaction ID specified already exists for async requests. |
|
204 |
*/ |
|
205 |
||
206 |
IMPORT_C void SetInfoL( const TDesC& aEntity, const TDesC& aKey, |
|
207 |
const CSysData* aInput ); |
|
208 |
||
209 |
/** |
|
210 |
* Cancel() |
|
211 |
* Cancels any outstanding requests and releases resources owned by them. |
|
212 |
* |
|
213 |
*/ |
|
214 |
||
215 |
IMPORT_C void Cancel(TInt32 aTransID); |
|
216 |
||
217 |
private: |
|
218 |
/* |
|
219 |
* Modifies General Entity attribute value. |
|
220 |
*/ |
|
221 |
void SetGeneralInfoL(const TDesC& aKey, const CSysData* aInput); |
|
222 |
||
223 |
/* |
|
224 |
* Modifies General Entity attribute value. |
|
225 |
*/ |
|
226 |
void SetDisplayInfoL(const TDesC& aKey, const CSysData* aInput); |
|
227 |
||
228 |
/* |
|
229 |
* Modifies Connectivity Entity attribute value. |
|
230 |
*/ |
|
231 |
void SetConnectivityInfoL(const TDesC& aKey, const CSysData* aInput); |
|
232 |
||
233 |
/* |
|
234 |
* Retrieves Network Entity attribute value. |
|
235 |
*/ |
|
236 |
void GetNetworkInfoL(TPtrC aKey,CSysData*& aSysData); |
|
237 |
||
238 |
/* |
|
239 |
* Retrieves Battery Entity attribute value. |
|
240 |
*/ |
|
241 |
void GetBatteryInfoL(TPtrC aKey,CSysData*& aSysData); |
|
242 |
||
243 |
/* |
|
244 |
* Retrieves General Entity attribute value. |
|
245 |
*/ |
|
246 |
void GetGeneralInfoL(TPtrC aKey,CSysData*& aSysData); |
|
247 |
||
248 |
/* |
|
249 |
* Retrieves Display Entity attribute value. |
|
250 |
*/ |
|
251 |
void GetDisplayInfoL(TPtrC aKey,CSysData*& aSysData); |
|
252 |
||
253 |
/* |
|
254 |
* Retrieves available/supported usb modes. |
|
255 |
*/ |
|
256 |
void GetAvailableUsbModesL(CSysData*& aSysData); |
|
257 |
||
258 |
/* |
|
259 |
* Retrieves Connectivity Entity attribute value. |
|
260 |
*/ |
|
261 |
void GetConnectivittyInfoL(TPtrC aKey,CSysData*& aSysData); |
|
262 |
||
263 |
/* |
|
264 |
* Retrieves Memory Entity attribute value. |
|
265 |
*/ |
|
266 |
void GetMemoryInfoL(const TDesC& aKey, const CSysData* aInput, |
|
267 |
CSysData*& aOutput); |
|
268 |
||
269 |
/* |
|
270 |
* Retrieves Feature Entity attribute value. |
|
271 |
*/ |
|
272 |
void GetFeatureInfoL(TPtrC aKey,CSysData*& aSysData); |
|
273 |
/* |
|
274 |
* Retrieves Device Entity attribute values. |
|
275 |
*/ |
|
276 |
void GetDeviceInfoL(TPtrC aKey,CSysData*& aSysData); |
|
10
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
277 |
|
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
278 |
/* |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
279 |
* Retrieves Camera Entity attribute values. |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
280 |
*/ |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
281 |
void GetCameraDataL(TPtrC aKey,CSysData*& aSysData); |
5 | 282 |
|
283 |
private: //DATA |
|
284 |
||
285 |
/** |
|
286 |
* status member to identify feature manager initialization state. |
|
287 |
*/ |
|
288 |
TBool iFeatureManagerInitialized; |
|
289 |
||
290 |
/** |
|
291 |
* class to read static device properties. |
|
292 |
*/ |
|
293 |
CDeviceInfo* iDeviceInfo; |
|
294 |
}; |
|
295 |
||
45 | 296 |
/** |
297 |
* @ref MMMFDevVideoPlayObserverImpl is used as video observer |
|
298 |
* |
|
299 |
* @lib sysinfoservice |
|
300 |
* @since S60 9.2 |
|
301 |
* @version $Revision: 1.0 $ |
|
302 |
*/ |
|
303 |
class MMMFDevVideoPlayObserverImpl : public MMMFDevVideoPlayObserver |
|
304 |
{ |
|
305 |
public: |
|
306 |
||
307 |
/* Dummy implementation for virtual function */ |
|
308 |
virtual void MdvpoNewBuffers() {} |
|
309 |
/* Dummy implementation for virtual function */ |
|
310 |
virtual void MdvpoReturnPicture(TVideoPicture* ) {} |
|
311 |
/* Dummy implementation for virtual function */ |
|
312 |
virtual void MdvpoSupplementalInformation(const TDesC8& , |
|
313 |
const TTimeIntervalMicroSeconds& , |
|
314 |
const TPictureId& ) {} |
|
315 |
/* Dummy implementation for virtual function */ |
|
316 |
virtual void MdvpoPictureLoss() {} |
|
317 |
/* Dummy implementation for virtual function */ |
|
318 |
virtual void MdvpoPictureLoss(const TArray<TPictureId>& ) {} |
|
319 |
/* Dummy implementation for virtual function */ |
|
320 |
virtual void MdvpoSliceLoss(TUint , TUint , const TPictureId& ){} |
|
321 |
/* Dummy implementation for virtual function */ |
|
322 |
virtual void MdvpoReferencePictureSelection(const TDesC8& ){} |
|
323 |
/* Dummy implementation for virtual function */ |
|
324 |
virtual void MdvpoTimedSnapshotComplete(TInt , |
|
325 |
TPictureData* , |
|
326 |
const TTimeIntervalMicroSeconds& , |
|
327 |
const TPictureId& ){} |
|
328 |
/* Dummy implementation for virtual function */ |
|
329 |
virtual void MdvpoNewPictures() {} |
|
330 |
/* Dummy implementation for virtual function */ |
|
331 |
virtual void MdvpoFatalError(TInt ) {} |
|
332 |
/* Dummy implementation for virtual function */ |
|
333 |
virtual void MdvpoInitComplete(TInt ) {} |
|
334 |
/* Dummy implementation for virtual function */ |
|
335 |
virtual void MdvpoStreamEnd() {} |
|
336 |
}; |
|
5 | 337 |
|
338 |
#endif __CSYSINFOSERVICE_H__ |
|
339 |