26 |
26 |
27 // INCLUDES |
27 // INCLUDES |
28 // System |
28 // System |
29 #include <e32base.h> |
29 #include <e32base.h> |
30 #include <MCLFOperationObserver.h> |
30 #include <MCLFOperationObserver.h> |
31 #include <MCLFChangedItemObserver.h> |
|
32 #include <MCLFItem.h> |
31 #include <MCLFItem.h> |
33 #include <badesca.h> |
32 #include <badesca.h> |
34 |
33 // Internal |
35 // upnp stack api |
|
36 #include <upnpitem.h> |
|
37 |
|
38 // upnpframework / avcontroller helper api |
|
39 #include "upnpconstantdefs.h" // for upnp-specific stuff |
34 #include "upnpconstantdefs.h" // for upnp-specific stuff |
40 |
|
41 // homeconnect internal |
|
42 #include "upnpcontentserverdefs.h" |
35 #include "upnpcontentserverdefs.h" |
43 #include "upnpcontentserverhandler.h" |
36 #include "upnpcontentserverhandler.h" |
44 |
|
45 |
|
46 // CONSTANTS |
|
47 const TInt KMaxRefreshCount = 3; |
|
48 |
37 |
49 // FORWARD DECLARATIONS |
38 // FORWARD DECLARATIONS |
50 class MCLFContentListingEngine; |
39 class MCLFContentListingEngine; |
51 class MCLFItemListModel; |
40 class MCLFItemListModel; |
52 class CUpnpCustomGrouper; |
41 class TClfMediaType; |
53 class CUpnpPostFilter; |
|
54 class MUpnpMetadataObserver; |
|
55 class CUPnPMetaDataUtility; |
|
56 |
42 |
|
43 using namespace UpnpContentServer; |
57 |
44 |
58 // CLASS DECLARATION |
45 // CLASS DECLARATION |
59 |
46 |
60 /** |
47 /** |
61 * Class to collect files from phone to share. |
48 * Class to collect files from phone to share. |
80 virtual ~CUpnpContentMetadataUtility(); |
68 virtual ~CUpnpContentMetadataUtility(); |
81 |
69 |
82 public: // New functions |
70 public: // New functions |
83 |
71 |
84 /** |
72 /** |
85 * Updates metadata for the item |
|
86 * @since S60 3.1 |
|
87 * @param aMediaType Media type of oitem to be updated |
|
88 * @param aItem pointer to item |
|
89 * @param aFileName Reference to item filename |
|
90 * @return ETrue if the item was found from this model |
|
91 */ |
|
92 TBool UpdateMetadataL( const TUpnpMediaType& aMediaType, |
|
93 CUpnpItem* aItem, |
|
94 const TDesC& aFileName ); |
|
95 |
|
96 /** |
|
97 * Returns music model |
73 * Returns music model |
98 * @since S60 3.1 |
74 * @since S60 5.2 |
99 * @return MCLFItemListModel reference to model |
75 * @return MCLFItemListModel reference to model |
100 */ |
76 */ |
101 const MCLFItemListModel& MusicFiles() const; |
77 const MCLFItemListModel* MusicFiles(); |
102 |
78 |
103 /** |
79 /** |
104 * Returns image model |
80 * Returns image model |
105 * @since S60 3.1 |
81 * @since S60 5.2 |
106 * @return MCLFItemListModel reference to model |
82 * @return MCLFItemListModel reference to model |
107 */ |
83 */ |
108 const MCLFItemListModel& ImageFiles() const; |
84 const MCLFItemListModel* ImageFiles(); |
109 |
|
110 |
85 |
111 /** |
86 /** |
112 * Returns video model |
87 * Returns video model |
113 * @since S60 3.1 |
88 * @since S60 5.2 |
114 * @return MCLFItemListModel reference to model |
89 * @return MCLFItemListModel reference to model |
115 */ |
90 */ |
116 const MCLFItemListModel& VideoFiles() const; |
91 const MCLFItemListModel* VideoFiles(); |
117 |
|
118 |
|
119 /** |
|
120 * Returns collection model |
|
121 * @since S60 3.1 |
|
122 * @return MCLFItemListModel reference to model |
|
123 */ |
|
124 const MCLFItemListModel& Collections() const; |
|
125 |
|
126 |
|
127 /** |
|
128 * Collects items from selected collection to the model |
|
129 * @since S60 3.1 |
|
130 * @param aNameOfCollection, collection name |
|
131 */ |
|
132 void CollectionItemsL( const TDesC& aNameOfCollection ); |
|
133 |
|
134 |
|
135 /** |
|
136 * Extract files from descriptor to the array |
|
137 * @since S60 3.1 |
|
138 * @param aFileArray, file name array |
|
139 * @param aFiles, file name descriptor |
|
140 */ |
|
141 void GetCollectionFileNamesL( CDesCArray& aFileArray, |
|
142 const TDesC& aFiles ) const; |
|
143 |
|
144 /** |
|
145 * Returns true if refresh is still ongoing |
|
146 * @since S60 3.1 |
|
147 * @return Status of the refresh operation |
|
148 */ |
|
149 TBool RefreshOngoing() const; |
|
150 |
|
151 /** |
|
152 * Clears all postfilters |
|
153 * @since S60 3.1 |
|
154 * |
|
155 */ |
|
156 void ClearPostFiltersL(); |
|
157 |
|
158 /** |
|
159 * Creates UPnP item from CLF Item |
|
160 * @since S60 3.1 |
|
161 * @param aCLFItem reference to original item |
|
162 * @param aParentId Parent id of the item |
|
163 * @return CUpnpItem new item allocation |
|
164 */ |
|
165 CUpnpItem* CreateItemL( const MCLFItem& aCLFItem, |
|
166 const TDesC8& aParentId ) const; |
|
167 |
|
168 /** |
|
169 * Creates UPnP item from CLF Item |
|
170 * @since S60 3.1 |
|
171 * @param aFullFilenme Filename of the item |
|
172 * @param aParentId Parent id of the item |
|
173 * @return CUpnpItem new item allocation |
|
174 */ |
|
175 CUpnpItem* CreateItemL( |
|
176 const TDesC& aFullFilename, |
|
177 const TDesC8& aParentId ) const; |
|
178 |
|
179 /** |
|
180 * Sets the callback for informing about refresh state |
|
181 * @since S60 3.1 |
|
182 * @param aHandler pointer to observer |
|
183 */ |
|
184 void SetCallback( MUpnpMetadataObserver* aObserver ); |
|
185 |
|
186 |
92 |
187 protected: // From MCLFOperationObserver |
93 protected: // From MCLFOperationObserver |
188 |
94 |
189 /** |
95 /** |
190 * Abstract method to get list model operation events. This method is |
96 * Abstract method to get list model operation events. This method is |
238 MCLFItemListModel* iImageModel; |
139 MCLFItemListModel* iImageModel; |
239 |
140 |
240 // Content listing model for videos (owned) |
141 // Content listing model for videos (owned) |
241 MCLFItemListModel* iVideoModel; |
142 MCLFItemListModel* iVideoModel; |
242 |
143 |
243 // Content listing model for collections (owned) |
144 // Waiter for Refresh processes (owned) |
244 MCLFItemListModel* iCollectionModel; |
145 CActiveSchedulerWait* iWait; |
245 |
146 |
246 // Custom grouper for collection grouping (owned) |
|
247 CUpnpCustomGrouper* iCustomGrouper; |
|
248 |
|
249 // Status to indicate if refresh operation is ongoing |
|
250 TBool iRefreshOngoing; |
|
251 |
|
252 // Keeps count of refreshed models |
|
253 TInt iRefreshCounter; |
|
254 |
|
255 // Post filter for filtering (owned) |
|
256 CUpnpPostFilter* iPostFilter; |
|
257 |
|
258 // Callback interface |
|
259 // not owned |
|
260 MUpnpMetadataObserver* iHandler; |
|
261 |
|
262 // The index maintained during the multiple CLF operations |
|
263 TInt iClfIndex; |
|
264 |
|
265 // Utility class for CLF |
|
266 CUPnPMetaDataUtility* iMetaDataUtility; // owned |
|
267 }; |
147 }; |
268 |
148 |
269 #endif // __UPNPCONTENTMETADATAUTILITY_H__ |
149 #endif // __UPNPCONTENTMETADATAUTILITY_H__ |
270 |
150 |
271 // End of File |
151 // End of File |