|
1 /* |
|
2 * Copyright (c) 2003 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: Data classs and structures. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #if !defined(AFX_SDCDATA_H__67B83F2E_D9A5_4F97_B3DE_6C5F6F81C67D__INCLUDED_) |
|
20 #define AFX_SDCDATA_H__67B83F2E_D9A5_4F97_B3DE_6C5F6F81C67D__INCLUDED_ |
|
21 |
|
22 #if _MSC_VER > 1000 |
|
23 #pragma once |
|
24 #endif // _MSC_VER > 1000 |
|
25 |
|
26 #include <vector> |
|
27 |
|
28 using namespace std; |
|
29 |
|
30 enum TSDCColorDepth |
|
31 { |
|
32 ESDCColorDepthNone, |
|
33 ESDCColorDepth1, |
|
34 ESDCColorDepth2, |
|
35 ESDCColorDepth4, |
|
36 ESDCColorDepth8, |
|
37 ESDCColorDepthC4, |
|
38 ESDCColorDepthC8, |
|
39 ESDCColorDepthC12, |
|
40 ESDCColorDepthC16, |
|
41 ESDCColorDepthC24, |
|
42 ESDCColorDepthC32 |
|
43 }; |
|
44 |
|
45 struct TSDCMBMEntry |
|
46 { |
|
47 int iIndex; |
|
48 wchar_t iSourcePath[512]; |
|
49 |
|
50 TSDCColorDepth iColorDepth; |
|
51 wchar_t iSourceFilename[512]; |
|
52 |
|
53 TSDCColorDepth iMaskColorDepth; |
|
54 wchar_t iMaskSourceFilename[512]; |
|
55 |
|
56 bool iSvgAnim; |
|
57 }; |
|
58 |
|
59 struct TSDCIID |
|
60 { |
|
61 int iMajor; |
|
62 int iMinor; |
|
63 }; |
|
64 |
|
65 struct TSDCPID |
|
66 { |
|
67 int iPID1; |
|
68 int iPID2; |
|
69 }; |
|
70 |
|
71 enum TSDCImageAttribute |
|
72 { |
|
73 ESDCImageAttributeNone =0x00, |
|
74 ESDCImageAttributeCoords =0x01, |
|
75 ESDCImageAttributeSize =0x02, |
|
76 ESDCImageAttributeStretch =0x04, |
|
77 ESDCImageAttributeTile =0x08, |
|
78 ESDCImageAttributeAlign =0x10, |
|
79 ESDCImageAttributeScale =0x20, |
|
80 ESDCImageAttributeTileX =0x40, |
|
81 ESDCImageAttributeTileY =0x80, |
|
82 ESDCImageAttributeNBC =0x100 |
|
83 }; |
|
84 |
|
85 enum TSDCImageAlignment |
|
86 { |
|
87 ESDCImageAlignNone =0x00, |
|
88 ESDCImageAlignVTop =0x01, |
|
89 ESDCImageAlignVBottom =0x02, |
|
90 ESDCImageAlignVCenter =0x04, |
|
91 ESDCImageAlignHLeft =0x08, |
|
92 ESDCImageAlignHRight =0x10, |
|
93 ESDCImageAlignHCenter =0x20, |
|
94 ESDCImageAlignTL =ESDCImageAlignVTop|ESDCImageAlignHLeft, |
|
95 ESDCImageAlignTR =ESDCImageAlignVTop|ESDCImageAlignHRight, |
|
96 ESDCImageAlignTC =ESDCImageAlignVTop|ESDCImageAlignHCenter, |
|
97 ESDCImageAlignBL =ESDCImageAlignVBottom|ESDCImageAlignHLeft, |
|
98 ESDCImageAlignBR =ESDCImageAlignVBottom|ESDCImageAlignHRight, |
|
99 ESDCImageAlignBC =ESDCImageAlignVBottom|ESDCImageAlignHCenter, |
|
100 ESDCImageAlignCL =ESDCImageAlignVCenter|ESDCImageAlignHLeft, |
|
101 ESDCImageAlignCR =ESDCImageAlignVCenter|ESDCImageAlignHRight, |
|
102 ESDCImageAlignCC =ESDCImageAlignVCenter|ESDCImageAlignHCenter, |
|
103 ESDCImageAlignVMask =ESDCImageAlignVTop|ESDCImageAlignVBottom| |
|
104 ESDCImageAlignVCenter, |
|
105 ESDCImageAlignHMask =ESDCImageAlignHLeft|ESDCImageAlignHRight| |
|
106 ESDCImageAlignHCenter |
|
107 }; |
|
108 |
|
109 struct TSDCImageAttributes |
|
110 { |
|
111 int iAttributeFlags; |
|
112 int iCoordX; |
|
113 int iCoordY; |
|
114 int iSizeW; |
|
115 int iSizeH; |
|
116 TSDCImageAlignment iAlignmentFlags; |
|
117 }; |
|
118 |
|
119 struct TSDCBitmapDef |
|
120 { |
|
121 TSDCIID iIID; |
|
122 int iMBMIndex; |
|
123 int iMaskMBMIndex; |
|
124 TSDCImageAttributes iAttributes; |
|
125 bool iAppIconBitmap; |
|
126 int iRestriction; |
|
127 }; |
|
128 |
|
129 struct TSDCColorTableEntry |
|
130 { |
|
131 int iIndex; |
|
132 int iRgb; |
|
133 }; |
|
134 |
|
135 struct TSDCColorTableDef |
|
136 { |
|
137 TSDCIID iIID; |
|
138 vector<TSDCColorTableEntry> iColors; |
|
139 int iRestriction; |
|
140 }; |
|
141 |
|
142 struct TSDCFrameDef |
|
143 { |
|
144 TSDCIID iIID; |
|
145 vector<TSDCIID> iElements; |
|
146 int iRestriction; |
|
147 }; |
|
148 |
|
149 struct TSDCNameEntry |
|
150 { |
|
151 int iLanguageID; |
|
152 wchar_t iName[512]; |
|
153 }; |
|
154 |
|
155 struct TSDCAppIconDef |
|
156 { |
|
157 TSDCIID iIID; |
|
158 vector<TSDCIID> iIcons; |
|
159 int iRestriction; |
|
160 }; |
|
161 |
|
162 struct TSDCBmpAnimFrame |
|
163 { |
|
164 TSDCIID iIID; |
|
165 int iTime; |
|
166 int iPosX; |
|
167 int iPosY; |
|
168 }; |
|
169 |
|
170 struct TSDCBmpAnimDef |
|
171 { |
|
172 TSDCIID iIID; |
|
173 int iInterval; |
|
174 int iPlayMode; |
|
175 int iFlash; |
|
176 vector<TSDCBmpAnimFrame> iFrames; |
|
177 int iRestriction; |
|
178 }; |
|
179 |
|
180 struct TSDCTargetDeviceEntry |
|
181 { |
|
182 wchar_t iDeviceName[128]; |
|
183 }; |
|
184 |
|
185 struct TSDCStringDef |
|
186 { |
|
187 TSDCIID iIID; |
|
188 wchar_t iString[512]; |
|
189 int iRestriction; |
|
190 }; |
|
191 |
|
192 struct TSDCEffectParameter |
|
193 { |
|
194 wchar_t iName[512]; |
|
195 int iType; |
|
196 int iNumber; |
|
197 int iRawDataCount; // Raw data itself is stored in iString |
|
198 wchar_t iString[512]; |
|
199 TSDCColorDepth iColorDepth; |
|
200 int iBmpIndex; |
|
201 int iMaskIndex; |
|
202 }; |
|
203 |
|
204 struct TSDCEffectCommand |
|
205 { |
|
206 int iUid; |
|
207 int iInputA; |
|
208 int iInputB; |
|
209 int iOutput; |
|
210 vector<TSDCEffectParameter> iParameters; |
|
211 }; |
|
212 |
|
213 struct TSDCScalableItemDef |
|
214 { |
|
215 TSDCIID iIID; |
|
216 TSDCIID iRefIID; |
|
217 int iInput; |
|
218 int iOutput; |
|
219 vector<TSDCEffectCommand> iCommands; |
|
220 int iRestriction; |
|
221 }; |
|
222 |
|
223 struct TSDCAnimParamGroup |
|
224 { |
|
225 int iValueA; |
|
226 int iValueB; |
|
227 vector<TSDCEffectParameter> iParameters; |
|
228 }; |
|
229 |
|
230 struct TSDCAnimationDef |
|
231 { |
|
232 TSDCIID iIID; |
|
233 int iInput; |
|
234 int iOutput; |
|
235 int iMinInterval; |
|
236 bool iMorphing; |
|
237 vector<TSDCEffectCommand> iPreprocessCommands; |
|
238 vector<TSDCEffectCommand> iAnimCommands; |
|
239 vector<TSDCAnimParamGroup> iValues; |
|
240 vector<TSDCAnimParamGroup> iTimingModels; |
|
241 vector<TSDCAnimParamGroup> iSizeBoundParams; |
|
242 int iRestriction; |
|
243 }; |
|
244 |
|
245 class CSDCData |
|
246 { |
|
247 public: |
|
248 CSDCData(); |
|
249 virtual ~CSDCData(); |
|
250 |
|
251 public: |
|
252 bool IsScalable(); |
|
253 |
|
254 public: |
|
255 bool IsDefined( const TSDCIID aIID ); |
|
256 bool IsDefined( const TSDCIID aIID, const int aRestriction ); |
|
257 |
|
258 public: |
|
259 void AppendNameEntry( const int aLanguageID, const wchar_t* aName ); |
|
260 void AppendTargetDeviceEntry( const wchar_t* aDeviceName ); |
|
261 |
|
262 public: |
|
263 bool HasMbmEntry( const TSDCColorDepth aColorDepth, const wchar_t* aFilename ); |
|
264 TSDCMBMEntry* FindMbmEntry( const TSDCColorDepth aColorDepth, const wchar_t* aFilename ); |
|
265 TSDCMBMEntry* AppendMbmEntry( const bool aSvg, |
|
266 const TSDCColorDepth aColorDepth, const wchar_t* aFilename, const bool aSvgAnim = false ); |
|
267 void SetBmpPath( const wchar_t* aPath ); |
|
268 |
|
269 public: |
|
270 void CreateBitmapDef( const TSDCIID aIID, const int aIndex, const int aMaskIndex, const TSDCImageAttributes aAttributes, const bool aAppIcon, const int aRestriction ); |
|
271 TSDCBitmapDef* GetBitmapDef( const TSDCIID aIID ); |
|
272 |
|
273 public: |
|
274 void CreateColorTableDef( const TSDCIID aIID, const vector<TSDCColorTableEntry> aColors, const int aRestriction ); |
|
275 |
|
276 public: |
|
277 void CreateFrameDef( const TSDCIID aIID, const vector<TSDCIID> aElements, const int aRestriction ); |
|
278 |
|
279 public: |
|
280 void CreateAppIconDef( const TSDCIID aIID, const vector<TSDCIID> aIcons, const int aRestriction ); |
|
281 |
|
282 public: |
|
283 void CreateBmpAnimDef( const TSDCIID aIID, const int aInterval, const int aPlayMode, const int aFlash, const vector<TSDCBmpAnimFrame> aFrames, const int aRestriction ); |
|
284 |
|
285 public: |
|
286 void CreateStringDef( const TSDCIID aIID, const wchar_t* aString, const int aRestriction ); |
|
287 |
|
288 public: |
|
289 void CreateScalableItemDef( const TSDCIID aIID, const int aInput, const int aOutput, const vector<TSDCEffectCommand> aCommands, const int aRestriction ); |
|
290 void CreateScalableItemRefDef( const TSDCIID aIID, const TSDCIID aRefIID, const int aRestriction ); |
|
291 |
|
292 public: |
|
293 void CreateAnimationDef( const TSDCIID aIID, const int aInput, const int aOutput, const int aMinInterval, |
|
294 const vector<TSDCEffectCommand> aPreprocessCommands, const vector<TSDCEffectCommand> aAnimCommands, |
|
295 const vector<TSDCAnimParamGroup> aValues, const vector<TSDCAnimParamGroup> aTimingModels, |
|
296 const vector<TSDCAnimParamGroup> aSizeBoundParams, const bool aMorphing, const int aRestriction ); |
|
297 |
|
298 private: |
|
299 bool CheckFile( const wchar_t* aPath , const wchar_t* aFileName ); |
|
300 |
|
301 public: |
|
302 TSDCPID iPid; |
|
303 int iSkinType; |
|
304 TSDCPID iAHOverridePid; |
|
305 TSDCPID iParentPid; |
|
306 TSDCPID iPalettePid; |
|
307 int iNextOwnMinor; |
|
308 int iProtection; |
|
309 wchar_t iAuthor[512]; |
|
310 wchar_t iCopyright[512]; |
|
311 wchar_t iTool[512]; |
|
312 int iCurrentRestriction; |
|
313 |
|
314 vector<TSDCNameEntry*> iNameVector; |
|
315 vector<TSDCMBMEntry*> iMbmVector; |
|
316 vector<TSDCBitmapDef*> iBitmapDefVector; |
|
317 vector<TSDCColorTableDef*> iColorTableDefVector; |
|
318 vector<TSDCFrameDef*> iFrameDefVector; |
|
319 vector<TSDCAppIconDef*> iAppIconDefVector; |
|
320 vector<TSDCBmpAnimDef*> iBmpAnimDefVector; |
|
321 vector<TSDCTargetDeviceEntry*> iTargetDeviceVector; |
|
322 vector<TSDCStringDef*> iStringDefVector; |
|
323 vector<TSDCScalableItemDef*> iScalableItemDefVector; |
|
324 vector<TSDCAnimationDef*> iAnimationDefVector; |
|
325 vector<int> iLanguageVector; |
|
326 |
|
327 wchar_t iBmpPath[512]; |
|
328 |
|
329 int iNextIconIndex; |
|
330 }; |
|
331 |
|
332 #endif // !defined(AFX_SDCDATA_H__67B83F2E_D9A5_4F97_B3DE_6C5F6F81C67D__INCLUDED_) |