|
1 /* |
|
2 * Copyright (c) 2006 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: Bitmap provider interface. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 #ifndef C_ALFBITMAPPROVIDER_H |
|
21 #define C_ALFBITMAPPROVIDER_H |
|
22 |
|
23 class CFbsBitmap; |
|
24 |
|
25 /** |
|
26 * MAlfBitmapProvider is an interface that provides a bitmap and its alpha |
|
27 * mask when requested. |
|
28 * |
|
29 * By storing MAlfBitmapProviders in the CAlfTextureManager we can delete and |
|
30 * regenerate the textures used by the toolkit as needed - enabling improved |
|
31 * use of memory resource, such as when the application goes to background. |
|
32 * In this case, when we want to restore all the textures, we may just recall |
|
33 * the providers to reload the textures. |
|
34 * |
|
35 * Typically, control classes would implement the ProvideBitmapL method of this |
|
36 * class, which would handle all the loading or generation needed to produce the |
|
37 * bitmaps stored by the TextureManager. |
|
38 * |
|
39 * A provider should exist as long as the associated texture is stored within |
|
40 * the texture manager. |
|
41 */ |
|
42 class MAlfBitmapProvider |
|
43 { |
|
44 public: |
|
45 |
|
46 virtual ~MAlfBitmapProvider() |
|
47 { |
|
48 } |
|
49 |
|
50 /** |
|
51 * Provide a bitmap and mask from the given UID. |
|
52 * This method should create a bitmap and its mask, usually by loading it from disk. |
|
53 * |
|
54 * @param aId TextureManager id of this bitmap, may be used for extracting |
|
55 * an icon resource. |
|
56 * @param aBitmap Output parameter for the provider: On return, has to store |
|
57 * a pointer to the generated bitmap. Ownership transferred to caller. |
|
58 * The support for input CFbsBitmap formats varies between |
|
59 * different renderers. See \ref cfbsbitmapsupport |
|
60 * Table describing renderer bitmap support. |
|
61 * @param aMaskBitmap |
|
62 * Output parameter for the provider: On return, has to store |
|
63 * a pointer to the generated alpha mask or <code>NULL</code> |
|
64 * if there is no mask. Ownership of the bitmap is transferred |
|
65 * to the caller. |
|
66 * |
|
67 * @see CAlfTextureManager::CreateTextureL() |
|
68 */ |
|
69 virtual void ProvideBitmapL(TInt aId, CFbsBitmap*& aBitmap, CFbsBitmap*& aMaskBitmap) = 0; |
|
70 |
|
71 }; |
|
72 |
|
73 |
|
74 #endif // C_ALFBITMAPPROVIDER_H |