|
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: ?Description |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef IRICONLOADER_H |
|
20 #define IRICONLOADER_H |
|
21 |
|
22 #include <e32base.h> |
|
23 |
|
24 class CFbsBitmap; |
|
25 class CGulIcon; |
|
26 |
|
27 /** |
|
28 * This class Creates CIconFileProvider. |
|
29 * |
|
30 * Since the AknIconUtils cannot access the private directory of application, |
|
31 * mix-in class MAknIconFileProvider is implemented to provide handle of the |
|
32 * icon files (ScalableScreenDrawingIcons.mbm in this case) to AknIconUtils. |
|
33 * Creates an icon.All the view will use this API to create the icons for the view. |
|
34 * |
|
35 * @code |
|
36 * |
|
37 * The icon is created by loading the image bitmap identified by aBitmapId |
|
38 * and the mask identified by aMaskId. |
|
39 * AknIconUtils::CreateIconL(bitmap , mask , *iFilename, aBitmapId , aMaskId); . |
|
40 * |
|
41 * Creates an icon. |
|
42 * The icon is created by loading the image bitmap identified by aBitmapId. |
|
43 * It returns a pointer to the icon and transfers ownership. |
|
44 * AknIconUtils::CreateIconL(*iFilename, aBitmapId); |
|
45 * |
|
46 * @endcode |
|
47 * |
|
48 */ |
|
49 class CIconFileProvider : public CBase |
|
50 { |
|
51 public: |
|
52 /** |
|
53 * CIconFileProvider(). |
|
54 * C++ default constructor. |
|
55 */ |
|
56 IMPORT_C CIconFileProvider(); |
|
57 |
|
58 /** |
|
59 * NewL. |
|
60 * Two-phased constructor. |
|
61 * Create a CIconFileProvider object, which will draw itself to |
|
62 * aRect. |
|
63 * @param aFilename the path where the icon should be loaded. |
|
64 * @return a pointer to the created instance of CIconFileProvider. |
|
65 */ |
|
66 IMPORT_C static CIconFileProvider* NewL(const TDesC& aFilename); |
|
67 |
|
68 /** |
|
69 * ConstructL |
|
70 * 2nd phase constructor. |
|
71 * Perform the second phase construction of a |
|
72 * CIconFileProvider object. |
|
73 * @param aFilename the path where the icon should be loaded. |
|
74 */ |
|
75 void ConstructL( const TDesC& aFilename); |
|
76 |
|
77 /** |
|
78 * ~CIconFileProvider |
|
79 * Destructor. |
|
80 */ |
|
81 ~CIconFileProvider(); |
|
82 |
|
83 /** |
|
84 * CreateIconL(). |
|
85 * Creates the icons for the listbox. |
|
86 * @param ID for the bitmap for which icon should be created. |
|
87 * @param ID for the bitmap mask for which icon should be created. |
|
88 */ |
|
89 IMPORT_C CGulIcon* CreateIconL(TInt aBitmapId,TInt aMaskId) const; |
|
90 |
|
91 /** |
|
92 * CreateIconL(). |
|
93 * Creates the icons for the listbox. |
|
94 * @param ID for the bitmap for which icon should be created. |
|
95 */ |
|
96 IMPORT_C CFbsBitmap* CreateIconL(TInt aBitmapId) const; |
|
97 private: |
|
98 // Filename where the icon should be created. |
|
99 HBufC* iFilename; |
|
100 }; |
|
101 |
|
102 #endif//IRICONLOADER_H |