|
1 /* |
|
2 * Copyright (c) 2010 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 the License "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: CVcxHgMyVideosThumbnailManager class definition* |
|
15 */ |
|
16 |
|
17 |
|
18 #ifndef VCXHGMYVIDEOSTHUMBNAILMANAGER_H |
|
19 #define VCXHGMYVIDEOSTHUMBNAILMANAGER_H |
|
20 |
|
21 // INCLUDE FILES |
|
22 #include <thumbnailmanager.h> |
|
23 #include <thumbnailmanagerobserver.h> |
|
24 |
|
25 // FORWARD DECLARATIONS |
|
26 |
|
27 // CLASS DECLARATION |
|
28 |
|
29 /** |
|
30 * |
|
31 * @lib vcxhgmyvideos.lib |
|
32 */ |
|
33 NONSHARABLE_CLASS( CVcxHgMyVideosThumbnailManager ) : |
|
34 public CBase, |
|
35 public MThumbnailManagerObserver |
|
36 { |
|
37 public: |
|
38 |
|
39 /** |
|
40 * Two-phased constructor. |
|
41 * |
|
42 * @return New object. |
|
43 */ |
|
44 static CVcxHgMyVideosThumbnailManager* NewL(); |
|
45 |
|
46 /** |
|
47 * Two-phased constructor. |
|
48 * |
|
49 * @return New object. |
|
50 */ |
|
51 static CVcxHgMyVideosThumbnailManager* NewLC(); |
|
52 |
|
53 /** |
|
54 * Destructor. |
|
55 */ |
|
56 virtual ~CVcxHgMyVideosThumbnailManager(); |
|
57 |
|
58 private: // From MThumbnailManagerObserver |
|
59 |
|
60 /** |
|
61 * Preview thumbnail generation or loading is complete. |
|
62 * |
|
63 * @param aThumbnail An object representing the resulting thumbnail. |
|
64 * @param aId Request ID for the operation |
|
65 */ |
|
66 void ThumbnailPreviewReady( MThumbnailData& aThumbnail, TThumbnailRequestId aId ); |
|
67 |
|
68 /** |
|
69 * Final thumbnail bitmap generation or loading is complete. |
|
70 * |
|
71 * @param aError Error code. |
|
72 * @param aThumbnail An object representing the resulting thumbnail. |
|
73 * @param aId Request ID for the operation. |
|
74 */ |
|
75 void ThumbnailReady( TInt aError, MThumbnailData& aThumbnail, TThumbnailRequestId aId ); |
|
76 |
|
77 public: // New methods |
|
78 /** |
|
79 * Peeks if there is thumbnail and fetches it if it exist. |
|
80 * No thumbnail creation is started when thumbnail does not exist. |
|
81 * |
|
82 * @param aSource |
|
83 * @return TThumbnailRequestId. |
|
84 */ |
|
85 TThumbnailRequestId PeekL( CThumbnailObjectSource& aSource ); |
|
86 |
|
87 /** |
|
88 * Gets thumbnail and creates it if it does not exist. |
|
89 * |
|
90 * @param aSource |
|
91 * @return TThumbnailRequestId. |
|
92 */ |
|
93 TThumbnailRequestId GetL( CThumbnailObjectSource& aSource ); |
|
94 |
|
95 /** |
|
96 * Cancels thumbnail request |
|
97 * |
|
98 * @param aRequestId |
|
99 */ |
|
100 void Cancel( TThumbnailRequestId aRequestId ); |
|
101 |
|
102 /** |
|
103 * Adds observer. |
|
104 * |
|
105 * @param aObserver |
|
106 */ |
|
107 void AddObserverL( MThumbnailManagerObserver& aObserver ); |
|
108 |
|
109 /** |
|
110 * Removes observer. |
|
111 * |
|
112 * @param aObserver |
|
113 */ |
|
114 void RemoveObserver( MThumbnailManagerObserver& aObserver ); |
|
115 |
|
116 private: |
|
117 |
|
118 /** |
|
119 * Default constructor |
|
120 */ |
|
121 CVcxHgMyVideosThumbnailManager(); |
|
122 |
|
123 /** |
|
124 * SessionL |
|
125 * @return CThumbnailManager ref. |
|
126 */ |
|
127 CThumbnailManager& SessionL(); |
|
128 |
|
129 private: |
|
130 |
|
131 /** |
|
132 * S60 Thumbnail Manager. |
|
133 * Own. |
|
134 */ |
|
135 CThumbnailManager* iTnManager; |
|
136 |
|
137 /** |
|
138 * Used for storing the observers. Pointers are not own. |
|
139 */ |
|
140 RPointerArray<MThumbnailManagerObserver> iTnObservers; |
|
141 |
|
142 /** |
|
143 * Stores current thumbnail generation flags |
|
144 */ |
|
145 CThumbnailManager::TThumbnailFlags iCurrentFlags; |
|
146 }; |
|
147 |
|
148 #endif // VCXHGMYVIDEOSTHUMBNAILMANAGER_H |