|
1 /* |
|
2 * Copyright (c) 2008 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: Manages Upnp actions needed by Fill Manager |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 #ifndef __CMFMUPNPMNGR_H |
|
21 #define __CMFMUPNPMNGR_H |
|
22 |
|
23 #include <e32base.h> |
|
24 #include "upnpavbrowsingsessionobserver.h" |
|
25 #include "upnpavdeviceobserver.h" |
|
26 |
|
27 // Forward declarations |
|
28 class CUPnPXMLParser; |
|
29 class CCmFillListItem; |
|
30 class MCmFmUPnPActionObserver; |
|
31 |
|
32 // CLASS DECLARATION |
|
33 /** |
|
34 * Class represents methods to communication with AV Controller API. |
|
35 * |
|
36 * @lib cmfillmanager.lib |
|
37 * |
|
38 * @since S60 v3.1 |
|
39 */ |
|
40 NONSHARABLE_CLASS( CCmFmUpnpMngr ): public CBase, |
|
41 public MUPnPAVBrowsingSessionObserver, |
|
42 public MUPnPAVDeviceObserver |
|
43 { |
|
44 |
|
45 public: |
|
46 |
|
47 /** |
|
48 * Two-phased constructor. |
|
49 * |
|
50 * @since S60 5.1 |
|
51 * @param aObserver, action observer |
|
52 * @return pointer to CCmFmUpnpMngr class |
|
53 */ |
|
54 static CCmFmUpnpMngr* NewL( MCmFmUPnPActionObserver* aObserver ); |
|
55 |
|
56 /** |
|
57 * Two-phased constructor. |
|
58 * |
|
59 * @since S60 5.1 |
|
60 * @param aObserver, action observer |
|
61 * @return pointer to CCmFmUpnpMngr class |
|
62 */ |
|
63 static CCmFmUpnpMngr* NewLC( MCmFmUPnPActionObserver* aObserver ); |
|
64 |
|
65 /** |
|
66 * Destructor. |
|
67 */ |
|
68 virtual ~CCmFmUpnpMngr(); |
|
69 |
|
70 public: |
|
71 |
|
72 /** |
|
73 * Sets av controller |
|
74 * |
|
75 * @since S60 5.1 |
|
76 * @param aAVController, pointer to av controller |
|
77 * @return None |
|
78 */ |
|
79 void SetAvController( MUPnPAVController* aAVController ); |
|
80 |
|
81 /** |
|
82 * Lists media servers |
|
83 * |
|
84 * @since S60 5.1 |
|
85 * @param aDevices, device list |
|
86 * @return None |
|
87 */ |
|
88 void GetMediaServersL( CUpnpAVDeviceList*& aDevices ); |
|
89 |
|
90 /** |
|
91 * Checks uri |
|
92 * |
|
93 * @since S60 5.1 |
|
94 * @param aDevice, upnp device |
|
95 * @param aItem, fill list item to be checked |
|
96 * @return None |
|
97 */ |
|
98 void CheckURIL( CUpnpAVDevice* aDevice, CCmFillListItem& aItem ); |
|
99 |
|
100 /** |
|
101 * Cancel UPnP operation |
|
102 * |
|
103 * @since S60 5.1 |
|
104 * @param None |
|
105 * @return None |
|
106 */ |
|
107 void CancelOperation(); |
|
108 |
|
109 /** |
|
110 * Returns browsed uri |
|
111 * |
|
112 * @since S60 5.1 |
|
113 * @param None |
|
114 * @return uri |
|
115 */ |
|
116 TDesC8& Uri() const; |
|
117 |
|
118 /** |
|
119 * Returns browsed upnp item |
|
120 * |
|
121 * @since S60 5.1 |
|
122 * @param None |
|
123 * @return upnp item |
|
124 */ |
|
125 CUpnpItem& UpnpItem() const; |
|
126 |
|
127 protected: |
|
128 |
|
129 // From base class MUPnPAVBrowsingSessionObserver |
|
130 |
|
131 /** |
|
132 * From MUPnPAVBrowsingSessionObserver |
|
133 * See base class definition |
|
134 */ |
|
135 virtual void BrowseResponse( const TDesC8& aBrowseResponse, |
|
136 TInt aError, |
|
137 TInt aMatches, |
|
138 TInt aTotalCount, |
|
139 const TDesC8& aUpdateId ); |
|
140 |
|
141 /** |
|
142 * From MUPnPAVBrowsingSessionObserver |
|
143 * See base class definition |
|
144 */ |
|
145 virtual void SearchResponse( const TDesC8& aSearchResponse, |
|
146 TInt aError, |
|
147 TInt aMatches, |
|
148 TInt aTotalCount, |
|
149 const TDesC8& aUpdateId ); |
|
150 |
|
151 /** |
|
152 * From MUPnPAVBrowsingSessionObserver |
|
153 * See base class definition |
|
154 */ |
|
155 virtual void SearchCapabilitiesResponse( |
|
156 TInt aStatus, |
|
157 const TDesC8& aSearchCapabilities ); |
|
158 |
|
159 /** |
|
160 * From MUPnPAVBrowsingSessionObserver |
|
161 * See base class definition |
|
162 */ |
|
163 virtual void CreateContainerResponse( TInt aError, |
|
164 const TDesC8& aObjectId ); |
|
165 |
|
166 /** |
|
167 * From MUPnPAVBrowsingSessionObserver |
|
168 * See base class definition |
|
169 */ |
|
170 virtual void DeleteObjectResponse( TInt aStatus ); |
|
171 |
|
172 /** |
|
173 * From MUPnPAVBrowsingSessionObserver |
|
174 * See base class definition |
|
175 */ |
|
176 virtual void MediaServerDisappeared( |
|
177 TUPnPDeviceDisconnectedReason aReason ); |
|
178 |
|
179 /** |
|
180 * From MUPnPAVBrowsingSessionObserver |
|
181 * See base class definition |
|
182 */ |
|
183 virtual void ReserveLocalMSServicesCompleted( TInt aStatus ); |
|
184 |
|
185 //public: |
|
186 // From base class MCmAVDeviceObserver |
|
187 |
|
188 /** |
|
189 * From MCmAVDeviceObserver |
|
190 * See base class definition |
|
191 */ |
|
192 void UPnPDeviceDiscovered(const CUpnpAVDevice& aDevice); |
|
193 |
|
194 /** |
|
195 * From MCmAVDeviceObserver |
|
196 * See base class definition |
|
197 */ |
|
198 void UPnPDeviceDisappeared(const CUpnpAVDevice& aDevice); |
|
199 |
|
200 /** |
|
201 * From MCmAVDeviceObserver |
|
202 * See base class definition |
|
203 */ |
|
204 void WLANConnectionLost(); |
|
205 |
|
206 private: |
|
207 |
|
208 /** |
|
209 * Performs the first phase of two phase construction. |
|
210 * |
|
211 * @since S60 5.1 |
|
212 * @param aObserver, UPnP action observer |
|
213 */ |
|
214 CCmFmUpnpMngr( MCmFmUPnPActionObserver* aObserver ); |
|
215 |
|
216 /** |
|
217 * Performs the second phase construction. |
|
218 */ |
|
219 void ConstructL(); |
|
220 |
|
221 /** |
|
222 * Parser all resolution which object owns |
|
223 * |
|
224 * @since S60 5.1 |
|
225 * @param aResElementsArray, resource array |
|
226 * @return Optimal resource element |
|
227 */ |
|
228 const CUpnpElement& ParseImageResolutions( |
|
229 RUPnPElementsArray& aResElementsArray ); |
|
230 |
|
231 /** |
|
232 * Initializes screen size member variable |
|
233 * |
|
234 * @since S60 5.1 |
|
235 * @param None |
|
236 * @return None |
|
237 */ |
|
238 void ScreenSizeL(); |
|
239 |
|
240 /** |
|
241 * Returns processed browse results received from a Media Server. |
|
242 * |
|
243 * UPnPAVController releases the memory allocated for |
|
244 * aResultArray after calling the callback method. |
|
245 * |
|
246 * @since S60 5.1 |
|
247 * @param aStatus TInt status information |
|
248 * @param aTotalCount TInt total number of objects |
|
249 * @param aResultArray browse result array |
|
250 * @return None |
|
251 */ |
|
252 void BrowseResponseL( TInt aStatus, |
|
253 TInt aTotalCount, |
|
254 const TDesC8& aResultArray ); |
|
255 |
|
256 /** |
|
257 * Returns processed search results received from a Media Server. |
|
258 * |
|
259 * UPnPAVController releases the memory allocated for |
|
260 * aResultArray after calling the callback method. |
|
261 * |
|
262 * @since S60 5.1 |
|
263 * @param aStatus TInt status information |
|
264 * @param aTotalCount TInt total number of objects |
|
265 * @param aResultArray RPointerArray of CUPnPObject objects |
|
266 * @return None |
|
267 */ |
|
268 void SearchResponse( TInt aStatus, |
|
269 TInt aTotalCount, |
|
270 const RPointerArray<CUpnpObject>& aResultArray ); |
|
271 |
|
272 private: |
|
273 |
|
274 /** |
|
275 * Pointer to AV Controller |
|
276 */ |
|
277 MUPnPAVController* iAVController; // not owned |
|
278 |
|
279 /** |
|
280 * Browse action Observer |
|
281 */ |
|
282 MCmFmUPnPActionObserver* iObserver; // not owned |
|
283 |
|
284 /** |
|
285 * Browse response parser |
|
286 */ |
|
287 CUPnPXMLParser* iParser; // owned |
|
288 |
|
289 /** |
|
290 * CUpnpAVDevice |
|
291 */ |
|
292 CUpnpAVDevice* iDevice; // Not owned |
|
293 |
|
294 /** |
|
295 * URI |
|
296 */ |
|
297 HBufC8* iURI; // owned |
|
298 |
|
299 /** |
|
300 * upnp item |
|
301 */ |
|
302 CUpnpItem* iItem; // owned |
|
303 |
|
304 /** |
|
305 * Browse started |
|
306 */ |
|
307 TTime iBrowseStarted; |
|
308 |
|
309 /** |
|
310 * Browse finished |
|
311 */ |
|
312 TTime iBrowseFinished; |
|
313 |
|
314 /** |
|
315 * Browse session |
|
316 */ |
|
317 MUPnPAVBrowsingSession* iBrowseSession; // Not owned |
|
318 |
|
319 /** |
|
320 * If true select optimal image size to be filled |
|
321 */ |
|
322 TBool iSelectOptimalImageSize; |
|
323 |
|
324 /** |
|
325 * Screen size of the device |
|
326 */ |
|
327 TSize iScreenSize; |
|
328 |
|
329 }; |
|
330 |
|
331 #endif // __CMFMUPNPMNGR_H |