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_C CHuiImageLoaderUtil ( )

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,
TInt aBitmapId,
TInt aMaskId
)

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 & aID An Akvon skin item ID of the graphical item (e.g. an icon) to load.
const TDesC & aFileName File name of graphics file e.g. mif file) when sepcified item is not found in the current skin.
TInt aBitmapId ID of the bitmap when fallback is used.
TInt aMaskId ID of the mask bitmap when fallback is used.

CreateImageLoaderL(TUid, TAknsAppIconType)

IMPORT_C MHuiBitmapProvider * CreateImageLoaderL ( TUid aAppUid,
TAknsAppIconType aType
)

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 aAppUid Application UID of the icon to be created.
TAknsAppIconType aType Type of the application icon. Likely EAknsAppIconTypeContext is used...

ImageLoaderExtension(const TUid &, TAny **)

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

Parameters

const TUid & aExtensionUid
TAny ** aExtensionParamters

SetSize(TSize, TScaleMode)

IMPORT_C void SetSize ( TSize aSize,
TScaleMode aMode = 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 aSize Size in pixel.
TScaleMode aMode = EAspectRatioPreserved Scaling mode enumeration from Avkon. It takes either of following three. EAspectRatioPreserved EAspectRatioPreservedAndUnusedSpaceRemoved EAspectRatioNotPreserved

SetSkinInstance(MAknsSkinInstance *)

IMPORT_C void SetSkinInstance ( 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 * aSkinInstance An 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]