|
1 /* |
|
2 * Copyright (c) 2006-2007 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: Class for handling central repositoty data |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef THUMBNAILCENREP_H |
|
20 #define THUMBNAILCENREP_H |
|
21 |
|
22 #include <gdi.h> |
|
23 |
|
24 #include <thumbnailmanager.h> // TThumbnailSize |
|
25 |
|
26 class CRepository; |
|
27 class TThumbnailPersistentSize; |
|
28 class TThumbnailAutoCreate; |
|
29 |
|
30 /** |
|
31 * Class for handling central repositoty data. |
|
32 * |
|
33 * @since S60 v5.0 |
|
34 */ |
|
35 class CThumbnailCenRep: public CBase |
|
36 { |
|
37 |
|
38 public: |
|
39 |
|
40 /** |
|
41 * Destructor |
|
42 * |
|
43 * @since S60 v5.0 |
|
44 */ |
|
45 virtual ~CThumbnailCenRep(); |
|
46 |
|
47 /** |
|
48 * Two-phased constructor |
|
49 * |
|
50 * @since S60 v5.0 |
|
51 * @return New CThumbnailCenRep instance. |
|
52 */ |
|
53 static CThumbnailCenRep* NewL(); |
|
54 |
|
55 /** |
|
56 * GetPersistentSizes |
|
57 * |
|
58 * @since S60 v5.0 |
|
59 * @return Reference to array of central repository settings |
|
60 */ |
|
61 RArray < TThumbnailPersistentSize > & GetPersistentSizes(); |
|
62 |
|
63 /** |
|
64 * GetAutoCreateParams |
|
65 * |
|
66 * @since S60 v5.0 |
|
67 * @return Reference to auto creation settings |
|
68 */ |
|
69 TThumbnailAutoCreate & GetAutoCreateParams(); |
|
70 |
|
71 /** |
|
72 * Get concrete persistent size associated to relative size |
|
73 * |
|
74 * @since S60 v5.0 |
|
75 * @param aThumbnailSize Relative size |
|
76 * @return Persistent size object |
|
77 */ |
|
78 TThumbnailPersistentSize & PersistentSizeL( TThumbnailSize |
|
79 aThumbnailSize ); |
|
80 |
|
81 private: |
|
82 |
|
83 /** |
|
84 * C++ default constructor |
|
85 * |
|
86 * @since S60 v5.0 |
|
87 * @return New CThumbnailCenRep instance. |
|
88 */ |
|
89 CThumbnailCenRep(); |
|
90 |
|
91 /** |
|
92 * ConstructL |
|
93 * |
|
94 * @since S60 v5.0 |
|
95 */ |
|
96 void ConstructL(); |
|
97 |
|
98 private: |
|
99 // data |
|
100 |
|
101 /** |
|
102 * Central Repository |
|
103 * Own. |
|
104 */ |
|
105 CRepository* iRepository; |
|
106 |
|
107 /** |
|
108 * Persistent sizes. |
|
109 */ |
|
110 RArray < TThumbnailPersistentSize > iPersistentSizes; |
|
111 |
|
112 /** |
|
113 * Auto creation parameters. |
|
114 */ |
|
115 TThumbnailAutoCreate * iAutoCreate; |
|
116 |
|
117 }; |
|
118 |
|
119 /** |
|
120 * Class for representing persistent thumbnail sizes and related |
|
121 * parameters. |
|
122 * |
|
123 * @since S60 v5.0 |
|
124 */ |
|
125 class TThumbnailPersistentSize |
|
126 { |
|
127 /** |
|
128 * Format used for storing bitmaps. |
|
129 * @since S60 v5.0 |
|
130 */ |
|
131 enum TThumbnailImageFormat |
|
132 { |
|
133 /** |
|
134 * Use JPEG compression for stored bitmaps. |
|
135 */ |
|
136 EJpeg, |
|
137 |
|
138 /** |
|
139 * Use native Symbian bitmap format for stored bitmaps. |
|
140 */ |
|
141 EBmp |
|
142 }; |
|
143 |
|
144 public: |
|
145 enum { EUnknownSourceType, EImage, EVideo, EAudio }; |
|
146 enum { EUnknownSizeType, EGrid, EList, EFullscreen }; |
|
147 |
|
148 public: |
|
149 |
|
150 /** |
|
151 * C++ constructor. |
|
152 * |
|
153 * @since S60 v5.0 |
|
154 * @param aSize Thumbnail size (in pixels) which will be stored. |
|
155 * @param aCrop If true, stored thumbnails are cropped to aspect ratio. |
|
156 * @param aMode Display mode used for stored bitmaps |
|
157 * @param aFormat Format used when storing thumbnails |
|
158 */ |
|
159 TThumbnailPersistentSize( const TSize& aSize, TBool aCrop, TDisplayMode |
|
160 aMode, TInt aFormat ); |
|
161 |
|
162 TThumbnailPersistentSize( TThumbnailSize aType, const TSize& aSize, TBool aCrop, TDisplayMode |
|
163 aMode, TInt aFormat, TBool aAutoCreate ); |
|
164 |
|
165 public: |
|
166 |
|
167 // data |
|
168 TThumbnailSize iType; |
|
169 TInt iSourceType; |
|
170 TInt iSizeType; |
|
171 |
|
172 TSize iSize; |
|
173 TBool iCrop; |
|
174 TDisplayMode iMode; |
|
175 TInt iFormat; |
|
176 |
|
177 TBool iAutoCreate; |
|
178 }; |
|
179 |
|
180 /** |
|
181 * Class for representing thumbnail auto creation parameters. |
|
182 * |
|
183 * @since S60 v5.0 |
|
184 */ |
|
185 class TThumbnailAutoCreate |
|
186 { |
|
187 |
|
188 public: |
|
189 |
|
190 /** |
|
191 * C++ constructor. |
|
192 * |
|
193 * @since S60 v5.0 |
|
194 */ |
|
195 TThumbnailAutoCreate(); |
|
196 |
|
197 public: |
|
198 |
|
199 // data |
|
200 TBool iImageGrid; |
|
201 TBool iImageList; |
|
202 TBool iImageFullscreen; |
|
203 TBool iVideoGrid; |
|
204 TBool iVideoList; |
|
205 TBool iVideoFullscreen; |
|
206 TBool iAudioGrid; |
|
207 TBool iAudioList; |
|
208 TBool iAudioFullscreen; |
|
209 }; |
|
210 |
|
211 #endif // THUMBNAILCENREP_H |