AknsUtils Class Reference

class AknsUtils

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.

AknSkins.lib

2.0

Public Member Functions
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 voidSetAvkonHighlightAnimationEnabledL(const TBool)
IMPORT_C voidSetAvkonSkinEnabledL(const TBool)
IMPORT_C MAknsSkinInstance *SkinInstance()
Private Member Functions
AknsUtils()
~AknsUtils()
TInt GetAppIconFromSkin(MAknsSkinInstance *, TUid, TSize, CFbsBitmap *&, CFbsBitmap *&)
IMPORT_C TIntReserved()
TAknsItemID SelectBestAppIconBitmapL(const TSize &, MAknsSkinInstance *, const TAknsItemID &)

Constructor & Destructor Documentation

AknsUtils()

AknsUtils()[private]

~AknsUtils()

~AknsUtils()[private]

Member Functions Documentation

AvkonHighlightAnimationEnabled()

IMPORT_C TBoolAvkonHighlightAnimationEnabled()[static]

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

3.0

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.

2.0

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.

2.8

Value of the boolean property as TBool.

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.

Parameters

MAknsSkinInstance * aInstancePointer to current skin instance. If NULL value is specified, the method leaves.
const TAknsItemID & aIDItem ID of the boolean property.

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.

2.8

AknSkins.lib

Exceptions:

If the method fails, it leaves with a standard error code.

Parameters

MAknsSkinInstance * aInstancePointer to current skin instance.
TUid aAppUidApplication UID. Icon is searched with major IID EAknsIIDMajorAppIcon and minor IID aAppUid.
TAknsAppIconType 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.
CFbsBitmap *& aBitmapIf method succeeds, set to point to the newly constructed bitmap. Ownership of the bitmap is transferred to the caller.
CFbsBitmap *& 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.

2.0

Newly constructed item definition object.

Exceptions:

If construction fails, the method leaves with an error code.

Parameters

const TAknsItemID & aIDItem ID of the item definition object to be created:
const TDesC & aFilename
const TInt aIndexIndex of the bitmap in the file.

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.

2.0

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

Exceptions:

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

Parameters

MAknsSkinInstance * aInstancePointer to current skin instance.
const TAknsItemID & aIDItem ID of the bitmap to be created.

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.

2.6

AknSkins.lib

Exceptions:

If data construction fails or bitmap is not found, the function leaves with an error code.

Parameters

MAknsSkinInstance * aInstancePointer to the current skin instance. Usually retrieved using AknsUtils::SkinInstance.
const TAknsItemID & aIDItem ID of the masked bitmap to be created.
const TAknsItemID & aColorIDItem ID of the color table.
const TInt aColorIndexIndex in the color table.
CFbsBitmap *& aBitmapIf method succeeds, set to point to the newly constructed bitmap. Ownership of the bitmap is transferred to the caller.
CFbsBitmap *& aMaskIf method succeeds, set to point to the newly constructed mask bitmap. Ownership of the bitmap is transferred to the caller.
const TDesC & aFilenameFilename to be used to construct the item, if no matching item was found in the currently active skin.
const TInt aFileBitmapIdID of the bitmap in the file. Used only if no matching item was found in the currently active skin.
const TInt aFileMaskIdID of the mask in the file. Used only if no matching item was found in the currently active skin.
const TRgb 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.

2.8

AknSkins.lib

Parameters

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

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.

2.6

AknSkins.lib

Note:

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

Parameters

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

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.

2.8

AknSkins.lib

Note:

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

Parameters

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

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.

2.0

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.

2.6

AknSkins.lib

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

Exceptions:

If data construction fails or bitmap is not found, the function leaves with an error code.

Parameters

MAknsSkinInstance * aInstancePointer to the current skin instance.
const TAknsItemID & aIDItem ID of the masked bitmap to be created.
const TDesC & aFilenameFilename to be used to construct the item, if no matching item was found in the currently active skin.
const TInt aFileIndexIndex (for bitmap) in the file. Used only if no matching item was found in the currently active skin.
const TInt aFileMaskIndexIndex (for mask) in the file. Used only if no matching item was found in the currently active skin.

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.

2.1

AknSkins.lib

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

Exceptions:

If data construction fails or bitmap is not found, the function leaves with an error code.

Parameters

MAknsSkinInstance * aInstancePointer to the current skin instance.
const TAknsItemID & aIDItem ID of the bitmap or masked bitmap to be created.
const TBool aRequireMaskETrue if masked bitmap is explicitly required. EFalse if mask is optional.

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.

2.6

AknSkins.lib

Exceptions:

If data construction fails or bitmap is not found, the function leaves with an error code.

Parameters

MAknsSkinInstance * aInstancePointer to the current skin instance. Usually retrieved using AknsUtils::SkinInstance.
const TAknsItemID & aIDItem ID of the masked bitmap to be created.
CFbsBitmap *& aBitmapIf method succeeds, set to point to the newly constructed bitmap. Ownership of the bitmap is transferred to the caller.
CFbsBitmap *& aMaskIf method succeeds, set to point to the newly constructed mask bitmap. Ownership of the bitmap is transferred to the caller.
const TDesC & aFilenameFilename to be used to construct the item, if no matching item was found in the currently active skin.
const TInt aFileBitmapIdID of the bitmap in the file. Used only if no matching item was found in the currently active skin.
const TInt 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.

2.6

AknSkins.lib

Exceptions:

If data construction fails or bitmap is not found, the function leaves with an error code.

Parameters

MAknsSkinInstance * aInstancePointer to the current skin instance. Usually retrieved using AknsUtils::SkinInstance.
const TAknsItemID & aIDItem ID of the non-masked bitmap to be created.
CFbsBitmap *& aBitmapIf method succeeds, set to point to the newly constructed bitmap. Ownership of the bitmap is transferred to the caller.
const TDesC & aFilenameFilename to be used to construct the item, if no matching item was found in the currently active skin.
const TInt 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.

Parameters

MAknsSkinInstance * aInstance
const TAknsItemID & aID
CFbsBitmap *& aBitmap
CFbsBitmap *& aMask
const TDesC & aFilename
const TInt aFileBitmapId
const TInt aFileMaskId

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.

Parameters

MAknsSkinInstance * aInstance
const TAknsItemID & aID
CFbsBitmap *& aBitmap
const TDesC & aFilename
const TInt aFileBitmapId

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.

2.0

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

Exceptions:

If construction fails, the method leaves with an error code.

Parameters

const TAknsItemID & aIDItem ID of the item definition object to be created:
const TDesC & aFilename
const TInt aIndexIndex of the bitmap mask in the file.
const TInt aMaskIndex

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.

2.6

AknSkins.lib

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

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.

Parameters

MAknsSkinInstance * aInstancePointer to the current skin instance.
const TAknsItemID & aIDItem ID of the masked bitmap to be created.
const TDesC & aFilenameFilename to be used to construct the item, if no matching item was found in the currently active skin.
const TInt aFileIndexIndex (for bitmap) in the file. Used only if no matching item was found in the currently active skin.
const TInt aFileMaskIndexIndex (for mask) in the file. Used only if no matching item was found in the currently active skin.

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.

2.0

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

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.

Parameters

MAknsSkinInstance * aInstancePointer to the current skin instance.
const TAknsItemID & aIDItem ID of the masked bitmap to be created.

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.

2.0

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

Parameters

MObjectProvider * 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.

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.

2.0

Parameters

const CCoeControl * 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.

2.0

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

Note:

This method does not support scalable graphics. Consider using CreateAppIconLC instead.

Parameters

MAknsSkinInstance * aInstancePointer to current skin instance.
TUid aAppUidApplication UID. Icon is searched with major IID EAknsIIDMajorAppIcon and minor IID aAppUid. AppArch search is always performed with UID only.
TSize aSizeMaximum size of the icon.
CApaMaskedBitmap & aAppBitmapOn return contains the icon.

GetAppIconFromSkin(MAknsSkinInstance *, TUid, TSize, CFbsBitmap *&, CFbsBitmap *&)

TInt GetAppIconFromSkin(MAknsSkinInstance *aInstance,
TUidaAppUid,
TSizeaSize,
CFbsBitmap *&aBitmap,
CFbsBitmap *&aMask
)[private, static]

Gets an application icon from skin.

2.8

Parameters

MAknsSkinInstance * aInstance
TUid aAppUid
TSize aSize
CFbsBitmap *& aBitmap
CFbsBitmap *& aMask

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.

2.0

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

Exceptions:

Parameters

MAknsSkinInstance * aInstancePointer to current skin instance. If NULL value is specified, method immediately returns with NULL return value.
const TAknsItemID & aIDItem ID of the bitmap to be retrieved.

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.

2.0

KErrNone if successful, otherwise an error code is returned.

Parameters

MAknsSkinInstance * aInstancePointer to current skin instance. If NULL value is specified, returns KErrNotSupported.
TRgb & aRgbReference to a TRgb that will receive the color.
const TAknsItemID & aIDItem ID of the color table.
const TInt aIndexIndex of the color in the color table.

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.

2.1

Exceptions:

Parameters

MAknsSkinInstance * aInstancePointer to the current skin instance. If NULL value is specified, the method assigns NULL to both the given pointers and then returns.
const TAknsItemID & aIDItem ID of the bitmap (or masked bitmap) to be retrieved.
CFbsBitmap *& 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.
CFbsBitmap *& 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.

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

Parameters

const CCoeControl * aControlPointer to the control whose position is to be queried.
TPoint & aScreenPosReference to the TPoint that will receive the position.

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.

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.

2.0

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

Parameters

const TAknsItemType aBaseTypeBase type.
const TAknsItemType aDerivedTypeDerived type.

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.

3.0

AknSkins.lib

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

Parameters

MAknsSkinInstance * aInstancePointer to current skin instance.
TUid aAppUidApplication UID. Icon is searched with major IID EAknsIIDMajorAppIcon and minor IID aAppUid.
TAknsAppIconType aTypeOnly EAknsAppIconType3D is allowed.
RFile & 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.

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.

2.0

Parameters

const CCoeControl * 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.

2.0

Parameters

const CCoeControl * aControlPointer to the control that needs its position to be updated in the control position list.
const TPoint & aPointThe new position to be registered with the given control (in screen coordinates).

Reserved()

IMPORT_C TIntReserved()[private, static]

Reserved for future use.

2.0

Always returns zero.

SelectBestAppIconBitmapL(const TSize &, MAknsSkinInstance *, const TAknsItemID &)

TAknsItemID SelectBestAppIconBitmapL(const TSize &aSize,
MAknsSkinInstance *aSkin,
const TAknsItemID &aAppIconIID
)[private, static]

Returns the best application icon bitmap IID among the listed icons.

2.1

Icon bitmap IID.

Parameters

const TSize & aSizeMaximum size.
MAknsSkinInstance * aSkinSkin instance.
const TAknsItemID & aAppIconIIDItem ID of the application icon.

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.

3.0

Exceptions:

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

Parameters

const TBool aEnabled

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.

2.0

Exceptions:

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

Parameters

const TBool aEnabled

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.

2.0

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