|
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: AVController client session |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 |
|
21 |
|
22 |
|
23 #ifndef C_CUPNPAVCONTROLLERCLIENT_H |
|
24 #define C_CUPNPAVCONTROLLERCLIENT_H |
|
25 |
|
26 // INCLUDES |
|
27 #include "upnpavcontrollerglobals.h" |
|
28 |
|
29 #include <e32base.h> |
|
30 |
|
31 // FORWARD DECLARATIONS |
|
32 class CUpnpItem; |
|
33 class CUpnpContainer; |
|
34 class CUpnpDevice; |
|
35 class CUpnpObject; |
|
36 class RFile; |
|
37 |
|
38 // CLASS DECLARATION |
|
39 /** |
|
40 * Client-side interface to AV Controller Server |
|
41 * |
|
42 * This class provides the client-side interface to the AV Controller |
|
43 * Server session. |
|
44 * |
|
45 * @lib upnpavcontrollerclient.lib |
|
46 * @since S60 v3.1 |
|
47 */ |
|
48 class RUPnPAVControllerClient : public RSessionBase |
|
49 { |
|
50 public: |
|
51 |
|
52 /** |
|
53 * Construct the object |
|
54 */ |
|
55 RUPnPAVControllerClient(); |
|
56 |
|
57 /** |
|
58 * Connects to the server and create a session |
|
59 * @return error code |
|
60 */ |
|
61 TInt Connect(); |
|
62 |
|
63 /** |
|
64 * Returns the version number |
|
65 * @return the version |
|
66 */ |
|
67 TVersion Version() const; |
|
68 |
|
69 /** |
|
70 * Startup request. Starts up the AV Control Point |
|
71 * |
|
72 * @param aStatus request status |
|
73 */ |
|
74 void StartUp( TRequestStatus& aStatus ); |
|
75 |
|
76 /** |
|
77 * Cancels startup. |
|
78 * |
|
79 * @return error code |
|
80 */ |
|
81 TInt CancelStartUp(); |
|
82 |
|
83 /** |
|
84 * Device discovery request |
|
85 * |
|
86 * @param aDiscovered type of device |
|
87 * @param aRcvdBufSize size of device |
|
88 * @param aStatus request status |
|
89 */ |
|
90 void DeviceRequest( TDes8& aDiscovered, TDes8& aRcvdBufSize, |
|
91 TRequestStatus& aStatus ); |
|
92 |
|
93 /** |
|
94 * Cancels device discovery request |
|
95 * |
|
96 * @return error code |
|
97 */ |
|
98 TInt CancelDeviceRequest(); |
|
99 |
|
100 /** |
|
101 * Gets device |
|
102 * |
|
103 * @param aDevice device |
|
104 * @return error code |
|
105 */ |
|
106 TInt GetDevice( TDes8& aDevice ); |
|
107 |
|
108 /** |
|
109 * Gets device list size |
|
110 * |
|
111 * @param aType type of devices |
|
112 * @param aSize size of the list |
|
113 * @return error code |
|
114 */ |
|
115 TInt GetDeviceListSize( TDes8& aType, TDes8& aSize ); |
|
116 |
|
117 /** |
|
118 * Gets device list |
|
119 * |
|
120 * @param aList device list |
|
121 * @return error code |
|
122 */ |
|
123 TInt GetDeviceList( TDes8& aList ); |
|
124 |
|
125 /** |
|
126 * Release media server |
|
127 * |
|
128 * @param aId session id |
|
129 * @return error code |
|
130 */ |
|
131 TInt ReleaseMediaServer( TInt aId ); |
|
132 |
|
133 /** |
|
134 * Reserve media server |
|
135 * |
|
136 * @param aId session id |
|
137 * @param aStatus request status |
|
138 */ |
|
139 void ReserveMediaServer( TInt aId, TRequestStatus& aStatus ); |
|
140 |
|
141 /** |
|
142 * Cancel reserve media server |
|
143 * |
|
144 * @param aId session id |
|
145 * @return error code |
|
146 */ |
|
147 TInt CancelReserveMediaServer( TInt aId ); |
|
148 |
|
149 public: // Rendering Session releated |
|
150 |
|
151 /** |
|
152 * Create a rendering session |
|
153 * |
|
154 * @param aId session id |
|
155 * @param aUuid device Uuid |
|
156 * @return error code |
|
157 */ |
|
158 TInt CreateRenderingSession( TInt aId, TDes8& aUuid ); |
|
159 |
|
160 /** |
|
161 * Destroy a rendering session |
|
162 * |
|
163 * @param aId session id |
|
164 * @return error code |
|
165 */ |
|
166 TInt DestroyRenderingSession( TInt aId ); |
|
167 |
|
168 /** |
|
169 * AV event request |
|
170 * |
|
171 * @param aEvent AV Event |
|
172 * @param aId session id |
|
173 * @param aStatus request status |
|
174 */ |
|
175 void EventRequest( TDes8& aEvent, TInt aId, TRequestStatus& aStatus ); |
|
176 |
|
177 /** |
|
178 * Cancel event request |
|
179 * |
|
180 * @param aId session id |
|
181 * @return error code |
|
182 */ |
|
183 TInt CancelEventRequest( TInt aId ); |
|
184 |
|
185 /** |
|
186 * Set URI |
|
187 * |
|
188 * @param aId session id |
|
189 * @param aRequest request information |
|
190 * @param aItem item |
|
191 * @param aType type of the item |
|
192 * @param aStatus request status |
|
193 */ |
|
194 void SetURI( TInt aId, TDes8& aRequest, TDes8& aItem, |
|
195 TRequestStatus& aStatus ); |
|
196 |
|
197 /** |
|
198 * Cancel reserve media server |
|
199 * |
|
200 * @param aId session id |
|
201 * @return error code |
|
202 */ |
|
203 TInt CancelSetURI( TInt aId ); |
|
204 |
|
205 /** |
|
206 * Set Next URI |
|
207 * |
|
208 * @param aId session id |
|
209 * @param aRequest request information |
|
210 * @param aItem item |
|
211 * @param aType type of the item |
|
212 * @param aStatus request status |
|
213 */ |
|
214 void SetNextURI( TInt aId, TDes8& Request, TDes8& aItem, |
|
215 TRequestStatus& aStatus ); |
|
216 |
|
217 /** |
|
218 * Cancel reserve media server |
|
219 * |
|
220 * @param aId session id |
|
221 * @return error code |
|
222 */ |
|
223 TInt CancelSetNextURI( TInt aId ); |
|
224 |
|
225 /** |
|
226 * Send play action |
|
227 * |
|
228 * @param aId session id |
|
229 * @param aStatus request status |
|
230 */ |
|
231 void Play( TInt aId, TRequestStatus& aStatus ); |
|
232 |
|
233 /** |
|
234 * Cancel play |
|
235 * |
|
236 * @param aId session id |
|
237 * @return error code |
|
238 */ |
|
239 TInt CancelPlay( TInt aId ); |
|
240 |
|
241 /** |
|
242 * Send stop action |
|
243 * |
|
244 * @param aId session id |
|
245 * @param aStatus request status |
|
246 */ |
|
247 void Stop( TInt aId, TRequestStatus& aStatus ); |
|
248 |
|
249 /** |
|
250 * Cancel stop |
|
251 * |
|
252 * @param aId session id |
|
253 * @return error code |
|
254 */ |
|
255 TInt CancelStop( TInt aId ); |
|
256 |
|
257 /** |
|
258 * Send pause action |
|
259 * |
|
260 * @param aId session id |
|
261 * @param aStatus request status |
|
262 */ |
|
263 void Pause( TInt aId, TRequestStatus& aStatus ); |
|
264 |
|
265 /** |
|
266 * Cancel pause |
|
267 * |
|
268 * @param aId session id |
|
269 * @return error code |
|
270 */ |
|
271 TInt CancelPause( TInt aId ); |
|
272 |
|
273 /** |
|
274 * Set volume level |
|
275 * |
|
276 * @param aId session id |
|
277 * @param aVolumeLevel volume level |
|
278 * @param aRetVolume (set) volume level |
|
279 * @param aStatus request status |
|
280 */ |
|
281 void SetVolume( TInt aId, TInt aVolumeLevel, TDes8& aRetVolume, |
|
282 TRequestStatus& aStatus ); |
|
283 |
|
284 /** |
|
285 * Cancel set volume |
|
286 * |
|
287 * @param aId session id |
|
288 * @return error code |
|
289 */ |
|
290 TInt CancelSetVolume( TInt aId ); |
|
291 |
|
292 /** |
|
293 * Get volume level |
|
294 * |
|
295 * @param aId session id |
|
296 * @param aVolumeLevel volume level |
|
297 * @param aStatus request status |
|
298 */ |
|
299 void GetVolume( TInt aId, TDes8& aVolumeLevel, TRequestStatus& aStatus ); |
|
300 |
|
301 /** |
|
302 * Cancel get volume |
|
303 * |
|
304 * @param aId session id |
|
305 * @return error code |
|
306 */ |
|
307 TInt CancelGetVolume( TInt aId ); |
|
308 |
|
309 /** |
|
310 * Set mute |
|
311 * |
|
312 * @param aId session id |
|
313 * @param aMute mute |
|
314 * @param aRetMute (set) mute |
|
315 * @param aStatus request status |
|
316 */ |
|
317 void SetMute( TInt aId, TBool aMute, TDes8& aRetMute, |
|
318 TRequestStatus& aStatus ); |
|
319 |
|
320 /** |
|
321 * Cancel set mute |
|
322 * |
|
323 * @param aId session id |
|
324 * @return error code |
|
325 */ |
|
326 TInt CancelSetMute( TInt aId ); |
|
327 |
|
328 /** |
|
329 * Get mute |
|
330 * |
|
331 * @param aId session id |
|
332 * @param aMute mute |
|
333 * @param aStatus request status |
|
334 */ |
|
335 void GetMute( TInt aId, TDes8& aMute, TRequestStatus& aStatus ); |
|
336 |
|
337 /** |
|
338 * Cancel get mute |
|
339 * |
|
340 * @param aId session id |
|
341 * @return error code |
|
342 */ |
|
343 TInt CancelGetMute( TInt aId ); |
|
344 |
|
345 /** |
|
346 * Get position info |
|
347 * |
|
348 * @param aId session id |
|
349 * @param aPosition position info |
|
350 * @param aLength lenght info |
|
351 * @param aStatus request status |
|
352 */ |
|
353 void GetPositionInfo( TInt aId, TDes8& aPosition, TDes8& aLength, |
|
354 TRequestStatus& aStatus ); |
|
355 |
|
356 /** |
|
357 * Cancel get position info |
|
358 * |
|
359 * @param aId session id |
|
360 * @return error code |
|
361 */ |
|
362 TInt CancelGetPositionInfo( TInt aId ); |
|
363 |
|
364 public: // Browsing Session releated |
|
365 |
|
366 /** |
|
367 * Create browsing session |
|
368 * |
|
369 * @param aId session id |
|
370 * @param aUuid device uuid |
|
371 * @return error code |
|
372 */ |
|
373 TInt CreateBrowsingSession( TInt aId, TDes8& aUuid ); |
|
374 |
|
375 /** |
|
376 * Destroy browsing session |
|
377 * |
|
378 * @param aId session id |
|
379 * @return error code |
|
380 */ |
|
381 TInt DestroyBrowsingSession( TInt aId ); |
|
382 |
|
383 /** |
|
384 * Get browse response size |
|
385 * |
|
386 * @param aId session id |
|
387 * @param aRequest request information |
|
388 * @param aSize response size |
|
389 * @param aMatches count of items |
|
390 * @param aStatus request status |
|
391 */ |
|
392 void BrowseResponseSize( TInt aId, TDes8& aRequest, TDes8& aParams, |
|
393 TRequestStatus& aStatus ); |
|
394 |
|
395 /** |
|
396 * Cancel get browse response size |
|
397 * |
|
398 * @param aId session id |
|
399 * @return error code |
|
400 */ |
|
401 TInt CancelBrowseResponseSize( TInt aId ); |
|
402 |
|
403 /** |
|
404 * Get browse response |
|
405 * |
|
406 * @param aId session id |
|
407 * @param aBrowseResponse browse response |
|
408 * @return error code |
|
409 */ |
|
410 TInt BrowseResponse( TInt aId, TDes8& aBrowseResponse, |
|
411 TDes8& aUpdateId ); |
|
412 |
|
413 /** |
|
414 * Get search response size |
|
415 * |
|
416 * @param aId session id |
|
417 * @param aRequest request information |
|
418 * @param aSize response size |
|
419 * @param aMatches count of items |
|
420 * @param aStatus request status |
|
421 */ |
|
422 void SearchResponseSize( TInt aId, TDes8& aRequest, TDes8& aParams, |
|
423 TRequestStatus& aStatus ); |
|
424 |
|
425 /** |
|
426 * Cancel get search response size |
|
427 * |
|
428 * @param aId session id |
|
429 * @return error code |
|
430 */ |
|
431 TInt CancelSearchResponseSize( TInt aId ); |
|
432 |
|
433 /** |
|
434 * Get search response |
|
435 * |
|
436 * @param aId session id |
|
437 * @param aSearchResponse search response |
|
438 * @return error code |
|
439 */ |
|
440 TInt SearchResponse( TInt aId, TDes8& aSearchResponse, |
|
441 TDes8& aUpdateId ); |
|
442 |
|
443 /** |
|
444 * Get search capabilities size |
|
445 * |
|
446 * @param aId session id |
|
447 * @param aSize size |
|
448 * @param aStatus request status |
|
449 */ |
|
450 void GetSearchCapabilitiesSize( TInt aId, TDes8& aSize, |
|
451 TRequestStatus& aStatus ); |
|
452 |
|
453 /** |
|
454 * Cancel get search capabilities size |
|
455 * |
|
456 * @param aId session id |
|
457 * @return error code |
|
458 */ |
|
459 TInt CancelGetSearchCapabilitiesSize( TInt aId ); |
|
460 |
|
461 /** |
|
462 * Get search capabilities |
|
463 * |
|
464 * @param aId session id |
|
465 * @param aCapabilitiesResponse search capabilities response |
|
466 * @return error code |
|
467 */ |
|
468 TInt SearchCapabilitiesResponse( TInt aId, |
|
469 TDes8& aCapabilitiesResponse ); |
|
470 |
|
471 /** |
|
472 * Create a container |
|
473 * |
|
474 * @param aId session id |
|
475 * @param aTitle container title |
|
476 * @param aParentId parent id |
|
477 * @param aContainerType container type |
|
478 * @param aStatus request status |
|
479 */ |
|
480 void CreateContainer( TInt aId, |
|
481 TDes8& aTitle, |
|
482 TDes8& aParentId, |
|
483 TInt aContainerType, |
|
484 TRequestStatus& aStatus ); |
|
485 |
|
486 /** |
|
487 * Cancel create container |
|
488 * |
|
489 * @param aId session id |
|
490 * @return error code |
|
491 */ |
|
492 TInt CancelCreateContainer( TInt aId ); |
|
493 |
|
494 /** |
|
495 * Delete object |
|
496 * |
|
497 * @param aId session id |
|
498 * @param aObjectId object id |
|
499 * @param aStatus request status |
|
500 */ |
|
501 void DeleteObject( TInt aId, TDes8& aObjectId, TRequestStatus& aStatus ); |
|
502 |
|
503 /** |
|
504 * Cancel delete object |
|
505 * |
|
506 * @param aId session id |
|
507 * @return error code |
|
508 */ |
|
509 TInt CancelDeleteObject( TInt aId ); |
|
510 |
|
511 /** |
|
512 * Device disappeared request |
|
513 * |
|
514 * @param aId session id |
|
515 * @param aStatus request status |
|
516 */ |
|
517 void DeviceDisappearedRequest( TInt aId, TRequestStatus& aStatus ); |
|
518 |
|
519 /** |
|
520 * Cancel device disappeared request |
|
521 * |
|
522 * @param aId session id |
|
523 * @return error code |
|
524 */ |
|
525 TInt CancelDeviceDisappearedRequest( TInt aId ); |
|
526 |
|
527 /** |
|
528 * Monitor WLAN connection request |
|
529 * |
|
530 * @param aStatus request status |
|
531 */ |
|
532 void MonitorConnection( TRequestStatus& aStatus ); |
|
533 |
|
534 /** |
|
535 * Cancel monitor connection |
|
536 * |
|
537 * @param aId session id |
|
538 * @return error code |
|
539 */ |
|
540 TInt CancelMonitorConnection(); |
|
541 |
|
542 /** |
|
543 * |
|
544 * |
|
545 * @param aInUse |
|
546 * @return error code |
|
547 */ |
|
548 TInt MSServicesInUse( TDes8& aInUse ); |
|
549 |
|
550 public: // Download Session releated |
|
551 |
|
552 /** |
|
553 * Create a download session |
|
554 * |
|
555 * @param aId session id |
|
556 * @param aUuid device Uuid |
|
557 * @return error code |
|
558 */ |
|
559 TInt CreateDownloadSession( TInt aId, TDes8& aUuid ); |
|
560 |
|
561 /** |
|
562 * Destroy a download session |
|
563 * |
|
564 * @param aId session id |
|
565 * @return error code |
|
566 */ |
|
567 TInt DestroyDownloadSession( TInt aId ); |
|
568 |
|
569 TInt StartDownload( TInt aId, TDes8& aFileTransferItem ); |
|
570 |
|
571 TInt StartDownload( TInt aId, TDes8& aFileTransferItem, |
|
572 const RFile& aFile ); |
|
573 |
|
574 void GetDownloadEvent( TInt aId, TDes8& aEvent, |
|
575 TRequestStatus& aStatus, TDes& aBuffer ); |
|
576 |
|
577 TInt CancelDownloadEvent( TInt aId ); |
|
578 |
|
579 TInt StartTrackingDownloadProgress( TInt aId, TInt aKey ); |
|
580 |
|
581 TInt CancelDownload( TInt aId, TInt aKey ); |
|
582 |
|
583 TInt CancelAllDownloads( TInt aId ); |
|
584 |
|
585 public: // Upload Session releated |
|
586 |
|
587 /** |
|
588 * Create an upload session |
|
589 * |
|
590 * @param aId session id |
|
591 * @param aUuid device Uuid |
|
592 * @return error code |
|
593 */ |
|
594 TInt CreateUploadSession( TInt aId, TDes8& aUuid ); |
|
595 |
|
596 /** |
|
597 * Destroy an upload session |
|
598 * |
|
599 * @param aId session id |
|
600 * @return error code |
|
601 */ |
|
602 TInt DestroyUploadSession( TInt aId ); |
|
603 |
|
604 TInt StartUpload( TInt aId, TDes8& aFileTransferItem ); |
|
605 |
|
606 void GetUploadEvent( TInt aId, TDes8& aEvent, |
|
607 TRequestStatus& aStatus ); |
|
608 |
|
609 TInt CancelUploadEvent( TInt aId ); |
|
610 |
|
611 TInt StartTrackingUploadProgress( TInt aId, TInt aKey ); |
|
612 |
|
613 TInt CancelUpload( TInt aId, TInt aKey ); |
|
614 |
|
615 TInt CancelAllUploads( TInt aId ); |
|
616 }; |
|
617 |
|
618 #endif // C_CUPNPAVCONTROLLERCLIENT_H |
|
619 |
|
620 // End of File |