29 #include <e32const.h> |
29 #include <e32const.h> |
30 #include <mpxitemid.h> |
30 #include <mpxitemid.h> |
31 |
31 |
32 // FORWARD DECLARATIONS |
32 // FORWARD DECLARATIONS |
33 class VideoCollectionWrapper; |
33 class VideoCollectionWrapper; |
34 class VideoSortFilterProxyModel; |
34 class VideoProxyModelGeneric; |
35 class QModelIndex; |
35 class QModelIndex; |
36 class QTimer; |
36 class QTimer; |
37 class VideoThumbnailFetcher; |
37 class VideoThumbnailFetcher; |
38 class HbIcon; |
38 class HbIcon; |
39 |
39 |
84 * Starts background thumbnail fetching from the given fetch index. |
84 * Starts background thumbnail fetching from the given fetch index. |
85 * |
85 * |
86 * @param model model of the items for the fetching. |
86 * @param model model of the items for the fetching. |
87 * @param fetchIndex index where to start the background thumbnail fetching. |
87 * @param fetchIndex index where to start the background thumbnail fetching. |
88 */ |
88 */ |
89 void startBackgroundFetching(VideoSortFilterProxyModel *model, int fetchIndex); |
89 void startBackgroundFetching(VideoProxyModelGeneric *model, int fetchIndex); |
90 |
90 |
91 /** |
91 /** |
92 * Enables or disables thumbnail background fetching. |
92 * Enables or disables thumbnail background fetching. |
93 * |
93 * |
94 * @param enable true enables and false disables thumbnail background fetching. |
94 * @param enable true enables and false disables thumbnail background fetching. |
191 * Loads icon from file or resource, the icon is scaled to size of the |
191 * Loads icon from file or resource, the icon is scaled to size of the |
192 * video list view thumbnail. |
192 * video list view thumbnail. |
193 * |
193 * |
194 * @param iconName name of the file or resource. |
194 * @param iconName name of the file or resource. |
195 * |
195 * |
196 * @return HbIcon the icon load from resource or file. |
196 * @return QIcon the icon load from resource or file. |
197 * |
197 * |
198 */ |
198 */ |
199 HbIcon loadIcon(QString iconName); |
199 QIcon *loadIcon(QString iconName); |
200 |
200 |
201 /** |
201 /** |
202 * Starts timer that continues the background thumbnail fetching at timeout. |
202 * Starts timer that continues the background thumbnail fetching at timeout. |
203 */ |
203 */ |
204 void continueBackgroundFetch(); |
204 void continueBackgroundFetch(); |
252 */ |
252 */ |
253 void allThumbnailsFetchedSlot(); |
253 void allThumbnailsFetchedSlot(); |
254 |
254 |
255 private: // Data |
255 private: // Data |
256 |
256 |
257 VideoThumbnailFetcher *mThumbnailFetcher; |
257 VideoThumbnailFetcher *mThumbnailFetcher; |
258 |
258 |
259 /** |
259 /** |
260 * Local cache for thumbnail data: |
260 * Local cache for thumbnail data: |
261 * - key is the video's media id |
261 * - key is the video's media id |
262 * - data is the actual thumbnail data. |
262 * - data is the actual thumbnail data. |
263 * If thumbnail data is not yet fetched, QIcon is default thumbnail. |
263 * If thumbnail data is not yet fetched, QIcon is default thumbnail. |
264 */ |
264 */ |
265 QCache<TMPXItemId, QIcon> mThumbnailData; |
265 QCache<TMPXItemId, QIcon> mThumbnailData; |
266 |
266 |
267 /** |
267 /** |
268 * Local hash for default thumbnails. |
268 * Local hash for default thumbnails. |
269 * - key is mpx item id defining default tn type |
269 * - key is mpx item id defining default tn type |
270 * - data is the actual thumbnail data. |
270 * - data is the actual thumbnail data. |
271 */ |
271 */ |
272 QHash<TMPXItemId, HbIcon> mDefaultThumbnails; |
272 QHash<TMPXItemId, QIcon *> mDefaultThumbnails; |
273 |
273 |
274 /** |
274 /** |
275 * Current model, set at call to startBackgroundFetching. |
275 * Current model, set at call to startBackgroundFetching. |
276 */ |
276 */ |
277 QPointer<VideoSortFilterProxyModel> mCurrentModel; |
277 QPointer<VideoProxyModelGeneric> mCurrentModel; |
278 |
278 |
279 /** |
279 /** |
280 * Current index for background thumbnail fetching. |
280 * Current index for background thumbnail fetching. |
281 */ |
281 */ |
282 int mCurrentFetchIndex; |
282 int mCurrentFetchIndex; |