MHuiBitmapProvider Class Reference

class MHuiBitmapProvider

MHuiBitmapProvider is an interface that provides a bitmap and its alpha mask when requested.

By storing MHuiBitmapProviders in the CHuiTextureManager we can delete and regenerate the textures used by the toolkit as needed - enabling improved use of memory resource, such as when the application goes to background. In this case, when we want to restore all the textures, we may just recall the providers to reload the textures.

Typically, control classes would implement the ProvideBitmapL method of this class, which would handle all the loading or generation needed to produce the bitmaps stored by the TextureManager.

A provider should exist as long as the associated texture is stored within the texture manager.

Constructor & Destructor Documentation

~MHuiBitmapProvider()

IMPORT_C ~MHuiBitmapProvider ( ) [virtual]

Member Functions Documentation

ProvideBitmapL(TInt, CFbsBitmap *&, CFbsBitmap *&)

void ProvideBitmapL ( TInt aId,
CFbsBitmap *& aBitmap,
CFbsBitmap *& aMaskBitmap
) [pure virtual]

Provide a bitmap and mask from the given UID. This method should create a bitmap and its mask, usually by loading it from disk.

CHuiTextureManager::CreateTextureL()

Parameters

TInt aId TextureManager id of this bitmap, may be used for extracting an icon resource.
CFbsBitmap *& aBitmap Output parameter for the provider: On return, has to store a pointer to the generated bitmap. Ownership transferred to caller. The support for input CFbsBitmap formats varies between different renderers. See Input bitmaps supported Table describing renderer bitmap support.
CFbsBitmap *& aMaskBitmap Output parameter for the provider: On return, has to store a pointer to the generated alpha mask or NULL if there is no mask. Ownership of the bitmap is transferred to the caller.