uiaccelerator_plat/alf_core_toolkit_api/inc/uiacceltk/HuiBitmapProvider.h
changeset 0 15bf7259bb7c
equal deleted inserted replaced
-1:000000000000 0:15bf7259bb7c
       
     1 /*
       
     2 * Copyright (c) 2006-2007 Nokia Corporation and/or its subsidiary(-ies). 
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:   Definition of MHuiBitmapProvider, an interface that provides 
       
    15 *                a bitmap and its alpha mask when requested. 
       
    16 *
       
    17 */
       
    18 
       
    19 
       
    20 
       
    21 #ifndef __HUIBITMAPPROVIDER_H__
       
    22 #define __HUIBITMAPPROVIDER_H__
       
    23 
       
    24 class CFbsBitmap;
       
    25 
       
    26 /** 
       
    27  * MHuiBitmapProvider is an interface that provides a bitmap and its alpha 
       
    28  * mask when requested.
       
    29  * 
       
    30  * By storing MHuiBitmapProviders in the CHuiTextureManager we can delete and 
       
    31  * regenerate the textures used by the toolkit as needed - enabling improved 
       
    32  * use of memory resource, such as when the application goes to background.
       
    33  * In this case, when we want to restore all the textures, we may just recall 
       
    34  * the providers to reload the textures. 
       
    35  *
       
    36  * Typically, control classes would implement the ProvideBitmapL method of this
       
    37  * class, which would handle all the loading or generation needed to produce the
       
    38  * bitmaps stored by the TextureManager.
       
    39  * 
       
    40  * A provider should exist as long as the associated texture is stored within
       
    41  * the texture manager.
       
    42  */
       
    43 class MHuiBitmapProvider 
       
    44     {
       
    45 public:
       
    46 
       
    47     IMPORT_C virtual ~MHuiBitmapProvider();
       
    48             
       
    49     /**
       
    50      * Provide a bitmap and mask from the given UID.
       
    51      * This method should create a bitmap and its mask, usually by loading it from disk.
       
    52      *
       
    53      * @param aId      TextureManager id of this bitmap, may be used for extracting
       
    54      *                 an icon resource.
       
    55      * @param aBitmap  Output parameter for the provider: On return, has to store 
       
    56      *                 a pointer to the generated bitmap. Ownership transferred to caller.
       
    57 	 *                 The support for input CFbsBitmap formats varies between 
       
    58 	 *                 different renderers. See \ref cfbsbitmapsupport 
       
    59 	 *                 Table describing renderer bitmap support.      
       
    60 	 * @param aMaskBitmap  
       
    61 	 *                 Output parameter for the provider: On return, has to store 
       
    62      *                 a pointer to the generated alpha mask or <code>NULL</code> 
       
    63      * 				   if there is no mask. Ownership of the bitmap is transferred 
       
    64      *                 to the caller.
       
    65      * 
       
    66      * @see CHuiTextureManager::CreateTextureL()
       
    67      */
       
    68      virtual void ProvideBitmapL(TInt aId, CFbsBitmap*& aBitmap, CFbsBitmap*& aMaskBitmap) = 0;
       
    69     
       
    70     };
       
    71 
       
    72 
       
    73 #endif // __HUIBITMAPPROVIDER_H__