|
1 /* |
|
2 * Copyright (c) 2007-2008 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: image provider for mif file |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 #ifndef C_HNATTRIMGPROVTHEMEMIF_H |
|
21 #define C_HNATTRIMGPROVTHEMEMIF_H |
|
22 |
|
23 #include "hnattrimgprovider.h" |
|
24 #include "hnglobals.h" |
|
25 |
|
26 /** |
|
27 * Image provider class for empty image. |
|
28 * Image provider specialization that loads image |
|
29 * froma an image file path. |
|
30 * |
|
31 * @lib hnpresentationmodel |
|
32 * @since S60 5.0 |
|
33 * @ingroup group_hnpresentationmodel |
|
34 */ |
|
35 NONSHARABLE_CLASS( CHnAttrImgProvThemeMif ) : public CHnAttrImgProvider |
|
36 { |
|
37 public: |
|
38 |
|
39 /** |
|
40 * Two-phase constructor. |
|
41 * |
|
42 * @since S60 5.0 |
|
43 * @param aSkinId Skin id |
|
44 * @param aFile File name |
|
45 * @param aBitmapId Bitmap id |
|
46 * @param aMaskId Mask id |
|
47 * @return Fully constructed object. |
|
48 */ |
|
49 IMPORT_C static CHnAttrImgProvThemeMif* NewL( TAknsItemID aSkinId, |
|
50 const TDesC& aFile, TInt aBitmapId, TInt aMaskId ); |
|
51 |
|
52 /** |
|
53 * Two-phase constructor. |
|
54 * |
|
55 * @since S60 5.0 |
|
56 * @param aSkinId Skin id |
|
57 * @param aFile File name |
|
58 * @param aBitmapId Bitmap id |
|
59 * @param aMaskId Mask id |
|
60 * @return Fully constructed object. |
|
61 */ |
|
62 IMPORT_C static CHnAttrImgProvThemeMif* NewLC( TAknsItemID aSkinId, |
|
63 const TDesC& aFile, TInt aBitmapId, TInt aMaskId ); |
|
64 |
|
65 /** |
|
66 * Virtual destructor. |
|
67 * |
|
68 * @since S60 5.0 |
|
69 */ |
|
70 virtual ~CHnAttrImgProvThemeMif(); |
|
71 |
|
72 // from base class CHnAttrImgProvider |
|
73 public: |
|
74 |
|
75 /** |
|
76 * Returns the value. |
|
77 * |
|
78 * @since S60 5.0 |
|
79 * @return Value |
|
80 */ |
|
81 const TDesC8& Value( ); |
|
82 |
|
83 /** |
|
84 * This method should create a bitmap and its mask, |
|
85 * by retrieving it form the application by a given uid (passed |
|
86 * in the constructor) |
|
87 * |
|
88 * @param aId Parameter not used. |
|
89 * @param aBitmap Output pointer to a bitmap. |
|
90 * @param aMaskBitmap Output pointer to a mask. |
|
91 */ |
|
92 void ProvideBitmapL(TInt aId, CFbsBitmap*& aBitmap, |
|
93 CFbsBitmap*& aMaskBitmap); |
|
94 |
|
95 |
|
96 private: |
|
97 |
|
98 /** |
|
99 * Default constructor. |
|
100 * |
|
101 * @since S60 5.0 |
|
102 */ |
|
103 CHnAttrImgProvThemeMif(); |
|
104 |
|
105 /** |
|
106 * Standard 2nd pahse symbian constructor. |
|
107 * |
|
108 * @since S60 5.0 |
|
109 * @param aSkinId Skin id |
|
110 * @param aFile File name |
|
111 * @param aBitmapId Bitmap id |
|
112 * @param aMaskId Mask id |
|
113 */ |
|
114 void ConstructL( TAknsItemID aSkinId, |
|
115 const TDesC& aFile, TInt aBitmapId, TInt aMaskId ); |
|
116 |
|
117 /** |
|
118 * Checks if mask id and bitmap id are in the range of mif file ids. |
|
119 * |
|
120 * @since S60 5.0 |
|
121 * @return ETrue if ids are in the range of mif file ids. Else return EFalse. |
|
122 */ |
|
123 TBool ValidateIconIds(); |
|
124 |
|
125 private: // data |
|
126 |
|
127 /** |
|
128 * Value. |
|
129 */ |
|
130 TBuf8<KMaxLength> iValue; |
|
131 |
|
132 /** |
|
133 * Skin id. |
|
134 */ |
|
135 TAknsItemID iSkinId; |
|
136 |
|
137 /** |
|
138 * File name. |
|
139 */ |
|
140 TPtrC iFile; |
|
141 |
|
142 /** |
|
143 * Bitmap id. |
|
144 */ |
|
145 TInt iBitmapId; |
|
146 |
|
147 /** |
|
148 * Mask id. |
|
149 */ |
|
150 TInt iMaskId; |
|
151 |
|
152 }; |
|
153 |
|
154 |
|
155 #endif // C_HNATTRIMGPROVTHEMEMIF_H |
|
156 |