|
1 /* |
|
2 * Copyright (c) 2005-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: header file of button and dragbar |
|
15 * |
|
16 */ |
|
17 |
|
18 #ifndef C_CAKNFEPCTRLLABEL_H |
|
19 #define C_CAKNFEPCTRLLABEL_H |
|
20 |
|
21 #include <peninputlayoutbasecontrol.h> |
|
22 /** |
|
23 * CAknFepCtrlLabel |
|
24 * |
|
25 * Label control. This class could be used directly by user. |
|
26 * |
|
27 * @lib peninputlayoutcontrol.lib |
|
28 * @since S60 V5.0 |
|
29 */ |
|
30 class CAknFepCtrlLabel: public CFepUiBaseCtrl |
|
31 { |
|
32 |
|
33 public: |
|
34 //constructor and destructor |
|
35 /** |
|
36 * Destructor. |
|
37 * |
|
38 * @since S60 V4.0 |
|
39 */ |
|
40 IMPORT_C virtual ~CAknFepCtrlLabel(); |
|
41 |
|
42 /** |
|
43 * Factory function. |
|
44 * |
|
45 * @since S60 V4.0 |
|
46 * @param aRect The rectangle area for this control |
|
47 * @param aUiLayout Ui layout who contains this control.Ownership not transferred |
|
48 * @param aControlId control Id |
|
49 * @return An instance of CButtonBase class |
|
50 */ |
|
51 IMPORT_C static CAknFepCtrlLabel* NewL(CFepUiLayout* aUiLayout,TInt aControlId); |
|
52 |
|
53 /** |
|
54 * Set bitmap for given status . |
|
55 * |
|
56 * @since S60 V4.0 |
|
57 * @param aBmp The bitmap. Ownership transferred to button |
|
58 * @param aType The bitmap type used for |
|
59 */ |
|
60 IMPORT_C void SetBitmapL(CFbsBitmap* aBmp); |
|
61 |
|
62 /** |
|
63 * Set mask bitmap for given status. |
|
64 * |
|
65 * @since S60 V4.0 |
|
66 * @param aBmp The bitmap. Ownership transferred to button |
|
67 * @param aType The bitmap type used for |
|
68 */ |
|
69 IMPORT_C void SetMaskBitmapL(CFbsBitmap* aBmp); |
|
70 |
|
71 //from base class CFepUiBaseCtrl |
|
72 /** |
|
73 * From CFepUiBaseCtrl |
|
74 * Draw control |
|
75 * |
|
76 * @since S60 V4.0 |
|
77 */ |
|
78 IMPORT_C virtual void Draw(); |
|
79 |
|
80 /* Set the font for caption |
|
81 * |
|
82 * @since S60 V4.0 |
|
83 * @param aFontSpec the font spec to be used. |
|
84 */ |
|
85 IMPORT_C virtual void SetFont(const TFontSpec& aFontSpec); |
|
86 |
|
87 /** |
|
88 * Set font information |
|
89 * |
|
90 * @since S60 V4.0 |
|
91 * @param aFont The font info for key drawing.Ownership not transferred |
|
92 */ |
|
93 IMPORT_C virtual void SetFont(const CFont* aFont); |
|
94 |
|
95 /** |
|
96 * Set font text color |
|
97 * |
|
98 * @since S60 V4.0 |
|
99 * @param aColor Color for font text |
|
100 */ |
|
101 IMPORT_C virtual void SetFontColor(const TRgb aColor); |
|
102 |
|
103 |
|
104 /** |
|
105 * Set text to label |
|
106 * |
|
107 * @since S60 v3.2 |
|
108 * @param aText Display text in lable |
|
109 * @return None |
|
110 */ |
|
111 IMPORT_C void SetText(const TDesC& aText); |
|
112 |
|
113 /** |
|
114 * Label size changed |
|
115 * |
|
116 * @since S60 v3.2 |
|
117 * @param aNewRect New rect for label |
|
118 * @param aIsReloadImages resize image |
|
119 * @return None |
|
120 */ |
|
121 IMPORT_C virtual void SizeChanged(TRect aNewRect, TBool aIsReloadImages); |
|
122 |
|
123 /** |
|
124 * Set aligment |
|
125 * |
|
126 * @since S60 v3.2 |
|
127 * @param aAlignment Text alignment |
|
128 * @return None |
|
129 */ |
|
130 IMPORT_C virtual void SetTextAlignment(CGraphicsContext::TTextAlign aAlignment); |
|
131 |
|
132 /** |
|
133 * Get aligment |
|
134 * |
|
135 * @since S60 v3.2 |
|
136 * @return Text alignment |
|
137 */ |
|
138 IMPORT_C virtual CGraphicsContext::TTextAlign TextAlignment(); |
|
139 |
|
140 protected: |
|
141 |
|
142 /** |
|
143 * Constructor |
|
144 * |
|
145 * @since S60 V4.0 |
|
146 * @param aRect The rectangle area for this control |
|
147 * @param aUiLayout Ui layout who contains this control.Ownership not transferred |
|
148 * @param aControlId control Id |
|
149 */ |
|
150 CAknFepCtrlLabel(CFepUiLayout* aUiLayout,TInt aControlId); |
|
151 |
|
152 /** |
|
153 * Bitmaps size changed |
|
154 * |
|
155 * @since S60 v3.2 |
|
156 * @param aSize New size for bitmaps |
|
157 * @return None |
|
158 */ |
|
159 void ResizeBitmaps(TSize aSize); |
|
160 |
|
161 private: |
|
162 |
|
163 /** |
|
164 * bitmap for dimmed state |
|
165 * Own. |
|
166 */ |
|
167 CFbsBitmap* iBmp; |
|
168 |
|
169 /** |
|
170 * mask bitmap for dim stute |
|
171 * Own. |
|
172 */ |
|
173 CFbsBitmap* iMaskBmp; |
|
174 |
|
175 /** |
|
176 * lable caption |
|
177 */ |
|
178 HBufC* iText; |
|
179 |
|
180 /** |
|
181 * Font object for key drawing |
|
182 * Ownership depends on flag iFontOwnership. |
|
183 */ |
|
184 CFont* iFont; |
|
185 |
|
186 /** |
|
187 * Font information for key drawing |
|
188 */ |
|
189 TFontSpec iFontSpec; |
|
190 |
|
191 /** |
|
192 * Flag ownership flag. ETrue if CFont object is owned by this control. |
|
193 */ |
|
194 TBool iFontOwnership; |
|
195 |
|
196 /** |
|
197 * Baseline for caption |
|
198 */ |
|
199 TInt iBaseline; |
|
200 |
|
201 /** |
|
202 * Pen color for first level caption |
|
203 */ |
|
204 TRgb iFontColor; |
|
205 |
|
206 /** |
|
207 * Text alignment |
|
208 */ |
|
209 CGraphicsContext::TTextAlign iAlignment; |
|
210 |
|
211 }; |
|
212 |
|
213 #endif // C_CAKNFEPCTRLLABEL_H |