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: List for data of settings dialog |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef UPNPADVANCEDFINDLIST_H |
|
20 #define UPNPADVANCEDFINDLIST_H |
|
21 |
|
22 // INCLUDES |
|
23 // System |
|
24 #include <aknsettingitemlist.h> |
|
25 #include <AknProgressDialog.h> |
|
26 |
|
27 // upnpframework / avcontroller api |
|
28 #include "upnpavbrowsingsessionobserver.h" |
|
29 |
|
30 // commonui internal |
|
31 #include "upnpcommonui.h" |
|
32 |
|
33 |
|
34 const TInt KMaxNameLength = 256; |
|
35 const TInt KGranularityOfArrays = 8; |
|
36 const TInt KSizeOfTBufC16 = 32; |
|
37 |
|
38 // FORWARD DECLARATIONS |
|
39 class MUPnPAVController; |
|
40 class MUPnPAVBrowsingSession; |
|
41 class CAdvancedFindResultWindow; |
|
42 class CUPnPAdvancedFindDialog; |
|
43 class CUPnPCommonUI; |
|
44 |
|
45 /** |
|
46 * Settings list class declaration |
|
47 * @since Series 60 3.1 |
|
48 */ |
|
49 NONSHARABLE_CLASS( CUPnPAdvancedFindList ) : public CAknSettingItemList, |
|
50 public MUPnPAVBrowsingSessionObserver, |
|
51 public MProgressDialogCallback |
|
52 { |
|
53 public: // Constructors and destructor |
|
54 |
|
55 /** |
|
56 * Two-phased constructor. |
|
57 */ |
|
58 static CUPnPAdvancedFindList* NewL( |
|
59 MUPnPAVController& aAVControl, |
|
60 MUPnPAVBrowsingSession& aBrowsingSession, |
|
61 CUPnPAdvancedFindDialog& aParent, |
|
62 CUPnPCommonUI& aCommonUI ); |
|
63 |
|
64 /** |
|
65 * Destructor. |
|
66 */ |
|
67 virtual ~CUPnPAdvancedFindList(); |
|
68 |
|
69 public: // Functions from base classes |
|
70 |
|
71 /** |
|
72 * From CAknSettingItemList, this launches the setting page. |
|
73 * @since Series 60 Series3.1 |
|
74 * @param aIndex, index of selected list item |
|
75 * @param aCalledFromMenu, indicates if editing is called trough menu |
|
76 * or from keyboard |
|
77 * @return none |
|
78 */ |
|
79 void EditItemL ( TInt aIndex, TBool aCalledFromMenu ); |
|
80 |
|
81 /** |
|
82 * Launch up CAknSettingItemList |
|
83 * @since Series 60 3.1 |
|
84 * @param none |
|
85 * @return error code |
|
86 */ |
|
87 TInt MakeQueryL( ); |
|
88 |
|
89 public: //From MProgressDialogCallback |
|
90 |
|
91 /** |
|
92 * Callback method Get's called when a dialog is dismissed |
|
93 * @since Series 60 3.1 |
|
94 * @param aButtonId the reason when the dialog is dismissed |
|
95 * @return none |
|
96 */ |
|
97 void DialogDismissedL( TInt aButtonId ); |
|
98 |
|
99 public: //From MUPnPAVBrowsingSessionObserver |
|
100 |
|
101 /** |
|
102 * Returns a browse result received from a Media Server. |
|
103 * |
|
104 * @since Series 60 3.1 |
|
105 * @param aBrowseResponse browse response xml document |
|
106 * @param aError system wide error code |
|
107 * @param aMatches number of returned items |
|
108 * @param aTotalCount total number of objects on container |
|
109 * @param aUpdateId update id number |
|
110 * @return None |
|
111 */ |
|
112 void BrowseResponse( |
|
113 const TDesC8& /*aBrowseResponse*/, |
|
114 TInt /*aError*/, |
|
115 TInt /*aMatches*/, |
|
116 TInt /*aTotalCount*/, |
|
117 const TDesC8& /*aUpdateId*/ |
|
118 ){}; |
|
119 |
|
120 /** |
|
121 * Returns a search result received from a Media Server. |
|
122 * |
|
123 * @param aSearchResponse search response xml document |
|
124 * @param aError system wide error code |
|
125 * @param aMatches number of returned items |
|
126 * @param aTotalCount total number of resulted items |
|
127 * @param aUpdateId update id number |
|
128 * @return None |
|
129 */ |
|
130 void SearchResponse( |
|
131 const TDesC8& aSearchResponse, |
|
132 TInt aError, |
|
133 TInt aMatches, |
|
134 TInt aTotalCount, |
|
135 const TDesC8& aUpdateId |
|
136 ); |
|
137 |
|
138 /** |
|
139 * Returns processed search results received from a Media Server. |
|
140 * |
|
141 * @since Series 60 3.1 |
|
142 * @param TInt aError status information |
|
143 * @param aTotalCount TInt total number of objects |
|
144 * @param RPointerArray of CUpnpObject objects |
|
145 * @return None |
|
146 */ |
|
147 void SearchResponseL( |
|
148 TInt aStatus, |
|
149 const RPointerArray<CUpnpObject>& aResultArray ); |
|
150 |
|
151 /** |
|
152 * Returns search capabilities of the requested Media Server. |
|
153 * |
|
154 * @since Series 60 3.1 |
|
155 * @param TInt aError status information |
|
156 * @param HBufC8& the search capabilities string |
|
157 * @return None |
|
158 */ |
|
159 void SearchCapabilitiesResponse( TInt /*aError*/, |
|
160 const TDesC8& /*aSearchCapabilities*/ ){}; |
|
161 |
|
162 /** |
|
163 * Notifies that the create container operation is complete. |
|
164 * |
|
165 * @since Series 60 3.1 |
|
166 * @param aError status information |
|
167 * @param aObjectId (const TDesC8&) object ID of the new container |
|
168 */ |
|
169 void CreateContainerResponse( TInt /*aError*/, |
|
170 const TDesC8& /*aObjectId = KNullDesC8*/ ) |
|
171 {}; |
|
172 |
|
173 /** |
|
174 * Notifies that the requested UPnP Object deletion is complete. |
|
175 * |
|
176 * @since Series 60 3.1 |
|
177 * @param aError status information |
|
178 * @return None |
|
179 */ |
|
180 void DeleteObjectResponse( TInt /*aError*/ ){}; |
|
181 |
|
182 /** |
|
183 * Notifies that the Media Server we have a session with has |
|
184 * disappeared. Session is now unusable and must be closed. |
|
185 * |
|
186 * @since Series 60 3.1 |
|
187 * @param aReason reason code |
|
188 * @return None |
|
189 */ |
|
190 void MediaServerDisappeared( TUPnPDeviceDisconnectedReason aReason ); |
|
191 |
|
192 /** |
|
193 * Notifies that the Media Server we have a session with has |
|
194 * disappeared. Session is now unusable and must be closed. |
|
195 * |
|
196 * @since Series 60 3.1 |
|
197 * @param aReason reason code |
|
198 * @return None |
|
199 */ |
|
200 void MediaServerDisappearedL( TUPnPDeviceDisconnectedReason aReason ); |
|
201 |
|
202 /** |
|
203 * Notifies that a local media server has been on sharing |
|
204 * |
|
205 * @since Series 60 3.1 |
|
206 * @param aReason reason code |
|
207 * @return None |
|
208 */ |
|
209 void ReserveLocalMSServicesCompleted( TInt /*aError*/ ){}; |
|
210 |
|
211 public: //business logic |
|
212 |
|
213 /** |
|
214 * Check if the setting page is open |
|
215 * |
|
216 * @since Series 60 3.1 |
|
217 * @param none |
|
218 * @return TBool ETrue if the setting is open |
|
219 */ |
|
220 TBool IsSettingPageOpen() const; |
|
221 |
|
222 protected: // Functions from base classes |
|
223 |
|
224 /** |
|
225 * Handles a change to the control's resources |
|
226 * |
|
227 * @since Series 60 3.1 |
|
228 * @param aType a message UID value. |
|
229 * @return None |
|
230 */ |
|
231 void HandleResourceChange( TInt aType ); |
|
232 |
|
233 private: |
|
234 |
|
235 /** |
|
236 * C++ default constructor. |
|
237 */ |
|
238 CUPnPAdvancedFindList( MUPnPAVController& aAVControl, |
|
239 MUPnPAVBrowsingSession& aBrowsingSession, |
|
240 CUPnPAdvancedFindDialog& aParent, |
|
241 CUPnPCommonUI& aCommonUI ); |
|
242 |
|
243 /** |
|
244 * By default Symbian 2nd phase constructor is private. |
|
245 */ |
|
246 void ConstructL(); |
|
247 |
|
248 /** |
|
249 * From CAknSettingItemList, Framework method to create a setting item. |
|
250 * @since Series 60 Series3.1 |
|
251 * @param aIdentifier, list item id to be created |
|
252 * @return CAknSettingItem, pointer to list item |
|
253 */ |
|
254 CAknSettingItem* CreateSettingItemL( TInt aIdentifier ); |
|
255 |
|
256 /** |
|
257 * Get search criteria |
|
258 * @since Series 60 Series3.1 |
|
259 * @param none |
|
260 * @return search criteria |
|
261 */ |
|
262 HBufC8* BuildSearchCriteriaL() const; |
|
263 |
|
264 private: // Data |
|
265 |
|
266 //time variable for date from item |
|
267 TTime iDateFrom; |
|
268 //time variable for date Until item |
|
269 TTime iDateUntil; |
|
270 //time variable for initial date from item |
|
271 TTime iDateInitial; |
|
272 |
|
273 // Boolean flag telling if Search response received |
|
274 TBool iSearchResponseReceived; |
|
275 |
|
276 // text for artist selection item |
|
277 TBuf<KMaxNameLength> iArtistText; |
|
278 // text for album selection item |
|
279 TBuf<KMaxNameLength> iAlbumText; |
|
280 // text for Genre selection item |
|
281 TBuf<KMaxNameLength> iGenreText; |
|
282 |
|
283 TBuf<KMaxNameLength> iFileName; |
|
284 |
|
285 //chosen media type |
|
286 TInt iMediatype; |
|
287 |
|
288 // wait note dialog |
|
289 CAknWaitDialog* iWaitNoteDialog; |
|
290 |
|
291 |
|
292 MUPnPAVController& iAVControl; |
|
293 |
|
294 //observer for browse results |
|
295 MUPnPAVBrowsingSessionObserver* iBrowseObserver; |
|
296 |
|
297 //Array for search result |
|
298 RPointerArray<CUpnpObject> iResultArray; |
|
299 |
|
300 CAdvancedFindResultWindow* iFindResultWindow; //not owned |
|
301 CUPnPCommonUI& iCommonUI; |
|
302 CUPnPAdvancedFindDialog& iAdvancedFindDialog; |
|
303 |
|
304 MUPnPAVBrowsingSession& iBrowseSession; |
|
305 |
|
306 CUPnPCommonUI::TUPnPAction iAction; |
|
307 |
|
308 TInt iExitCode; |
|
309 |
|
310 // iShowingErrorNote tells if we are showing the error note. |
|
311 // During the error note is shown, we cannot destroy our parent dialog |
|
312 // because then the continuation after error note fails (crashes) |
|
313 TBool iShowingErrorNote; |
|
314 |
|
315 TBool iClose; |
|
316 TBool iSettingPageOpen; |
|
317 |
|
318 TUPnPDeviceDisconnectedReason iCloseReason; |
|
319 |
|
320 }; |
|
321 #endif // UPNPADVANCEDFINDLIST_H |
|
322 |
|
323 // End of File |
|