|
1 /* |
|
2 * Copyright (c) 2006-2007 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: content fetching engine active object class defition |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 |
|
21 |
|
22 |
|
23 #ifndef __UPNPCONTENTREQUESTAO_H__ |
|
24 #define __UPNPCONTENTREQUESTAO_H__ |
|
25 |
|
26 |
|
27 // Include Files |
|
28 #include <e32base.h> |
|
29 #include <badesca.h> //for CDesCArray |
|
30 #include "upnpcontentserverclient.h" |
|
31 |
|
32 // FORWARD DECLARATIONS |
|
33 class CUPnPFileSharingEngine; |
|
34 |
|
35 |
|
36 // CLASS DECLARATION |
|
37 /** |
|
38 * Active object class for querying shared content from upnpcontentserver |
|
39 * @lib upnpapplicationengine.lib |
|
40 * @since S60 3.1 |
|
41 */ |
|
42 NONSHARABLE_CLASS( CUpnpContentRequestAO ): public CActive |
|
43 { |
|
44 |
|
45 public: // Constructors and destructor |
|
46 |
|
47 /** |
|
48 * C++ default constructor. |
|
49 * @since S60 3.1 |
|
50 * @param aEngine File sharing engine |
|
51 * @param aContentServer Handle to upnpcontentserver |
|
52 */ |
|
53 CUpnpContentRequestAO( |
|
54 CUPnPFileSharingEngine& aEngine, |
|
55 RUpnpContentServerClient& aContentServer ); |
|
56 |
|
57 /** |
|
58 * Destructor. |
|
59 */ |
|
60 virtual ~CUpnpContentRequestAO(); |
|
61 |
|
62 public: // new functions |
|
63 |
|
64 /** |
|
65 * Request playlist or album names for UI from server, asynchronous |
|
66 * @since S60 3.1 |
|
67 * @param aType Type of selections to request |
|
68 */ |
|
69 void RequestSelectionContentL( UpnpContentServer::TUpnpMediaType aType ); |
|
70 |
|
71 /** |
|
72 * Get playlist or album names for UI after request, synchronous |
|
73 * @since S60 3.1 |
|
74 * @param aArray Array for albums / playlist names |
|
75 */ |
|
76 void GetSelectionContentL( CDesCArray& aArray ); |
|
77 |
|
78 /** |
|
79 * Request selected items for UI from server, asynchronous |
|
80 * @since S60 3.1 |
|
81 * @param aType Type of selections to request |
|
82 */ |
|
83 void RequestSelectionIndexesL( |
|
84 UpnpContentServer::TUpnpMediaType aType ); |
|
85 |
|
86 /** |
|
87 * Get the selected items for UI after request, synchronous |
|
88 * @since S60 3.1 |
|
89 * @param aCurrentSelection Array for selection indexes |
|
90 */ |
|
91 void GetSelectionIndexesL( CArrayFix<TInt>& aCurrentSelection ); |
|
92 |
|
93 private: // from CActive |
|
94 |
|
95 /** |
|
96 * Function is called when active request is ready |
|
97 * @since S60 3.1 |
|
98 */ |
|
99 virtual void RunL(); |
|
100 |
|
101 /** |
|
102 * Cancels active request |
|
103 * @since S60 3.1 |
|
104 */ |
|
105 virtual void DoCancel(); |
|
106 |
|
107 private: // data |
|
108 |
|
109 /** |
|
110 * file sharing engine |
|
111 */ |
|
112 CUPnPFileSharingEngine& iEngine; |
|
113 |
|
114 /** |
|
115 * Content server session handle |
|
116 */ |
|
117 RUpnpContentServerClient& iContentServer; |
|
118 |
|
119 /** |
|
120 * Current state |
|
121 */ |
|
122 enum TState |
|
123 { |
|
124 ENone = 0, |
|
125 ERequestContent, |
|
126 ERequestIndexes |
|
127 }; |
|
128 TState iState; |
|
129 |
|
130 }; |
|
131 |
|
132 #endif // __UPNPCONTENTREQUESTAO_H__ |
|
133 |
|
134 // End of file |