AknsUtils Class Reference

#include <mw/AknsUtils.h>

Link against: AknSkins.lib

class AknsUtils
Public Member Functions
IMPORT_C TBoolAnimationBackgroundDisabled()
IMPORT_C TBoolAvkonHighlightAnimationEnabled()
IMPORT_C TBoolAvkonSkinEnabled()
IMPORT_C TBoolBooleanPropertyL(MAknsSkinInstance *, const TAknsItemID &)
IMPORT_C voidCreateAppIconLC(MAknsSkinInstance *, TUid, TAknsAppIconType, CFbsBitmap *&, CFbsBitmap *&)
IMPORT_C CAknsItemDef *CreateBitmapItemDefL(const TAknsItemID &, const TDesC &, const TInt)
IMPORT_C CFbsBitmap *CreateBitmapL(MAknsSkinInstance *, const TAknsItemID &)
IMPORT_C voidCreateColorIconL(MAknsSkinInstance *, const TAknsItemID &, const TAknsItemID &, const TInt, CFbsBitmap *&, CFbsBitmap *&, const TDesC &, const TInt, const TInt, const TRgb)
IMPORT_C voidCreateColorIconL(MAknsSkinInstance *, const TAknsItemID &, const TAknsItemID &, const TInt, CFbsBitmap *&, CFbsBitmap *&, const TDesC &, const TInt, const TInt, const TRgb, const TSize &, const TScaleMode)
IMPORT_C voidCreateColorIconLC(MAknsSkinInstance *, const TAknsItemID &, const TAknsItemID &, const TInt, CFbsBitmap *&, CFbsBitmap *&, const TDesC &, const TInt, const TInt, const TRgb)
IMPORT_C voidCreateColorIconLC(MAknsSkinInstance *, const TAknsItemID &, const TAknsItemID &, const TInt, CFbsBitmap *&, CFbsBitmap *&, const TDesC &, const TInt, const TInt, const TRgb, const TSize &, const TScaleMode)
IMPORT_C MAknsDataContext *CreateDataContextForContainerL()
IMPORT_C CGulIcon *CreateGulIconL(MAknsSkinInstance *, const TAknsItemID &, const TDesC &, const TInt, const TInt)
IMPORT_C CGulIcon *CreateGulIconL(MAknsSkinInstance *, const TAknsItemID &, const TBool)
IMPORT_C voidCreateIconL(MAknsSkinInstance *, const TAknsItemID &, CFbsBitmap *&, CFbsBitmap *&, const TDesC &, const TInt, const TInt)
IMPORT_C voidCreateIconL(MAknsSkinInstance *, const TAknsItemID &, CFbsBitmap *&, const TDesC &, const TInt)
IMPORT_C voidCreateIconLC(MAknsSkinInstance *, const TAknsItemID &, CFbsBitmap *&, CFbsBitmap *&, const TDesC &, const TInt, const TInt)
IMPORT_C voidCreateIconLC(MAknsSkinInstance *, const TAknsItemID &, CFbsBitmap *&, const TDesC &, const TInt)
IMPORT_C CAknsItemDef *CreateMaskedBitmapItemDefL(const TAknsItemID &, const TDesC &, const TInt, const TInt)
IMPORT_C CApaMaskedBitmap *CreateMaskedBitmapL(MAknsSkinInstance *, const TAknsItemID &, const TDesC &, const TInt, const TInt)
IMPORT_C CApaMaskedBitmap *CreateMaskedBitmapL(MAknsSkinInstance *, const TAknsItemID &)
IMPORT_C MAknsDataContext *DataContext(MObjectProvider *)
IMPORT_C voidDeregisterControlPosition(const CCoeControl *)
IMPORT_C TIntGetAppIcon(MAknsSkinInstance *, TUid, TSize, CApaMaskedBitmap &)
IMPORT_C CFbsBitmap *GetCachedBitmap(MAknsSkinInstance *, const TAknsItemID &)
IMPORT_C TIntGetCachedColor(MAknsSkinInstance *, TRgb &, const TAknsItemID &, const TInt)
IMPORT_C voidGetCachedMaskedBitmap(MAknsSkinInstance *, const TAknsItemID &, CFbsBitmap *&, CFbsBitmap *&)
IMPORT_C TIntGetControlPosition(const CCoeControl *, TPoint &)
IMPORT_C voidInitSkinSupportL()
TBool IsDerivedType(const TAknsItemType, const TAknsItemType)
IMPORT_C TIntOpenAppIconFile(MAknsSkinInstance *, TUid, TAknsAppIconType, RFile &)
IMPORT_C voidRegisterControlPosition(const CCoeControl *)
IMPORT_C voidRegisterControlPosition(const CCoeControl *, const TPoint &)
IMPORT_C voidSetAnimationBackgroundDisabledL(TBool)
IMPORT_C voidSetAvkonHighlightAnimationEnabledL(const TBool)
IMPORT_C voidSetAvkonSkinEnabledL(const TBool)
IMPORT_C MAknsSkinInstance *SkinInstance()

Detailed Description

Static utility class to support AVKON SKINS common operations. 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.

Since
2.0

Member Function Documentation

AnimationBackgroundDisabled ( )

IMPORT_C TBoolAnimationBackgroundDisabled()[static]

Queries whether animation background should be used for newly created current AppUi.

Since
5.2

Returns: ETrue if animation background is disabled, EFalse otherwise. The default value is EFalse.

AvkonHighlightAnimationEnabled ( )

IMPORT_C TBoolAvkonHighlightAnimationEnabled()[static]

Queries whether highlight animation should be used for newly created Avkon list controls.

Since
3.0

Returns: ETrue if list highlight animation should be used, EFalse otherwise. The default value is ETrue.

AvkonSkinEnabled ( )

IMPORT_C TBoolAvkonSkinEnabled()[static]

Queries whether default skin parameters should be used for newly created Avkon controls. Components supporting SetSkinEnabledL method should also check for this value upon construction and set their internal state accordingly.

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 EFalse, and therefore the flag must not be used as a generic "are skins enabled" switch.

Most controls do not (and should not) query the flag value. If control just fetches the skin control context with AknsDrawUtils::ControlContext, it will get the proper NULL value if no background has been defined.

Since
2.0

Returns: ETrue if default skin parameters should be used, EFalse otherwise. The default value is EFalse.

BooleanPropertyL ( MAknsSkinInstance *, const TAknsItemID & )

IMPORT_C TBoolBooleanPropertyL(MAknsSkinInstance *aInstance,
const TAknsItemID &aID
)[static]

Retrieves the value of the given boolean property skin item.

Since
2.8
Exceptions:
  • If the item is not found, leaves with KErrNotFound.

  • If the item is not a boolean property or another error occures, leaves with a system-wide error code.

ParameterDescription
aInstancePointer to current skin instance. If NULL value is specified, the method leaves.
aIDItem ID of the boolean property.

Returns: Value of the boolean property as TBool.

CreateAppIconLC ( MAknsSkinInstance *, TUid, TAknsAppIconType, CFbsBitmap *&, CFbsBitmap *& )

IMPORT_C voidCreateAppIconLC(MAknsSkinInstance *aInstance,
TUidaAppUid,
TAknsAppIconTypeaType,
CFbsBitmap *&aBitmap,
CFbsBitmap *&aMask
)[static]

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 AknIconUtils for details.

Note:
Since both the bitmaps are left in the cleanup stack, call to this method can not be enclosed in an immediate TRAP.
Since
2.8
library
AknSkins.lib
Exceptions:
If the method fails, it leaves with a standard error code.
ParameterDescription
aInstancePointer to current skin instance.
aAppUidApplication UID. Icon is searched with major IID EAknsIIDMajorAppIcon and minor IID aAppUid.
aTypeType of the application icon (list or context). This parameter is tentative. If no icon of the given type is found, the other icon is returned. Only the following values are allowed: EAknsAppIconTypeList and EAknsAppIconTypeContext.
aBitmapIf method succeeds, set to point to the newly constructed bitmap. Ownership of the bitmap is transferred to the caller.
aMaskIf method succeeds, set to point to the newly constructed mask bitmap. Ownership of the bitmap is transferred to the caller.

CreateBitmapItemDefL ( const TAknsItemID &, const TDesC &, const TInt )

IMPORT_C CAknsItemDef *CreateBitmapItemDefL(const TAknsItemID &aID,
const TDesC &aFilename,
const TIntaIndex
)[static]

Constructs a new bitmap item definition object.

Since
2.0
Exceptions:
If construction fails, the method leaves with an error code.
ParameterDescription
aIDItem ID of the item definition object to be created:
aIndexIndex of the bitmap in the file.

Returns: Newly constructed item definition object.

CreateBitmapL ( MAknsSkinInstance *, const TAknsItemID & )

IMPORT_C CFbsBitmap *CreateBitmapL(MAknsSkinInstance *aInstance,
const TAknsItemID &aID
)[static]

Constructs an independent bitmap. Creates an independent copy of bitmap (in terms of instance ownership) by given item ID.

Since
2.0
Exceptions:
  • If data construction fails or bitmap is not found, function leaves with an error code.

ParameterDescription
aInstancePointer to current skin instance.
aIDItem ID of the bitmap to be created.

Returns: Pointer to the newly created bitmap. Ownership of the object is transferred to the caller.

CreateColorIconL ( MAknsSkinInstance *, const TAknsItemID &, const TAknsItemID &, const TInt, CFbsBitmap *&, CFbsBitmap *&, const TDesC &, const TInt, const TInt, const TRgb )

IMPORT_C voidCreateColorIconL(MAknsSkinInstance *aInstance,
const TAknsItemID &aID,
const TAknsItemID &aColorID,
const TIntaColorIndex,
CFbsBitmap *&aBitmap,
CFbsBitmap *&aMask,
const TDesC &aFilename,
const TIntaFileBitmapId,
const TIntaFileMaskId,
const TRgbaDefaultColor
)[static]

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:
  • Creates a masked bitmap item from skin, or from the given MBM or MIF file if no matching item is found in the active skin.

  • If the icon can be color-skinned, applies the color retrieved from the given color table and index. If no color information is found in the active skin, uses the given fallback color value.

  • Returns the resulting bitmaps. If no color skinning was applied, returns the original bitmaps.

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.

Since
2.6
library
AknSkins.lib
Exceptions:
If data construction fails or bitmap is not found, the function leaves with an error code.
ParameterDescription
aInstancePointer to the current skin instance. Usually retrieved using AknsUtils::SkinInstance.
aIDItem ID of the masked bitmap to be created.
aColorIDItem ID of the color table.
aColorIndexIndex in the color table.
aBitmapIf method succeeds, set to point to the newly constructed bitmap. Ownership of the bitmap is transferred to the caller.
aMaskIf method succeeds, set to point to the newly constructed mask bitmap. Ownership of the bitmap is transferred to the caller.
aFilenameFilename to be used to construct the item, if no matching item was found in the currently active skin.
aFileBitmapIdID of the bitmap in the file. Used only if no matching item was found in the currently active skin.
aFileMaskIdID of the mask in the file. Used only if no matching item was found in the currently active skin.
aDefaultColorColor RGB value to be used, if no color is found in the currently active skin.

CreateColorIconL ( MAknsSkinInstance *, const TAknsItemID &, const TAknsItemID &, const TInt, CFbsBitmap *&, CFbsBitmap *&, const TDesC &, const TInt, const TInt, const TRgb, const TSize &, const TScaleMode )

IMPORT_C voidCreateColorIconL(MAknsSkinInstance *aInstance,
const TAknsItemID &aID,
const TAknsItemID &aColorID,
const TIntaColorIndex,
CFbsBitmap *&aBitmap,
CFbsBitmap *&aMask,
const TDesC &aFilename,
const TIntaFileBitmapId,
const TIntaFileMaskId,
const TRgbaDefaultColor,
const TSize &aSize,
const TScaleModeaScaleMode
)[static]

Otherwise identical to CreateColorIconL without size parameters, but calls SetSize to set the size of the resulting icon.

Since
2.8
library
AknSkins.lib

CreateColorIconLC ( MAknsSkinInstance *, const TAknsItemID &, const TAknsItemID &, const TInt, CFbsBitmap *&, CFbsBitmap *&, const TDesC &, const TInt, const TInt, const TRgb )

IMPORT_C voidCreateColorIconLC(MAknsSkinInstance *aInstance,
const TAknsItemID &aID,
const TAknsItemID &aColorID,
const TIntaColorIndex,
CFbsBitmap *&aBitmap,
CFbsBitmap *&aMask,
const TDesC &aFilename,
const TIntaFileBitmapId,
const TIntaFileMaskId,
const TRgbaDefaultColor
)[static]

Otherwise identical to CreateColorIconL, but leaves both the bitmap and the mask 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.

Since
2.6
library
AknSkins.lib
Note:
Since two bitmaps are left in the cleanup stack, call to this method can not be enclosed in an immediate TRAP.

CreateColorIconLC ( MAknsSkinInstance *, const TAknsItemID &, const TAknsItemID &, const TInt, CFbsBitmap *&, CFbsBitmap *&, const TDesC &, const TInt, const TInt, const TRgb, const TSize &, const TScaleMode )

IMPORT_C voidCreateColorIconLC(MAknsSkinInstance *aInstance,
const TAknsItemID &aID,
const TAknsItemID &aColorID,
const TIntaColorIndex,
CFbsBitmap *&aBitmap,
CFbsBitmap *&aMask,
const TDesC &aFilename,
const TIntaFileBitmapId,
const TIntaFileMaskId,
const TRgbaDefaultColor,
const TSize &aSize,
const TScaleModeaScaleMode
)[static]

Otherwise identical to CreateColorIconL, but leaves both the bitmap and the mask 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.

Since
2.8
library
AknSkins.lib
Note:
Since two bitmaps are left in the cleanup stack, call to this method can not be enclosed in an immediate TRAP.

CreateDataContextForContainerL ( )

IMPORT_C MAknsDataContext *CreateDataContextForContainerL()[static]

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.

Since
2.0

Returns: Newly created data context. Ownership of the context object is transferred to the caller.

CreateGulIconL ( MAknsSkinInstance *, const TAknsItemID &, const TDesC &, const TInt, const TInt )

IMPORT_C CGulIcon *CreateGulIconL(MAknsSkinInstance *aInstance,
const TAknsItemID &aID,
const TDesC &aFilename,
const TIntaFileIndex,
const TIntaFileMaskIndex
)[static]

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.

Since
2.6
library
AknSkins.lib
Exceptions:
If data construction fails or bitmap is not found, the function leaves with an error code.
ParameterDescription
aInstancePointer to the current skin instance.
aIDItem ID of the masked bitmap to be created.
aFilenameFilename to be used to construct the item, if no matching item was found in the currently active skin.
aFileIndexIndex (for bitmap) in the file. Used only if no matching item was found in the currently active skin.
aFileMaskIndexIndex (for mask) in the file. Used only if no matching item was found in the currently active skin.

Returns: Pointer to the newly created CGulIcon object. Ownership of the object is transferred to the caller.

CreateGulIconL ( MAknsSkinInstance *, const TAknsItemID &, const TBool )

IMPORT_C CGulIcon *CreateGulIconL(MAknsSkinInstance *aInstance,
const TAknsItemID &aID,
const TBoolaRequireMask
)[static]

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.

Note:
This method does not have fallback support (to load the bitmap from the specified file in case it is not available in the current skin). Consider using one of the fallback-enabled overloads instead.
Since
2.1
library
AknSkins.lib
Exceptions:
If data construction fails or bitmap is not found, the function leaves with an error code.
ParameterDescription
aInstancePointer to the current skin instance.
aIDItem ID of the bitmap or masked bitmap to be created.
aRequireMaskETrue if masked bitmap is explicitly required. EFalse if mask is optional.

Returns: Pointer to the newly created CGulIcon object. Ownership of the object is transferred to the caller.

CreateIconL ( MAknsSkinInstance *, const TAknsItemID &, CFbsBitmap *&, CFbsBitmap *&, const TDesC &, const TInt, const TInt )

IMPORT_C voidCreateIconL(MAknsSkinInstance *aInstance,
const TAknsItemID &aID,
CFbsBitmap *&aBitmap,
CFbsBitmap *&aMask,
const TDesC &aFilename,
const TIntaFileBitmapId,
const TIntaFileMaskId
)[static]

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.

Since
2.6
library
AknSkins.lib
Exceptions:
If data construction fails or bitmap is not found, the function leaves with an error code.
ParameterDescription
aInstancePointer to the current skin instance. Usually retrieved using AknsUtils::SkinInstance.
aIDItem ID of the masked bitmap to be created.
aBitmapIf method succeeds, set to point to the newly constructed bitmap. Ownership of the bitmap is transferred to the caller.
aMaskIf method succeeds, set to point to the newly constructed mask bitmap. Ownership of the bitmap is transferred to the caller.
aFilenameFilename to be used to construct the item, if no matching item was found in the currently active skin.
aFileBitmapIdID of the bitmap in the file. Used only if no matching item was found in the currently active skin.
aFileMaskIdID of the mask in the file. Used only if no matching item was found in the currently active skin.

CreateIconL ( MAknsSkinInstance *, const TAknsItemID &, CFbsBitmap *&, const TDesC &, const TInt )

IMPORT_C voidCreateIconL(MAknsSkinInstance *aInstance,
const TAknsItemID &aID,
CFbsBitmap *&aBitmap,
const TDesC &aFilename,
const TIntaFileBitmapId
)[static]

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.

Since
2.6
library
AknSkins.lib
Exceptions:
If data construction fails or bitmap is not found, the function leaves with an error code.
ParameterDescription
aInstancePointer to the current skin instance. Usually retrieved using AknsUtils::SkinInstance.
aIDItem ID of the non-masked bitmap to be created.
aBitmapIf method succeeds, set to point to the newly constructed bitmap. Ownership of the bitmap is transferred to the caller.
aFilenameFilename to be used to construct the item, if no matching item was found in the currently active skin.
aFileBitmapIdID of the bitmap in the file. Used only if no matching item was found in the currently active skin.

CreateIconLC ( MAknsSkinInstance *, const TAknsItemID &, CFbsBitmap *&, CFbsBitmap *&, const TDesC &, const TInt, const TInt )

IMPORT_C voidCreateIconLC(MAknsSkinInstance *aInstance,
const TAknsItemID &aID,
CFbsBitmap *&aBitmap,
CFbsBitmap *&aMask,
const TDesC &aFilename,
const TIntaFileBitmapId,
const TIntaFileMaskId
)[static]

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.

Note:
Since both the bitmaps are left in the cleanup stack, call to this method can not be enclosed in an immediate TRAP.

CreateIconLC ( MAknsSkinInstance *, const TAknsItemID &, CFbsBitmap *&, const TDesC &, const TInt )

IMPORT_C voidCreateIconLC(MAknsSkinInstance *aInstance,
const TAknsItemID &aID,
CFbsBitmap *&aBitmap,
const TDesC &aFilename,
const TIntaFileBitmapId
)[static]

Otherwise identical to CreateIconL, but leaves the bitmap in the cleanup stack. The type of the item pushed into the stack is undefined.

Note:
Since the bitmap is left in the cleanup stack, call to this method can not be enclosed in an immediate TRAP.

CreateMaskedBitmapItemDefL ( const TAknsItemID &, const TDesC &, const TInt, const TInt )

IMPORT_C CAknsItemDef *CreateMaskedBitmapItemDefL(const TAknsItemID &aID,
const TDesC &aFilename,
const TIntaIndex,
const TIntaMaskIndex
)[static]

Constructs a new masked bitmap item definition object.

Since
2.0
Exceptions:
If construction fails, the method leaves with an error code.
ParameterDescription
aIDItem ID of the item definition object to be created:
aIndexIndex of the bitmap mask in the file.

Returns: Newly constructed item definition object. Ownership of the object is transferred to the caller.

CreateMaskedBitmapL ( MAknsSkinInstance *, const TAknsItemID &, const TDesC &, const TInt, const TInt )

IMPORT_C CApaMaskedBitmap *CreateMaskedBitmapL(MAknsSkinInstance *aInstance,
const TAknsItemID &aID,
const TDesC &aFilename,
const TIntaFileIndex,
const TIntaFileMaskIndex
)[static]

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.

Since
2.6
library
AknSkins.lib
Exceptions:
If data construction fails or bitmap is not found, the function leaves with an error code.
Note:
Since CApaMaskedBitmap can not be used to store scalable graphics, consider using CreateIconLC instead.
ParameterDescription
aInstancePointer to the current skin instance.
aIDItem ID of the masked bitmap to be created.
aFilenameFilename to be used to construct the item, if no matching item was found in the currently active skin.
aFileIndexIndex (for bitmap) in the file. Used only if no matching item was found in the currently active skin.
aFileMaskIndexIndex (for mask) in the file. Used only if no matching item was found in the currently active skin.

Returns: Pointer to the newly created CApaMaskedBitmap object. Ownership of the object is transferred to the caller.

CreateMaskedBitmapL ( MAknsSkinInstance *, const TAknsItemID & )

IMPORT_C CApaMaskedBitmap *CreateMaskedBitmapL(MAknsSkinInstance *aInstance,
const TAknsItemID &aID
)[static]

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 MAknsSkinInstance::GetCachedItemData(TAknsItemID,TAknsItemType) or MAknsSkinInstance::CreateUncachedItemDataL(TAknsItemID,TAknsItemType) methods. For these, EAknsITMaskedBitmap should be given as the second parameter. Returned CAknsItemData pointer can be casted to a CAknsMaskedBitmapItemData pointer in order to get access to the bitmap objects themselves.

Note:
This method does not have fallback support (to load the bitmap from the specified file in case it is not available in the current skin). Consider using one of the fallback-enabled overloads instead.
Since
2.0
Exceptions:
If data construction fails or bitmap is not found, the function leaves with an error code.
Note:
Since CApaMaskedBitmap can not be used to store scalable graphics, consider using CreateIconLC instead.
ParameterDescription
aInstancePointer to the current skin instance.
aIDItem ID of the masked bitmap to be created.

Returns: Pointer to the newly created CApaMaskedBitmap object. Ownership of the object is transferred to the caller.

DataContext ( MObjectProvider * )

IMPORT_C MAknsDataContext *DataContext(MObjectProvider *aMop)[static]

Returns pointer to current data context. If aMop parameter is specified, retrieves the nearest data context in control hierarchy. If none is found (or NULL parameter was given) returns root data context from skin instance. If there is no skin instance, NULL value is returned.

Since
2.0
ParameterDescription
aMopObject provider to be used to find the nearest data context. In most cases this should be a pointer to the calling CCoeControl. NULL value is also valid.

Returns: Pointer to the nearest data context, or NULL if no skin support is available.

DeregisterControlPosition ( const CCoeControl * )

IMPORT_C voidDeregisterControlPosition(const CCoeControl *aControl)[static]

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.

Since
2.0
ParameterDescription
aControlPointer to the control that needs to be removed from the control position list.

GetAppIcon ( MAknsSkinInstance *, TUid, TSize, CApaMaskedBitmap & )

IMPORT_C TIntGetAppIcon(MAknsSkinInstance *aInstance,
TUidaAppUid,
TSizeaSize,
CApaMaskedBitmap &aAppBitmap
)[static]

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.

Since
2.0
Note:
This method does not support scalable graphics. Consider using CreateAppIconLC instead.
ParameterDescription
aInstancePointer to current skin instance.
aAppUidApplication UID. Icon is searched with major IID EAknsIIDMajorAppIcon and minor IID aAppUid. AppArch search is always performed with UID only.
aSizeMaximum size of the icon.
aAppBitmapOn return contains the icon.

Returns: KErrNone if succeeded, KErrNotFound if no icon was found or size requirements were not met, other error code if another error occured.

GetCachedBitmap ( MAknsSkinInstance *, const TAknsItemID & )

IMPORT_C CFbsBitmap *GetCachedBitmap(MAknsSkinInstance *aInstance,
const TAknsItemID &aID
)[static]

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.

Since
2.0
Exceptions:
ParameterDescription
aInstancePointer to current skin instance. If NULL value is specified, method immediately returns with NULL return value.
aIDItem ID of the bitmap to be retrieved.

Returns: Pointer to the bitmap, or NULL if no bitmap with given ID was found or an error occured.

GetCachedColor ( MAknsSkinInstance *, TRgb &, const TAknsItemID &, const TInt )

IMPORT_C TIntGetCachedColor(MAknsSkinInstance *aInstance,
TRgb &aRgb,
const TAknsItemID &aID,
const TIntaIndex
)[static]

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.

Since
2.0
ParameterDescription
aInstancePointer to current skin instance. If NULL value is specified, returns KErrNotSupported.
aRgbReference to a TRgb that will receive the color.
aIDItem ID of the color table.
aIndexIndex of the color in the color table.

Returns: KErrNone if successful, otherwise an error code is returned.

GetCachedMaskedBitmap ( MAknsSkinInstance *, const TAknsItemID &, CFbsBitmap *&, CFbsBitmap *& )

IMPORT_C voidGetCachedMaskedBitmap(MAknsSkinInstance *aInstance,
const TAknsItemID &aID,
CFbsBitmap *&aBitmap,
CFbsBitmap *&aMask
)[static]

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.

Since
2.1
Exceptions:
ParameterDescription
aInstancePointer to the current skin instance. If NULL value is specified, the method assigns NULL to both the given pointers and then returns.
aIDItem ID of the bitmap (or masked bitmap) to be retrieved.
aBitmapReference to the pointer that will receive the bitmap. NULL value is assigned if no bitmap with the given ID was found or an error occured.
aMaskReference to the pointer that will receive the mask. NULL value is assigned if no bitmap with the given ID was found, or the bitmap did not have a mask, or an error occured.

GetControlPosition ( const CCoeControl *, TPoint & )

IMPORT_C TIntGetControlPosition(const CCoeControl *aControl,
TPoint &aScreenPos
)[static]

Gets the position of the control registered in the control position list.

ParameterDescription
aControlPointer to the control whose position is to be queried.
aScreenPosReference to the TPoint that will receive the position.

Returns: KErrNone if successful, KErrNotFound if the control has not been registered.

InitSkinSupportL ( )

IMPORT_C voidInitSkinSupportL()[static]

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.

Since
2.0
Notes:
The framework calls this method automatically for each application. Thus, a normal application does not need to call this method explicitly.
Exceptions:
  • If allocation fails, function leaves with an error code.

IsDerivedType ( const TAknsItemType, const TAknsItemType )

TBool IsDerivedType(const TAknsItemTypeaBaseType,
const TAknsItemTypeaDerivedType
)[static]

Test whether the given type is derived from the given base type.

Since
2.0
ParameterDescription
aBaseTypeBase type.
aDerivedTypeDerived type.

Returns: ETrue if the type is derived from the base type, EFalse otherwise.

OpenAppIconFile ( MAknsSkinInstance *, TUid, TAknsAppIconType, RFile & )

IMPORT_C TIntOpenAppIconFile(MAknsSkinInstance *aInstance,
TUidaAppUid,
TAknsAppIconTypeaType,
RFile &aFile
)

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 CreateAppIconLC to construct the icon. Otherwise, one of the associated files is opened using the given RFile object.

Since
3.0
library
AknSkins.lib
ParameterDescription
aInstancePointer to current skin instance.
aAppUidApplication UID. Icon is searched with major IID EAknsIIDMajorAppIcon and minor IID aAppUid.
aTypeOnly EAknsAppIconType3D is allowed.
aFileReference to a RFile. If KErrNone is returned, this handle refers to an open file containing the data. If an error code is returned, the file is not opened.

Returns: KErrNone if a file was opened, an error code otherwise.

RegisterControlPosition ( const CCoeControl * )

IMPORT_C voidRegisterControlPosition(const CCoeControl *aControl)[static]

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.

Since
2.0
ParameterDescription
aControlPointer to the control that needs its position to be updated in the control position list.

RegisterControlPosition ( const CCoeControl *, const TPoint & )

IMPORT_C voidRegisterControlPosition(const CCoeControl *aControl,
const TPoint &aPoint
)[static]

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.

Since
2.0
ParameterDescription
aControlPointer to the control that needs its position to be updated in the control position list.
aPointThe new position to be registered with the given control (in screen coordinates).

SetAnimationBackgroundDisabledL ( TBool )

IMPORT_C voidSetAnimationBackgroundDisabledL(TBoolaDisabled)[static]

Sets the flag indicating whether animation background should be used in the scope of the current AppUi.

Since
5.2

SetAvkonHighlightAnimationEnabledL ( const TBool )

IMPORT_C voidSetAvkonHighlightAnimationEnabledL(const TBoolaEnabled)[static]

Sets the flag indicating whether highlight animations should be used for Avkon list controls in the scope of the current AppUi.

Since
3.0
Exceptions:
If construction of the storage object for the flag fails, leaves with an error code.

SetAvkonSkinEnabledL ( const TBool )

IMPORT_C voidSetAvkonSkinEnabledL(const TBoolaEnabled)[static]

Sets the flag indicating whether default skin parameters should be used for newly created Avkon controls in the scope of the current AppUi.

Since
2.0
Exceptions:
If construction of the storage object for the flag fails, leaves with an error code.

SkinInstance ( )

IMPORT_C MAknsSkinInstance *SkinInstance()[static]

Returns pointer to current skin instance. Retrieves pointer to the current application skin instance singleton. If there is none, NULL value is returned.

Since
2.0

Returns: Pointer to current skin instance, or NULL if no skin support is available.