CHuiImageLoaderUtil Class Reference

class CHuiImageLoaderUtil : public CBase

CHuiImageLoaderUtil is a utility class to create image loader with the system skin applied. CHuiImageLoaderUtil holds all MHuiBitmapProvider instance created through CreateImageLoaderL() so that appplication/control does not need to keep it by itself.

Typically, an application or a control needs to hold instance of CHuiImageLoaderUtil during entire its object life time, because bitmap provision callback from texture manager may be called even after instanciation of texture. For instance, image re-loading happens when application coming back to foreground and resource was released.

Inherits from

Constructor & Destructor Documentation

CHuiImageLoaderUtil()

IMPORT_CCHuiImageLoaderUtil()

Constructor

~CHuiImageLoaderUtil()

IMPORT_C~CHuiImageLoaderUtil()

Deconstructor

Member Functions Documentation

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

IMPORT_C MHuiBitmapProvider *CreateImageLoaderL(const TAknsItemID &aID,
const TDesC &aFileName,
TIntaBitmapId,
TIntaMaskId
)

Create MHuiBitmapProvider instance to load image with Avkon skin item ID with fallback. The fallback is used when the current skin does not contain the image with skin item ID. If either fails, this leaves. Use CHuiTextureManager::CreateTextureL() with return value of this method as a bitmap provider to create a HUI texture.

Parameters

const TAknsItemID & aIDAn Akvon skin item ID of the graphical item (e.g. an icon) to load.
const TDesC & aFileNameFile name of graphics file e.g. mif file) when sepcified item is not found in the current skin.
TInt aBitmapIdID of the bitmap when fallback is used.
TInt aMaskIdID of the mask bitmap when fallback is used.

CreateImageLoaderL(TUid, TAknsAppIconType)

IMPORT_C MHuiBitmapProvider *CreateImageLoaderL(TUidaAppUid,
TAknsAppIconTypeaType
)

Create MHuiBitmapProvider instance to load Application icon image. Use CHuiTextureManager::CreateTextureL() with return value of this method as a bitmap provider to create a HUI texture.

Parameters

TUid aAppUidApplication UID of the icon to be created.
TAknsAppIconType aTypeType of the application icon. Likely EAknsAppIconTypeContext is used...

ImageLoaderExtension(const TUid &, TAny **)

IMPORT_C voidImageLoaderExtension(const TUid &aExtensionUid,
TAny **aExtensionParamters
)[virtual]

Parameters

const TUid & aExtensionUid
TAny ** aExtensionParamters

SetSize(TSize, TScaleMode)

IMPORT_C voidSetSize(TSizeaSize,
TScaleModeaMode = EAspectRatioPreserved
)

Set size of the image to be loaded. This must be called before calling CreateImageLoaderL. This call only sets information and does *NOT* cause any scalable icon rasterization. Also Size setting does not affect any of image loaders already created.

Parameters

TSize aSizeSize in pixel.
TScaleMode aMode = EAspectRatioPreservedScaling mode enumeration from Avkon. It takes either of following three. EAspectRatioPreserved EAspectRatioPreservedAndUnusedSpaceRemoved EAspectRatioNotPreserved

SetSkinInstance(MAknsSkinInstance *)

IMPORT_C voidSetSkinInstance(MAknsSkinInstance *aSkinInstance)

Set skin instance, which is acquired from AknsUtils::SkinInstance(). If skin instance is not explicitly set with this method, the image loader will use skin instance from AknsUtils::SkinInstance().

Parameters

MAknsSkinInstance * aSkinInstanceAn Avkon skin instamce.

Member Data Documentation

RPointerArray< CHuiImageLoader > iImageLoaderList

RPointerArray< CHuiImageLoader >iImageLoaderList[protected]

An array to hold all loader created.

TScaleMode iScaleMode

TScaleMode iScaleMode[private]

Scale mode of image to be created

TSize iSize

TSize iSize[private]

Size of image to be created

MAknsSkinInstance * iSkinInstance

MAknsSkinInstance *iSkinInstance[private]

Skin instance.

TAny * iSpare

TAny *iSpare[private]