williamr@4
|
1 |
/*
|
williamr@4
|
2 |
* Copyright (c) 2002-2004 Nokia Corporation and/or its subsidiary(-ies).
|
williamr@4
|
3 |
* All rights reserved.
|
williamr@4
|
4 |
* This component and the accompanying materials are made available
|
williamr@4
|
5 |
* under the terms of "Eclipse Public License v1.0"
|
williamr@4
|
6 |
* which accompanies this distribution, and is available
|
williamr@4
|
7 |
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
|
williamr@4
|
8 |
*
|
williamr@4
|
9 |
* Initial Contributors:
|
williamr@4
|
10 |
* Nokia Corporation - initial contribution.
|
williamr@4
|
11 |
*
|
williamr@4
|
12 |
* Contributors:
|
williamr@4
|
13 |
*
|
williamr@4
|
14 |
* Description: Defines a public static utility class AknsUtils.
|
williamr@4
|
15 |
*
|
williamr@4
|
16 |
*/
|
williamr@4
|
17 |
|
williamr@4
|
18 |
|
williamr@4
|
19 |
#ifndef AKNSUTILS_H
|
williamr@4
|
20 |
#define AKNSUTILS_H
|
williamr@4
|
21 |
|
williamr@4
|
22 |
// INCLUDES
|
williamr@4
|
23 |
#include <AknsSkinInstance.h>
|
williamr@4
|
24 |
#include <apgicnfl.h>
|
williamr@4
|
25 |
#include <AknIconUtils.h>
|
williamr@4
|
26 |
|
williamr@4
|
27 |
// FORWARD DECLARATIONS
|
williamr@4
|
28 |
class CFbsBitmap;
|
williamr@4
|
29 |
class CAknsItemDef;
|
williamr@4
|
30 |
class CCoeControl;
|
williamr@4
|
31 |
class CGulIcon;
|
williamr@4
|
32 |
|
williamr@4
|
33 |
// TYPE DEFINITIONS
|
williamr@4
|
34 |
|
williamr@4
|
35 |
/**
|
williamr@4
|
36 |
* Type of the application icon.
|
williamr@4
|
37 |
*
|
williamr@4
|
38 |
* @since 2.8
|
williamr@4
|
39 |
*/
|
williamr@4
|
40 |
enum TAknsAppIconType
|
williamr@4
|
41 |
{
|
williamr@4
|
42 |
EAknsAppIconTypeList = 0,
|
williamr@4
|
43 |
EAknsAppIconTypeContext = 1,
|
williamr@4
|
44 |
EAknsAppIconType3D = 2
|
williamr@4
|
45 |
};
|
williamr@4
|
46 |
|
williamr@4
|
47 |
// CLASS DECLARATION
|
williamr@4
|
48 |
|
williamr@4
|
49 |
/**
|
williamr@4
|
50 |
* Static utility class to support AVKON SKINS common operations.
|
williamr@4
|
51 |
* AknsUtils provides utility method to initialize application skin support,
|
williamr@4
|
52 |
* retrieve current skin instance or data context, retrieve skin data
|
williamr@4
|
53 |
* items and to perform other skin-related tasks.
|
williamr@4
|
54 |
*
|
williamr@4
|
55 |
* This is a public static class with exported functions.
|
williamr@4
|
56 |
* The class is not intended for derivation outside the library.
|
williamr@4
|
57 |
*
|
williamr@4
|
58 |
* @lib AknSkins.lib
|
williamr@4
|
59 |
*
|
williamr@4
|
60 |
* @since 2.0
|
williamr@4
|
61 |
*/
|
williamr@4
|
62 |
class AknsUtils
|
williamr@4
|
63 |
{
|
williamr@4
|
64 |
|
williamr@4
|
65 |
public: // New functions - Creators
|
williamr@4
|
66 |
|
williamr@4
|
67 |
/**
|
williamr@4
|
68 |
* Initializes application skin support.
|
williamr@4
|
69 |
* Creates application skin instance. Method should be called once
|
williamr@4
|
70 |
* in the construction phase of application, before any other
|
williamr@4
|
71 |
* skin-related operations take place.
|
williamr@4
|
72 |
*
|
williamr@4
|
73 |
* @since 2.0
|
williamr@4
|
74 |
*
|
williamr@4
|
75 |
* @par Notes:
|
williamr@4
|
76 |
* The framework calls this method automatically for each
|
williamr@4
|
77 |
* application. Thus, a normal application does not need to
|
williamr@4
|
78 |
* call this method explicitly.
|
williamr@4
|
79 |
*
|
williamr@4
|
80 |
* @par Exceptions:
|
williamr@4
|
81 |
* - If allocation fails, function leaves with an error code.
|
williamr@4
|
82 |
*/
|
williamr@4
|
83 |
IMPORT_C static void InitSkinSupportL();
|
williamr@4
|
84 |
|
williamr@4
|
85 |
/**
|
williamr@4
|
86 |
* Creates data context suitable for a container.
|
williamr@4
|
87 |
* Constructs a new data context suitable for a container. Container
|
williamr@4
|
88 |
* should store the pointer and perform proper destruction when
|
williamr@4
|
89 |
* the lifetime of the container itself ends.
|
williamr@4
|
90 |
*
|
williamr@4
|
91 |
* @since 2.0
|
williamr@4
|
92 |
*
|
williamr@4
|
93 |
* @return Newly created data context. Ownership of the context object
|
williamr@4
|
94 |
* is transferred to the caller.
|
williamr@4
|
95 |
*/
|
williamr@4
|
96 |
IMPORT_C static MAknsDataContext* CreateDataContextForContainerL();
|
williamr@4
|
97 |
|
williamr@4
|
98 |
/**
|
williamr@4
|
99 |
* Constructs a new bitmap item definition object.
|
williamr@4
|
100 |
*
|
williamr@4
|
101 |
* @since 2.0
|
williamr@4
|
102 |
*
|
williamr@4
|
103 |
* @param aID Item ID of the item definition object to be created:
|
williamr@4
|
104 |
*
|
williamr@4
|
105 |
* @param aFile Filename of the MBM file.
|
williamr@4
|
106 |
*
|
williamr@4
|
107 |
* @param aIndex Index of the bitmap in the file.
|
williamr@4
|
108 |
*
|
williamr@4
|
109 |
* @return Newly constructed item definition object.
|
williamr@4
|
110 |
*
|
williamr@4
|
111 |
* @par Exceptions:
|
williamr@4
|
112 |
* If construction fails, the method leaves with an error code.
|
williamr@4
|
113 |
*/
|
williamr@4
|
114 |
IMPORT_C static CAknsItemDef* CreateBitmapItemDefL(
|
williamr@4
|
115 |
const TAknsItemID& aID, const TDesC& aFilename,
|
williamr@4
|
116 |
const TInt aIndex );
|
williamr@4
|
117 |
|
williamr@4
|
118 |
/**
|
williamr@4
|
119 |
* Constructs a new masked bitmap item definition object.
|
williamr@4
|
120 |
*
|
williamr@4
|
121 |
* @since 2.0
|
williamr@4
|
122 |
*
|
williamr@4
|
123 |
* @param aID Item ID of the item definition object to be created:
|
williamr@4
|
124 |
*
|
williamr@4
|
125 |
* @param aFile Filename of the MBM file.
|
williamr@4
|
126 |
*
|
williamr@4
|
127 |
* @param aIndex Index of the bitmap in the file.
|
williamr@4
|
128 |
*
|
williamr@4
|
129 |
* @param aIndex Index of the bitmap mask in the file.
|
williamr@4
|
130 |
*
|
williamr@4
|
131 |
* @return Newly constructed item definition object. Ownership of the
|
williamr@4
|
132 |
* object is transferred to the caller.
|
williamr@4
|
133 |
*
|
williamr@4
|
134 |
* @par Exceptions:
|
williamr@4
|
135 |
* If construction fails, the method leaves with an error code.
|
williamr@4
|
136 |
*/
|
williamr@4
|
137 |
IMPORT_C static CAknsItemDef* CreateMaskedBitmapItemDefL(
|
williamr@4
|
138 |
const TAknsItemID& aID, const TDesC& aFilename,
|
williamr@4
|
139 |
const TInt aIndex, const TInt aMaskIndex );
|
williamr@4
|
140 |
|
williamr@4
|
141 |
public: // New functions - Skin access
|
williamr@4
|
142 |
|
williamr@4
|
143 |
/**
|
williamr@4
|
144 |
* Returns pointer to current skin instance.
|
williamr@4
|
145 |
* Retrieves pointer to the current application skin instance singleton.
|
williamr@4
|
146 |
* If there is none, @c NULL value is returned.
|
williamr@4
|
147 |
*
|
williamr@4
|
148 |
* @since 2.0
|
williamr@4
|
149 |
*
|
williamr@4
|
150 |
* @return Pointer to current skin instance, or @c NULL if no skin
|
williamr@4
|
151 |
* support is available.
|
williamr@4
|
152 |
*/
|
williamr@4
|
153 |
IMPORT_C static MAknsSkinInstance* SkinInstance();
|
williamr@4
|
154 |
|
williamr@4
|
155 |
/**
|
williamr@4
|
156 |
* Returns pointer to current data context.
|
williamr@4
|
157 |
* If aMop parameter is specified, retrieves the nearest data context
|
williamr@4
|
158 |
* in control hierarchy. If none is found (or @c NULL parameter was
|
williamr@4
|
159 |
* given) returns root data context from skin instance. If there is
|
williamr@4
|
160 |
* no skin instance, @c NULL value is returned.
|
williamr@4
|
161 |
*
|
williamr@4
|
162 |
* @since 2.0
|
williamr@4
|
163 |
*
|
williamr@4
|
164 |
* @param aMop Object provider to be used to find the nearest data
|
williamr@4
|
165 |
* context. In most cases this should be a pointer to the calling
|
williamr@4
|
166 |
* @c CCoeControl. @c NULL value is also valid.
|
williamr@4
|
167 |
*
|
williamr@4
|
168 |
* @return Pointer to the nearest data context, or @c NULL if no
|
williamr@4
|
169 |
* skin support is available.
|
williamr@4
|
170 |
*/
|
williamr@4
|
171 |
IMPORT_C static MAknsDataContext* DataContext( MObjectProvider* aMop );
|
williamr@4
|
172 |
|
williamr@4
|
173 |
public: // New functions - Item access w/ fallback support
|
williamr@4
|
174 |
|
williamr@4
|
175 |
/**
|
williamr@4
|
176 |
* Constructs an independent masked bitmap with fallback support.
|
williamr@4
|
177 |
* Creates an independent (in terms of instance ownership) copy of a
|
williamr@4
|
178 |
* masked bitmap by the given item ID.
|
williamr@4
|
179 |
*
|
williamr@4
|
180 |
* If no matching item is found in the currently activate skin,
|
williamr@4
|
181 |
* attempts to construct the item using the given file.
|
williamr@4
|
182 |
*
|
williamr@4
|
183 |
* @since 2.6
|
williamr@4
|
184 |
*
|
williamr@4
|
185 |
* @lib AknSkins.lib
|
williamr@4
|
186 |
*
|
williamr@4
|
187 |
* @param aInstance Pointer to the current skin instance.
|
williamr@4
|
188 |
* Usually retrieved using @c AknsUtils::SkinInstance.
|
williamr@4
|
189 |
*
|
williamr@4
|
190 |
* @param aID Item ID of the masked bitmap to be created.
|
williamr@4
|
191 |
*
|
williamr@4
|
192 |
* @param aBitmap If method succeeds, set to point to the
|
williamr@4
|
193 |
* newly constructed bitmap. Ownership of the bitmap is transferred
|
williamr@4
|
194 |
* to the caller.
|
williamr@4
|
195 |
*
|
williamr@4
|
196 |
* @param aMask If method succeeds, set to point to the newly
|
williamr@4
|
197 |
* constructed mask bitmap. Ownership of the bitmap is transferred
|
williamr@4
|
198 |
* to the caller.
|
williamr@4
|
199 |
*
|
williamr@4
|
200 |
* @param aFilename Filename to be used to construct the item,
|
williamr@4
|
201 |
* if no matching item was found in the currently active skin.
|
williamr@4
|
202 |
*
|
williamr@4
|
203 |
* @param aFileBitmapId ID of the bitmap in the file.
|
williamr@4
|
204 |
* Used only if no matching item was found in the currently
|
williamr@4
|
205 |
* active skin.
|
williamr@4
|
206 |
*
|
williamr@4
|
207 |
* @param aFileMaskId ID of the mask in the file.
|
williamr@4
|
208 |
* Used only if no matching item was found in the currently
|
williamr@4
|
209 |
* active skin.
|
williamr@4
|
210 |
*
|
williamr@4
|
211 |
* @par Exceptions:
|
williamr@4
|
212 |
* If data construction fails or bitmap is not found, the function
|
williamr@4
|
213 |
* leaves with an error code.
|
williamr@4
|
214 |
*/
|
williamr@4
|
215 |
IMPORT_C static void CreateIconL(
|
williamr@4
|
216 |
MAknsSkinInstance* aInstance, const TAknsItemID& aID,
|
williamr@4
|
217 |
CFbsBitmap*& aBitmap, CFbsBitmap*& aMask,
|
williamr@4
|
218 |
const TDesC& aFilename,
|
williamr@4
|
219 |
const TInt aFileBitmapId, const TInt aFileMaskId );
|
williamr@4
|
220 |
|
williamr@4
|
221 |
/**
|
williamr@4
|
222 |
* Otherwise identical to CreateIconL, but leaves both the bitmaps
|
williamr@4
|
223 |
* in the cleanup stack.
|
williamr@4
|
224 |
* The order in which they are pushed into the stack and types of
|
williamr@4
|
225 |
* the items in the stack are both undefined.
|
williamr@4
|
226 |
*
|
williamr@4
|
227 |
* @copydoc AknsUtils::CreateIconL(MAknsSkinInstance*,TAknsItemID&,CFbsBitmap*&,CFbsBitmap*&,const TDesC&,const TInt,const TInt)
|
williamr@4
|
228 |
*
|
williamr@4
|
229 |
* @par Note:
|
williamr@4
|
230 |
* Since both the bitmaps are left in the cleanup stack,
|
williamr@4
|
231 |
* call to this method can not be enclosed in an immediate TRAP.
|
williamr@4
|
232 |
*/
|
williamr@4
|
233 |
IMPORT_C static void CreateIconLC(
|
williamr@4
|
234 |
MAknsSkinInstance* aInstance, const TAknsItemID& aID,
|
williamr@4
|
235 |
CFbsBitmap*& aBitmap, CFbsBitmap*& aMask,
|
williamr@4
|
236 |
const TDesC& aFilename,
|
williamr@4
|
237 |
const TInt aFileBitmapId, const TInt aFileMaskId );
|
williamr@4
|
238 |
|
williamr@4
|
239 |
/**
|
williamr@4
|
240 |
* Constructs an independent non-masked bitmap with fallback support.
|
williamr@4
|
241 |
* Creates an independent (in terms of instance ownership) copy of a
|
williamr@4
|
242 |
* non-masked bitmap by the given item ID.
|
williamr@4
|
243 |
*
|
williamr@4
|
244 |
* If no matching item is found in the currently activate skin,
|
williamr@4
|
245 |
* attempts to construct the item using the given file.
|
williamr@4
|
246 |
*
|
williamr@4
|
247 |
* @since 2.6
|
williamr@4
|
248 |
*
|
williamr@4
|
249 |
* @lib AknSkins.lib
|
williamr@4
|
250 |
*
|
williamr@4
|
251 |
* @param aInstance Pointer to the current skin instance.
|
williamr@4
|
252 |
* Usually retrieved using @c AknsUtils::SkinInstance.
|
williamr@4
|
253 |
*
|
williamr@4
|
254 |
* @param aID Item ID of the non-masked bitmap to be created.
|
williamr@4
|
255 |
*
|
williamr@4
|
256 |
* @param aBitmap If method succeeds, set to point to the
|
williamr@4
|
257 |
* newly constructed bitmap. Ownership of the bitmap is transferred
|
williamr@4
|
258 |
* to the caller.
|
williamr@4
|
259 |
*
|
williamr@4
|
260 |
* @param aFilename Filename to be used to construct the item,
|
williamr@4
|
261 |
* if no matching item was found in the currently active skin.
|
williamr@4
|
262 |
*
|
williamr@4
|
263 |
* @param aFileBitmapId ID of the bitmap in the file.
|
williamr@4
|
264 |
* Used only if no matching item was found in the currently
|
williamr@4
|
265 |
* active skin.
|
williamr@4
|
266 |
*
|
williamr@4
|
267 |
* @par Exceptions:
|
williamr@4
|
268 |
* If data construction fails or bitmap is not found, the function
|
williamr@4
|
269 |
* leaves with an error code.
|
williamr@4
|
270 |
*/
|
williamr@4
|
271 |
IMPORT_C static void CreateIconL(
|
williamr@4
|
272 |
MAknsSkinInstance* aInstance, const TAknsItemID& aID,
|
williamr@4
|
273 |
CFbsBitmap*& aBitmap,
|
williamr@4
|
274 |
const TDesC& aFilename,
|
williamr@4
|
275 |
const TInt aFileBitmapId );
|
williamr@4
|
276 |
|
williamr@4
|
277 |
/**
|
williamr@4
|
278 |
* Otherwise identical to CreateIconL, but leaves the bitmap
|
williamr@4
|
279 |
* in the cleanup stack.
|
williamr@4
|
280 |
* The type of the item pushed into the stack is undefined.
|
williamr@4
|
281 |
*
|
williamr@4
|
282 |
* @copydoc AknsUtils::CreateIconL(MAknsSkinInstance*,TAknsItemID&,CFbsBitmap*&,const TDesC&,const TInt)
|
williamr@4
|
283 |
*
|
williamr@4
|
284 |
* @par Note:
|
williamr@4
|
285 |
* Since the bitmap is left in the cleanup stack,
|
williamr@4
|
286 |
* call to this method can not be enclosed in an immediate TRAP.
|
williamr@4
|
287 |
*/
|
williamr@4
|
288 |
IMPORT_C static void CreateIconLC(
|
williamr@4
|
289 |
MAknsSkinInstance* aInstance, const TAknsItemID& aID,
|
williamr@4
|
290 |
CFbsBitmap*& aBitmap,
|
williamr@4
|
291 |
const TDesC& aFilename,
|
williamr@4
|
292 |
const TInt aFileBitmapId );
|
williamr@4
|
293 |
|
williamr@4
|
294 |
/**
|
williamr@4
|
295 |
* Constructs an independent masked bitmap with fallback support.
|
williamr@4
|
296 |
* Creates an independent (in terms of instance ownership) copy of a
|
williamr@4
|
297 |
* masked bitmap by the given item ID.
|
williamr@4
|
298 |
*
|
williamr@4
|
299 |
* If no matching item is found in the currently activate skin,
|
williamr@4
|
300 |
* attempts to construct the item using the given file.
|
williamr@4
|
301 |
*
|
williamr@4
|
302 |
* @since 2.6
|
williamr@4
|
303 |
*
|
williamr@4
|
304 |
* @lib AknSkins.lib
|
williamr@4
|
305 |
*
|
williamr@4
|
306 |
* @param aInstance Pointer to the current skin instance.
|
williamr@4
|
307 |
*
|
williamr@4
|
308 |
* @param aID Item ID of the masked bitmap to be created.
|
williamr@4
|
309 |
*
|
williamr@4
|
310 |
* @param aFilename Filename to be used to construct the item,
|
williamr@4
|
311 |
* if no matching item was found in the currently active skin.
|
williamr@4
|
312 |
*
|
williamr@4
|
313 |
* @param aFileIndex Index (for bitmap) in the file.
|
williamr@4
|
314 |
* Used only if no matching item was found in the currently
|
williamr@4
|
315 |
* active skin.
|
williamr@4
|
316 |
*
|
williamr@4
|
317 |
* @param aFileMaskIndex Index (for mask) in the file.
|
williamr@4
|
318 |
* Used only if no matching item was found in the currently
|
williamr@4
|
319 |
* active skin.
|
williamr@4
|
320 |
*
|
williamr@4
|
321 |
* @return Pointer to the newly created CApaMaskedBitmap object.
|
williamr@4
|
322 |
* Ownership of the object is transferred to the caller.
|
williamr@4
|
323 |
*
|
williamr@4
|
324 |
* @par Exceptions:
|
williamr@4
|
325 |
* If data construction fails or bitmap is not found, the function
|
williamr@4
|
326 |
* leaves with an error code.
|
williamr@4
|
327 |
*
|
williamr@4
|
328 |
* @par Note:
|
williamr@4
|
329 |
* Since @c CApaMaskedBitmap can not be used to store scalable
|
williamr@4
|
330 |
* graphics, consider using @c CreateIconLC instead.
|
williamr@4
|
331 |
*/
|
williamr@4
|
332 |
IMPORT_C static CApaMaskedBitmap* CreateMaskedBitmapL(
|
williamr@4
|
333 |
MAknsSkinInstance* aInstance, const TAknsItemID& aID,
|
williamr@4
|
334 |
const TDesC& aFilename,
|
williamr@4
|
335 |
const TInt aFileIndex, const TInt aFileMaskIndex );
|
williamr@4
|
336 |
|
williamr@4
|
337 |
/**
|
williamr@4
|
338 |
* Constructs an independent CGulIcon object with fallback support.
|
williamr@4
|
339 |
* Creates an independent (in terms of instance ownership) copy of a
|
williamr@4
|
340 |
* masked bitmap by the given item ID, and returns it as a
|
williamr@4
|
341 |
* newly constructed CGulIcon object.
|
williamr@4
|
342 |
*
|
williamr@4
|
343 |
* If no matching item is found in the currently active skin,
|
williamr@4
|
344 |
* attempts to construct the item using the given file.
|
williamr@4
|
345 |
*
|
williamr@4
|
346 |
* @since 2.6
|
williamr@4
|
347 |
*
|
williamr@4
|
348 |
* @lib AknSkins.lib
|
williamr@4
|
349 |
*
|
williamr@4
|
350 |
* @param aInstance Pointer to the current skin instance.
|
williamr@4
|
351 |
*
|
williamr@4
|
352 |
* @param aID Item ID of the masked bitmap to be created.
|
williamr@4
|
353 |
*
|
williamr@4
|
354 |
* @param aFilename Filename to be used to construct the item,
|
williamr@4
|
355 |
* if no matching item was found in the currently active skin.
|
williamr@4
|
356 |
*
|
williamr@4
|
357 |
* @param aFileIndex Index (for bitmap) in the file.
|
williamr@4
|
358 |
* Used only if no matching item was found in the currently
|
williamr@4
|
359 |
* active skin.
|
williamr@4
|
360 |
*
|
williamr@4
|
361 |
* @param aFileMaskIndex Index (for mask) in the file.
|
williamr@4
|
362 |
* Used only if no matching item was found in the currently
|
williamr@4
|
363 |
* active skin.
|
williamr@4
|
364 |
*
|
williamr@4
|
365 |
* @return Pointer to the newly created CGulIcon object.
|
williamr@4
|
366 |
* Ownership of the object is transferred to the caller.
|
williamr@4
|
367 |
*
|
williamr@4
|
368 |
* @par Exceptions:
|
williamr@4
|
369 |
* If data construction fails or bitmap is not found, the function
|
williamr@4
|
370 |
* leaves with an error code.
|
williamr@4
|
371 |
*/
|
williamr@4
|
372 |
IMPORT_C static CGulIcon* CreateGulIconL(
|
williamr@4
|
373 |
MAknsSkinInstance* aInstance, const TAknsItemID& aID,
|
williamr@4
|
374 |
const TDesC& aFilename,
|
williamr@4
|
375 |
const TInt aFileIndex, const TInt aFileMaskIndex );
|
williamr@4
|
376 |
|
williamr@4
|
377 |
/**
|
williamr@4
|
378 |
* Constructs an application icon supporting scalable graphics.
|
williamr@4
|
379 |
*
|
williamr@4
|
380 |
* This method is fallback-enabled. If no icon is found in the
|
williamr@4
|
381 |
* currently active skin, the application icon is retrieved using
|
williamr@4
|
382 |
* application resource file or AIF.
|
williamr@4
|
383 |
*
|
williamr@4
|
384 |
* After successful completion, the method leaves both the bitmaps
|
williamr@4
|
385 |
* in the cleanup stack.
|
williamr@4
|
386 |
* The order in which they are pushed into the stack and types of
|
williamr@4
|
387 |
* the items in the stack are both undefined.
|
williamr@4
|
388 |
*
|
williamr@4
|
389 |
* The caller must set the size of the returned bitmaps.
|
williamr@4
|
390 |
* See @c AknIconUtils for details.
|
williamr@4
|
391 |
*
|
williamr@4
|
392 |
* @par Note:
|
williamr@4
|
393 |
* Since both the bitmaps are left in the cleanup stack,
|
williamr@4
|
394 |
* call to this method can not be enclosed in an immediate TRAP.
|
williamr@4
|
395 |
*
|
williamr@4
|
396 |
* @since 2.8
|
williamr@4
|
397 |
*
|
williamr@4
|
398 |
* @lib AknSkins.lib
|
williamr@4
|
399 |
*
|
williamr@4
|
400 |
* @param aInstance Pointer to current skin instance.
|
williamr@4
|
401 |
*
|
williamr@4
|
402 |
* @param aAppUid Application UID. Icon is searched with major IID
|
williamr@4
|
403 |
* ::EAknsIIDMajorAppIcon and minor IID aAppUid.
|
williamr@4
|
404 |
*
|
williamr@4
|
405 |
* @param aType Type of the application icon (list or context).
|
williamr@4
|
406 |
* This parameter is tentative. If no icon of the given type
|
williamr@4
|
407 |
* is found, the other icon is returned. Only the following values
|
williamr@4
|
408 |
* are allowed: EAknsAppIconTypeList and EAknsAppIconTypeContext.
|
williamr@4
|
409 |
*
|
williamr@4
|
410 |
* @param aBitmap If method succeeds, set to point to the
|
williamr@4
|
411 |
* newly constructed bitmap. Ownership of the bitmap is transferred
|
williamr@4
|
412 |
* to the caller.
|
williamr@4
|
413 |
*
|
williamr@4
|
414 |
* @param aMask If method succeeds, set to point to the newly
|
williamr@4
|
415 |
* constructed mask bitmap. Ownership of the bitmap is transferred
|
williamr@4
|
416 |
* to the caller.
|
williamr@4
|
417 |
*
|
williamr@4
|
418 |
* @par Exceptions:
|
williamr@4
|
419 |
* If the method fails, it leaves with a standard error code.
|
williamr@4
|
420 |
*/
|
williamr@4
|
421 |
IMPORT_C static void CreateAppIconLC(
|
williamr@4
|
422 |
MAknsSkinInstance* aInstance, TUid aAppUid,
|
williamr@4
|
423 |
TAknsAppIconType aType,
|
williamr@4
|
424 |
CFbsBitmap*& aBitmap, CFbsBitmap*& aMask );
|
williamr@4
|
425 |
|
williamr@4
|
426 |
/**
|
williamr@4
|
427 |
* Opens the file containing application icon data.
|
williamr@4
|
428 |
*
|
williamr@4
|
429 |
* This method first checks whether there is a data file of the given
|
williamr@4
|
430 |
* type associated with the application icon of the given UID. If no
|
williamr@4
|
431 |
* file is found, an error code is returned and the caller should use
|
williamr@4
|
432 |
* @c CreateAppIconLC to construct the icon. Otherwise, one of the
|
williamr@4
|
433 |
* associated files is opened using the given @c RFile object.
|
williamr@4
|
434 |
*
|
williamr@4
|
435 |
* @since 3.0
|
williamr@4
|
436 |
*
|
williamr@4
|
437 |
* @lib AknSkins.lib
|
williamr@4
|
438 |
*
|
williamr@4
|
439 |
* @param aInstance Pointer to current skin instance.
|
williamr@4
|
440 |
*
|
williamr@4
|
441 |
* @param aAppUid Application UID. Icon is searched with major IID
|
williamr@4
|
442 |
* ::EAknsIIDMajorAppIcon and minor IID aAppUid.
|
williamr@4
|
443 |
*
|
williamr@4
|
444 |
* @param aType Only EAknsAppIconType3D is allowed.
|
williamr@4
|
445 |
*
|
williamr@4
|
446 |
* @param aFile Reference to a @c RFile. If @c KErrNone is returned,
|
williamr@4
|
447 |
* this handle refers to an open file containing the data.
|
williamr@4
|
448 |
* If an error code is returned, the file is not opened.
|
williamr@4
|
449 |
*
|
williamr@4
|
450 |
* @return @c KErrNone if a file was opened, an error code otherwise.
|
williamr@4
|
451 |
*/
|
williamr@4
|
452 |
IMPORT_C TInt OpenAppIconFile(
|
williamr@4
|
453 |
MAknsSkinInstance* aInstance, TUid aAppUid,
|
williamr@4
|
454 |
TAknsAppIconType aType, RFile& aFile );
|
williamr@4
|
455 |
|
williamr@4
|
456 |
/**
|
williamr@4
|
457 |
* Constructs an independent masked color-customized icon with
|
williamr@4
|
458 |
* fallback support without setting its size.
|
williamr@4
|
459 |
*
|
williamr@4
|
460 |
* Creates an independent (in terms of instance ownership) copy of a
|
williamr@4
|
461 |
* masked bitmap by the given item ID and applies color-based
|
williamr@4
|
462 |
* skinning to it.
|
williamr@4
|
463 |
*
|
williamr@4
|
464 |
* This method:
|
williamr@4
|
465 |
* - Creates a masked bitmap item from skin, or from the given
|
williamr@4
|
466 |
* MBM or MIF file if no matching item is found in the active skin.
|
williamr@4
|
467 |
* - If the icon can be color-skinned, applies the color retrieved
|
williamr@4
|
468 |
* from the given color table and index. If no color information
|
williamr@4
|
469 |
* is found in the active skin, uses the given fallback color value.
|
williamr@4
|
470 |
* - Returns the resulting bitmaps. If no color skinning was applied,
|
williamr@4
|
471 |
* returns the original bitmaps.
|
williamr@4
|
472 |
*
|
williamr@4
|
473 |
* The method fails only, if the masked bitmap can not be constructed
|
williamr@4
|
474 |
* at all. If the icon can not be color-skinned, it is returned as-is.
|
williamr@4
|
475 |
*
|
williamr@4
|
476 |
* @since 2.6
|
williamr@4
|
477 |
*
|
williamr@4
|
478 |
* @lib AknSkins.lib
|
williamr@4
|
479 |
*
|
williamr@4
|
480 |
* @param aInstance Pointer to the current skin instance.
|
williamr@4
|
481 |
* Usually retrieved using @c AknsUtils::SkinInstance.
|
williamr@4
|
482 |
*
|
williamr@4
|
483 |
* @param aID Item ID of the masked bitmap to be created.
|
williamr@4
|
484 |
*
|
williamr@4
|
485 |
* @param aColorID Item ID of the color table.
|
williamr@4
|
486 |
*
|
williamr@4
|
487 |
* @param aColorIndex Index in the color table.
|
williamr@4
|
488 |
*
|
williamr@4
|
489 |
* @param aBitmap If method succeeds, set to point to the
|
williamr@4
|
490 |
* newly constructed bitmap. Ownership of the bitmap is transferred
|
williamr@4
|
491 |
* to the caller.
|
williamr@4
|
492 |
*
|
williamr@4
|
493 |
* @param aMask If method succeeds, set to point to the newly
|
williamr@4
|
494 |
* constructed mask bitmap. Ownership of the bitmap is transferred
|
williamr@4
|
495 |
* to the caller.
|
williamr@4
|
496 |
*
|
williamr@4
|
497 |
* @param aFilename Filename to be used to construct the item,
|
williamr@4
|
498 |
* if no matching item was found in the currently active skin.
|
williamr@4
|
499 |
*
|
williamr@4
|
500 |
* @param aFileBitmapId ID of the bitmap in the file.
|
williamr@4
|
501 |
* Used only if no matching item was found in the currently
|
williamr@4
|
502 |
* active skin.
|
williamr@4
|
503 |
*
|
williamr@4
|
504 |
* @param aFileMaskId ID of the mask in the file.
|
williamr@4
|
505 |
* Used only if no matching item was found in the currently
|
williamr@4
|
506 |
* active skin.
|
williamr@4
|
507 |
*
|
williamr@4
|
508 |
* @param aDefaultColor Color RGB value to be used, if no color
|
williamr@4
|
509 |
* is found in the currently active skin.
|
williamr@4
|
510 |
*
|
williamr@4
|
511 |
* @par Exceptions:
|
williamr@4
|
512 |
* If data construction fails or bitmap is not found, the function
|
williamr@4
|
513 |
* leaves with an error code.
|
williamr@4
|
514 |
*/
|
williamr@4
|
515 |
IMPORT_C static void CreateColorIconL(
|
williamr@4
|
516 |
MAknsSkinInstance* aInstance, const TAknsItemID& aID,
|
williamr@4
|
517 |
const TAknsItemID& aColorID, const TInt aColorIndex,
|
williamr@4
|
518 |
CFbsBitmap*& aBitmap, CFbsBitmap*& aMask,
|
williamr@4
|
519 |
const TDesC& aFilename,
|
williamr@4
|
520 |
const TInt aFileBitmapId, const TInt aFileMaskId,
|
williamr@4
|
521 |
const TRgb aDefaultColor );
|
williamr@4
|
522 |
|
williamr@4
|
523 |
/**
|
williamr@4
|
524 |
* Otherwise identical to @c CreateColorIconL, but leaves both the
|
williamr@4
|
525 |
* bitmap and the mask in the cleanup stack.
|
williamr@4
|
526 |
* The order in which they are pushed into the stack and types of
|
williamr@4
|
527 |
* the items in the stack are both undefined.
|
williamr@4
|
528 |
*
|
williamr@4
|
529 |
* @since 2.6
|
williamr@4
|
530 |
*
|
williamr@4
|
531 |
* @lib AknSkins.lib
|
williamr@4
|
532 |
*
|
williamr@4
|
533 |
* @par Note:
|
williamr@4
|
534 |
* Since two bitmaps are left in the cleanup stack,
|
williamr@4
|
535 |
* call to this method can not be enclosed in an immediate TRAP.
|
williamr@4
|
536 |
*/
|
williamr@4
|
537 |
IMPORT_C static void CreateColorIconLC(
|
williamr@4
|
538 |
MAknsSkinInstance* aInstance, const TAknsItemID& aID,
|
williamr@4
|
539 |
const TAknsItemID& aColorID, const TInt aColorIndex,
|
williamr@4
|
540 |
CFbsBitmap*& aBitmap, CFbsBitmap*& aMask,
|
williamr@4
|
541 |
const TDesC& aFilename,
|
williamr@4
|
542 |
const TInt aFileBitmapId, const TInt aFileMaskId,
|
williamr@4
|
543 |
const TRgb aDefaultColor );
|
williamr@4
|
544 |
|
williamr@4
|
545 |
/**
|
williamr@4
|
546 |
* Otherwise identical to @c CreateColorIconL without size parameters,
|
williamr@4
|
547 |
* but calls @c SetSize to set the size of the resulting icon.
|
williamr@4
|
548 |
*
|
williamr@4
|
549 |
* @since 2.8
|
williamr@4
|
550 |
*
|
williamr@4
|
551 |
* @lib AknSkins.lib
|
williamr@4
|
552 |
*/
|
williamr@4
|
553 |
IMPORT_C static void CreateColorIconL(
|
williamr@4
|
554 |
MAknsSkinInstance* aInstance, const TAknsItemID& aID,
|
williamr@4
|
555 |
const TAknsItemID& aColorID, const TInt aColorIndex,
|
williamr@4
|
556 |
CFbsBitmap*& aBitmap, CFbsBitmap*& aMask,
|
williamr@4
|
557 |
const TDesC& aFilename,
|
williamr@4
|
558 |
const TInt aFileBitmapId, const TInt aFileMaskId,
|
williamr@4
|
559 |
const TRgb aDefaultColor,
|
williamr@4
|
560 |
const TSize& aSize, const TScaleMode aScaleMode );
|
williamr@4
|
561 |
|
williamr@4
|
562 |
/**
|
williamr@4
|
563 |
* Otherwise identical to @c CreateColorIconL, but leaves both the
|
williamr@4
|
564 |
* bitmap and the mask in the cleanup stack.
|
williamr@4
|
565 |
* The order in which they are pushed into the stack and types of
|
williamr@4
|
566 |
* the items in the stack are both undefined.
|
williamr@4
|
567 |
*
|
williamr@4
|
568 |
* @since 2.8
|
williamr@4
|
569 |
*
|
williamr@4
|
570 |
* @lib AknSkins.lib
|
williamr@4
|
571 |
*
|
williamr@4
|
572 |
* @par Note:
|
williamr@4
|
573 |
* Since two bitmaps are left in the cleanup stack,
|
williamr@4
|
574 |
* call to this method can not be enclosed in an immediate TRAP.
|
williamr@4
|
575 |
*/
|
williamr@4
|
576 |
IMPORT_C static void CreateColorIconLC(
|
williamr@4
|
577 |
MAknsSkinInstance* aInstance, const TAknsItemID& aID,
|
williamr@4
|
578 |
const TAknsItemID& aColorID, const TInt aColorIndex,
|
williamr@4
|
579 |
CFbsBitmap*& aBitmap, CFbsBitmap*& aMask,
|
williamr@4
|
580 |
const TDesC& aFilename,
|
williamr@4
|
581 |
const TInt aFileBitmapId, const TInt aFileMaskId,
|
williamr@4
|
582 |
const TRgb aDefaultColor,
|
williamr@4
|
583 |
const TSize& aSize, const TScaleMode aScaleMode );
|
williamr@4
|
584 |
|
williamr@4
|
585 |
public: // New functions - Item access w/o support for scalable graphics
|
williamr@4
|
586 |
|
williamr@4
|
587 |
/**
|
williamr@4
|
588 |
* Constructs an application icon. Icon bitmaps are duplicated to the
|
williamr@4
|
589 |
* given CApaMaskedBitmap object.
|
williamr@4
|
590 |
*
|
williamr@4
|
591 |
* Since Series 60 Release 2.6, this method is fallback-enabled.
|
williamr@4
|
592 |
* If no icon is found in the currently active skin, it uses
|
williamr@4
|
593 |
* AppArch to construct the icon.
|
williamr@4
|
594 |
*
|
williamr@4
|
595 |
* @since 2.0
|
williamr@4
|
596 |
*
|
williamr@4
|
597 |
* @param aInstance Pointer to current skin instance.
|
williamr@4
|
598 |
*
|
williamr@4
|
599 |
* @param aAppUid Application UID. Icon is searched with major IID
|
williamr@4
|
600 |
* ::EAknsIIDMajorAppIcon and minor IID aAppUid. AppArch search
|
williamr@4
|
601 |
* is always performed with UID only.
|
williamr@4
|
602 |
*
|
williamr@4
|
603 |
* @param aSize Maximum size of the icon.
|
williamr@4
|
604 |
*
|
williamr@4
|
605 |
* @param aAppBitmap On return contains the icon.
|
williamr@4
|
606 |
*
|
williamr@4
|
607 |
* @return KErrNone if succeeded, KErrNotFound if no icon was found
|
williamr@4
|
608 |
* or size requirements were not met, other error code if
|
williamr@4
|
609 |
* another error occured.
|
williamr@4
|
610 |
*
|
williamr@4
|
611 |
* @par Note:
|
williamr@4
|
612 |
* This method does not support scalable graphics.
|
williamr@4
|
613 |
* Consider using @c CreateAppIconLC instead.
|
williamr@4
|
614 |
*/
|
williamr@4
|
615 |
IMPORT_C static TInt GetAppIcon(
|
williamr@4
|
616 |
MAknsSkinInstance* aInstance, TUid aAppUid, TSize aSize,
|
williamr@4
|
617 |
CApaMaskedBitmap& aAppBitmap );
|
williamr@4
|
618 |
|
williamr@4
|
619 |
public: // New functions - Item access w/ ownership
|
williamr@4
|
620 |
|
williamr@4
|
621 |
/**
|
williamr@4
|
622 |
* Constructs an independent bitmap.
|
williamr@4
|
623 |
* Creates an independent copy of bitmap (in terms of instance ownership)
|
williamr@4
|
624 |
* by given item ID.
|
williamr@4
|
625 |
*
|
williamr@4
|
626 |
* @since 2.0
|
williamr@4
|
627 |
*
|
williamr@4
|
628 |
* @param aInstance Pointer to current skin instance.
|
williamr@4
|
629 |
*
|
williamr@4
|
630 |
* @param aID Item ID of the bitmap to be created.
|
williamr@4
|
631 |
*
|
williamr@4
|
632 |
* @return Pointer to the newly created bitmap. Ownership of the object
|
williamr@4
|
633 |
* is transferred to the caller.
|
williamr@4
|
634 |
*
|
williamr@4
|
635 |
* @par Exceptions:
|
williamr@4
|
636 |
* - If data construction fails or bitmap is not found, function
|
williamr@4
|
637 |
* leaves with an error code.
|
williamr@4
|
638 |
*/
|
williamr@4
|
639 |
IMPORT_C static CFbsBitmap* CreateBitmapL(
|
williamr@4
|
640 |
MAknsSkinInstance* aInstance, const TAknsItemID& aID );
|
williamr@4
|
641 |
|
williamr@4
|
642 |
/**
|
williamr@4
|
643 |
* Constructs an independent masked bitmap.
|
williamr@4
|
644 |
* Creates an independent (in terms of instance ownership) copy of a
|
williamr@4
|
645 |
* masked bitmap by the given item ID.
|
williamr@4
|
646 |
*
|
williamr@4
|
647 |
* Alternatively, masked bitmaps can be retrieved by using
|
williamr@4
|
648 |
* @c MAknsSkinInstance::GetCachedItemData(TAknsItemID,TAknsItemType)
|
williamr@4
|
649 |
* or
|
williamr@4
|
650 |
* @c MAknsSkinInstance::CreateUncachedItemDataL(TAknsItemID,TAknsItemType)
|
williamr@4
|
651 |
* methods. For these, @c ::EAknsITMaskedBitmap should be given as the
|
williamr@4
|
652 |
* second parameter. Returned @c CAknsItemData pointer can be casted
|
williamr@4
|
653 |
* to a @c CAknsMaskedBitmapItemData pointer in order to get access
|
williamr@4
|
654 |
* to the bitmap objects themselves.
|
williamr@4
|
655 |
*
|
williamr@4
|
656 |
* @par Note:
|
williamr@4
|
657 |
* This method does not have fallback support (to load the bitmap from
|
williamr@4
|
658 |
* the specified file in case it is not available in the current
|
williamr@4
|
659 |
* skin). Consider using one of the fallback-enabled overloads
|
williamr@4
|
660 |
* instead.
|
williamr@4
|
661 |
*
|
williamr@4
|
662 |
* @since 2.0
|
williamr@4
|
663 |
*
|
williamr@4
|
664 |
* @param aInstance Pointer to the current skin instance.
|
williamr@4
|
665 |
*
|
williamr@4
|
666 |
* @param aID Item ID of the masked bitmap to be created.
|
williamr@4
|
667 |
*
|
williamr@4
|
668 |
* @return Pointer to the newly created CApaMaskedBitmap object.
|
williamr@4
|
669 |
* Ownership of the object is transferred to the caller.
|
williamr@4
|
670 |
*
|
williamr@4
|
671 |
* @par Exceptions:
|
williamr@4
|
672 |
* If data construction fails or bitmap is not found, the function
|
williamr@4
|
673 |
* leaves with an error code.
|
williamr@4
|
674 |
*
|
williamr@4
|
675 |
* @par Note:
|
williamr@4
|
676 |
* Since @c CApaMaskedBitmap can not be used to store scalable
|
williamr@4
|
677 |
* graphics, consider using @c CreateIconLC instead.
|
williamr@4
|
678 |
*/
|
williamr@4
|
679 |
IMPORT_C static CApaMaskedBitmap* CreateMaskedBitmapL(
|
williamr@4
|
680 |
MAknsSkinInstance* aInstance, const TAknsItemID& aID );
|
williamr@4
|
681 |
|
williamr@4
|
682 |
/**
|
williamr@4
|
683 |
* Constructs an independent CGulIcon object.
|
williamr@4
|
684 |
* Creates an independent (in terms of instance ownership) copy of a
|
williamr@4
|
685 |
* bitmap or a masked bitmap by the given item ID, and returns it as a
|
williamr@4
|
686 |
* newly constructed CGulIcon object.
|
williamr@4
|
687 |
*
|
williamr@4
|
688 |
* @par Note:
|
williamr@4
|
689 |
* This method does not have fallback support (to load the bitmap from
|
williamr@4
|
690 |
* the specified file in case it is not available in the current
|
williamr@4
|
691 |
* skin). Consider using one of the fallback-enabled overloads
|
williamr@4
|
692 |
* instead.
|
williamr@4
|
693 |
*
|
williamr@4
|
694 |
* @since 2.1
|
williamr@4
|
695 |
*
|
williamr@4
|
696 |
* @lib AknSkins.lib
|
williamr@4
|
697 |
*
|
williamr@4
|
698 |
* @param aInstance Pointer to the current skin instance.
|
williamr@4
|
699 |
*
|
williamr@4
|
700 |
* @param aID Item ID of the bitmap or masked bitmap to be created.
|
williamr@4
|
701 |
*
|
williamr@4
|
702 |
* @param aRequireMask ETrue if masked bitmap is explicitly required.
|
williamr@4
|
703 |
* EFalse if mask is optional.
|
williamr@4
|
704 |
*
|
williamr@4
|
705 |
* @return Pointer to the newly created CGulIcon object.
|
williamr@4
|
706 |
* Ownership of the object is transferred to the caller.
|
williamr@4
|
707 |
*
|
williamr@4
|
708 |
* @par Exceptions:
|
williamr@4
|
709 |
* If data construction fails or bitmap is not found, the function
|
williamr@4
|
710 |
* leaves with an error code.
|
williamr@4
|
711 |
*/
|
williamr@4
|
712 |
IMPORT_C static CGulIcon* CreateGulIconL(
|
williamr@4
|
713 |
MAknsSkinInstance* aInstance, const TAknsItemID& aID,
|
williamr@4
|
714 |
const TBool aRequireMask );
|
williamr@4
|
715 |
|
williamr@4
|
716 |
public: // New functions - Item access w/o ownership
|
williamr@4
|
717 |
|
williamr@4
|
718 |
/**
|
williamr@4
|
719 |
* Returns pointer to a cached bitmap.
|
williamr@4
|
720 |
* Retrieves (and constructs if necessary) a bitmap in skin instance
|
williamr@4
|
721 |
* cache. Caller can use the bitmap temporarily (e.g. in drawing code),
|
williamr@4
|
722 |
* but should not store pointer to it, since its lifetime is determined
|
williamr@4
|
723 |
* by cache.
|
williamr@4
|
724 |
*
|
williamr@4
|
725 |
* @since 2.0
|
williamr@4
|
726 |
*
|
williamr@4
|
727 |
* @param aInstance Pointer to current skin instance. If @c NULL value
|
williamr@4
|
728 |
* is specified, method immediately returns with @c NULL return value.
|
williamr@4
|
729 |
*
|
williamr@4
|
730 |
* @param aID Item ID of the bitmap to be retrieved.
|
williamr@4
|
731 |
*
|
williamr@4
|
732 |
* @return Pointer to the bitmap, or @c NULL if no bitmap with given ID
|
williamr@4
|
733 |
* was found or an error occured.
|
williamr@4
|
734 |
*
|
williamr@4
|
735 |
* @par Exceptions:
|
williamr@4
|
736 |
* - Because the method can not leave, error handling procedure
|
williamr@4
|
737 |
* described in
|
williamr@4
|
738 |
* MAknsSkinInstance::GetCachedItemData(const TAknsItemID& aID) is
|
williamr@4
|
739 |
* used if data construction fails.
|
williamr@4
|
740 |
*/
|
williamr@4
|
741 |
IMPORT_C static CFbsBitmap* GetCachedBitmap(
|
williamr@4
|
742 |
MAknsSkinInstance* aInstance, const TAknsItemID& aID );
|
williamr@4
|
743 |
|
williamr@4
|
744 |
/**
|
williamr@4
|
745 |
* Retrieves temporary pointers to a cached bitmap and its mask.
|
williamr@4
|
746 |
* Retrieves (and constructs, if necessary) a masked bitmap in the skin
|
williamr@4
|
747 |
* instance cache. Pointers to the bitmap (and its mask) are stored
|
williamr@4
|
748 |
* to the pointers given as parameters. Caller can use the bitmaps
|
williamr@4
|
749 |
* temporarily (e.g. in drawing code), but should not store them, since
|
williamr@4
|
750 |
* their lifetimes are determined by the cache.
|
williamr@4
|
751 |
*
|
williamr@4
|
752 |
* @since 2.1
|
williamr@4
|
753 |
*
|
williamr@4
|
754 |
* @param aInstance Pointer to the current skin instance. If @c NULL
|
williamr@4
|
755 |
* value is specified, the method assigns @c NULL to both the given
|
williamr@4
|
756 |
* pointers and then returns.
|
williamr@4
|
757 |
*
|
williamr@4
|
758 |
* @param aID Item ID of the bitmap (or masked bitmap) to be retrieved.
|
williamr@4
|
759 |
*
|
williamr@4
|
760 |
* @param aBitmap Reference to the pointer that will receive the bitmap.
|
williamr@4
|
761 |
* @c NULL value is assigned if no bitmap with the given ID was found
|
williamr@4
|
762 |
* or an error occured.
|
williamr@4
|
763 |
*
|
williamr@4
|
764 |
* @param aMask Reference to the pointer that will receive the mask.
|
williamr@4
|
765 |
* @c NULL value is assigned if no bitmap with the given ID was found,
|
williamr@4
|
766 |
* or the bitmap did not have a mask, or an error occured.
|
williamr@4
|
767 |
*
|
williamr@4
|
768 |
* @par Exceptions:
|
williamr@4
|
769 |
* - Because the method can not leave, error handling procedure
|
williamr@4
|
770 |
* described in
|
williamr@4
|
771 |
* MAknsSkinInstance::GetCachedItemData(const TAknsItemID& aID) is
|
williamr@4
|
772 |
* used if data construction fails.
|
williamr@4
|
773 |
*/
|
williamr@4
|
774 |
IMPORT_C static void GetCachedMaskedBitmap(
|
williamr@4
|
775 |
MAknsSkinInstance* aInstance, const TAknsItemID& aID,
|
williamr@4
|
776 |
CFbsBitmap*& aBitmap, CFbsBitmap*& aMask );
|
williamr@4
|
777 |
|
williamr@4
|
778 |
/**
|
williamr@4
|
779 |
* Returns a color value from a cached color table.
|
williamr@4
|
780 |
* Retrieves (and constructs if necessary) a color table in
|
williamr@4
|
781 |
* skin instance cache and returns a color value from it.
|
williamr@4
|
782 |
*
|
williamr@4
|
783 |
* Since release 2.8, this method also handles any backward
|
williamr@4
|
784 |
* compatibility operations possibly required.
|
williamr@4
|
785 |
*
|
williamr@4
|
786 |
* @since 2.0
|
williamr@4
|
787 |
*
|
williamr@4
|
788 |
* @param aInstance Pointer to current skin instance. If @c NULL value
|
williamr@4
|
789 |
* is specified, returns KErrNotSupported.
|
williamr@4
|
790 |
*
|
williamr@4
|
791 |
* @param aRgb Reference to a TRgb that will receive the color.
|
williamr@4
|
792 |
*
|
williamr@4
|
793 |
* @param aID Item ID of the color table.
|
williamr@4
|
794 |
*
|
williamr@4
|
795 |
* @param aIndex Index of the color in the color table.
|
williamr@4
|
796 |
*
|
williamr@4
|
797 |
* @return KErrNone if successful, otherwise an error code is returned.
|
williamr@4
|
798 |
*/
|
williamr@4
|
799 |
IMPORT_C static TInt GetCachedColor(
|
williamr@4
|
800 |
MAknsSkinInstance* aInstance, TRgb& aRgb, const TAknsItemID& aID,
|
williamr@4
|
801 |
const TInt aIndex );
|
williamr@4
|
802 |
|
williamr@4
|
803 |
/**
|
williamr@4
|
804 |
* Retrieves the value of the given boolean property skin item.
|
williamr@4
|
805 |
*
|
williamr@4
|
806 |
* @since 2.8
|
williamr@4
|
807 |
*
|
williamr@4
|
808 |
* @param aInstance Pointer to current skin instance. If @c NULL value
|
williamr@4
|
809 |
* is specified, the method leaves.
|
williamr@4
|
810 |
*
|
williamr@4
|
811 |
* @param aID Item ID of the boolean property.
|
williamr@4
|
812 |
*
|
williamr@4
|
813 |
* @return Value of the boolean property as @c TBool.
|
williamr@4
|
814 |
*
|
williamr@4
|
815 |
* @par Exceptions:
|
williamr@4
|
816 |
* - If the item is not found, leaves with @c KErrNotFound.
|
williamr@4
|
817 |
* - If the item is not a boolean property or another error occures,
|
williamr@4
|
818 |
* leaves with a system-wide error code.
|
williamr@4
|
819 |
*/
|
williamr@4
|
820 |
IMPORT_C static TBool BooleanPropertyL( MAknsSkinInstance* aInstance,
|
williamr@4
|
821 |
const TAknsItemID& aID );
|
williamr@4
|
822 |
|
williamr@4
|
823 |
/**
|
williamr@4
|
824 |
* Test whether the given type is derived from the given base type.
|
williamr@4
|
825 |
*
|
williamr@4
|
826 |
* @since 2.0
|
williamr@4
|
827 |
*
|
williamr@4
|
828 |
* @param aBaseType Base type.
|
williamr@4
|
829 |
*
|
williamr@4
|
830 |
* @param aDerivedType Derived type.
|
williamr@4
|
831 |
*
|
williamr@4
|
832 |
* @return ETrue if the type is derived from the base type, EFalse
|
williamr@4
|
833 |
* otherwise.
|
williamr@4
|
834 |
*
|
williamr@4
|
835 |
* @internal
|
williamr@4
|
836 |
*/
|
williamr@4
|
837 |
static TBool IsDerivedType( const TAknsItemType aBaseType,
|
williamr@4
|
838 |
const TAknsItemType aDerivedType );
|
williamr@4
|
839 |
|
williamr@4
|
840 |
public: // New functions - Avkon parameters
|
williamr@4
|
841 |
|
williamr@4
|
842 |
/**
|
williamr@4
|
843 |
* Sets the flag indicating whether default skin parameters should
|
williamr@4
|
844 |
* be used for newly created Avkon controls in the scope of the
|
williamr@4
|
845 |
* current AppUi.
|
williamr@4
|
846 |
*
|
williamr@4
|
847 |
* @since 2.0
|
williamr@4
|
848 |
*
|
williamr@4
|
849 |
* @param Value of the flag as TBool.
|
williamr@4
|
850 |
*
|
williamr@4
|
851 |
* @par Exceptions:
|
williamr@4
|
852 |
* If construction of the storage object for the flag fails,
|
williamr@4
|
853 |
* leaves with an error code.
|
williamr@4
|
854 |
*/
|
williamr@4
|
855 |
IMPORT_C static void SetAvkonSkinEnabledL( const TBool aEnabled );
|
williamr@4
|
856 |
|
williamr@4
|
857 |
/**
|
williamr@4
|
858 |
* Queries whether default skin parameters should be used for newly
|
williamr@4
|
859 |
* created Avkon controls. Components supporting
|
williamr@4
|
860 |
* <code>SetSkinEnabledL</code> method should also check for this
|
williamr@4
|
861 |
* value upon construction and set their internal state accordingly.
|
williamr@4
|
862 |
*
|
williamr@4
|
863 |
* Note that this flag is intended to be used to determine whether or
|
williamr@4
|
864 |
* not controls should create skin backgrounds for main pane
|
williamr@4
|
865 |
* layouts. Skins are always enabled for e.g. all the popup windows,
|
williamr@4
|
866 |
* even through the flag may be @c EFalse, and therefore the flag
|
williamr@4
|
867 |
* must not be used as a generic "are skins enabled" switch.
|
williamr@4
|
868 |
*
|
williamr@4
|
869 |
* Most controls do not (and should not) query the flag value. If
|
williamr@4
|
870 |
* control just fetches the skin control context with
|
williamr@4
|
871 |
* @c AknsDrawUtils::ControlContext, it will get the proper @c NULL
|
williamr@4
|
872 |
* value if no background has been defined.
|
williamr@4
|
873 |
*
|
williamr@4
|
874 |
* @since 2.0
|
williamr@4
|
875 |
*
|
williamr@4
|
876 |
* @return ETrue if default skin parameters should be used,
|
williamr@4
|
877 |
* EFalse otherwise. The default value is EFalse.
|
williamr@4
|
878 |
*/
|
williamr@4
|
879 |
IMPORT_C static TBool AvkonSkinEnabled();
|
williamr@4
|
880 |
|
williamr@4
|
881 |
/**
|
williamr@4
|
882 |
* Sets the flag indicating whether highlight animations should be used
|
williamr@4
|
883 |
* for Avkon list controls in the scope of the current AppUi.
|
williamr@4
|
884 |
*
|
williamr@4
|
885 |
* @since 3.0
|
williamr@4
|
886 |
*
|
williamr@4
|
887 |
* @param Value of the flag as TBool.
|
williamr@4
|
888 |
*
|
williamr@4
|
889 |
* @par Exceptions:
|
williamr@4
|
890 |
* If construction of the storage object for the flag fails,
|
williamr@4
|
891 |
* leaves with an error code.
|
williamr@4
|
892 |
*/
|
williamr@4
|
893 |
IMPORT_C static void SetAvkonHighlightAnimationEnabledL( const TBool aEnabled );
|
williamr@4
|
894 |
|
williamr@4
|
895 |
/**
|
williamr@4
|
896 |
* Queries whether highlight animation should be used for newly created
|
williamr@4
|
897 |
* Avkon list controls.
|
williamr@4
|
898 |
*
|
williamr@4
|
899 |
* @since 3.0
|
williamr@4
|
900 |
*
|
williamr@4
|
901 |
* @return ETrue if list highlight animation should be used, EFalse
|
williamr@4
|
902 |
* otherwise. The default value is ETrue.
|
williamr@4
|
903 |
*/
|
williamr@4
|
904 |
IMPORT_C static TBool AvkonHighlightAnimationEnabled();
|
williamr@4
|
905 |
|
williamr@4
|
906 |
public: // New functions - Control position list
|
williamr@4
|
907 |
|
williamr@4
|
908 |
/**
|
williamr@4
|
909 |
* Registers the position of the given control.
|
williamr@4
|
910 |
* The position is stored in the thread-local control position list.
|
williamr@4
|
911 |
* If the control has already been registered, its position is updated.
|
williamr@4
|
912 |
*
|
williamr@4
|
913 |
* Registering the position of the control enables background drawing
|
williamr@4
|
914 |
* methods in AknsDrawUtils to calculate positions in
|
williamr@4
|
915 |
* parent-absolute layouts without causing window server flushes.
|
williamr@4
|
916 |
*
|
williamr@4
|
917 |
* When a registered control goes out of scope, it must call
|
williamr@4
|
918 |
* AknsUtils::DeregisterControlPosition to ensure that it is properly
|
williamr@4
|
919 |
* removed from the list.
|
williamr@4
|
920 |
*
|
williamr@4
|
921 |
* @since 2.0
|
williamr@4
|
922 |
*
|
williamr@4
|
923 |
* @param aControl Pointer to the control that needs its position
|
williamr@4
|
924 |
* to be updated in the control position list.
|
williamr@4
|
925 |
*/
|
williamr@4
|
926 |
IMPORT_C static void RegisterControlPosition(
|
williamr@4
|
927 |
const CCoeControl* aControl );
|
williamr@4
|
928 |
|
williamr@4
|
929 |
/**
|
williamr@4
|
930 |
* Registers the position of the given control with given position.
|
williamr@4
|
931 |
* The position is stored in the thread-local control position list.
|
williamr@4
|
932 |
* If the control has already been registered, its position is updated.
|
williamr@4
|
933 |
*
|
williamr@4
|
934 |
* Registering the position of the control enables background drawing
|
williamr@4
|
935 |
* methods in AknsDrawUtils to calculate positions in
|
williamr@4
|
936 |
* parent-absolute layouts without causing window server flushes.
|
williamr@4
|
937 |
*
|
williamr@4
|
938 |
* When a registered control goes out of scope, it must call
|
williamr@4
|
939 |
* AknsUtils::DeregisterControlPosition to ensure that it is properly
|
williamr@4
|
940 |
* removed from the list.
|
williamr@4
|
941 |
*
|
williamr@4
|
942 |
* @since 2.0
|
williamr@4
|
943 |
*
|
williamr@4
|
944 |
* @param aControl Pointer to the control that needs its position
|
williamr@4
|
945 |
* to be updated in the control position list.
|
williamr@4
|
946 |
*
|
williamr@4
|
947 |
* @param aPoint The new position to be registered with the given
|
williamr@4
|
948 |
* control (in screen coordinates).
|
williamr@4
|
949 |
*/
|
williamr@4
|
950 |
IMPORT_C static void RegisterControlPosition(
|
williamr@4
|
951 |
const CCoeControl* aControl, const TPoint& aPoint );
|
williamr@4
|
952 |
|
williamr@4
|
953 |
/**
|
williamr@4
|
954 |
* Removes the position of the given control from the list.
|
williamr@4
|
955 |
* The position of the given control is removed from the thread-local
|
williamr@4
|
956 |
* control position list. If the control has not been registered,
|
williamr@4
|
957 |
* this method does nothing.
|
williamr@4
|
958 |
*
|
williamr@4
|
959 |
* @since 2.0
|
williamr@4
|
960 |
*
|
williamr@4
|
961 |
* @param aControl Pointer to the control that needs to be removed
|
williamr@4
|
962 |
* from the control position list.
|
williamr@4
|
963 |
*/
|
williamr@4
|
964 |
IMPORT_C static void DeregisterControlPosition(
|
williamr@4
|
965 |
const CCoeControl* aControl );
|
williamr@4
|
966 |
|
williamr@4
|
967 |
/**
|
williamr@4
|
968 |
* Gets the position of the control registered in the control position
|
williamr@4
|
969 |
* list.
|
williamr@4
|
970 |
*
|
williamr@4
|
971 |
* @param aControl Pointer to the control whose position is to be
|
williamr@4
|
972 |
* queried.
|
williamr@4
|
973 |
*
|
williamr@4
|
974 |
* @param aScreenPos Reference to the TPoint that will receive the
|
williamr@4
|
975 |
* position.
|
williamr@4
|
976 |
*
|
williamr@4
|
977 |
* @return KErrNone if successful, KErrNotFound if the control has
|
williamr@4
|
978 |
* not been registered.
|
williamr@4
|
979 |
*/
|
williamr@4
|
980 |
IMPORT_C static TInt GetControlPosition( const CCoeControl* aControl,
|
williamr@4
|
981 |
TPoint& aScreenPos );
|
williamr@4
|
982 |
|
williamr@4
|
983 |
private: // Internal methods
|
williamr@4
|
984 |
|
williamr@4
|
985 |
/**
|
williamr@4
|
986 |
* Gets an application icon from skin.
|
williamr@4
|
987 |
*
|
williamr@4
|
988 |
* @since 2.8
|
williamr@4
|
989 |
*
|
williamr@4
|
990 |
* @internal
|
williamr@4
|
991 |
*/
|
williamr@4
|
992 |
static TInt GetAppIconFromSkin(
|
williamr@4
|
993 |
MAknsSkinInstance* aInstance, TUid aAppUid, TSize aSize,
|
williamr@4
|
994 |
CFbsBitmap*& aBitmap, CFbsBitmap*& aMask );
|
williamr@4
|
995 |
|
williamr@4
|
996 |
/**
|
williamr@4
|
997 |
* Returns the best application icon bitmap IID among the listed icons.
|
williamr@4
|
998 |
*
|
williamr@4
|
999 |
* @since 2.1
|
williamr@4
|
1000 |
*
|
williamr@4
|
1001 |
* @param aSize Maximum size.
|
williamr@4
|
1002 |
*
|
williamr@4
|
1003 |
* @param aSkin Skin instance.
|
williamr@4
|
1004 |
*
|
williamr@4
|
1005 |
* @param aAppIconIID Item ID of the application icon.
|
williamr@4
|
1006 |
*
|
williamr@4
|
1007 |
* @return Icon bitmap IID.
|
williamr@4
|
1008 |
*
|
williamr@4
|
1009 |
* @internal
|
williamr@4
|
1010 |
*/
|
williamr@4
|
1011 |
static TAknsItemID SelectBestAppIconBitmapL(
|
williamr@4
|
1012 |
const TSize& aSize, MAknsSkinInstance* aSkin,
|
williamr@4
|
1013 |
const TAknsItemID& aAppIconIID );
|
williamr@4
|
1014 |
|
williamr@4
|
1015 |
private: // Reserved exports
|
williamr@4
|
1016 |
|
williamr@4
|
1017 |
/**
|
williamr@4
|
1018 |
* Reserved for future use.
|
williamr@4
|
1019 |
*
|
williamr@4
|
1020 |
* @since 2.0
|
williamr@4
|
1021 |
*
|
williamr@4
|
1022 |
* @return Always returns zero.
|
williamr@4
|
1023 |
*/
|
williamr@4
|
1024 |
IMPORT_C static TInt Reserved();
|
williamr@4
|
1025 |
|
williamr@4
|
1026 |
private: // Prohibited constructors and destructor
|
williamr@4
|
1027 |
|
williamr@4
|
1028 |
// Construction prohibited (static class)
|
williamr@4
|
1029 |
AknsUtils();
|
williamr@4
|
1030 |
// Destruction prohibited (static class)
|
williamr@4
|
1031 |
~AknsUtils();
|
williamr@4
|
1032 |
};
|
williamr@4
|
1033 |
|
williamr@4
|
1034 |
#endif // AKNSUTILS_H
|
williamr@4
|
1035 |
|
williamr@4
|
1036 |
// End of File
|