|
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: Mifconv source file class. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef __MIFCONVSOURCEFILE_H__ |
|
20 #define __MIFCONVSOURCEFILE_H__ |
|
21 |
|
22 #include "mifconv.h" |
|
23 |
|
24 class MifConvSourceFile |
|
25 { |
|
26 public: |
|
27 |
|
28 /** |
|
29 * Default constructor |
|
30 */ |
|
31 MifConvSourceFile(); |
|
32 |
|
33 /** |
|
34 * Copy constructor |
|
35 */ |
|
36 MifConvSourceFile( const MifConvSourceFile& src ); |
|
37 |
|
38 /** |
|
39 * Destructor |
|
40 */ |
|
41 virtual ~MifConvSourceFile(); |
|
42 |
|
43 /** |
|
44 * Sets filename for the icon file |
|
45 * @param filename Source icon filename |
|
46 */ |
|
47 void SetFilename( const MifConvString& filename ); |
|
48 |
|
49 /** |
|
50 * Sets icon depth for the source file |
|
51 * @param depth Icon depth string. |
|
52 */ |
|
53 void SetDepthString( const MifConvString& depth); |
|
54 |
|
55 /** |
|
56 * Sets icon mask depth for the source file |
|
57 * @param depth Icon mask depth string. |
|
58 */ |
|
59 void SetMaskDepthString( const MifConvString& depth); |
|
60 |
|
61 /** |
|
62 * Specifies the animated flag for icon |
|
63 * @param isAnimated, true if the icon is animated, false otherwise |
|
64 */ |
|
65 void SetAnimated( bool isAnimated ); |
|
66 |
|
67 /** |
|
68 * Sets icon depth and mask depth parameters for the source file. Sets both string and enumeration values of |
|
69 * depth and mask depth parameters. |
|
70 * @param depthAndMask String containing the depth and mask as user has given them (e.g "/c8,8") |
|
71 */ |
|
72 void SetDepthAndMask( const MifConvString& depthAndMask ); |
|
73 |
|
74 /** |
|
75 * Returns source icon filename |
|
76 * @return Filename of the icon file |
|
77 */ |
|
78 const MifConvString& Filename() const; |
|
79 |
|
80 /** |
|
81 * Returns icon depth of the source file |
|
82 * @return Icon depth enumeration value. |
|
83 */ |
|
84 IconDepth Depth() const; |
|
85 |
|
86 /** |
|
87 * Sets icon depth of the source file |
|
88 * @param depth Icon depth enumeration value. |
|
89 */ |
|
90 void SetDepth(IconDepth depth); |
|
91 |
|
92 /** |
|
93 * Returns icon depth of the source file |
|
94 * @return Icon depth string |
|
95 */ |
|
96 const MifConvString& DepthString() const; |
|
97 |
|
98 /** |
|
99 * Returns icon depth of the mask file |
|
100 * @return Icon mask depth enumeration value. |
|
101 */ |
|
102 IconMaskDepth MaskDepth() const; |
|
103 |
|
104 /** |
|
105 * Sets icon depth of the mask file |
|
106 * @param depth Icon mask depth enumeration value. |
|
107 */ |
|
108 void SetMaskDepth(IconMaskDepth depth); |
|
109 |
|
110 /** |
|
111 * Returns icon depth of the mask file |
|
112 * @return Icon mask depth string |
|
113 */ |
|
114 const MifConvString& MaskDepthString() const; |
|
115 |
|
116 /** |
|
117 * Returns true if the icon is animated, otherwise false |
|
118 * @return <code>boolean</code> value specifying if the icon is animated. |
|
119 */ |
|
120 bool IsAnimated() const; |
|
121 |
|
122 /** |
|
123 * Returns the mask filename for the bmp file |
|
124 * @return Mask file name for the bitmap file. |
|
125 */ |
|
126 const MifConvString& BmpMaskFilename() const; |
|
127 |
|
128 /** |
|
129 * Sets mask filename. |
|
130 * @param maskFilename Mask filename |
|
131 */ |
|
132 void SetBmpMaskFilename( const MifConvString& maskFilename ); |
|
133 |
|
134 /** |
|
135 * Sets file content. |
|
136 * @param content Pointer to the data content array. |
|
137 * @param len Data content lenght |
|
138 */ |
|
139 void SetContent( char* content, unsigned int len ); |
|
140 |
|
141 /** |
|
142 * Returns data content of the file |
|
143 * @return Pointer to the data content array. See also ContentLength() -method. |
|
144 */ |
|
145 char* Content() const; |
|
146 |
|
147 /** |
|
148 * Returns data content length. |
|
149 * @return Length of the data content. |
|
150 */ |
|
151 int ContentLength() const; |
|
152 |
|
153 /** |
|
154 * Sets display mode for the source icon. |
|
155 * @param mode Display mode enumeration value. |
|
156 */ |
|
157 void SetDisplayMode( IconDisplayMode mode); |
|
158 |
|
159 /** |
|
160 * Returns display mode of the icon. |
|
161 * @return Display mode enumeration value. |
|
162 */ |
|
163 IconDisplayMode DisplayMode() const; |
|
164 |
|
165 /** |
|
166 * Sets display mode for the mask file. |
|
167 * @param mode Display mode enumeration value for the mask file. |
|
168 */ |
|
169 void SetMaskDisplayMode( IconDisplayMode mode); |
|
170 |
|
171 /** |
|
172 * Returns display mode of the mask file. |
|
173 * @return Display mode enumeration value of the mask file. |
|
174 */ |
|
175 IconDisplayMode MaskDisplayMode() const; |
|
176 |
|
177 protected: |
|
178 |
|
179 /** |
|
180 * Parses icon depth parameter from the user given argument string. If, for example, user |
|
181 * has given a string "/c8,8" as a depth and mask for the file, this function returns <code>IconDepth_c8</code> |
|
182 * @param depthAndMask String containing the depth and mask parameters for the source file. |
|
183 * @return Icon depth enumeration value |
|
184 */ |
|
185 IconDepth ParseIconDepth( const MifConvString& depthAndMask ); |
|
186 |
|
187 /** |
|
188 * Parses icon mask parameter from the user given argument string. If, for example, user |
|
189 * has given a string "/c8,8" as a depth and mask for the file, this function returns <code>IconMask_8</code> |
|
190 * @param depthAndMask String containing the depth and mask parameters for the source file. |
|
191 * @return Icon mask enumeration value |
|
192 */ |
|
193 IconMaskDepth ParseIconMaskDepth( const MifConvString& depthAndMask ); |
|
194 |
|
195 MifConvString iFilename; |
|
196 MifConvString iDepthString; |
|
197 MifConvString iMaskDepthString; |
|
198 IconDepth iDepth; |
|
199 IconMaskDepth iMaskDepth; |
|
200 IconDisplayMode iDisplayMode; |
|
201 IconDisplayMode iMaskDisplayMode; |
|
202 bool iAnimated; |
|
203 MifConvString iMaskFilename; |
|
204 char* iContent; |
|
205 unsigned int iContentLen; |
|
206 }; |
|
207 |
|
208 typedef std::vector<MifConvSourceFile> MifConvSourceFileList; |
|
209 |
|
210 #endif |