|
1 /* |
|
2 * Copyright (c) 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 "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: device data class |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 |
|
21 |
|
22 |
|
23 #ifndef C_CUPNPAVDEVICE_H |
|
24 #define C_CUPNPAVDEVICE_H |
|
25 |
|
26 |
|
27 #include <e32base.h> |
|
28 //#include <s32strm.h> |
|
29 #include <s32mem.h> |
|
30 |
|
31 // FORWARD DECLARATIONS |
|
32 |
|
33 // CLASS DECLARATION |
|
34 |
|
35 /** |
|
36 * UPnP AV Device class |
|
37 * |
|
38 * UPnP AV Device class, represents a UPnP Media Server or Renderer. |
|
39 * |
|
40 * @lib - |
|
41 * @since Series 60 3.1 |
|
42 */ |
|
43 class CUpnpAVDevice : public CBase |
|
44 { |
|
45 public: |
|
46 |
|
47 /** |
|
48 * Enumeration to define the type of a device |
|
49 */ |
|
50 enum TUpnpAVDeviceType |
|
51 { |
|
52 EMediaServer, |
|
53 EMediaRenderer |
|
54 }; |
|
55 |
|
56 public: // Constructors and destructor |
|
57 |
|
58 /** |
|
59 * Two-phased constructor. Instance is left in cleanup stack. |
|
60 * |
|
61 * @return a device instance |
|
62 */ |
|
63 IMPORT_C static CUpnpAVDevice* NewLC(); |
|
64 |
|
65 /** |
|
66 * Two-phased constructor. |
|
67 * |
|
68 * @return a device instance |
|
69 */ |
|
70 IMPORT_C static CUpnpAVDevice* NewL(); |
|
71 |
|
72 /** |
|
73 * Two-phased constructor. |
|
74 * |
|
75 * @param aDevice a device to copy information from |
|
76 * @return a device instance |
|
77 */ |
|
78 IMPORT_C static CUpnpAVDevice* NewL( const CUpnpAVDevice& aDevice ); |
|
79 |
|
80 /** |
|
81 * Destructor. |
|
82 */ |
|
83 IMPORT_C virtual ~CUpnpAVDevice(); |
|
84 |
|
85 public: |
|
86 |
|
87 /** |
|
88 * Externalizes device information to stream. |
|
89 * Leaves in case of errors. |
|
90 * @since Series 60 3.0 |
|
91 * @param reference to RWriteStream |
|
92 * @return none |
|
93 */ |
|
94 IMPORT_C void ExternalizeL( RWriteStream& aStream ) const; |
|
95 |
|
96 /** |
|
97 * Internalizes device information from stream. |
|
98 * Leaves in case of errors. |
|
99 * @since Series 60 3.0 |
|
100 * @param reference to RReadStream |
|
101 * @return none |
|
102 */ |
|
103 IMPORT_C void InternalizeL( RReadStream& aStream ); |
|
104 |
|
105 /** |
|
106 * Externalizes device information to a heap descriptor |
|
107 * |
|
108 * @return externalized device |
|
109 */ |
|
110 IMPORT_C HBufC8* ToDes8L() const; |
|
111 |
|
112 /** |
|
113 * Overwrites all existing data in this device and replaces it |
|
114 * with data copied from given device. |
|
115 * @since Series 60 3.1 |
|
116 * @param aDevice object to copy attributes from |
|
117 */ |
|
118 IMPORT_C void CopyFromL( const CUpnpAVDevice& aDevice ); |
|
119 |
|
120 protected: // |
|
121 |
|
122 /** |
|
123 * Constructor |
|
124 */ |
|
125 IMPORT_C CUpnpAVDevice(); |
|
126 |
|
127 /** |
|
128 * Perform the second phase construction |
|
129 */ |
|
130 void ConstructL(); |
|
131 |
|
132 public: // New methods |
|
133 |
|
134 /** |
|
135 * Sets the friendly name of the device |
|
136 * |
|
137 * @param aName name |
|
138 */ |
|
139 IMPORT_C void SetFriendlyNameL( const TDesC8& aName ); |
|
140 |
|
141 /** |
|
142 * Return friendly name |
|
143 * |
|
144 * @return friendly name |
|
145 */ |
|
146 IMPORT_C const TDesC8& FriendlyName() const; |
|
147 |
|
148 /** |
|
149 * Sets the Uuid of the device |
|
150 * |
|
151 * @param aUuid Uuid |
|
152 */ |
|
153 IMPORT_C void SetUuidL( const TDesC8& aUuid ); |
|
154 |
|
155 /** |
|
156 * Return Uuid |
|
157 * |
|
158 * @return Uuid |
|
159 */ |
|
160 IMPORT_C const TDesC8& Uuid() const; |
|
161 |
|
162 /** |
|
163 * Sets the device type (Media Server/Renderer) |
|
164 * |
|
165 * @param aDeviceType device type |
|
166 */ |
|
167 IMPORT_C void SetDeviceType( TUpnpAVDeviceType aDeviceType ); |
|
168 |
|
169 /** |
|
170 * Return device type |
|
171 * |
|
172 * @return device type |
|
173 */ |
|
174 IMPORT_C TUpnpAVDeviceType DeviceType() const; |
|
175 |
|
176 /** |
|
177 * Return link offset (used in linked list) |
|
178 * |
|
179 * @return link offset |
|
180 */ |
|
181 IMPORT_C static TInt LinkOffset(); |
|
182 |
|
183 public: // UPnP media server device capability getters and setters |
|
184 |
|
185 /** |
|
186 * Sets the copy capability of the device |
|
187 * |
|
188 * @param TBool the copy capability |
|
189 * @return None |
|
190 */ |
|
191 IMPORT_C void SetCopyCapability( TBool aCopyCap ); |
|
192 |
|
193 /** |
|
194 * Gets the copy capability of the device |
|
195 * |
|
196 * @param None |
|
197 * @return TBool the copy capability |
|
198 */ |
|
199 IMPORT_C TBool CopyCapability() const; |
|
200 |
|
201 /** |
|
202 * Sets the search capability of the device |
|
203 * |
|
204 * @param TBool the search capability |
|
205 * @return None |
|
206 */ |
|
207 IMPORT_C void SetSearchCapability( TBool aSearchCap ); |
|
208 |
|
209 /** |
|
210 * Gets the search capability of the device |
|
211 * |
|
212 * @param None |
|
213 * @return TBool the search capability |
|
214 */ |
|
215 IMPORT_C TBool SearchCapability() const; |
|
216 |
|
217 public: // UPnP rendering device capability getters and setters |
|
218 |
|
219 /** |
|
220 * Sets the pause capability of the device |
|
221 * |
|
222 * @param TBool the pause capability |
|
223 * @return None |
|
224 */ |
|
225 IMPORT_C void SetPauseCapability( TBool aPauseCap ); |
|
226 |
|
227 /** |
|
228 * Gets the pause capability of the device |
|
229 * |
|
230 * @param None |
|
231 * @return TBool the pause capability |
|
232 */ |
|
233 IMPORT_C TBool PauseCapability() const; |
|
234 |
|
235 /** |
|
236 * Sets the volume capability of the device |
|
237 * |
|
238 * @param TBool the volume capability |
|
239 * @return None |
|
240 */ |
|
241 IMPORT_C void SetVolumeCapability( TBool aVolumeCap ); |
|
242 |
|
243 /** |
|
244 * Gets the volume capability of the device |
|
245 * |
|
246 * @param None |
|
247 * @return TBool the volume capability |
|
248 */ |
|
249 IMPORT_C TBool VolumeCapability() const; |
|
250 |
|
251 /** |
|
252 * Sets the mute capability of the device |
|
253 * |
|
254 * @param TBool the mute capability |
|
255 * @return None |
|
256 */ |
|
257 IMPORT_C void SetMuteCapability( TBool aMuteCap ); |
|
258 |
|
259 /** |
|
260 * Gets the mute capability of the device |
|
261 * |
|
262 * @param None |
|
263 * @return TBool the mute capability |
|
264 */ |
|
265 IMPORT_C TBool MuteCapability() const; |
|
266 |
|
267 /** |
|
268 * Sets the maximum volume of the device |
|
269 * |
|
270 * @param TInt the maximum volume |
|
271 * @return None |
|
272 */ |
|
273 IMPORT_C void SetMaxVolume( TInt aVolume ); |
|
274 |
|
275 /** |
|
276 * Gets the maximum volume of the device |
|
277 * |
|
278 * @return TInt the maximum volume |
|
279 */ |
|
280 IMPORT_C TInt MaxVolume() const; |
|
281 |
|
282 /** |
|
283 * Sets the SetNextAVTransportUri capability of the device |
|
284 * |
|
285 * @param aCap (TBool) |
|
286 * @return None |
|
287 */ |
|
288 IMPORT_C void SetNextAVTransportUri( TBool aCap ); |
|
289 |
|
290 /** |
|
291 * Returns the SetNextAVTransportUri capability of the device |
|
292 * |
|
293 * @param None |
|
294 * @return TBool ETrue if SetNextAVTrasportUri action is supported |
|
295 */ |
|
296 IMPORT_C TBool NextAVTransportUri() const; |
|
297 |
|
298 public: // UPnP media rendering capability getters and setters |
|
299 |
|
300 IMPORT_C void SetCapabilitiesBySupportedMimeTypesL( |
|
301 const TDesC8& aListOfMimeTypes ); |
|
302 |
|
303 /** |
|
304 * Sets audio capability of the device |
|
305 * |
|
306 * @param aCap (TBool) |
|
307 * @return None |
|
308 */ |
|
309 IMPORT_C void SetAudioCapability( TBool aCap ); |
|
310 |
|
311 /** |
|
312 * Gets the audio media capability of the device |
|
313 * |
|
314 * @param None |
|
315 * @return TBool the audio media capability |
|
316 */ |
|
317 IMPORT_C TBool AudioCapability() const; |
|
318 |
|
319 /** |
|
320 * Sets image capability of the device |
|
321 * |
|
322 * @param aCap (TBool) |
|
323 * @return None |
|
324 */ |
|
325 IMPORT_C void SetImageCapability( TBool aCap ); |
|
326 |
|
327 /** |
|
328 * Gets the image media capability of the device |
|
329 * |
|
330 * @param None |
|
331 * @return TBool the image media capability |
|
332 */ |
|
333 IMPORT_C TBool ImageCapability() const; |
|
334 |
|
335 /** |
|
336 * Sets video capability of the device |
|
337 * |
|
338 * @param aCap (TBool) |
|
339 * @return None |
|
340 */ |
|
341 IMPORT_C void SetVideoCapability( TBool aCap ); |
|
342 |
|
343 /** |
|
344 * Gets the video media capability of the device |
|
345 * |
|
346 * @param None |
|
347 * @return TBool the video media capability |
|
348 */ |
|
349 IMPORT_C TBool VideoCapability() const; |
|
350 |
|
351 public: // DLNA releated |
|
352 |
|
353 /** |
|
354 * Sets if the device is Dlna compatible |
|
355 * |
|
356 * @param aDlnaCompatible |
|
357 */ |
|
358 IMPORT_C void SetDlnaCompatible( TBool aDlnaCompatible ); |
|
359 |
|
360 /** |
|
361 * Return if the device is Dlna compatible |
|
362 * |
|
363 * @return ETrue if the device is dlna compatible |
|
364 */ |
|
365 IMPORT_C TBool DlnaCompatible() const; |
|
366 |
|
367 protected: |
|
368 |
|
369 TSglQueLink iSlink; |
|
370 |
|
371 HBufC8* iUuid; // Owned |
|
372 |
|
373 HBufC8* iName; // Owned |
|
374 |
|
375 TUpnpAVDeviceType iDeviceType; |
|
376 |
|
377 TBool iCopyCapability; |
|
378 |
|
379 TBool iSearchCapability; |
|
380 |
|
381 TBool iPauseCapability; |
|
382 |
|
383 TBool iVolumeCapability; |
|
384 |
|
385 TBool iMuteCapability; |
|
386 |
|
387 TBool iAudioMediaCapability; |
|
388 |
|
389 TBool iImageMediaCapability; |
|
390 |
|
391 TBool iVideoMediaCapability; |
|
392 |
|
393 TBool iNextAVTransportUri; |
|
394 |
|
395 TInt iMaxVolume; |
|
396 |
|
397 TBool iDlnaCompatible; |
|
398 }; |
|
399 |
|
400 |
|
401 #endif // C_CUPNPAVDEVICE_H |