1 /* |
|
2 * Copyright (c) 2009 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: CVideoThumbnailData class definition* |
|
15 */ |
|
16 |
|
17 #ifndef __VIDEOTHUMBNAILDATA_H__ |
|
18 #define __VIDEOTHUMBNAILDATA_H__ |
|
19 |
|
20 // INCLUDES |
|
21 #include <qobject.h> |
|
22 #include <qhash.h> |
|
23 #include <qpair.h> |
|
24 #include <qicon.h> |
|
25 #include <qset.h> |
|
26 |
|
27 // FORWARD DECLARATIONS |
|
28 class VideoSortFilterProxyModel; |
|
29 |
|
30 class VideoThumbnailData : public QObject |
|
31 { |
|
32 /** |
|
33 * defined to be able to use signals and slots |
|
34 */ |
|
35 Q_OBJECT |
|
36 |
|
37 /** |
|
38 * disable copy-constructor and assignment operator |
|
39 */ |
|
40 Q_DISABLE_COPY(VideoThumbnailData) |
|
41 |
|
42 public: // Constructor |
|
43 |
|
44 /* |
|
45 * Thumbnail fetch priorities |
|
46 */ |
|
47 enum VideoThumbnailPriority |
|
48 { |
|
49 VideoThumbnailPriorityBackground = 2000, |
|
50 VideoThumbnailPriorityLow = 5000, |
|
51 VideoThumbnailPriorityMedium = 10000, |
|
52 VideoThumbnailPriorityHigh = 2000 |
|
53 }; |
|
54 |
|
55 /** |
|
56 * Returns singleton instance for this class. |
|
57 * |
|
58 * @return The singleton instance. |
|
59 * |
|
60 */ |
|
61 static VideoThumbnailData &instance(); |
|
62 |
|
63 /** |
|
64 * Starts background thumbnail fetching. |
|
65 * |
|
66 * @param fetchIndex index where to start the background thumbnail fetching. |
|
67 * |
|
68 */ |
|
69 void startBackgroundFetching(VideoSortFilterProxyModel *model, int fetchIndex); |
|
70 |
|
71 /** |
|
72 * Enables or disables thumbnail background fetching. Default is enabled. |
|
73 * |
|
74 * @param enable true enables and false disables thumbnail background fetching. |
|
75 */ |
|
76 void enableBackgroundFetching(bool enable); |
|
77 |
|
78 /** |
|
79 * Frees allocated data for thumbnails and cancels ongoing fetches. |
|
80 */ |
|
81 void freeThumbnailData(); |
|
82 |
|
83 private: |
|
84 |
|
85 /** |
|
86 * Default constructor |
|
87 */ |
|
88 VideoThumbnailData(); |
|
89 |
|
90 /** |
|
91 * Destructor |
|
92 */ |
|
93 ~VideoThumbnailData(); |
|
94 |
|
95 public: |
|
96 static int mEnableBackgroundThumbnailFetchingCallCount; |
|
97 static int mStartFetchingThumbnailsCallCount; |
|
98 static int mStartFetchingThumbnailsThumbnailCount; |
|
99 static int mInstanceCallCount; |
|
100 static int mFreeThumbnailDataCallCount; |
|
101 static int mBackgroundThumbnailFetchingEnabled; |
|
102 static int mStartBackgroundFetchingCallCount; |
|
103 |
|
104 private: // data |
|
105 |
|
106 |
|
107 }; |
|
108 #endif // __VIDEOTHUMBNAILDATA_H__ |
|
109 |
|
110 // End of file |
|