API published in: S60 2nd Ed
Link against: aknskins.lib aknskinsrv.lib aknswallpaperutils.lib
Required Capabilities
None
#include <aknsutils.h>
AknsUtils provides utility method to initialize application skin support, retrieve current skin instance or data context, retrieve skin data items and to perform other skin-related tasks.
This is a public static class with exported functions. The class is not intended for derivation outside the library.
Public Member Functions |
|
IMPORT_C TInt | OpenAppIconFile (MAknsSkinInstance *aInstance, TUid aAppUid, TAknsAppIconType aType, RFile &aFile) |
Opens the file containing application icon data. |
|
Static Public Member Functions |
|
static IMPORT_C void | InitSkinSupportL () |
Initializes application skin support. |
|
static IMPORT_C MAknsDataContext * | CreateDataContextForContainerL () |
Creates data context suitable for a container. |
|
static IMPORT_C CAknsItemDef * | CreateBitmapItemDefL (const TAknsItemID &aID, const TDesC &aFilename, const TInt aIndex) |
Constructs a new bitmap item definition object. |
|
static IMPORT_C CAknsItemDef * | CreateMaskedBitmapItemDefL (const TAknsItemID &aID, const TDesC &aFilename, const TInt aIndex, const TInt aMaskIndex) |
Constructs a new masked bitmap item definition object. |
|
static IMPORT_C MAknsSkinInstance * | SkinInstance () |
Returns pointer to current skin instance. |
|
static IMPORT_C MAknsDataContext * | DataContext (MObjectProvider *aMop) |
Returns pointer to current data context. |
|
static IMPORT_C void | CreateIconL (MAknsSkinInstance *aInstance, const TAknsItemID &aID, CFbsBitmap *&aBitmap, CFbsBitmap *&aMask, const TDesC &aFilename, const TInt aFileBitmapId, const TInt aFileMaskId) |
Constructs an independent masked bitmap with fallback support. |
|
static IMPORT_C void | CreateIconLC (MAknsSkinInstance *aInstance, const TAknsItemID &aID, CFbsBitmap *&aBitmap, CFbsBitmap *&aMask, const TDesC &aFilename, const TInt aFileBitmapId, const TInt aFileMaskId) |
Otherwise identical to CreateIconL, but leaves both the bitmaps in the cleanup stack. |
|
static IMPORT_C void | CreateIconL (MAknsSkinInstance *aInstance, const TAknsItemID &aID, CFbsBitmap *&aBitmap, const TDesC &aFilename, const TInt aFileBitmapId) |
Constructs an independent non-masked bitmap with fallback support. |
|
static IMPORT_C void | CreateIconLC (MAknsSkinInstance *aInstance, const TAknsItemID &aID, CFbsBitmap *&aBitmap, const TDesC &aFilename, const TInt aFileBitmapId) |
Otherwise identical to CreateIconL, but leaves the bitmap in the cleanup stack. |
|
static IMPORT_C CApaMaskedBitmap * | CreateMaskedBitmapL (MAknsSkinInstance *aInstance, const TAknsItemID &aID, const TDesC &aFilename, const TInt aFileIndex, const TInt aFileMaskIndex) |
Constructs an independent masked bitmap with fallback support. |
|
static IMPORT_C CGulIcon * | CreateGulIconL (MAknsSkinInstance *aInstance, const TAknsItemID &aID, const TDesC &aFilename, const TInt aFileIndex, const TInt aFileMaskIndex) |
Constructs an independent CGulIcon object with fallback support. |
|
static IMPORT_C void | CreateAppIconLC (MAknsSkinInstance *aInstance, TUid aAppUid, TAknsAppIconType aType, CFbsBitmap *&aBitmap, CFbsBitmap *&aMask) |
Constructs an application icon supporting scalable graphics. |
|
static IMPORT_C void | CreateColorIconL (MAknsSkinInstance *aInstance, const TAknsItemID &aID, const TAknsItemID &aColorID, const TInt aColorIndex, CFbsBitmap *&aBitmap, CFbsBitmap *&aMask, const TDesC &aFilename, const TInt aFileBitmapId, const TInt aFileMaskId, const TRgb aDefaultColor) |
Constructs an independent masked color-customized icon with fallback support without setting its size. |
|
static IMPORT_C void | CreateColorIconLC (MAknsSkinInstance *aInstance, const TAknsItemID &aID, const TAknsItemID &aColorID, const TInt aColorIndex, CFbsBitmap *&aBitmap, CFbsBitmap *&aMask, const TDesC &aFilename, const TInt aFileBitmapId, const TInt aFileMaskId, const TRgb aDefaultColor) |
Otherwise identical to CreateColorIconL , but leaves both the bitmap and the mask in the cleanup stack. |
|
static IMPORT_C void | CreateColorIconL (MAknsSkinInstance *aInstance, const TAknsItemID &aID, const TAknsItemID &aColorID, const TInt aColorIndex, CFbsBitmap *&aBitmap, CFbsBitmap *&aMask, const TDesC &aFilename, const TInt aFileBitmapId, const TInt aFileMaskId, const TRgb aDefaultColor, const TSize &aSize, const TScaleMode aScaleMode) |
Otherwise identical to CreateColorIconL without size parameters, but calls SetSize to set the size of the resulting icon. |
|
static IMPORT_C void | CreateColorIconLC (MAknsSkinInstance *aInstance, const TAknsItemID &aID, const TAknsItemID &aColorID, const TInt aColorIndex, CFbsBitmap *&aBitmap, CFbsBitmap *&aMask, const TDesC &aFilename, const TInt aFileBitmapId, const TInt aFileMaskId, const TRgb aDefaultColor, const TSize &aSize, const TScaleMode aScaleMode) |
Otherwise identical to CreateColorIconL , but leaves both the bitmap and the mask in the cleanup stack. |
|
static IMPORT_C TInt | GetAppIcon (MAknsSkinInstance *aInstance, TUid aAppUid, TSize aSize, CApaMaskedBitmap &aAppBitmap) |
Constructs an application icon. |
|
static IMPORT_C CFbsBitmap * | CreateBitmapL (MAknsSkinInstance *aInstance, const TAknsItemID &aID) |
Constructs an independent bitmap. |
|
static IMPORT_C CApaMaskedBitmap * | CreateMaskedBitmapL (MAknsSkinInstance *aInstance, const TAknsItemID &aID) |
Constructs an independent masked bitmap. |
|
static IMPORT_C CGulIcon * | CreateGulIconL (MAknsSkinInstance *aInstance, const TAknsItemID &aID, const TBool aRequireMask) |
Constructs an independent CGulIcon object. |
|
static IMPORT_C CFbsBitmap * | GetCachedBitmap (MAknsSkinInstance *aInstance, const TAknsItemID &aID) |
Returns pointer to a cached bitmap. |
|
static IMPORT_C void | GetCachedMaskedBitmap (MAknsSkinInstance *aInstance, const TAknsItemID &aID, CFbsBitmap *&aBitmap, CFbsBitmap *&aMask) |
Retrieves temporary pointers to a cached bitmap and its mask. |
|
static IMPORT_C TInt | GetCachedColor (MAknsSkinInstance *aInstance, TRgb &aRgb, const TAknsItemID &aID, const TInt aIndex) |
Returns a color value from a cached color table. |
|
static IMPORT_C TBool | BooleanPropertyL (MAknsSkinInstance *aInstance, const TAknsItemID &aID) |
Retrieves the value of the given boolean property skin item. |
|
static TBool | IsDerivedType (const TAknsItemType aBaseType, const TAknsItemType aDerivedType) |
Test whether the given type is derived from the given base type. |
|
static IMPORT_C void | SetAvkonSkinEnabledL (const TBool aEnabled) |
Sets the flag indicating whether default skin parameters should be used for newly created Avkon controls in the scope of the
current AppUi. |
|
static IMPORT_C TBool | AvkonSkinEnabled () |
Queries whether default skin parameters should be used for newly created Avkon controls. |
|
static IMPORT_C void | SetAvkonHighlightAnimationEnabledL (const TBool aEnabled) |
Sets the flag indicating whether highlight animations should be used for Avkon list controls in the scope of the current AppUi.
|
|
static IMPORT_C TBool | AvkonHighlightAnimationEnabled () |
Queries whether highlight animation should be used for newly created Avkon list controls. |
|
static IMPORT_C void | RegisterControlPosition (const CCoeControl *aControl) |
Registers the position of the given control. |
|
static IMPORT_C void | RegisterControlPosition (const CCoeControl *aControl, const TPoint &aPoint) |
Registers the position of the given control with given position. |
|
static IMPORT_C void | DeregisterControlPosition (const CCoeControl *aControl) |
Removes the position of the given control from the list. |
|
static IMPORT_C TInt | GetControlPosition (const CCoeControl *aControl, TPoint &aScreenPos) |
Gets the position of the control registered in the control position list. |
|
Queries whether highlight animation should be used for newly created Avkon list controls.
|
|
Queries whether default skin parameters should be used for newly created Avkon controls.
Components supporting
Note that this flag is intended to be used to determine whether or not controls should create skin backgrounds for main pane
layouts. Skins are always enabled for e.g. all the popup windows, even through the flag may be
Most controls do not (and should not) query the flag value. If control just fetches the skin control context with
|
|
Retrieves the value of the given boolean property skin item.
|
|
Constructs an application icon supporting scalable graphics. This method is fallback-enabled. If no icon is found in the currently active skin, the application icon is retrieved using application resource file or AIF. After successful completion, the method leaves both the bitmaps in the cleanup stack. The order in which they are pushed into the stack and types of the items in the stack are both undefined.
The caller must set the size of the returned bitmaps. See
|
|
Constructs a new bitmap item definition object.
|
|
Constructs an independent bitmap. Creates an independent copy of bitmap (in terms of instance ownership) by given item ID.
|
|
Otherwise identical to |
|
Constructs an independent masked color-customized icon with fallback support without setting its size. Creates an independent (in terms of instance ownership) copy of a masked bitmap by the given item ID and applies color-based skinning to it. This method:
The method fails only, if the masked bitmap can not be constructed at all. If the icon can not be color-skinned, it is returned as-is.
|
|
Otherwise identical to The order in which they are pushed into the stack and types of the items in the stack are both undefined.
|
|
Otherwise identical to The order in which they are pushed into the stack and types of the items in the stack are both undefined.
|
|
Creates data context suitable for a container. Constructs a new data context suitable for a container. Container should store the pointer and perform proper destruction when the lifetime of the container itself ends.
|
|
Constructs an independent CGulIcon object. Creates an independent (in terms of instance ownership) copy of a bitmap or a masked bitmap by the given item ID, and returns it as a newly constructed CGulIcon object.
|
|
Constructs an independent CGulIcon object with fallback support. Creates an independent (in terms of instance ownership) copy of a masked bitmap by the given item ID, and returns it as a newly constructed CGulIcon object. If no matching item is found in the currently active skin, attempts to construct the item using the given file.
|
|
Constructs an independent non-masked bitmap with fallback support. Creates an independent (in terms of instance ownership) copy of a non-masked bitmap by the given item ID. If no matching item is found in the currently activate skin, attempts to construct the item using the given file.
|
|
Constructs an independent masked bitmap with fallback support. Creates an independent (in terms of instance ownership) copy of a masked bitmap by the given item ID. If no matching item is found in the currently activate skin, attempts to construct the item using the given file.
|
|
Otherwise identical to CreateIconL, but leaves the bitmap in the cleanup stack. The type of the item pushed into the stack is undefined.
|
|
Otherwise identical to CreateIconL, but leaves both the bitmaps in the cleanup stack. The order in which they are pushed into the stack and types of the items in the stack are both undefined.
|
|
Constructs a new masked bitmap item definition object.
|
|
Constructs an independent masked bitmap. Creates an independent (in terms of instance ownership) copy of a masked bitmap by the given item ID.
Alternatively, masked bitmaps can be retrieved by using
|
|
Constructs an independent masked bitmap with fallback support. Creates an independent (in terms of instance ownership) copy of a masked bitmap by the given item ID. If no matching item is found in the currently activate skin, attempts to construct the item using the given file.
|
|
Returns pointer to current data context.
If aMop parameter is specified, retrieves the nearest data context in control hierarchy. If none is found (or
|
|
Removes the position of the given control from the list. The position of the given control is removed from the thread-local control position list. If the control has not been registered, this method does nothing.
|
|
Constructs an application icon. Icon bitmaps are duplicated to the given CApaMaskedBitmap object. Since Series 60 Release 2.6, this method is fallback-enabled. If no icon is found in the currently active skin, it uses AppArch to construct the icon.
|
|
Returns pointer to a cached bitmap. Retrieves (and constructs if necessary) a bitmap in skin instance cache. Caller can use the bitmap temporarily (e.g. in drawing code), but should not store pointer to it, since its lifetime is determined by cache.
|
|
Returns a color value from a cached color table. Retrieves (and constructs if necessary) a color table in skin instance cache and returns a color value from it. Since release 2.8, this method also handles any backward compatibility operations possibly required.
|
|
Retrieves temporary pointers to a cached bitmap and its mask. Retrieves (and constructs, if necessary) a masked bitmap in the skin instance cache. Pointers to the bitmap (and its mask) are stored to the pointers given as parameters. Caller can use the bitmaps temporarily (e.g. in drawing code), but should not store them, since their lifetimes are determined by the cache.
|
|
Gets the position of the control registered in the control position list.
|
|
Initializes application skin support. Creates application skin instance. Method should be called once in the construction phase of application, before any other skin-related operations take place.
|
|
Test whether the given type is derived from the given base type.
|
|
Opens the file containing application icon data.
This method first checks whether there is a data file of the given type associated with the application icon of the given
UID. If no file is found, an error code is returned and the caller should use
|
|
Registers the position of the given control with given position. The position is stored in the thread-local control position list. If the control has already been registered, its position is updated. Registering the position of the control enables background drawing methods in AknsDrawUtils to calculate positions in parent-absolute layouts without causing window server flushes. When a registered control goes out of scope, it must call AknsUtils::DeregisterControlPosition to ensure that it is properly removed from the list.
|
|
Registers the position of the given control. The position is stored in the thread-local control position list. If the control has already been registered, its position is updated. Registering the position of the control enables background drawing methods in AknsDrawUtils to calculate positions in parent-absolute layouts without causing window server flushes. When a registered control goes out of scope, it must call AknsUtils::DeregisterControlPosition to ensure that it is properly removed from the list.
|
|
Sets the flag indicating whether highlight animations should be used for Avkon list controls in the scope of the current AppUi.
|
|
Sets the flag indicating whether default skin parameters should be used for newly created Avkon controls in the scope of the current AppUi.
|
|
Returns pointer to current skin instance.
Retrieves pointer to the current application skin instance singleton. If there is none,
|