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 "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: Header file for the Common UI class |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef CUPNPCOMMONUI_H |
|
20 #define CUPNPCOMMONUI_H |
|
21 |
|
22 // INCLUDES |
|
23 #include <eikspmod.h> |
|
24 #include <eikclb.h> |
|
25 #include <aknview.h> |
|
26 |
|
27 // CONSTANTS |
|
28 |
|
29 // Application UID's needed in code |
|
30 const TInt KMediaGalleryUID3 = { 0x101F8599 }; |
|
31 |
|
32 enum TUPnPBrowseActionIds |
|
33 { |
|
34 EUPnPBrowseOpen = 1, |
|
35 EUPnPBrowseFind, |
|
36 EUPnPBrowseShowExt, |
|
37 EUPnPBrowsePlayExt, |
|
38 EUPnPBrowseCopy |
|
39 }; |
|
40 |
|
41 enum TUPnPBrowseIncomingActionId |
|
42 { |
|
43 EUPnPSelectContainer = 1, |
|
44 EUPnPBrowseFolders |
|
45 }; |
|
46 |
|
47 enum TUPnPDialogTitle |
|
48 { |
|
49 EUPnPSelectDeviceTitle = 1, /* "Select device:" */ |
|
50 EUPnPSelectFolderTitle, /* "Select folder:" */ |
|
51 EUPnPCopyToTitle, /* "Copy to:" */ |
|
52 EUPnPMoveToTitle /* "Move to: */ |
|
53 }; |
|
54 |
|
55 enum TUPnPDeviceTypesToSearch |
|
56 { |
|
57 EUPnPSearchAllDevices = 1, |
|
58 EUPnPSearchAllServerDevices, |
|
59 EUPnPSearchServerDevicesWithCopyCapability, |
|
60 EUPnPSearchServerDevicesWithSearchCapability, |
|
61 EUPnPSearchAllRenderingDevices, |
|
62 EUPnPSearchRenderingDevicesWithImageCapability, |
|
63 EUPnPSearchRenderingDevicesWithVideoCapability, |
|
64 EUPnPSearchRenderingDevicesWithImageAndVideoCapability, |
|
65 EUPnPSearchRenderingDevicesWithAudioCapability |
|
66 }; |
|
67 |
|
68 enum TUPnPPopUpSoftkey |
|
69 { |
|
70 EUPnPSoftkeyCopy = 1, |
|
71 EUPnPSoftkeyMove, |
|
72 EUPnPSoftkeySelect |
|
73 }; |
|
74 |
|
75 // FORWARD DECLARATIONS |
|
76 class CAknViewAppUi; |
|
77 class CUPnPExternalDeviceDialog; |
|
78 class CUPnPBrowseDialog; |
|
79 class CUPnPAdvancedFindDialog; |
|
80 class CUPnPVideoPlayerDlg; |
|
81 class CUPnPSelectionDialog; |
|
82 class MUPnPAVController; |
|
83 class MUPnPAVRenderingSession; |
|
84 class MUPnPAVBrowsingSession; |
|
85 class CUPnPPlayListFiller; |
|
86 class CUPnPMusicAdapter; |
|
87 |
|
88 class CUpnpObject; |
|
89 class CUpnpAVDevice; |
|
90 class CUpnpContainer; |
|
91 |
|
92 |
|
93 |
|
94 |
|
95 // CLASS DECLARATION |
|
96 |
|
97 /** |
|
98 * CUPnPCommonUI class |
|
99 * |
|
100 * Collection UI class. |
|
101 */ |
|
102 class CUPnPCommonUI : public CBase |
|
103 { |
|
104 public: |
|
105 |
|
106 enum TUPnPAction |
|
107 { |
|
108 EUPnPNone = 0, |
|
109 EUPnPBrowse, |
|
110 EUPnPSearch, |
|
111 EUPnPCopy, |
|
112 EUPnPShow |
|
113 }; |
|
114 |
|
115 public: // Constructors and destructor |
|
116 |
|
117 /** |
|
118 * Two-phased constructor. |
|
119 */ |
|
120 IMPORT_C static CUPnPCommonUI* NewL(); |
|
121 |
|
122 /** |
|
123 * Destructor. |
|
124 */ |
|
125 IMPORT_C virtual ~CUPnPCommonUI(); |
|
126 |
|
127 public: // Business logic methods |
|
128 |
|
129 /** |
|
130 * Executes device selection dialog |
|
131 * |
|
132 * @since Series 60 3.1 |
|
133 * @param aAVControl (MUPnPAVController&) controller for remote devices |
|
134 * @return TInt, Error code |
|
135 */ |
|
136 IMPORT_C TInt ExecuteDeviceDialogL( MUPnPAVController& aAVControl ); |
|
137 |
|
138 /** |
|
139 * Executes browse dialog |
|
140 * |
|
141 * @since Series 60 3.1 |
|
142 * @param aAVControl (MUPnPAVController&) controller for remote devices |
|
143 * @return TInt, Error code |
|
144 */ |
|
145 IMPORT_C TInt ExecuteBrowseDialogL( MUPnPAVController& aAVControl, |
|
146 const CUpnpAVDevice& aDevice ); |
|
147 |
|
148 /** |
|
149 * Executes video player |
|
150 * |
|
151 * @since Series 60 3.1 |
|
152 * @param aRenderingSession (MUPnPAVRenderingSession& ) |
|
153 * the rendering session to used for the playback |
|
154 * @param aObject (CUpnpObject&) the video item to be played |
|
155 * @return TInt, Error code |
|
156 */ |
|
157 IMPORT_C TInt ExecuteVideoPlayerL( |
|
158 MUPnPAVRenderingSession& aRenderingSession, |
|
159 const CUpnpObject& aObject ); |
|
160 |
|
161 /** |
|
162 * Executes music player |
|
163 * |
|
164 * @since Series 60 3.1 |
|
165 * @param aAVControl UPnPAVControl reference |
|
166 * @param aFiller Object that contains playlist information |
|
167 * @param aRenderer the selected renderer device |
|
168 * @return TInt error code |
|
169 */ |
|
170 IMPORT_C TInt ExecuteMusicPlayerL( MUPnPAVController& aAVControl, |
|
171 CUPnPPlayListFiller* aFiller, |
|
172 const CUpnpAVDevice* aTargetDevice ); |
|
173 |
|
174 /** |
|
175 * Displays a UPnP device selection pop-up dialog. |
|
176 * |
|
177 * @since Series 60 3.1 |
|
178 * @param aAVControl (MUPnPAVController&) reference to a |
|
179 * CUPnPAVControl |
|
180 * @param aDevice (CUpnpAVDevice&) reference to the device |
|
181 * @param aType (TUPnPDeviceTypesToSearch), type of device that is |
|
182 * requested |
|
183 * @param aTitle (TUPnPDialogTitle) the title for the dialog |
|
184 * @return TInt exiting reason |
|
185 */ |
|
186 IMPORT_C TInt SelectDeviceL( MUPnPAVController& aAVControl, |
|
187 CUpnpAVDevice& aDevice, |
|
188 TUPnPDeviceTypesToSearch aType, |
|
189 TUPnPDialogTitle aTitle ); |
|
190 |
|
191 /** |
|
192 * Dismiss dialog |
|
193 * when media server disappears |
|
194 * |
|
195 * @since Series 60 3.1 |
|
196 * @param aError exit error |
|
197 * |
|
198 * @return None |
|
199 */ |
|
200 IMPORT_C void DismissDialogL( TInt aError ); |
|
201 |
|
202 /** |
|
203 * Displays an Connection failed error note needed in aiw engine. |
|
204 * |
|
205 * @since Series 60 3.1 |
|
206 */ |
|
207 IMPORT_C void DisplayConnectionErrorNoteL(); |
|
208 |
|
209 /** |
|
210 * Displays an Connection lost error note if copying files fails. |
|
211 * |
|
212 * @since Series 60 3.2.3 |
|
213 */ |
|
214 IMPORT_C void DisplayConnectionLostCopyErrorNoteL(); |
|
215 |
|
216 public: // Common API internal interface |
|
217 |
|
218 /** |
|
219 * Executes the Advanced Find Dialog. |
|
220 * |
|
221 * @since Series 60 3.1 |
|
222 * @param aAVControl (MUPnPAVController&) reference to AVController |
|
223 * @param aBrowsingSession (MUPnPAVBrowsingSession&) reference to the |
|
224 * rendering session |
|
225 * @return TInt the status |
|
226 */ |
|
227 TInt ExecuteAdvFindDialogL( MUPnPAVController& aAVControl, |
|
228 MUPnPAVBrowsingSession& aBrowsingSession ); |
|
229 |
|
230 /** |
|
231 * Display a error message |
|
232 * |
|
233 * @since Series 60 3.1 |
|
234 * @param aResource The string from the resource file |
|
235 * @param aMaxNumberOfResultsShown The integer filled up in the string |
|
236 * @return None |
|
237 */ |
|
238 void DisplayErrorTextL( TInt aResource, |
|
239 TInt aMaxNumberOfResultsShown ); |
|
240 |
|
241 /** |
|
242 * Displays error note |
|
243 * |
|
244 * @since Series 60 3.1 |
|
245 * @param TInt, note resource |
|
246 * @return None |
|
247 */ |
|
248 void DisplayErrorTextL( TInt aResource ); |
|
249 |
|
250 /** |
|
251 * Displays error note |
|
252 * |
|
253 * @since Series 60 3.1 |
|
254 * @param TInt, note resource |
|
255 * @param aInfo, note resource |
|
256 * @return None |
|
257 */ |
|
258 void DisplayErrorTextL( TInt aResource, const TDesC& aInfo ); |
|
259 |
|
260 |
|
261 /** |
|
262 * Displays Information text |
|
263 * |
|
264 * @since Series 60 3.1 |
|
265 * @param TInt, note resource |
|
266 * @param TInt, number of files copied |
|
267 * @return None |
|
268 */ |
|
269 void DisplayInfoTextL( TInt aResource, |
|
270 TInt aNumberOfCopy ); |
|
271 |
|
272 /** |
|
273 * Displays Information text |
|
274 * |
|
275 * @since Series 60 3.1 |
|
276 * @param TInt, note resource |
|
277 * @return None |
|
278 */ |
|
279 void DisplayInfoTextL( TInt aResource ); |
|
280 |
|
281 /** |
|
282 * Return number of dialogs created in CommonUI |
|
283 * |
|
284 * @since Series 60 3.1 |
|
285 * @param none |
|
286 * @return any of dialog created |
|
287 */ |
|
288 TBool PresenceOfDialog(); |
|
289 |
|
290 /** |
|
291 * Handle common error code from other dialogs |
|
292 * |
|
293 * @since Series 60 3.1 |
|
294 * @param aError error code |
|
295 * @return none |
|
296 */ |
|
297 void HandleCommonErrorL( TInt aError, |
|
298 TInt aNumCopyItem ); |
|
299 |
|
300 /** |
|
301 * Get current upnp action |
|
302 * |
|
303 * @since Series 60 3.1 |
|
304 * @param aAction current upnp action |
|
305 * @return none |
|
306 */ |
|
307 void GetUpnpAction( TUPnPAction aAction ); |
|
308 |
|
309 private: |
|
310 |
|
311 /** |
|
312 * C++ default constructor |
|
313 */ |
|
314 CUPnPCommonUI(); |
|
315 |
|
316 /** |
|
317 * EPOC default constructor. |
|
318 */ |
|
319 void ConstructL(); |
|
320 |
|
321 /** |
|
322 * Get Copy location |
|
323 * @since Series 60 3.1 |
|
324 * @param aLocation current copy loaction |
|
325 */ |
|
326 void GetCopyLocationL( TDes& aLocation ) const; |
|
327 |
|
328 private: // Data |
|
329 |
|
330 CAknViewAppUi* iAppUi; // Not owned |
|
331 CUPnPExternalDeviceDialog* iExternalDeviceSelection; // Not owned |
|
332 CUPnPBrowseDialog* iBrowseSelection; //not owned |
|
333 CUPnPAdvancedFindDialog* iAdvFindDialog; //not owned |
|
334 CUPnPVideoPlayerDlg* iVideoPlayerDialog; //not owned |
|
335 CUPnPSelectionDialog* iDeviceSelection; //not owned |
|
336 TInt iResFileOffset; |
|
337 CEikonEnv* iCoeEnv; //not owned |
|
338 CUPnPMusicAdapter* iMusicAdapter; //owned |
|
339 CUPnPCommonUI::TUPnPAction iAction; |
|
340 |
|
341 /** |
|
342 * Flag the FeatureManager is initialized or not |
|
343 */ |
|
344 TBool iFeatureManagerInitialized; |
|
345 }; |
|
346 |
|
347 #endif // CUPNPCOMMONUI_H |
|
348 |
|
349 // End of File |
|