1 /* |
|
2 * Copyright (c) 2002-2005 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: Interface of normal button and multidisplay button |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef C_CAKNFEPCTRLEVENTBUTTON_H |
|
20 #define C_CAKNFEPCTRLEVENTBUTTON_H |
|
21 |
|
22 // system includes |
|
23 #include <peninputlayoutbasecontrol.h> |
|
24 #include <peninputlayoutbutton.h> |
|
25 #include <peninputbutton.h> |
|
26 #include <peninputcommonbutton.h> |
|
27 |
|
28 // forward declarations |
|
29 class TResourceReader; |
|
30 |
|
31 // class declarations |
|
32 /** |
|
33 * Basic functionality for graphic buttons |
|
34 * It provides creation from resource and can react according to SizeChanged Msg |
|
35 * |
|
36 * @lib fepcommonctrls.lib |
|
37 * @since S60 v3.2 |
|
38 */ |
|
39 class CAknFepCtrlEventButton : public CAknFepCtrlCommonButton |
|
40 { |
|
41 public: |
|
42 |
|
43 /** |
|
44 * Symbian constructor. |
|
45 * |
|
46 * @since S60 v3.2 |
|
47 * @param aUiLayout The layout |
|
48 * @param aControlId The control id |
|
49 * @param aEvent An event Id to be sent |
|
50 * @param aUnicode A Unicode value to be sent |
|
51 * @return Pointer to created CAknFepCtrlEventButton object |
|
52 */ |
|
53 IMPORT_C static CAknFepCtrlEventButton* NewL(CFepUiLayout* aUiLayout, |
|
54 TInt aControlId, |
|
55 TInt aEvent = 0xFFFF, |
|
56 TInt aUnicode = 0, |
|
57 TAknsItemID aNormalID = KAknsIIDQsnFrFunctionButtonNormal, |
|
58 TAknsItemID aPressedID = KAknsIIDQsnFrFunctionButtonPressed, |
|
59 TAknsItemID aInactiveID = KAknsIIDQsnFrFunctionButtonInactive); |
|
60 |
|
61 /** |
|
62 * Symbian constructor. |
|
63 * |
|
64 * @since S60 v3.2 |
|
65 * @param aUiLayout The layout |
|
66 * @param aControlId The control id |
|
67 * @param aEvent An event Id to be sent |
|
68 * @param aUnicode A Unicode value to be sent |
|
69 * @return Pointer to created CAknFepCtrlEventButton object |
|
70 */ |
|
71 IMPORT_C static CAknFepCtrlEventButton* NewLC(CFepUiLayout* aUiLayout, |
|
72 TInt aControlId, |
|
73 TInt aEvent = 0xFFFF, |
|
74 TInt aUnicode = 0, |
|
75 TAknsItemID aNormalID = KAknsIIDQsnFrFunctionButtonNormal, |
|
76 TAknsItemID aPressedID = KAknsIIDQsnFrFunctionButtonPressed, |
|
77 TAknsItemID aInactiveID = KAknsIIDQsnFrFunctionButtonInactive); |
|
78 |
|
79 /** |
|
80 * destructor. |
|
81 * |
|
82 * @since S60 v3.2 |
|
83 * @return None |
|
84 */ |
|
85 IMPORT_C virtual ~CAknFepCtrlEventButton(); |
|
86 |
|
87 /** |
|
88 * From CButtonBase |
|
89 * Handle button up event. cancel all timers |
|
90 * |
|
91 * @since S60 v3.2 |
|
92 * @param aPoint Point position |
|
93 * @return The control who handles the event |
|
94 */ |
|
95 IMPORT_C virtual CFepUiBaseCtrl* HandlePointerUpEventL(const TPoint& aPoint); |
|
96 |
|
97 /** |
|
98 * This function gets the current Event Id |
|
99 * |
|
100 * @since S60 v3.2 |
|
101 * @return Current Event Id |
|
102 */ |
|
103 IMPORT_C TInt Event() const; |
|
104 |
|
105 /** |
|
106 * This function gets the current Unicode value |
|
107 * |
|
108 * @since S60 v3.2 |
|
109 * @return Current Unicode value |
|
110 */ |
|
111 IMPORT_C TInt Unicode() const; |
|
112 |
|
113 /** |
|
114 * This function sets the Event Id sent by this button |
|
115 * |
|
116 * @since S60 v3.2 |
|
117 * @param aEvent An event Id to be sent |
|
118 * @return None |
|
119 */ |
|
120 IMPORT_C void SetEvent(TInt aEvent); |
|
121 |
|
122 /** |
|
123 * This function sets the Unicode value sent by this button |
|
124 * |
|
125 * @since S60 v3.2 |
|
126 * @param aUnicode A Unicode value to be sent |
|
127 * @return None |
|
128 */ |
|
129 IMPORT_C void SetUnicode(TInt aUnicode); |
|
130 |
|
131 /** |
|
132 * This function sets the text written on the button |
|
133 * |
|
134 * @since S60 v3.2 |
|
135 * @param aText the text will be shown |
|
136 * @return None |
|
137 */ |
|
138 IMPORT_C void SetText(const TDesC& aText); |
|
139 |
|
140 /** |
|
141 * This function set the font used to draw the text |
|
142 * |
|
143 * @since S60 v3.2 |
|
144 * @param aFont the font |
|
145 * @return None |
|
146 */ |
|
147 IMPORT_C void SetFont(const CFont* aFont); |
|
148 |
|
149 /** |
|
150 * This function set the shadow font used to draw the text |
|
151 * |
|
152 * @since S60 v3.2 |
|
153 * @param aFont the shadow font |
|
154 * @return None |
|
155 */ |
|
156 IMPORT_C void SetShadowFont(const CFont* aFont); |
|
157 |
|
158 /** |
|
159 * This function set the font color used to draw the text |
|
160 * |
|
161 * @since S60 v3.2 |
|
162 * @param aColor the font color |
|
163 * @return None |
|
164 */ |
|
165 IMPORT_C void SetFontColor(const TRgb aColor); |
|
166 |
|
167 /** |
|
168 * This function set the shadow font color used to draw the text |
|
169 * |
|
170 * @since S60 v3.2 |
|
171 * @param aColor the shadow font color |
|
172 * @return None |
|
173 */ |
|
174 IMPORT_C void SetShadowFontColor(const TRgb aColor); |
|
175 |
|
176 /** |
|
177 * Draw function |
|
178 * |
|
179 * @since S60 v3.2 |
|
180 * @return None |
|
181 */ |
|
182 IMPORT_C void Draw(); |
|
183 |
|
184 protected: |
|
185 |
|
186 /** |
|
187 * C++ constructor. |
|
188 * |
|
189 * @since S60 v3.2 |
|
190 * @param aUiLayout Ui Layout who contains this control |
|
191 * @param aControlId Control Id |
|
192 * @param aEvent An event Id to be sent |
|
193 * @param aUnicode A Unicode value to be sent |
|
194 * @return None |
|
195 */ |
|
196 IMPORT_C CAknFepCtrlEventButton(CFepUiLayout* aUiLayout, |
|
197 TInt aControlId, |
|
198 TInt aEvent, |
|
199 TInt aUnicode, |
|
200 TAknsItemID aNormalID = KAknsIIDQsnFrFunctionButtonNormal, |
|
201 TAknsItemID aPressedID = KAknsIIDQsnFrFunctionButtonPressed, |
|
202 TAknsItemID aInactiveID = KAknsIIDQsnFrFunctionButtonInactive); |
|
203 /** |
|
204 * Display button caption. |
|
205 * |
|
206 * @since S60 v3.2 |
|
207 * @return None |
|
208 */ |
|
209 IMPORT_C void DisplayText(); |
|
210 |
|
211 private: |
|
212 |
|
213 /** |
|
214 * Event Id |
|
215 */ |
|
216 TInt iEvent; |
|
217 |
|
218 /** |
|
219 * Unicode value |
|
220 */ |
|
221 TInt iUnicode; |
|
222 |
|
223 /** |
|
224 * Text shown on button |
|
225 */ |
|
226 HBufC* iText; |
|
227 |
|
228 /** |
|
229 * the font used to show the text |
|
230 */ |
|
231 const CFont* iFont; |
|
232 |
|
233 /** |
|
234 * the shadow font used to show the text |
|
235 */ |
|
236 const CFont* iShadowFont; |
|
237 |
|
238 /** |
|
239 * the font color used to show the text |
|
240 */ |
|
241 TRgb iFontColor; |
|
242 |
|
243 /** |
|
244 * the shadow font color used to show the text |
|
245 */ |
|
246 TRgb iShadowFontColor; |
|
247 }; |
|
248 |
|
249 #endif // C_CAKNFEPCTRLEVENTBUTTON_H |
|
250 |
|
251 // End Of File |
|