williamr@2
|
1 |
/*
|
williamr@2
|
2 |
* Copyright (c) 2001-2006 Nokia Corporation and/or its subsidiary(-ies).
|
williamr@2
|
3 |
* All rights reserved.
|
williamr@2
|
4 |
* This component and the accompanying materials are made available
|
williamr@2
|
5 |
* under the terms of the License "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members
|
williamr@2
|
6 |
* which accompanies this distribution, and is available
|
williamr@2
|
7 |
* at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
|
williamr@2
|
8 |
*
|
williamr@2
|
9 |
* Initial Contributors:
|
williamr@2
|
10 |
* Nokia Corporation - initial contribution.
|
williamr@2
|
11 |
*
|
williamr@2
|
12 |
* Contributors:
|
williamr@2
|
13 |
*
|
williamr@2
|
14 |
* Description: Command button class interfaces. Contains a common base class
|
williamr@2
|
15 |
* for command-generating buttons, plus several concrete, specialized classes
|
williamr@2
|
16 |
*
|
williamr@2
|
17 |
*
|
williamr@2
|
18 |
*/
|
williamr@2
|
19 |
|
williamr@2
|
20 |
|
williamr@2
|
21 |
#if !defined(__EIKCMBUT_H__)
|
williamr@2
|
22 |
#define __EIKCMBUT_H__
|
williamr@2
|
23 |
|
williamr@2
|
24 |
#if !defined(__EIKBUTB_H__)
|
williamr@2
|
25 |
#include <eikbutb.h>
|
williamr@2
|
26 |
#endif
|
williamr@2
|
27 |
|
williamr@2
|
28 |
#if !defined(__COECCNTX_H__)
|
williamr@2
|
29 |
#include <coeccntx.h>
|
williamr@2
|
30 |
#endif
|
williamr@2
|
31 |
|
williamr@2
|
32 |
#if !defined(__GULUTIL_H__)
|
williamr@2
|
33 |
#include <gulutil.h>
|
williamr@2
|
34 |
#endif
|
williamr@2
|
35 |
|
williamr@2
|
36 |
class CEikLabel;
|
williamr@2
|
37 |
class CEikImage;
|
williamr@2
|
38 |
class CEikAlignedControl;
|
williamr@2
|
39 |
class TResourceReader;
|
williamr@2
|
40 |
class CEikCommandStack;
|
williamr@2
|
41 |
|
williamr@2
|
42 |
/**
|
williamr@2
|
43 |
* Base class for buttons that generate commands.
|
williamr@2
|
44 |
*
|
williamr@2
|
45 |
* MControlContext is mixed in. This class is used as the interface to the button member of
|
williamr@2
|
46 |
* CEikLabeledButton, as well as being the base class for CEikCommandButton, CEikTextButton, and CEikBitmapButton
|
williamr@2
|
47 |
*
|
williamr@2
|
48 |
* @lib eikcoctl.dll
|
williamr@2
|
49 |
* @since S60 1.0
|
williamr@2
|
50 |
*/
|
williamr@2
|
51 |
class CEikCommandButtonBase : public CEikButtonBase, public MCoeControlContext
|
williamr@2
|
52 |
{
|
williamr@2
|
53 |
public:
|
williamr@2
|
54 |
/**
|
williamr@2
|
55 |
* Enumeration to tag the components of a command button (text or image)
|
williamr@2
|
56 |
*/
|
williamr@2
|
57 |
enum TWhichComponent
|
williamr@2
|
58 |
{
|
williamr@2
|
59 |
EFirst,
|
williamr@2
|
60 |
ESecond
|
williamr@2
|
61 |
};
|
williamr@2
|
62 |
|
williamr@2
|
63 |
/**
|
williamr@2
|
64 |
* Controls which of the components of the command button are shown.
|
williamr@2
|
65 |
*/
|
williamr@2
|
66 |
enum TDisplayContent
|
williamr@2
|
67 |
{
|
williamr@2
|
68 |
EFirstOnly =0x0100,
|
williamr@2
|
69 |
ESecondOnly =0x0200,
|
williamr@2
|
70 |
EBoth =0x0300
|
williamr@2
|
71 |
};
|
williamr@2
|
72 |
|
williamr@2
|
73 |
/*
|
williamr@2
|
74 |
* Layout and font options for the components of the command button
|
williamr@2
|
75 |
*/
|
williamr@2
|
76 |
enum TLayout
|
williamr@2
|
77 |
{
|
williamr@2
|
78 |
EFirstRightSecondLeft=0x0000,
|
williamr@2
|
79 |
EFirstBottomSecondTop=0x0001,
|
williamr@2
|
80 |
EFirstTopSecondBottom=0x0002,
|
williamr@2
|
81 |
EFirstLeftSecondRight=0x0003,
|
williamr@2
|
82 |
EDenseFont =0x0008
|
williamr@2
|
83 |
};
|
williamr@2
|
84 |
|
williamr@2
|
85 |
/**
|
williamr@2
|
86 |
* Options for where excess space between the two components of the command button is distrubuted
|
williamr@2
|
87 |
*/
|
williamr@2
|
88 |
enum TExcess
|
williamr@2
|
89 |
{
|
williamr@2
|
90 |
EShare =0x0000,
|
williamr@2
|
91 |
EToFirst =0x0010,
|
williamr@2
|
92 |
EToSecond =0x0020
|
williamr@2
|
93 |
};
|
williamr@2
|
94 |
|
williamr@2
|
95 |
public: // new functions
|
williamr@2
|
96 |
|
williamr@2
|
97 |
/**
|
williamr@2
|
98 |
* C++ destructor
|
williamr@2
|
99 |
*/
|
williamr@2
|
100 |
IMPORT_C ~CEikCommandButtonBase();
|
williamr@2
|
101 |
|
williamr@2
|
102 |
/**
|
williamr@2
|
103 |
* Sets the layout of the button
|
williamr@2
|
104 |
* @param aLayout Layout enumeration
|
williamr@2
|
105 |
*/
|
williamr@2
|
106 |
IMPORT_C void SetButtonLayout(TLayout aLayout);
|
williamr@2
|
107 |
|
williamr@2
|
108 |
/**
|
williamr@2
|
109 |
* Sets where excess space is to be put
|
williamr@2
|
110 |
* @param aExcess Excess space enumeration
|
williamr@2
|
111 |
*/
|
williamr@2
|
112 |
IMPORT_C void SetExcessSpace(TExcess aExcess);
|
williamr@2
|
113 |
|
williamr@2
|
114 |
/**
|
williamr@2
|
115 |
* Sets the content of the button
|
williamr@2
|
116 |
*
|
williamr@2
|
117 |
* @param aContent
|
williamr@2
|
118 |
*/
|
williamr@2
|
119 |
IMPORT_C void SetDisplayContent(TDisplayContent aContent);
|
williamr@2
|
120 |
|
williamr@2
|
121 |
/**
|
williamr@2
|
122 |
* Causes the content to be (re-)laid out.
|
williamr@2
|
123 |
*/
|
williamr@2
|
124 |
IMPORT_C void LayoutComponents();
|
williamr@2
|
125 |
|
williamr@2
|
126 |
/**
|
williamr@2
|
127 |
* Read preamble part of the resource. This call can be followed by calls to
|
williamr@2
|
128 |
* ConstructLabelFromResourceL and/or ConstructImageFromResourceL to complete contruction.
|
williamr@2
|
129 |
*/
|
williamr@2
|
130 |
IMPORT_C void StartConstructFromResourceL(TResourceReader& aReader);
|
williamr@2
|
131 |
|
williamr@2
|
132 |
/**
|
williamr@2
|
133 |
* Constructs a label component for the button
|
williamr@2
|
134 |
*
|
williamr@2
|
135 |
* @aparam aWhich Which component to construct in this call
|
williamr@2
|
136 |
*/
|
williamr@2
|
137 |
IMPORT_C void ConstructLabelFromResourceL(TResourceReader& aReader,TWhichComponent aWhich);
|
williamr@2
|
138 |
|
williamr@2
|
139 |
/**
|
williamr@2
|
140 |
* Constructs an image component for the button
|
williamr@2
|
141 |
*
|
williamr@2
|
142 |
* @aparam aWhich Which component to construct in this call
|
williamr@2
|
143 |
*/
|
williamr@2
|
144 |
IMPORT_C void ConstructImageFromResourceL(TResourceReader& aReader,TWhichComponent aWhich);
|
williamr@2
|
145 |
|
williamr@2
|
146 |
/**
|
williamr@2
|
147 |
* Cause a recalculation of the components alignment
|
williamr@2
|
148 |
*/
|
williamr@2
|
149 |
IMPORT_C virtual void UpdateComponentAlignment();
|
williamr@2
|
150 |
|
williamr@2
|
151 |
/**
|
williamr@2
|
152 |
* Sets this button to be the default.
|
williamr@2
|
153 |
*/
|
williamr@2
|
154 |
IMPORT_C void SetDefault(TBool aIsDefault);
|
williamr@2
|
155 |
|
williamr@2
|
156 |
public: // from CCoeControl. See base class documentation
|
williamr@2
|
157 |
/**
|
williamr@2
|
158 |
* From CCoeControl
|
williamr@2
|
159 |
*
|
williamr@2
|
160 |
* Sets the button to be inactive. The button is drawn with a dimmed effect.
|
williamr@2
|
161 |
*
|
williamr@2
|
162 |
* @param aDimmed If not EFalse, set the state to dimmed. Otherwise set to non-dimmed
|
williamr@2
|
163 |
*/
|
williamr@2
|
164 |
IMPORT_C void SetDimmed(TBool aDimmed);
|
williamr@2
|
165 |
|
williamr@2
|
166 |
/**
|
williamr@2
|
167 |
* From CCoeControl
|
williamr@2
|
168 |
*
|
williamr@2
|
169 |
* Reports to the caller the minimum size that the control can be, given its contents.
|
williamr@2
|
170 |
*
|
williamr@2
|
171 |
* @return The minimum size
|
williamr@2
|
172 |
*/
|
williamr@2
|
173 |
IMPORT_C TSize MinimumSize();
|
williamr@2
|
174 |
|
williamr@2
|
175 |
/**
|
williamr@2
|
176 |
* From CCoeControl
|
williamr@2
|
177 |
*
|
williamr@2
|
178 |
* Returns the number of component controls
|
williamr@2
|
179 |
*
|
williamr@2
|
180 |
* @return Number of component controls
|
williamr@2
|
181 |
*/
|
williamr@2
|
182 |
IMPORT_C TInt CountComponentControls() const;
|
williamr@2
|
183 |
|
williamr@2
|
184 |
/**
|
williamr@2
|
185 |
* From CCoeControl
|
williamr@2
|
186 |
*
|
williamr@2
|
187 |
* Return a pointer to the component control at the give index.
|
williamr@2
|
188 |
*
|
williamr@2
|
189 |
* @return Pointer to the conponent control. No ownership is transferred
|
williamr@2
|
190 |
*/
|
williamr@2
|
191 |
IMPORT_C CCoeControl* ComponentControl(TInt aIndex) const;
|
williamr@2
|
192 |
|
williamr@2
|
193 |
/**
|
williamr@2
|
194 |
* From CCoeControl
|
williamr@2
|
195 |
*
|
williamr@2
|
196 |
* Make the control ready for display.
|
williamr@2
|
197 |
*/
|
williamr@2
|
198 |
IMPORT_C void ActivateL();
|
williamr@2
|
199 |
|
williamr@2
|
200 |
/**
|
williamr@2
|
201 |
* From CCoeControl
|
williamr@2
|
202 |
*
|
williamr@2
|
203 |
* Sets the control whose window is to be used as a container for this control
|
williamr@2
|
204 |
*
|
williamr@2
|
205 |
* @param aContainer control
|
williamr@2
|
206 |
*/
|
williamr@2
|
207 |
IMPORT_C void SetContainerWindowL(const CCoeControl& aContainer);
|
williamr@2
|
208 |
|
williamr@2
|
209 |
/**
|
williamr@2
|
210 |
* From CCoeControl
|
williamr@2
|
211 |
*
|
williamr@2
|
212 |
* Called when the focus has changed
|
williamr@2
|
213 |
*
|
williamr@2
|
214 |
* @param aDrawNow Iff not EFalse, then the control is requested to redraw.
|
williamr@2
|
215 |
*/
|
williamr@2
|
216 |
IMPORT_C void FocusChanged(TDrawNow aDrawNow);
|
williamr@2
|
217 |
|
williamr@2
|
218 |
/**
|
williamr@2
|
219 |
* From CCoeControl
|
williamr@2
|
220 |
*
|
williamr@2
|
221 |
* CONE framework is requesting that the passed-in key be handled.
|
williamr@2
|
222 |
*
|
williamr@2
|
223 |
* @param aKeyEvent Wserv event type
|
williamr@2
|
224 |
* @param aKeyCode Key code
|
williamr@2
|
225 |
*/
|
williamr@2
|
226 |
IMPORT_C TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent,TEventCode /*aType*/);
|
williamr@2
|
227 |
|
williamr@2
|
228 |
/**
|
williamr@2
|
229 |
* From CCoeControl
|
williamr@2
|
230 |
*
|
williamr@2
|
231 |
* Obtain the list of colors to be used by this control
|
williamr@2
|
232 |
*
|
williamr@2
|
233 |
* @param aColorUseList
|
williamr@2
|
234 |
*/
|
williamr@2
|
235 |
IMPORT_C virtual void GetColorUseListL(CArrayFix<TCoeColorUse>& aColorUseList) const;
|
williamr@2
|
236 |
|
williamr@2
|
237 |
/**
|
williamr@2
|
238 |
* From CCoeControl
|
williamr@2
|
239 |
*
|
williamr@2
|
240 |
* This is called when resource or layout or other display-affecting setting has changed.
|
williamr@2
|
241 |
* Change the internals of the control so that it is ready for a subsequent SizeChanged call.
|
williamr@2
|
242 |
*
|
williamr@2
|
243 |
* @param aType Type of resource or setting that has changed
|
williamr@2
|
244 |
*/
|
williamr@2
|
245 |
IMPORT_C virtual void HandleResourceChange(TInt aType);
|
williamr@2
|
246 |
|
williamr@2
|
247 |
/**
|
williamr@2
|
248 |
* From CCoeControl
|
williamr@2
|
249 |
*
|
williamr@2
|
250 |
* Handle a pointer event that has been routed to this control
|
williamr@2
|
251 |
*
|
williamr@2
|
252 |
* @param aPointerEvent Pointer event to handle
|
williamr@2
|
253 |
*/
|
williamr@2
|
254 |
IMPORT_C void HandlePointerEventL(const TPointerEvent& aPointerEvent);
|
williamr@2
|
255 |
|
williamr@2
|
256 |
public: // but not exported
|
williamr@2
|
257 |
/**
|
williamr@2
|
258 |
* Access to the command stack
|
williamr@2
|
259 |
*
|
williamr@2
|
260 |
* @return pointer to the command stack
|
williamr@2
|
261 |
*/
|
williamr@2
|
262 |
CEikCommandStack* CommandStack() const;
|
williamr@2
|
263 |
|
williamr@2
|
264 |
/**
|
williamr@2
|
265 |
* Access to the button flags
|
williamr@2
|
266 |
*
|
williamr@2
|
267 |
* @return The button flag pattern
|
williamr@2
|
268 |
*/
|
williamr@2
|
269 |
TInt ButFlags() const;
|
williamr@2
|
270 |
|
williamr@2
|
271 |
/**
|
williamr@2
|
272 |
* Access to whether the button is default
|
williamr@2
|
273 |
*
|
williamr@2
|
274 |
* @return EFalse iff the button is not default.
|
williamr@2
|
275 |
*/
|
williamr@2
|
276 |
TBool IsDefault() const;
|
williamr@2
|
277 |
|
williamr@2
|
278 |
protected:
|
williamr@2
|
279 |
|
williamr@2
|
280 |
/**
|
williamr@2
|
281 |
* From CEikButtonBase
|
williamr@2
|
282 |
*
|
williamr@2
|
283 |
* Framework method called when the state changes
|
williamr@2
|
284 |
*/
|
williamr@2
|
285 |
IMPORT_C void StateChanged();
|
williamr@2
|
286 |
|
williamr@2
|
287 |
protected:
|
williamr@2
|
288 |
/**
|
williamr@2
|
289 |
* Constructor
|
williamr@2
|
290 |
*/
|
williamr@2
|
291 |
IMPORT_C CEikCommandButtonBase();
|
williamr@2
|
292 |
|
williamr@2
|
293 |
/**
|
williamr@2
|
294 |
* Sets the label text for the button.
|
williamr@2
|
295 |
*
|
williamr@2
|
296 |
* @param aText The text to set
|
williamr@2
|
297 |
* @param aComponent The component for which the text is to be set.
|
williamr@2
|
298 |
*/
|
williamr@2
|
299 |
IMPORT_C void SetTextL(const TDesC& aText,CEikAlignedControl*& aComponent);
|
williamr@2
|
300 |
|
williamr@2
|
301 |
/**
|
williamr@2
|
302 |
* Sets the bitmap and optional mask for the button
|
williamr@2
|
303 |
*
|
williamr@2
|
304 |
* @param aMain The bitmap to use
|
williamr@2
|
305 |
* @param aMask The mask. If null, then no mask will be used
|
williamr@2
|
306 |
* @param aComponent The component for which the picture is to be set.
|
williamr@2
|
307 |
*/
|
williamr@2
|
308 |
IMPORT_C void SetPictureL(const CFbsBitmap* aMain,const CFbsBitmap* aMask,CEikAlignedControl*& aComponent);
|
williamr@2
|
309 |
|
williamr@2
|
310 |
/**
|
williamr@2
|
311 |
* Sets the bitmap and optional mask from an mbm file.
|
williamr@2
|
312 |
*
|
williamr@2
|
313 |
* @param aFile Mbm filename
|
williamr@2
|
314 |
* @param aMain Index of the bitmap to use
|
williamr@2
|
315 |
* @param aMask Index of the mask. If -1, then a null mask will be used
|
williamr@2
|
316 |
* @param aComponent The component for which the picture is to be set.
|
williamr@2
|
317 |
*/
|
williamr@2
|
318 |
IMPORT_C void SetPictureFromFileL(const TDesC& aFilename,TInt aMain,TInt aMask,CEikAlignedControl*& aComponent);
|
williamr@2
|
319 |
|
williamr@2
|
320 |
/**
|
williamr@2
|
321 |
* Utility routine. Calling this without a leave will ensure the internal command stack is constructed.
|
williamr@2
|
322 |
*/
|
williamr@2
|
323 |
inline void CheckCreateCommandStackL();
|
williamr@2
|
324 |
|
williamr@2
|
325 |
protected: // from CCoeControl
|
williamr@2
|
326 |
/**
|
williamr@2
|
327 |
* From CCoeControl
|
williamr@2
|
328 |
*
|
williamr@2
|
329 |
* Request for the control to draw itself within the given rectangle
|
williamr@2
|
330 |
*
|
williamr@2
|
331 |
* @param aRect TRect to draw
|
williamr@2
|
332 |
*/
|
williamr@2
|
333 |
IMPORT_C void Draw(const TRect& aRect) const;
|
williamr@2
|
334 |
|
williamr@2
|
335 |
protected:
|
williamr@2
|
336 |
|
williamr@2
|
337 |
/**
|
williamr@2
|
338 |
* Utility routine. Sets additional look and feel attributes for the image
|
williamr@2
|
339 |
*/
|
williamr@2
|
340 |
void SetImageAttributes(CEikImage* aImage);
|
williamr@2
|
341 |
|
williamr@2
|
342 |
/**
|
williamr@2
|
343 |
* Access the behaviour set into the button
|
williamr@2
|
344 |
*/
|
williamr@2
|
345 |
inline TInt Behavior() const;
|
williamr@2
|
346 |
|
williamr@2
|
347 |
protected:
|
williamr@2
|
348 |
/**
|
williamr@2
|
349 |
* From CCoeControl
|
williamr@2
|
350 |
*
|
williamr@2
|
351 |
* Serialize the state of the control
|
williamr@2
|
352 |
*
|
williamr@2
|
353 |
* @param aWriteStream Output stream for the serialization
|
williamr@2
|
354 |
*/
|
williamr@2
|
355 |
IMPORT_C void WriteInternalStateL(RWriteStream& aWriteStream) const;
|
williamr@2
|
356 |
|
williamr@2
|
357 |
private:
|
williamr@2
|
358 |
/**
|
williamr@2
|
359 |
* From CCoeControl
|
williamr@2
|
360 |
*
|
williamr@2
|
361 |
* Framework method called when the size or layout changes
|
williamr@2
|
362 |
*/
|
williamr@2
|
363 |
IMPORT_C void SizeChanged();
|
williamr@2
|
364 |
IMPORT_C void Reserved_2();
|
williamr@2
|
365 |
|
williamr@2
|
366 |
private: // from CEikButtonBase
|
williamr@2
|
367 |
IMPORT_C void Reserved_3();
|
williamr@2
|
368 |
|
williamr@2
|
369 |
private:
|
williamr@2
|
370 |
/**
|
williamr@2
|
371 |
* From MCoeControlContext
|
williamr@2
|
372 |
*
|
williamr@2
|
373 |
* Modify the passed-in graphics context ready for use in this control
|
williamr@2
|
374 |
*
|
williamr@2
|
375 |
* @param aGc Graphics context to set up
|
williamr@2
|
376 |
*/
|
williamr@2
|
377 |
IMPORT_C void PrepareContext(CWindowGc& aGc) const;
|
williamr@2
|
378 |
|
williamr@2
|
379 |
private:
|
williamr@2
|
380 |
IMPORT_C virtual void Reserved_4();
|
williamr@2
|
381 |
private:
|
williamr@2
|
382 |
/**
|
williamr@2
|
383 |
* From CAknControl
|
williamr@2
|
384 |
*/
|
williamr@2
|
385 |
IMPORT_C void* ExtensionInterface( TUid aInterface );
|
williamr@2
|
386 |
|
williamr@2
|
387 |
// New methods
|
williamr@2
|
388 |
private:
|
williamr@2
|
389 |
void SetComponentExtents(const TRect& aRect);
|
williamr@2
|
390 |
void SetNewComponentExtentL();
|
williamr@2
|
391 |
TBool LayoutIsVertical() const;
|
williamr@2
|
392 |
protected:
|
williamr@2
|
393 |
TMargins8 iMargins;
|
williamr@2
|
394 |
/**
|
williamr@2
|
395 |
* The components of the button: the image or the text (order determined by construction)
|
williamr@2
|
396 |
*/
|
williamr@2
|
397 |
CEikAlignedControl* iComponents[2];
|
williamr@2
|
398 |
TInt iCmdFlags;
|
williamr@2
|
399 |
private:
|
williamr@2
|
400 |
TInt iDrawOffset;
|
williamr@2
|
401 |
/**
|
williamr@2
|
402 |
* Owned
|
williamr@2
|
403 |
*/
|
williamr@2
|
404 |
CEikCommandStack* iCommandStack;
|
williamr@2
|
405 |
TInt iDummy;
|
williamr@2
|
406 |
TBool iDefault;
|
williamr@2
|
407 |
};
|
williamr@2
|
408 |
|
williamr@2
|
409 |
/**
|
williamr@2
|
410 |
* Command button with a text and/or an image
|
williamr@2
|
411 |
*
|
williamr@2
|
412 |
* This class in S60 does not function without derivation
|
williamr@2
|
413 |
* This class does NOT implement S60 look-and-feel and is not skinned.
|
williamr@2
|
414 |
*
|
williamr@2
|
415 |
* @lib eikcoctl.dll
|
williamr@2
|
416 |
* @since S60 1.0
|
williamr@2
|
417 |
*/
|
williamr@2
|
418 |
class CEikCommandButton : public CEikCommandButtonBase
|
williamr@2
|
419 |
{
|
williamr@2
|
420 |
public:
|
williamr@2
|
421 |
/** Layout options for a command button*/
|
williamr@2
|
422 |
enum TLayout
|
williamr@2
|
423 |
{
|
williamr@2
|
424 |
ETextRightPictureLeft=0x000,
|
williamr@2
|
425 |
ETextBottomPictureTop=0x001,
|
williamr@2
|
426 |
ETextTopPictureBottom=0x002,
|
williamr@2
|
427 |
ETextLeftPictureRight=0x003
|
williamr@2
|
428 |
};
|
williamr@2
|
429 |
|
williamr@2
|
430 |
/**
|
williamr@2
|
431 |
* Where to put excess space in the layout
|
williamr@2
|
432 |
*/
|
williamr@2
|
433 |
enum TExcess
|
williamr@2
|
434 |
{
|
williamr@2
|
435 |
EShare =0x0000,
|
williamr@2
|
436 |
EToText =0x0010,
|
williamr@2
|
437 |
EToPicture =0x0020
|
williamr@2
|
438 |
};
|
williamr@2
|
439 |
|
williamr@2
|
440 |
/**
|
williamr@2
|
441 |
* Content to diplay for this button
|
williamr@2
|
442 |
*/
|
williamr@2
|
443 |
enum TDisplayContent
|
williamr@2
|
444 |
{
|
williamr@2
|
445 |
ETextOnly =0x0100,
|
williamr@2
|
446 |
EPictureOnly =0x0200,
|
williamr@2
|
447 |
ETextAndPicture =0x0300
|
williamr@2
|
448 |
};
|
williamr@2
|
449 |
|
williamr@2
|
450 |
public:
|
williamr@2
|
451 |
|
williamr@2
|
452 |
/**
|
williamr@2
|
453 |
* Constructor
|
williamr@2
|
454 |
*/
|
williamr@2
|
455 |
IMPORT_C CEikCommandButton();
|
williamr@2
|
456 |
|
williamr@2
|
457 |
/**
|
williamr@2
|
458 |
* C++ destructor
|
williamr@2
|
459 |
*/
|
williamr@2
|
460 |
IMPORT_C ~CEikCommandButton();
|
williamr@2
|
461 |
|
williamr@2
|
462 |
/**
|
williamr@2
|
463 |
* Sets the label text for the button.
|
williamr@2
|
464 |
*
|
williamr@2
|
465 |
* @param aText The text to set
|
williamr@2
|
466 |
*/
|
williamr@2
|
467 |
IMPORT_C void SetTextL(const TDesC& aText);
|
williamr@2
|
468 |
|
williamr@2
|
469 |
/**
|
williamr@2
|
470 |
* Sets the bitmap and optional mask for the button
|
williamr@2
|
471 |
*
|
williamr@2
|
472 |
* @param aMain The bitmap to use
|
williamr@2
|
473 |
* @param aMask The mask. If null, then no mask will be used
|
williamr@2
|
474 |
*/
|
williamr@2
|
475 |
IMPORT_C void SetPictureL(const CFbsBitmap* aMain,const CFbsBitmap* aMask=NULL);
|
williamr@2
|
476 |
|
williamr@2
|
477 |
/**
|
williamr@2
|
478 |
* Set bitmap and mask from file.
|
williamr@2
|
479 |
*/
|
williamr@2
|
480 |
IMPORT_C void SetPictureFromFileL(const TDesC& aFilename,TInt aMain,TInt aMask=-1);
|
williamr@2
|
481 |
|
williamr@2
|
482 |
/**
|
williamr@2
|
483 |
* Access the label control that implements the text label of the button. Ownership is not transferred.
|
williamr@2
|
484 |
*
|
williamr@2
|
485 |
* @return A pointer to the CEikLabel control used to implement the text display
|
williamr@2
|
486 |
*/
|
williamr@2
|
487 |
IMPORT_C CEikLabel* Label() const;
|
williamr@2
|
488 |
|
williamr@2
|
489 |
/**
|
williamr@2
|
490 |
* Access the CEikImage that implements the picture component of the button. Ownership is not transferred.
|
williamr@2
|
491 |
*
|
williamr@2
|
492 |
* @return A pointer to the CEikImage used to implement the image display.
|
williamr@2
|
493 |
*/
|
williamr@2
|
494 |
IMPORT_C CEikImage* Picture() const;
|
williamr@2
|
495 |
|
williamr@2
|
496 |
/**
|
williamr@2
|
497 |
* Set the layout of the button
|
williamr@2
|
498 |
*
|
williamr@2
|
499 |
* @param aLayout Layout to be used
|
williamr@2
|
500 |
*/
|
williamr@2
|
501 |
IMPORT_C void SetButtonLayout(TLayout aLayout);
|
williamr@2
|
502 |
|
williamr@2
|
503 |
/**
|
williamr@2
|
504 |
* Sets where the excess space in the layout is to be distributed
|
williamr@2
|
505 |
*
|
williamr@2
|
506 |
* @param aExcess Enum value to say where the excess space is to go
|
williamr@2
|
507 |
*/
|
williamr@2
|
508 |
IMPORT_C void SetExcessSpace(TExcess aExcess);
|
williamr@2
|
509 |
|
williamr@2
|
510 |
/**
|
williamr@2
|
511 |
* Set what content is to be displayed in the button
|
williamr@2
|
512 |
*
|
williamr@2
|
513 |
* @param aContent Enum value saying what content to display
|
williamr@2
|
514 |
*/
|
williamr@2
|
515 |
IMPORT_C void SetDisplayContent(TDisplayContent aContent);
|
williamr@2
|
516 |
|
williamr@2
|
517 |
/**
|
williamr@2
|
518 |
* Sets the command button's text, bitmap and bitmap mask.
|
williamr@2
|
519 |
*
|
williamr@2
|
520 |
* @param aCommandId Command ID to be generated by pressing this button
|
williamr@2
|
521 |
* @param aText Text to display on the button
|
williamr@2
|
522 |
* @param aBitmap Bitmap to display on the button
|
williamr@2
|
523 |
* @param aMask Mask to use. May be Null
|
williamr@2
|
524 |
*/
|
williamr@2
|
525 |
IMPORT_C void SetCommandL(TInt aCommandId,const TDesC* aText,const CFbsBitmap* aBitmap,const CFbsBitmap* aMask);
|
williamr@2
|
526 |
|
williamr@2
|
527 |
/**
|
williamr@2
|
528 |
* Push a command ID + text + image binding onto the command stack.
|
williamr@2
|
529 |
*
|
williamr@2
|
530 |
* @param aCommandId Command ID to be generated by pressing this button
|
williamr@2
|
531 |
* @param aText Text to display on the button
|
williamr@2
|
532 |
* @param aBitmap Bitmap to display on the button
|
williamr@2
|
533 |
* @param aMask Mask to use. May be Null
|
williamr@2
|
534 |
*/
|
williamr@2
|
535 |
IMPORT_C void AddCommandToStackL(TInt aCommandId,const TDesC* aText,const CFbsBitmap* aBitmap,const CFbsBitmap* aMask);
|
williamr@2
|
536 |
|
williamr@2
|
537 |
/**
|
williamr@2
|
538 |
* Find the stacked command with a given command ID and remove it from the stack
|
williamr@2
|
539 |
*
|
williamr@2
|
540 |
* @param aCommandId ID of the command to be removed
|
williamr@2
|
541 |
* @return EFalse iff the comand is not found
|
williamr@2
|
542 |
*/
|
williamr@2
|
543 |
IMPORT_C TBool RemoveCommandFromStack(TInt aCommandId);
|
williamr@2
|
544 |
|
williamr@2
|
545 |
/**
|
williamr@2
|
546 |
* Remove the top (most recently added) command binding from the command stack
|
williamr@2
|
547 |
*
|
williamr@2
|
548 |
* @return the number of commands left on the stack.
|
williamr@2
|
549 |
*/
|
williamr@2
|
550 |
IMPORT_C TInt PopCommandFromStack();
|
williamr@2
|
551 |
|
williamr@2
|
552 |
public: // from CCoeControl
|
williamr@2
|
553 |
/**
|
williamr@2
|
554 |
* From CCoeControl
|
williamr@2
|
555 |
*
|
williamr@2
|
556 |
* Construct the object from resource
|
williamr@2
|
557 |
*
|
williamr@2
|
558 |
* @param aReader Fully constructed resource reader
|
williamr@2
|
559 |
*/
|
williamr@2
|
560 |
IMPORT_C void ConstructFromResourceL(TResourceReader& aReader);
|
williamr@2
|
561 |
|
williamr@2
|
562 |
/**
|
williamr@2
|
563 |
* From CCoeControl
|
williamr@2
|
564 |
*
|
williamr@2
|
565 |
* Handle a pointer event coming from the CONE framework
|
williamr@2
|
566 |
*
|
williamr@2
|
567 |
* @param aPointerEvent Event to handle
|
williamr@2
|
568 |
*/
|
williamr@2
|
569 |
IMPORT_C void HandlePointerEventL(const TPointerEvent& aPointerEvent);
|
williamr@2
|
570 |
|
williamr@2
|
571 |
public:
|
williamr@2
|
572 |
/**
|
williamr@2
|
573 |
* From CEikCommandButtonBase
|
williamr@2
|
574 |
*
|
williamr@2
|
575 |
* Cause a recalculation of the components alignment
|
williamr@2
|
576 |
*/
|
williamr@2
|
577 |
IMPORT_C void UpdateComponentAlignment();
|
williamr@2
|
578 |
|
williamr@2
|
579 |
private:
|
williamr@2
|
580 |
void UpdateLabelReserveLengthL(const TDesC* aText);
|
williamr@2
|
581 |
|
williamr@2
|
582 |
private:
|
williamr@2
|
583 |
/**
|
williamr@2
|
584 |
* From CAknControl
|
williamr@2
|
585 |
*/
|
williamr@2
|
586 |
IMPORT_C void* ExtensionInterface( TUid aInterface );
|
williamr@2
|
587 |
private:
|
williamr@2
|
588 |
TInt iDummy;
|
williamr@2
|
589 |
};
|
williamr@2
|
590 |
|
williamr@2
|
591 |
/**
|
williamr@2
|
592 |
* The CEikTwoPictureCommandButton class is a command button which can hold two pictures as
|
williamr@2
|
593 |
* well as label text. If a second picture is set for the button it is shown when the button
|
williamr@2
|
594 |
* is pressed.
|
williamr@2
|
595 |
*
|
williamr@2
|
596 |
* @lib eikcoctl.dll
|
williamr@2
|
597 |
* @since S60 1.0
|
williamr@2
|
598 |
*/
|
williamr@2
|
599 |
class CEikTwoPictureCommandButton : public CEikCommandButtonBase
|
williamr@2
|
600 |
{
|
williamr@2
|
601 |
public:
|
williamr@2
|
602 |
|
williamr@2
|
603 |
/**
|
williamr@2
|
604 |
* Layout options for the Two Picture botton
|
williamr@2
|
605 |
*/
|
williamr@2
|
606 |
enum TLayout
|
williamr@2
|
607 |
{
|
williamr@2
|
608 |
ETextRightPictureLeft=0x000,
|
williamr@2
|
609 |
ETextBottomPictureTop=0x001,
|
williamr@2
|
610 |
ETextTopPictureBottom=0x002,
|
williamr@2
|
611 |
ETextLeftPictureRight=0x003
|
williamr@2
|
612 |
};
|
williamr@2
|
613 |
|
williamr@2
|
614 |
/**
|
williamr@2
|
615 |
* Where to put the excess space when laying out the bitmaps or text
|
williamr@2
|
616 |
*/
|
williamr@2
|
617 |
enum TExcess
|
williamr@2
|
618 |
{
|
williamr@2
|
619 |
EShare =0x0000,
|
williamr@2
|
620 |
EToText =0x0010,
|
williamr@2
|
621 |
EToPicture =0x0020
|
williamr@2
|
622 |
};
|
williamr@2
|
623 |
|
williamr@2
|
624 |
/**
|
williamr@2
|
625 |
* Content to display for the text
|
williamr@2
|
626 |
*/
|
williamr@2
|
627 |
enum TDisplayContent
|
williamr@2
|
628 |
{
|
williamr@2
|
629 |
ETextOnly =0x0100,
|
williamr@2
|
630 |
EPictureOnly =0x0200,
|
williamr@2
|
631 |
ETextAndPicture =0x0300
|
williamr@2
|
632 |
};
|
williamr@2
|
633 |
|
williamr@2
|
634 |
private:
|
williamr@2
|
635 |
/**
|
williamr@2
|
636 |
* Options for the type of button
|
williamr@2
|
637 |
*/
|
williamr@2
|
638 |
enum TPictureButtonType
|
williamr@2
|
639 |
{
|
williamr@2
|
640 |
EPictureButWithBorders =0x0000,
|
williamr@2
|
641 |
EPictureButWithoutBorders =0x1000
|
williamr@2
|
642 |
};
|
williamr@2
|
643 |
|
williamr@2
|
644 |
/**
|
williamr@2
|
645 |
* Sets the ownership of the pictures bitmap and mask objects. If owned externally, then no copy is made of the objects
|
williamr@2
|
646 |
* in the setter functions. It must be, in this case, ensured by the client that that the button is destroyed before
|
williamr@2
|
647 |
* deleting the externally-owned objects.
|
williamr@2
|
648 |
*/
|
williamr@2
|
649 |
enum TExternalPicture
|
williamr@2
|
650 |
{
|
williamr@2
|
651 |
EPictureNotOwnedExternally =0x00,
|
williamr@2
|
652 |
EPictureOwnedExternally =0x01
|
williamr@2
|
653 |
};
|
williamr@2
|
654 |
|
williamr@2
|
655 |
public:
|
williamr@2
|
656 |
|
williamr@2
|
657 |
/**
|
williamr@2
|
658 |
* Two picture command button constructor
|
williamr@2
|
659 |
*/
|
williamr@2
|
660 |
IMPORT_C CEikTwoPictureCommandButton();
|
williamr@2
|
661 |
|
williamr@2
|
662 |
/**
|
williamr@2
|
663 |
* Two picture command button C++ destructor
|
williamr@2
|
664 |
*/
|
williamr@2
|
665 |
IMPORT_C ~CEikTwoPictureCommandButton();
|
williamr@2
|
666 |
|
williamr@2
|
667 |
/**
|
williamr@2
|
668 |
* Accesses ownership of the second picture' bitmap and mask (if present)
|
williamr@2
|
669 |
*
|
williamr@2
|
670 |
* @return EFalse iff and if the second picture is not owned externally
|
williamr@2
|
671 |
*/
|
williamr@2
|
672 |
IMPORT_C TBool IsSecondPictureOwnedExternally();
|
williamr@2
|
673 |
|
williamr@2
|
674 |
/**
|
williamr@2
|
675 |
* Access the picture image.
|
williamr@2
|
676 |
*
|
williamr@2
|
677 |
* @return The picture as a CEikImage. No ownership transferred.
|
williamr@2
|
678 |
*/
|
williamr@2
|
679 |
IMPORT_C CEikImage* Picture() const;
|
williamr@2
|
680 |
|
williamr@2
|
681 |
/**
|
williamr@2
|
682 |
* Constructs the two images from resource
|
williamr@2
|
683 |
*
|
williamr@2
|
684 |
* @param aReader Constructed resource reader.
|
williamr@2
|
685 |
* @param aWhich Which picture to be constructing
|
williamr@2
|
686 |
*/
|
williamr@2
|
687 |
IMPORT_C void ConstructImagesFromResourceL(TResourceReader& aReader,TWhichComponent aWhich);
|
williamr@2
|
688 |
|
williamr@2
|
689 |
/**
|
williamr@2
|
690 |
* Sets the label text on the button
|
williamr@2
|
691 |
*
|
williamr@2
|
692 |
* @param aText The text to set
|
williamr@2
|
693 |
*/
|
williamr@2
|
694 |
IMPORT_C void SetTextL(const TDesC& aText);
|
williamr@2
|
695 |
|
williamr@2
|
696 |
/**
|
williamr@2
|
697 |
* Sets the bitmap and optional mask for the button's two pictures. Optionally, only the first button's
|
williamr@2
|
698 |
* picture may be set up.
|
williamr@2
|
699 |
*
|
williamr@2
|
700 |
* @param aMain The bitmap to use for the first picture
|
williamr@2
|
701 |
* @param aMask The mask. If null, then no mask will be used
|
williamr@2
|
702 |
* @param aSecondMain The bitmap to use for the second picture
|
williamr@2
|
703 |
* @param aSecondMask The mask. If null, then no mask will be used
|
williamr@2
|
704 |
*/
|
williamr@2
|
705 |
IMPORT_C void SetTwoPicturesL(const CFbsBitmap* aMain,const CFbsBitmap* aMask=NULL,const CFbsBitmap* aSecondMain=NULL, const CFbsBitmap* aSecondMask=NULL);
|
williamr@2
|
706 |
|
williamr@2
|
707 |
/**
|
williamr@2
|
708 |
* Sets the bitmap and optional mask for the button's second picture
|
williamr@2
|
709 |
*
|
williamr@2
|
710 |
* @param aMain The bitmap to use
|
williamr@2
|
711 |
* @param aMask The mask. If null, then no mask will be used
|
williamr@2
|
712 |
*/
|
williamr@2
|
713 |
IMPORT_C void SetSecondPicture(const CFbsBitmap* aSecondMain, const CFbsBitmap* aSecondMask=NULL);
|
williamr@2
|
714 |
|
williamr@2
|
715 |
/**
|
williamr@2
|
716 |
* Sets the bitmap and optional mask for the first picture from an mbm file.
|
williamr@2
|
717 |
*
|
williamr@2
|
718 |
* @param aFile Mbm filename
|
williamr@2
|
719 |
* @param aMain Index of the bitmap to use
|
williamr@2
|
720 |
* @param aMask Index of the mask. If -1, then a null mask will be used
|
williamr@2
|
721 |
*/
|
williamr@2
|
722 |
IMPORT_C void SetPictureFromFileL(const TDesC& aFilename,TInt aMain,TInt aMask=-1);
|
williamr@2
|
723 |
|
williamr@2
|
724 |
/**
|
williamr@2
|
725 |
* Sets the bitmap and optional mask for the second picture from an mbm file.
|
williamr@2
|
726 |
*
|
williamr@2
|
727 |
* @param aFile Mbm filename
|
williamr@2
|
728 |
* @param aMain Index of the bitmap to use
|
williamr@2
|
729 |
* @param aMask Index of the mask. If -1, then a null mask will be used
|
williamr@2
|
730 |
*/
|
williamr@2
|
731 |
IMPORT_C void SetSecondPictureFromFileL(const TDesC& aFilename,TInt aMain,TInt aMask=-1);
|
williamr@2
|
732 |
|
williamr@2
|
733 |
/**
|
williamr@2
|
734 |
* Sets the ownership of the second picture object
|
williamr@2
|
735 |
*
|
williamr@2
|
736 |
* @param aOwnership Set to EFalse if bitmaps associated with the object are owned by the button
|
williamr@2
|
737 |
*/
|
williamr@2
|
738 |
IMPORT_C void SetSecondPictureOwnedExternally(TBool aOwnership);
|
williamr@2
|
739 |
|
williamr@2
|
740 |
public: // from CCoeControl.
|
williamr@2
|
741 |
|
williamr@2
|
742 |
/**
|
williamr@2
|
743 |
* From CCoeControl
|
williamr@2
|
744 |
*
|
williamr@2
|
745 |
* @param aReader Fully constructed resource reader
|
williamr@2
|
746 |
*/
|
williamr@2
|
747 |
IMPORT_C void ConstructFromResourceL(TResourceReader& aReader);
|
williamr@2
|
748 |
|
williamr@2
|
749 |
/**
|
williamr@2
|
750 |
* From CCoeControl
|
williamr@2
|
751 |
*
|
williamr@2
|
752 |
* Make the control ready for display
|
williamr@2
|
753 |
*/
|
williamr@2
|
754 |
IMPORT_C void ActivateL();
|
williamr@2
|
755 |
|
williamr@2
|
756 |
/**
|
williamr@2
|
757 |
* From CCoeControl
|
williamr@2
|
758 |
*
|
williamr@2
|
759 |
* Handle a pointer event coming from the CONE framework
|
williamr@2
|
760 |
*
|
williamr@2
|
761 |
* @param aPointerEvent Event to handle
|
williamr@2
|
762 |
*/
|
williamr@2
|
763 |
IMPORT_C void HandlePointerEventL(const TPointerEvent& aPointerEvent);
|
williamr@2
|
764 |
|
williamr@2
|
765 |
protected:
|
williamr@2
|
766 |
/**
|
williamr@2
|
767 |
* From CCoeControl
|
williamr@2
|
768 |
*
|
williamr@2
|
769 |
* Serialize the state of the control
|
williamr@2
|
770 |
*
|
williamr@2
|
771 |
* @param aWriteStream Output stream for the serialization
|
williamr@2
|
772 |
*/
|
williamr@2
|
773 |
IMPORT_C void WriteInternalStateL(RWriteStream& aWriteStream) const;
|
williamr@2
|
774 |
|
williamr@2
|
775 |
private: // from CCoeControl
|
williamr@2
|
776 |
|
williamr@2
|
777 |
/**
|
williamr@2
|
778 |
* From CCoeControl
|
williamr@2
|
779 |
*
|
williamr@2
|
780 |
* Request for the control to draw itself within the given rectangle
|
williamr@2
|
781 |
*
|
williamr@2
|
782 |
* @param aRect TRect to draw
|
williamr@2
|
783 |
*/
|
williamr@2
|
784 |
IMPORT_C void Draw(const TRect& /*aRect*/) const;
|
williamr@2
|
785 |
|
williamr@2
|
786 |
/**
|
williamr@2
|
787 |
* From CEikButtonBase
|
williamr@2
|
788 |
*
|
williamr@2
|
789 |
* Framework method called when the state changes
|
williamr@2
|
790 |
*/
|
williamr@2
|
791 |
IMPORT_C void StateChanged();
|
williamr@2
|
792 |
|
williamr@2
|
793 |
private:
|
williamr@2
|
794 |
/**
|
williamr@2
|
795 |
* From CAknControl
|
williamr@2
|
796 |
*/
|
williamr@2
|
797 |
IMPORT_C void* ExtensionInterface( TUid aInterface );
|
williamr@2
|
798 |
|
williamr@2
|
799 |
private:
|
williamr@2
|
800 |
/**
|
williamr@2
|
801 |
* From MCoeControlContext
|
williamr@2
|
802 |
*
|
williamr@2
|
803 |
* Modify the passed-in graphics context ready for use in this control
|
williamr@2
|
804 |
*
|
williamr@2
|
805 |
* @param aGc Graphics context to set up
|
williamr@2
|
806 |
*/
|
williamr@2
|
807 |
IMPORT_C void PrepareContext(CWindowGc& aGc) const;
|
williamr@2
|
808 |
|
williamr@2
|
809 |
private:
|
williamr@2
|
810 |
void SwapPictures(CEikImage* aImage);
|
williamr@2
|
811 |
|
williamr@2
|
812 |
private:
|
williamr@2
|
813 |
/**
|
williamr@2
|
814 |
* Ownership dependent on state of flags
|
williamr@2
|
815 |
*/
|
williamr@2
|
816 |
const CFbsBitmap* iSecondBitmap;
|
williamr@2
|
817 |
/**
|
williamr@2
|
818 |
* Ownership dependent on state of flags
|
williamr@2
|
819 |
*/
|
williamr@2
|
820 |
const CFbsBitmap* iSecondMaskBitmap;
|
williamr@2
|
821 |
TInt iPictureFlags;
|
williamr@2
|
822 |
TInt iDummy;
|
williamr@2
|
823 |
};
|
williamr@2
|
824 |
|
williamr@2
|
825 |
/**
|
williamr@2
|
826 |
* The CEikInverterCommandButton class is a command button which swaps the foreground and background
|
williamr@2
|
827 |
* colors used to draw the button contents when the button is pressed.
|
williamr@2
|
828 |
*
|
williamr@2
|
829 |
* @since S60 1.0
|
williamr@2
|
830 |
*/
|
williamr@2
|
831 |
class CEikInverterCommandButton : public CEikCommandButton
|
williamr@2
|
832 |
{
|
williamr@2
|
833 |
public:
|
williamr@2
|
834 |
|
williamr@2
|
835 |
/**
|
williamr@2
|
836 |
* Constructor
|
williamr@2
|
837 |
*/
|
williamr@2
|
838 |
IMPORT_C CEikInverterCommandButton();
|
williamr@2
|
839 |
|
williamr@2
|
840 |
/**
|
williamr@2
|
841 |
* C++ destructor
|
williamr@2
|
842 |
*/
|
williamr@2
|
843 |
IMPORT_C ~CEikInverterCommandButton();
|
williamr@2
|
844 |
|
williamr@2
|
845 |
public: // From CCoeControl
|
williamr@2
|
846 |
|
williamr@2
|
847 |
/**
|
williamr@2
|
848 |
* From CCoeControl
|
williamr@2
|
849 |
*
|
williamr@2
|
850 |
* Handle a pointer event coming from the CONE framework
|
williamr@2
|
851 |
*
|
williamr@2
|
852 |
* @param aPointerEvent Event to handle
|
williamr@2
|
853 |
*/
|
williamr@2
|
854 |
IMPORT_C void HandlePointerEventL(const TPointerEvent& aPointerEvent);
|
williamr@2
|
855 |
|
williamr@2
|
856 |
protected:
|
williamr@2
|
857 |
|
williamr@2
|
858 |
/**
|
williamr@2
|
859 |
* From CCoeControl
|
williamr@2
|
860 |
*
|
williamr@2
|
861 |
* Serialize the state of the control
|
williamr@2
|
862 |
*
|
williamr@2
|
863 |
* @param aWriteStream Output stream for the serialization
|
williamr@2
|
864 |
*/
|
williamr@2
|
865 |
IMPORT_C void WriteInternalStateL(RWriteStream& aWriteStream) const;
|
williamr@2
|
866 |
|
williamr@2
|
867 |
private:
|
williamr@2
|
868 |
/**
|
williamr@2
|
869 |
* From MCoeControlContext
|
williamr@2
|
870 |
*
|
williamr@2
|
871 |
* Modify the passed-in graphics context ready for use in this control
|
williamr@2
|
872 |
*
|
williamr@2
|
873 |
* @param aGc Graphics context to set up
|
williamr@2
|
874 |
*/
|
williamr@2
|
875 |
IMPORT_C void PrepareContext(CWindowGc& aGc) const;
|
williamr@2
|
876 |
|
williamr@2
|
877 |
private:
|
williamr@2
|
878 |
/**
|
williamr@2
|
879 |
* From CAknControl
|
williamr@2
|
880 |
*/
|
williamr@2
|
881 |
IMPORT_C void* ExtensionInterface( TUid aInterface );
|
williamr@2
|
882 |
private:
|
williamr@2
|
883 |
TInt iFlag;
|
williamr@2
|
884 |
TInt iDummy;
|
williamr@2
|
885 |
};
|
williamr@2
|
886 |
|
williamr@2
|
887 |
/**
|
williamr@2
|
888 |
* A command button with a text label
|
williamr@2
|
889 |
*
|
williamr@2
|
890 |
* This specialization of CEikCommandButtonBase supports a single text label.
|
williamr@2
|
891 |
*
|
williamr@2
|
892 |
* @lib eikcoctl.dll
|
williamr@2
|
893 |
* @since S60 1.0
|
williamr@2
|
894 |
*/
|
williamr@2
|
895 |
class CEikTextButton : public CEikCommandButtonBase
|
williamr@2
|
896 |
{
|
williamr@2
|
897 |
public:
|
williamr@2
|
898 |
|
williamr@2
|
899 |
/**
|
williamr@2
|
900 |
* Constructor
|
williamr@2
|
901 |
*/
|
williamr@2
|
902 |
IMPORT_C CEikTextButton();
|
williamr@2
|
903 |
|
williamr@2
|
904 |
/**
|
williamr@2
|
905 |
* C++ destructor
|
williamr@2
|
906 |
*/
|
williamr@2
|
907 |
IMPORT_C ~CEikTextButton();
|
williamr@2
|
908 |
|
williamr@2
|
909 |
/**
|
williamr@2
|
910 |
* Sets the label text for the button.
|
williamr@2
|
911 |
*
|
williamr@2
|
912 |
* @param aText The text to set
|
williamr@2
|
913 |
* @param aWhich The component for which the text is to be set.
|
williamr@2
|
914 |
*/
|
williamr@2
|
915 |
IMPORT_C void SetTextL(const TDesC& aText,TWhichComponent aWhich=EFirst);
|
williamr@2
|
916 |
|
williamr@2
|
917 |
/**
|
williamr@2
|
918 |
* Access the label control that implements the text label of the button. Ownership is not transferred.
|
williamr@2
|
919 |
*
|
williamr@2
|
920 |
* @return A pointer to the CEikLabel control used to implement the text display
|
williamr@2
|
921 |
*/
|
williamr@2
|
922 |
IMPORT_C CEikLabel* Label(TWhichComponent aWhich=EFirst) const;
|
williamr@2
|
923 |
|
williamr@2
|
924 |
// from CCoeControl
|
williamr@2
|
925 |
public:
|
williamr@2
|
926 |
|
williamr@2
|
927 |
/**
|
williamr@2
|
928 |
* From CCoeControl
|
williamr@2
|
929 |
*
|
williamr@2
|
930 |
* Construct the object from resource
|
williamr@2
|
931 |
*
|
williamr@2
|
932 |
* @param aReader Fully constructed resource reader
|
williamr@2
|
933 |
*/
|
williamr@2
|
934 |
IMPORT_C void ConstructFromResourceL(TResourceReader& aReader);
|
williamr@2
|
935 |
|
williamr@2
|
936 |
/**
|
williamr@2
|
937 |
* From CCoeControl
|
williamr@2
|
938 |
*
|
williamr@2
|
939 |
* Handle a pointer event coming from the CONE framework
|
williamr@2
|
940 |
*
|
williamr@2
|
941 |
* @param aPointerEvent Event to handle
|
williamr@2
|
942 |
*/
|
williamr@2
|
943 |
IMPORT_C void HandlePointerEventL(const TPointerEvent& aPointerEvent);
|
williamr@2
|
944 |
|
williamr@2
|
945 |
// From CAknControl
|
williamr@2
|
946 |
private:
|
williamr@2
|
947 |
IMPORT_C void* ExtensionInterface( TUid aInterface );
|
williamr@2
|
948 |
|
williamr@2
|
949 |
private: // data
|
williamr@2
|
950 |
TInt iDummy;
|
williamr@2
|
951 |
};
|
williamr@2
|
952 |
|
williamr@2
|
953 |
/**
|
williamr@2
|
954 |
* A command button with a single bitmap
|
williamr@2
|
955 |
*
|
williamr@2
|
956 |
* This specialization of CEikCommandButtonBase supports a single bitmap, optionally with a mask.
|
williamr@2
|
957 |
*
|
williamr@2
|
958 |
* @lib eikcoctl.dll
|
williamr@2
|
959 |
* @since S60 1.0
|
williamr@2
|
960 |
*/
|
williamr@2
|
961 |
class CEikBitmapButton : public CEikCommandButtonBase
|
williamr@2
|
962 |
{
|
williamr@2
|
963 |
public:
|
williamr@2
|
964 |
|
williamr@2
|
965 |
/**
|
williamr@2
|
966 |
* Constructor
|
williamr@2
|
967 |
*/
|
williamr@2
|
968 |
IMPORT_C CEikBitmapButton();
|
williamr@2
|
969 |
|
williamr@2
|
970 |
/**
|
williamr@2
|
971 |
* C++ Destructor
|
williamr@2
|
972 |
*/
|
williamr@2
|
973 |
IMPORT_C ~CEikBitmapButton();
|
williamr@2
|
974 |
|
williamr@2
|
975 |
/**
|
williamr@2
|
976 |
* Sets the bitmap and optional mask for the button
|
williamr@2
|
977 |
*
|
williamr@2
|
978 |
* @param aMain The bitmap to use
|
williamr@2
|
979 |
* @param aMask The mask. If null, then no mask will be used
|
williamr@2
|
980 |
* @param aWhich The component for which the picture is to be set.
|
williamr@2
|
981 |
*/
|
williamr@2
|
982 |
IMPORT_C void SetPictureL(const CFbsBitmap* aMain,const CFbsBitmap* aMask=NULL,TWhichComponent aWhich=EFirst);
|
williamr@2
|
983 |
|
williamr@2
|
984 |
/**
|
williamr@2
|
985 |
* Sets the bitmap and optional mask from an mbm file.
|
williamr@2
|
986 |
*
|
williamr@2
|
987 |
* @param aFile Mbm filename
|
williamr@2
|
988 |
* @param aMain Index of the bitmap to use
|
williamr@2
|
989 |
* @param aMask Index of the mask. If -1, then a null mask will be used
|
williamr@2
|
990 |
* @param aWhich The component for which the picture is to be set.
|
williamr@2
|
991 |
*/
|
williamr@2
|
992 |
IMPORT_C void SetPictureFromFileL(const TDesC& aFilename,TInt aMain,TInt aMask=-1,TWhichComponent aWhich=EFirst);
|
williamr@2
|
993 |
|
williamr@2
|
994 |
/**
|
williamr@2
|
995 |
* Access to the image
|
williamr@2
|
996 |
*
|
williamr@2
|
997 |
* @param aWhich Which picture to access
|
williamr@2
|
998 |
* @return pointer to the image. No ownership is transferred
|
williamr@2
|
999 |
*/
|
williamr@2
|
1000 |
IMPORT_C CEikImage* Picture(TWhichComponent aWhich=EFirst) const;
|
williamr@2
|
1001 |
|
williamr@2
|
1002 |
// from CCoeControl
|
williamr@2
|
1003 |
public:
|
williamr@2
|
1004 |
/**
|
williamr@2
|
1005 |
* From CCoeControl
|
williamr@2
|
1006 |
*
|
williamr@2
|
1007 |
* Construct the object from resource
|
williamr@2
|
1008 |
*
|
williamr@2
|
1009 |
* @param aReader Fully constructed resource reader
|
williamr@2
|
1010 |
*/
|
williamr@2
|
1011 |
IMPORT_C void ConstructFromResourceL(TResourceReader& aReader);
|
williamr@2
|
1012 |
|
williamr@2
|
1013 |
/**
|
williamr@2
|
1014 |
* From CCoeControl
|
williamr@2
|
1015 |
*
|
williamr@2
|
1016 |
* Handle a pointer event coming from the CONE framework
|
williamr@2
|
1017 |
*
|
williamr@2
|
1018 |
* @param aPointerEvent Event to handle
|
williamr@2
|
1019 |
*/
|
williamr@2
|
1020 |
IMPORT_C void HandlePointerEventL(const TPointerEvent& aPointerEvent);
|
williamr@2
|
1021 |
|
williamr@2
|
1022 |
private:
|
williamr@2
|
1023 |
/**
|
williamr@2
|
1024 |
* From CAknControl
|
williamr@2
|
1025 |
*/
|
williamr@2
|
1026 |
IMPORT_C void* ExtensionInterface( TUid aInterface );
|
williamr@2
|
1027 |
|
williamr@2
|
1028 |
private: // data
|
williamr@2
|
1029 |
TInt iDummy;
|
williamr@2
|
1030 |
};
|
williamr@2
|
1031 |
|
williamr@2
|
1032 |
#endif // __EIKCMBUT_H__
|