|
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: store file manager |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 #ifndef __CMSMCLFMNGR_H |
|
21 #define __CMSMCLFMNGR_H |
|
22 |
|
23 #include <e32base.h> |
|
24 #include <MCLFOperationObserver.h> |
|
25 #include <MCLFItemListModel.h> |
|
26 #include <badesca.h> |
|
27 #include "cmcommontypes.h" |
|
28 #include "cmcommon.h" |
|
29 #include "cmsmcommon.h" |
|
30 |
|
31 // Forward declarations |
|
32 class MCLFContentListingEngine; |
|
33 class MCLFItemListModel; |
|
34 class MCLFSortingStyle; |
|
35 class MCmSmMusicMngrObserver; |
|
36 class CCmSmFileMngr; |
|
37 |
|
38 // CLASS DECLARATION |
|
39 |
|
40 /** |
|
41 * CCmSmClfMngr class definition |
|
42 * This class processes music files metadata. |
|
43 * |
|
44 * @lib cmstoremanager.lib |
|
45 * |
|
46 * @since S60 5.1 |
|
47 */ |
|
48 NONSHARABLE_CLASS( CCmSmClfMngr ) : public CActive, |
|
49 public MCLFOperationObserver |
|
50 { |
|
51 public: |
|
52 |
|
53 /** |
|
54 * Two-phased constructor. |
|
55 * Creates new CCmSmClfMngr class |
|
56 * |
|
57 * @since S60 5.1 |
|
58 * @param aObserver, observer pointer |
|
59 * @param aFileMngr, file manager reference |
|
60 * @param aItems, store list items |
|
61 * @return pointer to CCmSmClfMngr class |
|
62 */ |
|
63 static CCmSmClfMngr* NewL( MCmSmMusicMngrObserver& aObserver, |
|
64 CCmSmFileMngr& aFileMngr, RPointerArray<CCmStoreListItem>& aItems ); |
|
65 |
|
66 /** |
|
67 * Two-phased constructor. |
|
68 * Creates new CCmSmClfMngr class |
|
69 * |
|
70 * @since S60 5.1 |
|
71 * @param aObserver, observer pointer |
|
72 * @param aFileMngr, file manager reference |
|
73 * @param aItems, store list items |
|
74 * @return pointer to CCmSmClfMngr class |
|
75 */ |
|
76 static CCmSmClfMngr* NewLC( MCmSmMusicMngrObserver& aObserver, |
|
77 CCmSmFileMngr& aFileMngr, RPointerArray<CCmStoreListItem>& aItems ); |
|
78 |
|
79 /** |
|
80 * Destructor. |
|
81 */ |
|
82 virtual ~CCmSmClfMngr(); |
|
83 |
|
84 /** |
|
85 * Cancels list processing |
|
86 * |
|
87 * @since S60 5.1 |
|
88 * @param None |
|
89 * @return None |
|
90 */ |
|
91 void CancelOperation(); |
|
92 |
|
93 /** |
|
94 * Cancel clf refresh |
|
95 * |
|
96 * @since S60 5.1 |
|
97 * @param None |
|
98 * @return None |
|
99 */ |
|
100 void CancelClfRefresh(); |
|
101 |
|
102 /** |
|
103 * Setting up clf lists |
|
104 * |
|
105 * @since S60 5.1 |
|
106 * @param aMediaType, media type |
|
107 * @return None |
|
108 */ |
|
109 void SetupCLFListModelsL( TCmMediaType aMediaType ); |
|
110 |
|
111 /** |
|
112 * CLF refresh |
|
113 * |
|
114 * @since S60 5.1 |
|
115 * @param aMediaType, media type |
|
116 * @return None |
|
117 */ |
|
118 void DoRefreshL( TCmMediaType aMediaType ); |
|
119 |
|
120 /** |
|
121 * Filters files from the clf lists |
|
122 * |
|
123 * @since S60 5.1 |
|
124 * @param None |
|
125 * @return None |
|
126 */ |
|
127 void FilterItemsL(); |
|
128 |
|
129 /** |
|
130 * Filters defined media files from the clf lists |
|
131 * |
|
132 * @since S60 5.1 |
|
133 * @param aNewItems, list model |
|
134 * @param aDeviceIds, devices |
|
135 * @param aType, media type |
|
136 * @return None |
|
137 */ |
|
138 void FilterNewItemsL( MCLFItemListModel* aNewItems, |
|
139 RArray<TInt> aDeviceIds, TCmMediaType aType ); |
|
140 |
|
141 // From base class MCLFOperationObserver |
|
142 |
|
143 /** |
|
144 * From MCLFOperationObserver |
|
145 * See base class definition |
|
146 */ |
|
147 void HandleOperationEventL( TCLFOperationEvent aOperationEvent, |
|
148 TInt aError ); |
|
149 |
|
150 protected: |
|
151 |
|
152 // From base class CActive |
|
153 |
|
154 /** |
|
155 * From CActive |
|
156 * See base class definition |
|
157 */ |
|
158 void RunL(); |
|
159 |
|
160 /** |
|
161 * From CActive |
|
162 * See base class definition |
|
163 */ |
|
164 void DoCancel(); |
|
165 |
|
166 private: |
|
167 |
|
168 /** |
|
169 * Completes request |
|
170 * |
|
171 * @since S60 5.1 |
|
172 * @param aStatus, defined id for the completing |
|
173 * @return None |
|
174 */ |
|
175 void CompleteRequest( TCmSmFileProcessingStatus aStatus ); |
|
176 |
|
177 private: |
|
178 |
|
179 /** |
|
180 * Performs the first phase of two phase construction. |
|
181 * |
|
182 * since S60 5.1 |
|
183 * @param aObserver, music manager observer |
|
184 * @param aFileMngr, file manager |
|
185 * @param aItems, store list items |
|
186 */ |
|
187 CCmSmClfMngr( MCmSmMusicMngrObserver& aObserver, |
|
188 CCmSmFileMngr& aFileMngr, RPointerArray<CCmStoreListItem>& aItems ); |
|
189 |
|
190 /** |
|
191 * Performs the second phase construction. |
|
192 */ |
|
193 void ConstructL(); |
|
194 |
|
195 private: |
|
196 |
|
197 /** |
|
198 * Pointer to observer class |
|
199 */ |
|
200 MCmSmMusicMngrObserver& iObserver; |
|
201 /** |
|
202 * Main file manager |
|
203 */ |
|
204 CCmSmFileMngr& iFileMngr; |
|
205 /** |
|
206 * Clf engine |
|
207 */ |
|
208 MCLFContentListingEngine* iEngine; // owned |
|
209 /** |
|
210 * Audio list model to be refreshed |
|
211 */ |
|
212 MCLFItemListModel* iNewAudioItems; // owned |
|
213 /** |
|
214 * Image list model to be refreshed |
|
215 */ |
|
216 MCLFItemListModel* iNewImageItems; // owned |
|
217 /** |
|
218 * Video list model to be refreshed |
|
219 */ |
|
220 MCLFItemListModel* iNewVideoItems; // owned |
|
221 /** |
|
222 * Sorting style for item ordering. |
|
223 */ |
|
224 MCLFSortingStyle* iSortingStyle; // owned |
|
225 /** |
|
226 * Store file list items |
|
227 */ |
|
228 RPointerArray<CCmStoreListItem>& iItems; |
|
229 /** |
|
230 * Filter file index |
|
231 */ |
|
232 TInt iFilterIndex; |
|
233 }; |
|
234 |
|
235 #endif // __CMSMCLFMNGR_H |
|
236 |