1 /* |
|
2 * Copyright (c) 2002-2005 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: bitmap db manager,which is used by drop down list |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef C_BITMAPDB_H |
|
20 #define C_BITMAPDB_H |
|
21 |
|
22 #include <e32base.h> |
|
23 #include <w32std.h> |
|
24 #include <barsread.h> |
|
25 #include <AknsUtils.h> |
|
26 |
|
27 /** |
|
28 * Bitmap db manager |
|
29 * |
|
30 * Bitmap db manager used by drop down list |
|
31 * |
|
32 * @lib FepCtrlDropdownList.lib |
|
33 * @since S60 v3.2 |
|
34 */ |
|
35 NONSHARABLE_CLASS(CBitmapDb) : public CBase |
|
36 { |
|
37 |
|
38 public: |
|
39 /** |
|
40 * bitmap type |
|
41 * |
|
42 * defines the types from bitmap database used by drop down list. |
|
43 * |
|
44 * @lib FepCtrlDropdownList.lib |
|
45 * @since S60 v3.2 |
|
46 */ |
|
47 enum TBitmapType |
|
48 { |
|
49 EBitmapListBg, |
|
50 |
|
51 EBitmapListBgMask, |
|
52 |
|
53 // the primary background bitmap |
|
54 EBitmapPrimary, |
|
55 |
|
56 // the primary Mask background bitmap |
|
57 EBitmapPrimaryMask, |
|
58 |
|
59 // the secondary background bitmap |
|
60 EBitmapSecondary, |
|
61 |
|
62 // the secondary Mask background bitmap |
|
63 EBitmapSecondaryMask, |
|
64 |
|
65 // the highlight cell background bitmap |
|
66 EBitmapHighlight, |
|
67 |
|
68 // the highlight cell Mask background bitmap |
|
69 EBitmapHighlightMask, |
|
70 |
|
71 // the pen down cell background bitmap |
|
72 EBitmapPenDown, |
|
73 |
|
74 // the pen down cell Mask background bitmap |
|
75 EBitmapPenDownMask, |
|
76 |
|
77 // disable bitmap for page down button |
|
78 EBitmapNextDisable, |
|
79 |
|
80 // disable mask bitmap for page down button |
|
81 EBitmapNextDisableMask, |
|
82 |
|
83 // bitmap for page down button |
|
84 EBitmapNext, |
|
85 |
|
86 // mask bitmap for page down button |
|
87 EBitmapNextMask, |
|
88 |
|
89 // pressed bitmap for page down button |
|
90 EBitmapNextPress, |
|
91 |
|
92 // pressed mask bitmap for page down button |
|
93 EBitmapNextPressMask, |
|
94 |
|
95 // bitmap for page close button |
|
96 EBitmapClose, |
|
97 |
|
98 // mask bitmap for page close button |
|
99 EBitmapCloseMask, |
|
100 |
|
101 // pressed bitmap for page close button |
|
102 EBitmapClosePress, |
|
103 |
|
104 // pressed mask bitmap for page close button |
|
105 EBitmapClosePressMask, |
|
106 |
|
107 // bitmap for page up button |
|
108 EBitmapPrevious, |
|
109 |
|
110 // mask bitmap for page up button |
|
111 EBitmapPreviousMask, |
|
112 |
|
113 // pressed bitmap for page up button |
|
114 EBitmapPreviousPress, |
|
115 |
|
116 // pressed mask bitmap for page up button |
|
117 EBitmapPreviousPressMask, |
|
118 EBitmapExpand, |
|
119 |
|
120 EBitmapExpandMask, |
|
121 |
|
122 EBitmapExpandPress, |
|
123 |
|
124 EBitmapExpandPressMask, |
|
125 |
|
126 EBitmapLastType = EBitmapExpandPressMask |
|
127 }; |
|
128 |
|
129 public: // Method |
|
130 |
|
131 /** |
|
132 * Create a object of CBitmapDb, static method |
|
133 * |
|
134 * @since S60 v3.2 |
|
135 * @param aReader resource reader which provide the bitmap(mask) id |
|
136 * @param aBitmapSize the size needed to set for the bitmap |
|
137 * @return CBitmapDb pointer. |
|
138 */ |
|
139 static CBitmapDb* NewL(TResourceReader& aReader, |
|
140 TSize aBitmapSize, |
|
141 TSize aExpandSize, |
|
142 TSize aSpinBtnSize); |
|
143 |
|
144 /** |
|
145 * Destructor |
|
146 * |
|
147 * @since S60 v3.2 |
|
148 */ |
|
149 virtual ~CBitmapDb(); |
|
150 |
|
151 /** |
|
152 * Get bitmap from the database |
|
153 * |
|
154 * @since S60 v3.2 |
|
155 * @param aType bitmap type |
|
156 * @return the destination bitmap, Null if can't find |
|
157 */ |
|
158 const CFbsBitmap* GetBitMap(const TBitmapType aType); |
|
159 |
|
160 void ConstructFromResourceL(TResourceReader& aReader, |
|
161 TSize aBitmapSize, |
|
162 TSize aExpandSize, |
|
163 TSize aSpinBtnSize); |
|
164 |
|
165 /** |
|
166 * Get text color of drop down list |
|
167 * |
|
168 * @since S60 v3.2 |
|
169 * @return Text color of drop down list |
|
170 */ |
|
171 const TRgb TextColor(); |
|
172 |
|
173 /** |
|
174 * Get frame color of drop down list |
|
175 * |
|
176 * @since S60 v3.2 |
|
177 * @return Frame color of drop down list |
|
178 */ |
|
179 const TRgb FrameColor(); |
|
180 |
|
181 static void CreateDimmedMaskL( CFbsBitmap*& aDimmedMask, |
|
182 const CFbsBitmap* aMask |
|
183 /*TScaleMode aScaleMode*/ ); |
|
184 |
|
185 void SizeChanged(TSize aSize); |
|
186 private: // Data |
|
187 |
|
188 /** |
|
189 * 2nd construct method |
|
190 * |
|
191 * @since S60 v3.2 |
|
192 * @param aReader resource reader which provide the bitmap(mask) id |
|
193 * @param aBitmapSize the size needed to set for the bitmap |
|
194 * @return None |
|
195 */ |
|
196 void ConstructL(TResourceReader& aReader, |
|
197 TSize aBitmapSize, |
|
198 TSize aExpandSize, |
|
199 TSize aSpinBtnSize); |
|
200 |
|
201 // txin |
|
202 void CreateIconL(const TDesC& aBmpFileName, |
|
203 TAknsItemID aId, |
|
204 CFbsBitmap** aBmp, |
|
205 CFbsBitmap** aMaskBmp, |
|
206 TInt aBmpId, |
|
207 TInt aMaskBmpId, |
|
208 TSize aSize, |
|
209 TBool aColorIcon); |
|
210 // end |
|
211 |
|
212 private: // Data |
|
213 |
|
214 /** |
|
215 * the bitmap array |
|
216 */ |
|
217 RPointerArray<CFbsBitmap> iBmpList; |
|
218 |
|
219 /** |
|
220 * the text color of drop down list |
|
221 */ |
|
222 TRgb iTextColor; |
|
223 |
|
224 /** |
|
225 * the frame color of drop down list |
|
226 */ |
|
227 TRgb iFrameColor; |
|
228 }; |
|
229 |
|
230 #endif // C_BITMAPDB_H |
|
231 |
|
232 // End Of File |
|