56
|
1 |
/*
|
|
2 |
* Copyright (c) 2002-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: EIKON button group container class definition.
|
|
15 |
*
|
|
16 |
*/
|
|
17 |
|
|
18 |
|
|
19 |
#ifndef __EIKBTGPC_H__
|
|
20 |
#define __EIKBTGPC_H__
|
|
21 |
|
|
22 |
#include <coecntrl.h>
|
|
23 |
#include <eikbtgrp.h>
|
|
24 |
#include <eikcmobs.h>
|
|
25 |
#include <lafpublc.h>
|
|
26 |
#include <uikon.hrh>
|
|
27 |
|
|
28 |
#include <AknControl.h>
|
|
29 |
|
|
30 |
class MEikCommandObserver;
|
|
31 |
class CEikButtonGroupStack;
|
|
32 |
class CEikCommandButton;
|
|
33 |
class CEikListBox;
|
|
34 |
|
|
35 |
/**
|
|
36 |
* The CEikButtonGroupContainer class provides a wrapper around the different button arrays
|
|
37 |
* used in pen and no-pen devices.
|
|
38 |
*
|
|
39 |
* @lib eikcoctl.lib
|
|
40 |
* @since S60 0.9
|
|
41 |
*/
|
|
42 |
NONSHARABLE_CLASS(CEikButtonGroupContainer) : public CAknControl, public MEikCommandObserver
|
|
43 |
{
|
|
44 |
public:
|
|
45 |
/**
|
|
46 |
* Declares an object type for a class, in order to allow the object
|
|
47 |
* provider mechanism to locate and provide objects from the class.
|
|
48 |
*/
|
|
49 |
DECLARE_TYPE_ID(0x101F4107)
|
|
50 |
|
|
51 |
/**
|
|
52 |
* Describes how the container is being used.
|
|
53 |
*
|
|
54 |
* The enumeration is used by the system to create the appropriate (UI variant-specific)
|
|
55 |
* button group for the specified type.
|
|
56 |
*/
|
|
57 |
enum TUse
|
|
58 |
{
|
|
59 |
EView = SLafButtonGroupContainer::EView, ///< In a view.
|
|
60 |
EDialog = SLafButtonGroupContainer::EDialog, ///< In a dialog.
|
|
61 |
EToolbar = SLafButtonGroupContainer::EToolbar, ///< In a toolbar.
|
|
62 |
ECba = SLafButtonGroupContainer::ECba, ///< In a control button array.
|
|
63 |
EDialogButtons = SLafButtonGroupContainer::EDialogButtons ///< In dialog buttons.
|
|
64 |
};
|
|
65 |
|
|
66 |
/**
|
|
67 |
* Describes the orientation of the container.
|
|
68 |
*/
|
|
69 |
enum TOrientation
|
|
70 |
{
|
|
71 |
EVertical = SLafButtonGroupContainer::EVertical, ///< Buttons are laid out vertically.
|
|
72 |
EHorizontal = SLafButtonGroupContainer::EHorizontal ///< Buttons are laid out horizontally.
|
|
73 |
};
|
|
74 |
|
|
75 |
/**
|
|
76 |
* Relative positions of the container and the control which uses it.
|
|
77 |
*/
|
|
78 |
enum TLocation
|
|
79 |
{
|
|
80 |
/** The button group is internal to the control which is using it. E.g. dialog buttons. */
|
|
81 |
EInternal = SLafButtonGroupContainer::EInternal,
|
|
82 |
|
|
83 |
/** The button group is external to the control which is using it. E.g. toolbar or cba. */
|
|
84 |
EExternal = SLafButtonGroupContainer::EExternal
|
|
85 |
};
|
|
86 |
|
|
87 |
/**
|
|
88 |
* Flags for the display of hotkeys.
|
|
89 |
*/
|
|
90 |
enum THotKeyFlags
|
|
91 |
{
|
|
92 |
EShowHotKey = 0x01, ///< Hotkeys for commands should be shown.
|
|
93 |
EPlainHotKey = 0x02 ///< Hotkeys for commands should not be shown.
|
|
94 |
};
|
|
95 |
|
|
96 |
/**
|
|
97 |
* Additional flags.
|
|
98 |
*/
|
|
99 |
enum TFlags
|
|
100 |
{
|
|
101 |
EAddToStack = 0x01, ///< Not used.
|
|
102 |
EDelayActivation = 0x02, ///< If set, the container is not activated during construction.
|
|
103 |
EUseMaxSize = 0x04, ///< Not used.
|
|
104 |
EIsEmbedded = 0x08, ///< Embedded in a dialog or popup.
|
|
105 |
EParentIsControl = 0x10, ///< Parent window group is treated as CCoeControl.
|
|
106 |
EAlwaysShown = 0x20 ///< Left softkey is not automatically hidden
|
|
107 |
};
|
|
108 |
|
|
109 |
/**
|
|
110 |
* Defines the positions for each command.
|
|
111 |
*/
|
|
112 |
enum TCommandPosition
|
|
113 |
{
|
|
114 |
ELeftSoftkeyPosition = 0, ///< Position for left softkey.
|
|
115 |
ERightSoftkeyPosition = 2, ///< Position for right softkey.
|
|
116 |
EMiddleSoftkeyPosition = 3 ///< Position for middle softkey.
|
|
117 |
};
|
|
118 |
|
|
119 |
public:
|
|
120 |
/**
|
|
121 |
* Creates a button group container in its own window.
|
|
122 |
*
|
|
123 |
* @param aUse The button group's type.
|
|
124 |
* @param aOrientation The button group's orientation. You need specify this
|
|
125 |
* only for devices that can layout their buttons either
|
|
126 |
* horizontally or vertically.
|
|
127 |
* @param aCommandObserver A command observer to be notified of commands on
|
|
128 |
* the container.
|
|
129 |
* @param aResourceId A resource containing descriptions of buttons in the group.
|
|
130 |
* This can be NULL if buttons are to be added dynamically.
|
|
131 |
* @param aFlags The button group's flags.
|
|
132 |
* @return Button group container object.
|
|
133 |
*/
|
|
134 |
IMPORT_C static CEikButtonGroupContainer* NewL(
|
|
135 |
TUse aUse,
|
|
136 |
TOrientation aOrientation,
|
|
137 |
MEikCommandObserver* aCommandObserver,
|
|
138 |
TInt aResourceId,
|
|
139 |
TUint aFlags = EAddToStack);
|
|
140 |
|
|
141 |
/**
|
|
142 |
* Creates a button group container in its parent control's window.
|
|
143 |
*
|
|
144 |
* @param aUse The button group's type.
|
|
145 |
* @param aOrientation The button group's orientation. You need specify this
|
|
146 |
* only for devices that can layout their buttons either
|
|
147 |
* horizontally or vertically.
|
|
148 |
* @param aCommandObserver A command observer to be notified of commands on
|
|
149 |
* the container.
|
|
150 |
* @param aResourceId A resource containing descriptions of buttons in the group.
|
|
151 |
* This can be NULL if buttons are to be added dynamically.
|
|
152 |
* @param aParent The control's parent.
|
|
153 |
* @param aFlags The button group's flags.
|
|
154 |
* @return Button group container object.
|
|
155 |
*/
|
|
156 |
IMPORT_C static CEikButtonGroupContainer* NewL(
|
|
157 |
TUse aUse,
|
|
158 |
TOrientation aOrientation,
|
|
159 |
MEikCommandObserver* aCommandObserver,
|
|
160 |
TInt aResourceId,
|
|
161 |
const CCoeControl& aParent,
|
|
162 |
TUint aFlags = EAddToStack);
|
|
163 |
|
|
164 |
/**
|
|
165 |
* Creates a button group container in given window group.
|
|
166 |
*
|
|
167 |
* @param aUse The button group's type.
|
|
168 |
* @param aOrientation The button group's orientation. You need specify this
|
|
169 |
* only for devices that can layout their buttons either
|
|
170 |
* horizontally or vertically.
|
|
171 |
* @param aCommandObserver A command observer to be notified of commands on
|
|
172 |
* the container.
|
|
173 |
* @param aResourceId A resource containing descriptions of buttons in the group.
|
|
174 |
* This can be NULL if buttons are to be added dynamically.
|
|
175 |
* @param aParentWg The parent window group.
|
|
176 |
* @param aFlags The button group's flags.
|
|
177 |
* @return Button group container object.
|
|
178 |
*/
|
|
179 |
IMPORT_C static CEikButtonGroupContainer* NewL(
|
|
180 |
TUse aUse,
|
|
181 |
TOrientation aOrientation,
|
|
182 |
MEikCommandObserver* aCommandObserver,
|
|
183 |
TInt aResourceId,
|
|
184 |
RWindowGroup& aParentWg,
|
|
185 |
TUint aFlags = EAddToStack);
|
|
186 |
|
|
187 |
/**
|
|
188 |
* Destructor.
|
|
189 |
*/
|
|
190 |
IMPORT_C ~CEikButtonGroupContainer();
|
|
191 |
|
|
192 |
/**
|
|
193 |
* Gets a pointer to an application's currently active CEikButtonGroupContainer (if any).
|
|
194 |
*
|
|
195 |
* Returns NULL if there are no containers active or none suitable for sharing.
|
|
196 |
* Ownership of the returned pointer is not transferred.
|
|
197 |
*
|
|
198 |
* @return Pointer to the button group container.
|
|
199 |
*/
|
|
200 |
IMPORT_C static CEikButtonGroupContainer* Current();
|
|
201 |
|
|
202 |
public:
|
|
203 |
/**
|
|
204 |
* Sets a command button's text label and command ID.
|
|
205 |
*
|
|
206 |
* @param aPosition The position within the button group of the button to change.
|
|
207 |
* If the position is out of range this function raises a panic.
|
|
208 |
* @param aCommandId Command ID the button will send.
|
|
209 |
* @param aText Text for the button.
|
|
210 |
*/
|
|
211 |
inline void SetCommandL(
|
|
212 |
TInt aPosition,
|
|
213 |
TInt aCommandId,
|
|
214 |
const TDesC& aText);
|
|
215 |
|
|
216 |
/**
|
|
217 |
* Sets a command button's bitmap and command ID.
|
|
218 |
*
|
|
219 |
* @param aPosition The position within the button group of the button to change.
|
|
220 |
* If the position is out of range this function raises a panic.
|
|
221 |
* @param aCommandId Command ID the button will send.
|
|
222 |
* @param aBitmap The bitmap for the button.
|
|
223 |
* @param aMask The mask bitmap for aBitmap.
|
|
224 |
*/
|
|
225 |
inline void SetCommandL(
|
|
226 |
TInt aPosition,
|
|
227 |
TInt aCommandId,
|
|
228 |
const CFbsBitmap& aBitmap,
|
|
229 |
const CFbsBitmap& aMask);
|
|
230 |
|
|
231 |
/**
|
|
232 |
* Sets a command button's bitmap, text and command ID.
|
|
233 |
*
|
|
234 |
* @param aPosition The position within the button group of the button to change.
|
|
235 |
* If the position is out of range, the function raises a panic.
|
|
236 |
* @param aCommandId Command ID the button will send.
|
|
237 |
* @param aText The text for the button.
|
|
238 |
* @param aBitmap The bitmap for the button.
|
|
239 |
* @param aMask The mask bitmap for aBitmap.
|
|
240 |
*/
|
|
241 |
inline void SetCommandL(
|
|
242 |
TInt aPosition,
|
|
243 |
TInt aCommandId,
|
|
244 |
const TDesC& aText,
|
|
245 |
const CFbsBitmap& aBitmap,
|
|
246 |
const CFbsBitmap& aMask);
|
|
247 |
|
|
248 |
/**
|
|
249 |
* Sets a command button's bitmap and command ID. The bitmap and its mask are read
|
|
250 |
* from a file.
|
|
251 |
*
|
|
252 |
* @param aPosition The position within the button group of the button to change.
|
|
253 |
* If the position is out of range, the function raises a panic.
|
|
254 |
* @param aCommandId Command ID the button will send.
|
|
255 |
* @param aFile A multi-bitmap file, containing mask and bitmap images.
|
|
256 |
* @param aBitmapId ID of the bitmap within aFile.
|
|
257 |
* @param aMaskId ID of the mask within aFile.
|
|
258 |
*/
|
|
259 |
inline void SetCommandL(
|
|
260 |
TInt aPosition,
|
|
261 |
TInt aCommandId,
|
|
262 |
const TDesC& aFile,
|
|
263 |
TInt aBitmapId,
|
|
264 |
TInt aMaskId);
|
|
265 |
|
|
266 |
/**
|
|
267 |
* Sets a command button's bitmap, text label and command ID. The bitmap and its
|
|
268 |
* mask are read from a file.
|
|
269 |
*
|
|
270 |
* @param aPosition The position within the button group of the button to change.
|
|
271 |
* If the position is out of range, the function raises a panic.
|
|
272 |
* @param aCommandId Command ID the button will send.
|
|
273 |
* @param aText The text for the button.
|
|
274 |
* @param aFile A multi-bitmap file, containing mask and bitmap images.
|
|
275 |
* @param aBitmapId ID of the bitmap within aFile.
|
|
276 |
* @param aMaskId ID of the mask within aFile.
|
|
277 |
*/
|
|
278 |
inline void SetCommandL(
|
|
279 |
TInt aPosition,
|
|
280 |
TInt aCommandId,
|
|
281 |
const TDesC& aText,
|
|
282 |
const TDesC& aFile,
|
|
283 |
TInt aBitmapId,
|
|
284 |
TInt aMaskId);
|
|
285 |
|
|
286 |
/**
|
|
287 |
* Sets a command button's bitmap, text label and command ID. The bitmap, mask,
|
|
288 |
* text and command ID are all read from resource.
|
|
289 |
*
|
|
290 |
* @param aPosition The position within the button group of the button to change.
|
|
291 |
* If the position is out of range, the function raises a panic.
|
|
292 |
* @param aResourceId Resource ID specifying the text, bitmaps and command ID.
|
|
293 |
*/
|
|
294 |
inline void SetCommandL(
|
|
295 |
TInt aPosition,
|
|
296 |
TInt aResourceId);
|
|
297 |
|
|
298 |
/**
|
|
299 |
* Sets a command button's text. The button to change is identified by its command ID.
|
|
300 |
*
|
|
301 |
* @param aCommandId Command ID of the button to change.
|
|
302 |
* @param aText The text for the button.
|
|
303 |
* @leave KErrNotFound The ID cannot be matched to any button.
|
|
304 |
*/
|
|
305 |
inline void SetCommandL(
|
|
306 |
TInt aCommandId,
|
|
307 |
const TDesC& aText);
|
|
308 |
|
|
309 |
/**
|
|
310 |
* Sets a command button's bitmap and mask. The button to change is identified
|
|
311 |
* by its command ID.
|
|
312 |
*
|
|
313 |
* @param aCommandId Command ID of the button to change.
|
|
314 |
* @param aBitmap Bitmap for the button.
|
|
315 |
* @param aMask Mask bitmap for aBitmap.
|
|
316 |
* @leave KErrNotFound The ID cannot be matched to any button.
|
|
317 |
*/
|
|
318 |
inline void SetCommandL(
|
|
319 |
TInt aCommandId,
|
|
320 |
const CFbsBitmap& aBitmap,
|
|
321 |
const CFbsBitmap& aMask);
|
|
322 |
|
|
323 |
/**
|
|
324 |
* Sets a command button's bitmap, mask and text. The button to change is
|
|
325 |
* identified by its command ID.
|
|
326 |
*
|
|
327 |
* @param aCommandId Command ID of the button to change.
|
|
328 |
* @param aText Text for the button.
|
|
329 |
* @param aBitmap Bitmap for the button.
|
|
330 |
* @param aMask Mask bitmap for aBitmap.
|
|
331 |
*/
|
|
332 |
inline void SetCommandL(
|
|
333 |
TInt aCommandId,
|
|
334 |
const TDesC& aText,
|
|
335 |
const CFbsBitmap& aBitmap,
|
|
336 |
const CFbsBitmap& aMask);
|
|
337 |
|
|
338 |
/**
|
|
339 |
* Sets a command button's bitmap and mask. The bitmap and mask are read from
|
|
340 |
* a multi bitmap file. The button to change is identified by its command ID.
|
|
341 |
*
|
|
342 |
* @param aCommandId Command ID of the button to change.
|
|
343 |
* @param aFile A multi-bitmap file, containing mask and bitmap images.
|
|
344 |
* @param aBitmapId ID of the bitmap within aFile.
|
|
345 |
* @param aMaskId ID of the mask within aFile.
|
|
346 |
*/
|
|
347 |
inline void SetCommandL(
|
|
348 |
TInt aCommandId,
|
|
349 |
const TDesC& aFile,
|
|
350 |
TInt aBitmapId,
|
|
351 |
TInt aMaskId);
|
|
352 |
|
|
353 |
/**
|
|
354 |
* Sets a command button's bitmap, mask and text. The bitmap and its mask are read
|
|
355 |
* from a multi bitmap file. The button to change is identified by its command ID.
|
|
356 |
*
|
|
357 |
* @param aCommandId Command ID of the button to change.
|
|
358 |
* @param aText Text for the button.
|
|
359 |
* @param aFile A multi-bitmap file, containing mask and bitmap images.
|
|
360 |
* @param aBitmapId ID of the bitmap within aFile.
|
|
361 |
* @param aMaskId ID of the mask within aFile.
|
|
362 |
*/
|
|
363 |
inline void SetCommandL(
|
|
364 |
TInt aCommandId,
|
|
365 |
const TDesC& aText,
|
|
366 |
const TDesC& aFile,
|
|
367 |
TInt aBitmapId,
|
|
368 |
TInt aMaskId);
|
|
369 |
|
|
370 |
/**
|
|
371 |
* Initialises the group of command buttons from a resource.
|
|
372 |
*
|
|
373 |
* @param aResourceId ID of the resource structure specifying the command buttons.
|
|
374 |
*/
|
|
375 |
IMPORT_C void SetCommandSetL(
|
|
376 |
TInt aResourceId);
|
|
377 |
|
|
378 |
/**
|
|
379 |
* Adds a command button with a text label and command ID.
|
|
380 |
*
|
|
381 |
* @param aPosition The position in the button group for the new button.
|
|
382 |
* @param aCommandId Command ID for the new button.
|
|
383 |
* @param aText Text for the button.
|
|
384 |
*/
|
|
385 |
inline void AddCommandL(
|
|
386 |
TInt aPosition,
|
|
387 |
TInt aCommandId,
|
|
388 |
const TDesC& aText);
|
|
389 |
|
|
390 |
/**
|
|
391 |
* Adds a command button with a bitmap label and command ID.
|
|
392 |
*
|
|
393 |
* @param aPosition The position in the button group for the new button.
|
|
394 |
* @param aCommandId Command ID for the new button.
|
|
395 |
* @param aBitmap Bitmap for the button.
|
|
396 |
* @param aMask Mask bitmap for aBitmap.
|
|
397 |
*/
|
|
398 |
inline void AddCommandL(
|
|
399 |
TInt aPosition,
|
|
400 |
TInt aCommandId,
|
|
401 |
const CFbsBitmap& aBitmap,
|
|
402 |
const CFbsBitmap& aMask);
|
|
403 |
|
|
404 |
/**
|
|
405 |
* Adds a command button with a command ID and a label containing both
|
|
406 |
* a bitmap and text.
|
|
407 |
*
|
|
408 |
* @param aPosition The position in the button group for the new button.
|
|
409 |
* @param aCommandId Command ID for the new button.
|
|
410 |
* @param aText Text for the button.
|
|
411 |
* @param aBitmap Bitmap for the button.
|
|
412 |
* @param aMask Mask bitmap for aBitmap.
|
|
413 |
*/
|
|
414 |
inline void AddCommandL(
|
|
415 |
TInt aPosition,
|
|
416 |
TInt aCommandId,
|
|
417 |
const TDesC& aText,
|
|
418 |
const CFbsBitmap& aBitmap,
|
|
419 |
const CFbsBitmap& aMask);
|
|
420 |
|
|
421 |
/**
|
|
422 |
* Adds a command button with a command ID and a bitmap which is read from a file.
|
|
423 |
*
|
|
424 |
* @param aPosition The position in the button group for the new button.
|
|
425 |
* @param aCommandId Command ID for the new button.
|
|
426 |
* @param aFile Multi-bitmap file containing the bitmap and mask.
|
|
427 |
* @param aBitmapId ID of the bitmap within aFile.
|
|
428 |
* @param aMaskId ID of the mask within aFile.
|
|
429 |
*/
|
|
430 |
inline void AddCommandL(
|
|
431 |
TInt aPosition,
|
|
432 |
TInt aCommandId,
|
|
433 |
const TDesC& aFile,
|
|
434 |
TInt aBitmapId,
|
|
435 |
TInt aMaskId);
|
|
436 |
|
|
437 |
/**
|
|
438 |
* Adds a command button with a command ID and a label containing both a bitmap
|
|
439 |
* and text. The bitmap and mask are read from file.
|
|
440 |
*
|
|
441 |
* @param aPosition The position in the button group for the new button.
|
|
442 |
* @param aCommandId Command ID for the new button.
|
|
443 |
* @param aText Text for the button.
|
|
444 |
* @param aFile Multi-bitmap file containing the bitmap and mask.
|
|
445 |
* @param aBitmapId ID of the bitmap within aFile.
|
|
446 |
* @param aMaskId ID of the mask within aFile.
|
|
447 |
*/
|
|
448 |
inline void AddCommandL(
|
|
449 |
TInt aPosition,
|
|
450 |
TInt aCommandId,
|
|
451 |
const TDesC& aText,
|
|
452 |
const TDesC& aFile,
|
|
453 |
TInt aBitmapId,
|
|
454 |
TInt aMaskId);
|
|
455 |
|
|
456 |
/**
|
|
457 |
* Pushes a command button with a text label and command ID onto a position's
|
|
458 |
* button stack. This function behaves similarly to SetCommandL() but allows
|
|
459 |
* the previous command button to be retrieved by calling RemoveCommandFromStack().
|
|
460 |
*
|
|
461 |
* @param aPosition The position in the button group at which to add the command button.
|
|
462 |
* @param aCommandId Command ID the button will send.
|
|
463 |
* @param aText Text for the button.
|
|
464 |
*/
|
|
465 |
inline void AddCommandToStackL(
|
|
466 |
TInt aPosition,
|
|
467 |
TInt aCommandId,
|
|
468 |
const TDesC& aText);
|
|
469 |
|
|
470 |
/**
|
|
471 |
* Pushes a command button with a bitmap, mask and command ID onto a position's
|
|
472 |
* button stack. This function behaves similarly to SetCommandL() but allows the
|
|
473 |
* previous command button to be retrieved by calling RemoveCommandFromStack().
|
|
474 |
*
|
|
475 |
* @param aPosition The position in the button group at which to add the command button.
|
|
476 |
* @param aCommandId Command ID the button will send.
|
|
477 |
* @param aBitmap Bitmap for the button.
|
|
478 |
* @param aMask Mask bitmap for aBitmap.
|
|
479 |
*/
|
|
480 |
inline void AddCommandToStackL(
|
|
481 |
TInt aPosition,
|
|
482 |
TInt aCommandId,
|
|
483 |
const CFbsBitmap& aBitmap,
|
|
484 |
const CFbsBitmap& aMask);
|
|
485 |
|
|
486 |
/**
|
|
487 |
* Pushes a command button with text, bitmap, mask and a command ID onto a position's
|
|
488 |
* button stack. This function behaves similarly to SetCommandL() but allows the
|
|
489 |
* previous command button to be retrieved by calling RemoveCommandFromStack().
|
|
490 |
*
|
|
491 |
* @param aPosition The position in the button group at which to add the command button.
|
|
492 |
* @param aCommandId Command ID the button will send.
|
|
493 |
* @param aText Text for the button.
|
|
494 |
* @param aBitmap Bitmap for the button.
|
|
495 |
* @param aMask Mask bitmap for aBitmap.
|
|
496 |
*/
|
|
497 |
inline void AddCommandToStackL(
|
|
498 |
TInt aPosition,
|
|
499 |
TInt aCommandId,
|
|
500 |
const TDesC& aText,
|
|
501 |
const CFbsBitmap& aBitmap,
|
|
502 |
const CFbsBitmap& aMask);
|
|
503 |
|
|
504 |
/**
|
|
505 |
* Pushes a command button with a bitmap, mask and command ID onto a position's button
|
|
506 |
* stack. The bitmap and mask are read from a file. This function behaves similarly to
|
|
507 |
* SetCommandL() but allows the previous command button to be retrieved by calling
|
|
508 |
* RemoveCommandFromStack().
|
|
509 |
*
|
|
510 |
* @param aPosition The position in the button group at which to add the command button.
|
|
511 |
* @param aCommandId Command ID the button will send.
|
|
512 |
* @param aFile A multi-bitmap file containing mask and bitmap.
|
|
513 |
* @param aBitmapId Index into the file of the bitmap.
|
|
514 |
* @param aMaskId Index into the file of the bitmap mask.
|
|
515 |
*/
|
|
516 |
inline void AddCommandToStackL(
|
|
517 |
TInt aPosition,
|
|
518 |
TInt aCommandId,
|
|
519 |
const TDesC& aFile,
|
|
520 |
TInt aBitmapId,
|
|
521 |
TInt aMaskId);
|
|
522 |
|
|
523 |
/**
|
|
524 |
* Pushes a command button with text, bitmap, mask and command button onto a position's
|
|
525 |
* button stack. The bitmap and mask are read from a file. This function behaves similarly
|
|
526 |
* to SetCommandL() but allows the previous command button to be retrieved by calling
|
|
527 |
* RemoveCommandFromStack().
|
|
528 |
*
|
|
529 |
* @param aPosition The position in the button group at which to push the command button.
|
|
530 |
* @param aCommandId Command ID the button will send.
|
|
531 |
* @param aText Text for the button.
|
|
532 |
* @param aFile A multi-bitmap file containing mask and bitmap.
|
|
533 |
* @param aBitmapId Index into the file of the bitmap.
|
|
534 |
* @param aMaskId Index into the file of the bitmap mask.
|
|
535 |
*/
|
|
536 |
inline void AddCommandToStackL(
|
|
537 |
TInt aPosition,
|
|
538 |
TInt aCommandId,
|
|
539 |
const TDesC& aText,
|
|
540 |
const TDesC& aFile,
|
|
541 |
TInt aBitmapId,
|
|
542 |
TInt aMaskId);
|
|
543 |
|
|
544 |
/**
|
|
545 |
* Pushes a command button onto a position's button stack. The text, bitmap, mask and
|
|
546 |
* command ID are all read from resource. This function behaves similarly to
|
|
547 |
* SetCommandL() but allows the previous command button to be retrieved by calling
|
|
548 |
* RemoveCommandFromStack().
|
|
549 |
*
|
|
550 |
* @param aPosition The position in the button group at which to push the command button.
|
|
551 |
* @param aResourceId ID of a resource specifying the text, bitmaps and command ID.
|
|
552 |
*/
|
|
553 |
inline void AddCommandToStackL(
|
|
554 |
TInt aPosition,
|
|
555 |
TInt aResourceId);
|
|
556 |
|
|
557 |
/**
|
|
558 |
* As with SetCommandL() but for a set of buttons, also allows the previous command
|
|
559 |
* button to be retrieved by calling RemoveCommand().
|
|
560 |
*
|
|
561 |
* @param aResourceId Resource describing the set of command buttons.
|
|
562 |
*/
|
|
563 |
IMPORT_C void AddCommandSetToStackL(
|
|
564 |
TInt aResourceId);
|
|
565 |
|
|
566 |
/**
|
|
567 |
* Removes the command identified by aCommandId, in position aPosition in the group,
|
|
568 |
* from the command stack. Automatically retrieves the previous command details.
|
|
569 |
* Commands are added to the stack by calling AddCommandToStackL.
|
|
570 |
*
|
|
571 |
* @param aPosition The position in the button group from which to remove the
|
|
572 |
* command button.
|
|
573 |
* @param aCommandId Command ID.
|
|
574 |
*/
|
|
575 |
IMPORT_C void RemoveCommandFromStack(TInt aPosition, TInt aCommandId);
|
|
576 |
|
|
577 |
/**
|
|
578 |
* Sets the default command ID for buttons in this container.
|
|
579 |
*
|
|
580 |
* @param aCommandId Command to issue if no other is specified.
|
|
581 |
*/
|
|
582 |
IMPORT_C void SetDefaultCommand(TInt aCommandId);
|
|
583 |
|
|
584 |
/**
|
|
585 |
* Calculates minimum size required to display the buttons defined in the specified
|
|
586 |
* resource structure.
|
|
587 |
*
|
|
588 |
* @param aResourceId The ID of the resource structure describing the button group.
|
|
589 |
* @return Minimum size required to display the button group defined in the specified resource structure.
|
|
590 |
*/
|
|
591 |
IMPORT_C TSize CalcMinimumSizeL(TInt aResourceId) const;
|
|
592 |
|
|
593 |
/**
|
|
594 |
* Places the command in position aPosition in the group on the cleanup stack. Typically
|
|
595 |
* used when a control or view changes the contents of two or more buttons on receipt of
|
|
596 |
* focus. After altering one command with a call to AddCommandToStackL() the push is made
|
|
597 |
* to guarantee the display will be left in a consistent state if the second (and any
|
|
598 |
* subsequent) calls to AddCommandToStackL() fail. Only a single command can be pushed
|
|
599 |
* for each position.
|
|
600 |
*
|
|
601 |
* @param aPosition Position in the container of the button to push.
|
|
602 |
*/
|
|
603 |
IMPORT_C void CleanupCommandPushL(TInt aPosition);
|
|
604 |
|
|
605 |
/**
|
|
606 |
* Removes a command from the cleanup stack without destroying it.
|
|
607 |
*/
|
|
608 |
inline void CleanupCommandPop();
|
|
609 |
|
|
610 |
/**
|
|
611 |
* Removes one or more commands from the cleanup stack without destroying them.
|
|
612 |
*
|
|
613 |
* @param aCount Number of commands to pop.
|
|
614 |
*/
|
|
615 |
IMPORT_C void CleanupCommandPop(TInt aCount);
|
|
616 |
|
|
617 |
/**
|
|
618 |
* Removes a single command which was pushed onto the cleanup stack. It does this by
|
|
619 |
* calling CleanupCommandPushL(), rolling back to the previous details. The command
|
|
620 |
* button popped is destroyed.
|
|
621 |
*/
|
|
622 |
inline void CleanupCommandPopAndDestroy();
|
|
623 |
|
|
624 |
/**
|
|
625 |
* Removes one or more commands which were pushed onto the cleanup stack. It does this
|
|
626 |
* by calling CleanupCommandPushL(), rolling back to the previous details. The command
|
|
627 |
* buttons popped are destroyed.
|
|
628 |
*
|
|
629 |
* @param aCount Number of commands to pop and destroy.
|
|
630 |
*/
|
|
631 |
inline void CleanupCommandPopAndDestroy(TInt aCount);
|
|
632 |
|
|
633 |
/**
|
|
634 |
* Gets the maximum number of buttons that can be supported by the device.
|
|
635 |
*
|
|
636 |
* @return The number of command buttons supported.
|
|
637 |
*/
|
|
638 |
IMPORT_C TInt MaxCommands() const;
|
|
639 |
|
|
640 |
/**
|
|
641 |
* Gets the total number of buttons currently present in the group.
|
|
642 |
*
|
|
643 |
* @return The number of buttons.
|
|
644 |
*/
|
|
645 |
IMPORT_C TInt ButtonCount() const;
|
|
646 |
|
|
647 |
/**
|
|
648 |
* Dims (but doesn't draw) the button with id aCommandId if aDimmed is ETrue. If two
|
|
649 |
* buttons have the same id, the button to be dimmed is undefined.
|
|
650 |
*
|
|
651 |
* @param aCommandId The id for command to be dimmed.
|
|
652 |
* @param aDimmed ETrue for dimming.
|
|
653 |
*/
|
|
654 |
IMPORT_C void DimCommand(TInt aCommandId, TBool aDimmed);
|
|
655 |
|
|
656 |
/**
|
|
657 |
* Returns ETrue if the button with id aCommandId is dimmed. If two buttons have
|
|
658 |
* the same id, the results of this check are undefined.
|
|
659 |
*
|
|
660 |
* @param aCommandId The id for command to be checked.
|
|
661 |
* @return The state of the button.
|
|
662 |
*/
|
|
663 |
IMPORT_C TBool IsCommandDimmed(TInt aCommandId) const;
|
|
664 |
|
|
665 |
/**
|
|
666 |
* Sets the the button with id aCommandId to be visible if aVisible is ETrue. If two
|
|
667 |
* buttons have the same id, the button to be altered is undefined.
|
|
668 |
*
|
|
669 |
* @param aCommandId The id for command to be made visible.
|
|
670 |
* @param aVisible EFalse for making button invisible.
|
|
671 |
*/
|
|
672 |
IMPORT_C void MakeCommandVisible(TInt aCommandId, TBool aVisible);
|
|
673 |
|
|
674 |
/**
|
|
675 |
* Returns ETrue if the button with id aCommandId is visible. If two buttons have
|
|
676 |
* the same id, the results are undefined.
|
|
677 |
*
|
|
678 |
* @param aCommandId The id for command to be checked.
|
|
679 |
* @return The state of the button.
|
|
680 |
*/
|
|
681 |
IMPORT_C TBool IsCommandVisible(TInt aCommandId) const;
|
|
682 |
|
|
683 |
/**
|
|
684 |
* Animates the button with id aCommandId. If two buttons have the same id, the
|
|
685 |
* button to be animated is undefined.
|
|
686 |
*
|
|
687 |
* @since S60 3.1
|
|
688 |
* @param aCommandId The id for command to be animated.
|
|
689 |
*/
|
|
690 |
IMPORT_C void AnimateCommand(TInt aCommandId);
|
|
691 |
|
|
692 |
/**
|
|
693 |
* Dims (but doesn't draw) the button with position aPosition.
|
|
694 |
*
|
|
695 |
* @since S60 3.1
|
|
696 |
* @param aPosition The position for command to be dimmed.
|
|
697 |
* @param aDimmed ETrue for dimming.
|
|
698 |
*/
|
|
699 |
IMPORT_C void DimCommandByPosition(TCommandPosition aPosition, TBool aDimmed);
|
|
700 |
|
|
701 |
/**
|
|
702 |
* Returns ETrue if the button with position aPosition is dimmed.
|
|
703 |
*
|
|
704 |
* @since S60 3.1
|
|
705 |
* @param aPosition The position for command to be checked.
|
|
706 |
* @return The state of the button.
|
|
707 |
*/
|
|
708 |
IMPORT_C TBool IsCommandDimmedByPosition(TCommandPosition aPosition) const;
|
|
709 |
|
|
710 |
/**
|
|
711 |
* Sets the the button with position aPosition to be visible if aVisible is ETrue.
|
|
712 |
*
|
|
713 |
* @since S60 3.1
|
|
714 |
* @param aPosition The position for command to be made visible.
|
|
715 |
* @param aVisible EFalse for making button invisible.
|
|
716 |
*/
|
|
717 |
IMPORT_C void MakeCommandVisibleByPosition(TCommandPosition aPosition, TBool aVisible);
|
|
718 |
|
|
719 |
/**
|
|
720 |
* Returns ETrue if the button with position aPosition is visible.
|
|
721 |
*
|
|
722 |
* @since S60 3.1
|
|
723 |
* @param aPosition The position for command to be checked.
|
|
724 |
* @return The state of the button.
|
|
725 |
*/
|
|
726 |
IMPORT_C TBool IsCommandVisibleByPosition(TCommandPosition aPosition) const;
|
|
727 |
|
|
728 |
/**
|
|
729 |
* Animates the button with position aPosition.
|
|
730 |
*
|
|
731 |
* @since S60 3.1
|
|
732 |
* @param aPosition The position for command to be animated.
|
|
733 |
*/
|
|
734 |
IMPORT_C void AnimateCommandByPosition(TCommandPosition aPosition);
|
|
735 |
|
|
736 |
/**
|
|
737 |
* Gets the button group's location. Typically the button group is external to the
|
|
738 |
* view which is using it. In some cases, such as in dialogs with button panels,
|
|
739 |
* the button group is internal to the control which is using it.
|
|
740 |
*
|
|
741 |
* @return The button group's location.
|
|
742 |
*/
|
|
743 |
IMPORT_C TLocation Location() const;
|
|
744 |
|
|
745 |
/**
|
|
746 |
* Gets a pointer to the command button with the specified command Id.
|
|
747 |
*
|
|
748 |
* @param aCommandId Command ID of the button.
|
|
749 |
* @return Pointer to the command button CEikCommandButton, NULL if there
|
|
750 |
* was no button with Id aCommandId.
|
|
751 |
*/
|
|
752 |
IMPORT_C CEikCommandButton* CommandButtonOrNull(TInt aCommandId) const;
|
|
753 |
|
|
754 |
/**
|
|
755 |
* Sets the boundary rectangle for externally-positioned button groups.
|
|
756 |
* For use by EExternal button groups only.
|
|
757 |
*
|
|
758 |
* @param aRect The boundary rectangle to use. The button group attaches
|
|
759 |
* itself to the inside of this rectangle.
|
|
760 |
*/
|
|
761 |
IMPORT_C void SetBoundingRect(const TRect& aRect);
|
|
762 |
|
|
763 |
/**
|
|
764 |
* Subtracts the area occupied by the button group from the specified bounding
|
|
765 |
* rectangle. This method should be used in preference to querying the container's
|
|
766 |
* area at all times. For use by EExternal button groups only.
|
|
767 |
*
|
|
768 |
* @param aBoundingRect Rectangle to be modified.
|
|
769 |
*/
|
|
770 |
IMPORT_C void ReduceRect(TRect& aBoundingRect) const;
|
|
771 |
|
|
772 |
/**
|
|
773 |
* Gets a pointer to the control (button) with the specified command ID.
|
|
774 |
* This method is intended to allow access to standard CCoeControl functionality
|
|
775 |
* only. Casting the return value is likely to fail on different devices.
|
|
776 |
*
|
|
777 |
* @param aCommandId Command ID of the button to get.
|
|
778 |
* @return Pointer to a CCoeControl, NULL if there was no button at aCommandId.
|
|
779 |
*/
|
|
780 |
IMPORT_C CCoeControl* ControlOrNull(TInt aCommandId) const;
|
|
781 |
|
|
782 |
/**
|
|
783 |
* Gets a pointer to the the button with the specified command Id.
|
|
784 |
*
|
|
785 |
* @param aCommandId Command ID of the button to obtain.
|
|
786 |
* @return The button object.
|
|
787 |
*/
|
|
788 |
IMPORT_C CEikCommandButton* ButtonById(TInt aCommandId) const;
|
|
789 |
|
|
790 |
/**
|
|
791 |
* Gets the position in the group of the button with the specified command Id.
|
|
792 |
* The return value is undefined if two buttons share the same id.
|
|
793 |
*
|
|
794 |
* @param aCommandId Identifies the command.
|
|
795 |
* @return The command's container position.
|
|
796 |
*/
|
|
797 |
IMPORT_C TInt PositionById(TInt aCommandId) const;
|
|
798 |
|
|
799 |
/**
|
|
800 |
* Updates a command's hotkey and whether the key is displayed.
|
|
801 |
* This function is only supported by containers being used for dialog buttons.
|
|
802 |
*
|
|
803 |
* @param aCommandId Identifies the command to update.
|
|
804 |
* @param aFlags Whether to display the hotkey.
|
|
805 |
* @param aKeyId Hotkey identifier.
|
|
806 |
*/
|
|
807 |
IMPORT_C void UpdateHotKey(TInt aCommandId, THotKeyFlags aFlags, TInt aKeyId);
|
|
808 |
|
|
809 |
/**
|
|
810 |
* Changes the command observer for the button at aPos to aCommandObserver.
|
|
811 |
* Panics if an updated observer is already present. This function should be followed
|
|
812 |
* by RemoveCommandObserver() when you need to put back the original observer.
|
|
813 |
*
|
|
814 |
* @param aPos The button's position.
|
|
815 |
* @param aCommandObserver The command observer.
|
|
816 |
*/
|
|
817 |
IMPORT_C void UpdateCommandObserverL(TInt aPos, MEikCommandObserver& aCommandObserver);
|
|
818 |
|
|
819 |
/**
|
|
820 |
* Removes the temporary observer for the button at aPos, replacing it with the
|
|
821 |
* observer that was present when UpdateCommandObserverL() was called.
|
|
822 |
*
|
|
823 |
* @param aPos The button's position.
|
|
824 |
*/
|
|
825 |
IMPORT_C void RemoveCommandObserver(TInt aPos);
|
|
826 |
|
|
827 |
/**
|
|
828 |
* Checks for existence of updated command observer for the button at aPosition.
|
|
829 |
*
|
|
830 |
* @since S60 3.2
|
|
831 |
* @param aPosition The position for button to be checked.
|
|
832 |
* @return ETrue, if updated command observer exists.
|
|
833 |
*/
|
|
834 |
IMPORT_C TBool UpdatedCommandObserverExists(TCommandPosition aPosition) const;
|
|
835 |
|
|
836 |
/**
|
|
837 |
* Tests whether the button group has explicitly been instructed to suppress redraws.
|
|
838 |
* Some button groups may not activate themselves during construction, in which
|
|
839 |
* case, they need to be activated by the client. This method allows the client
|
|
840 |
* to enquire whether this is necessary.
|
|
841 |
*
|
|
842 |
* @return ETrue if the button group will suppress redraws, otherwise EFalse.
|
|
843 |
*/
|
|
844 |
IMPORT_C TBool DelayActivation() const;
|
|
845 |
|
|
846 |
/**
|
|
847 |
* Returns the container's button group.
|
|
848 |
*
|
|
849 |
* @return Pointer to the button group object. Ownership is not transferred.
|
|
850 |
*/
|
|
851 |
inline MEikButtonGroup* ButtonGroup();
|
|
852 |
|
|
853 |
/**
|
|
854 |
* Returns the button group type.
|
|
855 |
*
|
|
856 |
* @return The button group type.
|
|
857 |
*/
|
|
858 |
inline TUse ButtonGroupType();
|
|
859 |
|
|
860 |
/**
|
|
861 |
* Internal method for setting markable list's MSK observer.
|
|
862 |
* This observer is called before default CBA observer if MSK is pressed.
|
|
863 |
* Observer is removed by passing NULL as parameter.
|
|
864 |
*
|
|
865 |
* @since S60 3.1
|
|
866 |
* @param aMSKObserverOwner
|
|
867 |
* @param aCommandObserver
|
|
868 |
*/
|
|
869 |
void UpdateMSKCommandObserver(
|
|
870 |
CEikListBox* aMSKObserverOwner,
|
|
871 |
MEikCommandObserver* aCommandObserver);
|
|
872 |
|
|
873 |
public: // From CCoeControl.
|
|
874 |
/**
|
|
875 |
* From CCoeControl.
|
|
876 |
* Gets the control's minimum required size.
|
|
877 |
*
|
|
878 |
* @return The minimum size required by the control.
|
|
879 |
*/
|
|
880 |
IMPORT_C TSize MinimumSize();
|
|
881 |
|
|
882 |
/**
|
|
883 |
* From CCoeControl.
|
|
884 |
* Handles key events.
|
|
885 |
*
|
|
886 |
* @param aKeyEvent The key event.
|
|
887 |
* @param aType The type of key event: EEventKey, EEventKeyUp or EEventKeyDown.
|
|
888 |
* @return Indicates whether or not the key event was used by this control.
|
|
889 |
*/
|
|
890 |
IMPORT_C TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent, TEventCode aType);
|
|
891 |
|
|
892 |
/**
|
|
893 |
* From CCoeControl.
|
|
894 |
* Sets this control as visible or invisible.
|
|
895 |
*
|
|
896 |
* @param aVisible ETrue to make the control visible, EFalse to make it invisible.
|
|
897 |
*/
|
|
898 |
void MakeVisible(TBool aVisible);
|
|
899 |
|
|
900 |
/**
|
|
901 |
* From CCoeControl.
|
|
902 |
* Writes the internal state of the control and its components to aStream.
|
|
903 |
* Does nothing in release mode.
|
|
904 |
*
|
|
905 |
* @param aWriteStream The output stream.
|
|
906 |
*/
|
|
907 |
IMPORT_C void WriteInternalStateL(RWriteStream& aWriteStream) const;
|
|
908 |
|
|
909 |
public:
|
|
910 |
/**
|
|
911 |
* Formerly from MTopSetMember<CEikButtonGroupContainer>, now reserved.
|
|
912 |
*/
|
|
913 |
IMPORT_C virtual void Reserved_MtsmPosition();
|
|
914 |
|
|
915 |
/**
|
|
916 |
* Formerly from MTopSetMember<CEikButtonGroupContainer>, now reserved.
|
|
917 |
*/
|
|
918 |
IMPORT_C virtual void Reserved_MtsmObject();
|
|
919 |
|
|
920 |
public: // New functions for enhanced cba support.
|
|
921 |
/**
|
|
922 |
* Used to offer list of commands for softkeys.
|
|
923 |
*
|
|
924 |
* @since S60 3.2
|
|
925 |
* @param aCommandList A list of command ids to be offered for softkeys.
|
|
926 |
*/
|
|
927 |
IMPORT_C void OfferCommandListL(const RArray<TInt>& aCommandList);
|
|
928 |
|
|
929 |
/**
|
|
930 |
* Used to offer list of commands for softkeys.
|
|
931 |
*
|
|
932 |
* @since S60 3.2
|
|
933 |
* @param aResourceId Id for CBA resource that defines enhanced cba buttons.
|
|
934 |
*/
|
|
935 |
IMPORT_C void OfferCommandListL(const TInt aResourceId);
|
|
936 |
|
|
937 |
/**
|
|
938 |
* Used to check if a certain command have been approved to the current command set
|
|
939 |
*
|
|
940 |
* @since S60 3.2
|
|
941 |
* @param aCommandId The id for command which existence should be checked.
|
|
942 |
* @return ETrue if command is in control group, otherwise EFalse.
|
|
943 |
*/
|
|
944 |
IMPORT_C TBool IsCommandInGroup(const TInt aCommandId) const;
|
|
945 |
|
|
946 |
/**
|
|
947 |
* Replaces command with another.
|
|
948 |
*
|
|
949 |
* @since S60 3.2
|
|
950 |
* @param aCommandId Id for command that should be replaced.
|
|
951 |
* @param aResourceId Resource id for new enhanced cba button.
|
|
952 |
*/
|
|
953 |
IMPORT_C void ReplaceCommand(const TInt aCommandId, const TInt aResourceId);
|
|
954 |
|
|
955 |
private:
|
|
956 |
enum TCommandOp {ESet, EAdd, EPush};
|
|
957 |
|
|
958 |
private:
|
|
959 |
class TCmdPos
|
|
960 |
{
|
|
961 |
public:
|
|
962 |
inline TCmdPos();
|
|
963 |
inline TCmdPos(TInt aPos, TInt aCmd);
|
|
964 |
public:
|
|
965 |
TInt iPos;
|
|
966 |
TInt iCmd;
|
|
967 |
};
|
|
968 |
|
|
969 |
class TCmdObserver
|
|
970 |
{
|
|
971 |
public:
|
|
972 |
inline TCmdObserver(TInt aPos, MEikCommandObserver& aObserver);
|
|
973 |
public:
|
|
974 |
TInt iPos;
|
|
975 |
MEikCommandObserver& iObserver;
|
|
976 |
};
|
|
977 |
|
|
978 |
class CCmdObserverArray : public CArrayFixFlat<TCmdObserver>
|
|
979 |
{
|
|
980 |
public:
|
|
981 |
inline CCmdObserverArray();
|
|
982 |
TInt FindIndex(TInt aPos);
|
|
983 |
};
|
|
984 |
|
|
985 |
private:
|
|
986 |
CEikButtonGroupContainer(TUse aUse);
|
|
987 |
|
|
988 |
void ConstructL(
|
|
989 |
TOrientation aOrientation,
|
|
990 |
MEikCommandObserver* aCommandObserver,
|
|
991 |
TInt aResourceId,
|
|
992 |
RWindowGroup* aParentWg,
|
|
993 |
TUint aFlags);
|
|
994 |
|
|
995 |
IMPORT_C void DoSetCommandL(
|
|
996 |
TInt aPosition,
|
|
997 |
TInt aCommandId,
|
|
998 |
const TDesC* aText,
|
|
999 |
const CFbsBitmap* aBitmap,
|
|
1000 |
const CFbsBitmap* aMask,
|
|
1001 |
TCommandOp aOp);
|
|
1002 |
|
|
1003 |
IMPORT_C void DoSetCommandL(
|
|
1004 |
TInt aPosition,
|
|
1005 |
TInt aCommandId,
|
|
1006 |
const TDesC* aText,
|
|
1007 |
const TDesC& aFile,
|
|
1008 |
TInt aBitmapId,
|
|
1009 |
TInt aMaskId,
|
|
1010 |
TCommandOp aOp);
|
|
1011 |
|
|
1012 |
IMPORT_C void DoSetCommandL(
|
|
1013 |
TInt aCommandId,
|
|
1014 |
const TDesC* aText,
|
|
1015 |
const CFbsBitmap* aBitmap,
|
|
1016 |
const CFbsBitmap* aMask,
|
|
1017 |
TCommandOp aOp);
|
|
1018 |
|
|
1019 |
IMPORT_C void DoSetCommandL(
|
|
1020 |
TInt aCommandId,
|
|
1021 |
const TDesC* aText,
|
|
1022 |
const TDesC& aFile,
|
|
1023 |
TInt aBitmapId,
|
|
1024 |
TInt aMaskId,
|
|
1025 |
TCommandOp aOp);
|
|
1026 |
|
|
1027 |
IMPORT_C void DoSetCommandL(
|
|
1028 |
TInt aPosition,
|
|
1029 |
TInt aResourceId,
|
|
1030 |
TCommandOp aOp);
|
|
1031 |
|
|
1032 |
inline CCoeControl* ButtonGroupAsControl() const;
|
|
1033 |
void UpdateRect();
|
|
1034 |
static void CleanupCommandDestroy(TAny* aPtr);
|
|
1035 |
TCmdPos DoCleanupCommandPop();
|
|
1036 |
void DoCleanupCommandPopAndDestroy();
|
|
1037 |
|
|
1038 |
private: // from CCoeControl
|
|
1039 |
TInt CountComponentControls() const;
|
|
1040 |
CCoeControl* ComponentControl(TInt aIndex) const;
|
|
1041 |
void SizeChanged();
|
|
1042 |
|
|
1043 |
private: // from MEikCommandObserver
|
|
1044 |
void ProcessCommandL(TInt aCommandId);
|
|
1045 |
CCoeControl* CreateCustomCommandControlL(TInt aControlType);
|
|
1046 |
|
|
1047 |
private:
|
|
1048 |
MEikButtonGroup* iButtonGroup;
|
|
1049 |
TUse iUse;
|
|
1050 |
CArrayFix<TCmdPos>* iCommandsCleanup;
|
|
1051 |
MEikCommandObserver* iCommandObserver;
|
|
1052 |
CCmdObserverArray* iObserverArray;
|
|
1053 |
TDblQueLink iBtLink;
|
|
1054 |
CEikListBox* iMSKObserverOwner;
|
|
1055 |
TInt iSpare;
|
|
1056 |
TInt iValid;
|
|
1057 |
private:
|
|
1058 |
friend class CCmdObserverArray;
|
|
1059 |
friend class CEikButtonGroupStack;
|
|
1060 |
};
|
|
1061 |
|
|
1062 |
|
|
1063 |
// Inline function implementations.
|
|
1064 |
|
|
1065 |
inline void CEikButtonGroupContainer::SetCommandL(
|
|
1066 |
TInt aPosition,
|
|
1067 |
TInt aCommandId,
|
|
1068 |
const TDesC& aText)
|
|
1069 |
{
|
|
1070 |
DoSetCommandL(aPosition, aCommandId, &aText, NULL, NULL, ESet);
|
|
1071 |
}
|
|
1072 |
|
|
1073 |
inline void CEikButtonGroupContainer::SetCommandL(
|
|
1074 |
TInt aPosition,
|
|
1075 |
TInt aCommandId,
|
|
1076 |
const CFbsBitmap& aBitmap,
|
|
1077 |
const CFbsBitmap& aMask)
|
|
1078 |
{
|
|
1079 |
DoSetCommandL(aPosition, aCommandId, NULL, &aBitmap, &aMask, ESet);
|
|
1080 |
}
|
|
1081 |
|
|
1082 |
inline void CEikButtonGroupContainer::SetCommandL(
|
|
1083 |
TInt aPosition,
|
|
1084 |
TInt aCommandId,
|
|
1085 |
const TDesC& aText,
|
|
1086 |
const CFbsBitmap& aBitmap,
|
|
1087 |
const CFbsBitmap& aMask)
|
|
1088 |
{
|
|
1089 |
DoSetCommandL(aPosition, aCommandId, &aText, &aBitmap, &aMask, ESet);
|
|
1090 |
}
|
|
1091 |
|
|
1092 |
inline void CEikButtonGroupContainer::SetCommandL(
|
|
1093 |
TInt aPosition,
|
|
1094 |
TInt aCommandId,
|
|
1095 |
const TDesC& aFile,
|
|
1096 |
TInt aBitmapId,
|
|
1097 |
TInt aMaskId)
|
|
1098 |
{
|
|
1099 |
DoSetCommandL(aPosition, aCommandId, NULL, aFile, aBitmapId, aMaskId, ESet);
|
|
1100 |
}
|
|
1101 |
|
|
1102 |
inline void CEikButtonGroupContainer::SetCommandL(
|
|
1103 |
TInt aPosition,
|
|
1104 |
TInt aCommandId,
|
|
1105 |
const TDesC& aText,
|
|
1106 |
const TDesC& aFile,
|
|
1107 |
TInt aBitmapId,
|
|
1108 |
TInt aMaskId)
|
|
1109 |
{
|
|
1110 |
DoSetCommandL(aPosition, aCommandId, &aText, aFile, aBitmapId, aMaskId, ESet);
|
|
1111 |
}
|
|
1112 |
|
|
1113 |
inline void CEikButtonGroupContainer::SetCommandL(
|
|
1114 |
TInt aPosition,
|
|
1115 |
TInt aResourceId)
|
|
1116 |
{
|
|
1117 |
DoSetCommandL(aPosition, aResourceId, ESet);
|
|
1118 |
}
|
|
1119 |
|
|
1120 |
inline void CEikButtonGroupContainer::SetCommandL(
|
|
1121 |
TInt aCommandId,
|
|
1122 |
const TDesC& aText)
|
|
1123 |
{
|
|
1124 |
DoSetCommandL(aCommandId, &aText, NULL, NULL, ESet);
|
|
1125 |
}
|
|
1126 |
|
|
1127 |
inline void CEikButtonGroupContainer::SetCommandL(
|
|
1128 |
TInt aCommandId,
|
|
1129 |
const CFbsBitmap& aBitmap,
|
|
1130 |
const CFbsBitmap& aMask)
|
|
1131 |
{
|
|
1132 |
DoSetCommandL(aCommandId, NULL, &aBitmap, &aMask, ESet);
|
|
1133 |
}
|
|
1134 |
|
|
1135 |
inline void CEikButtonGroupContainer::SetCommandL(
|
|
1136 |
TInt aCommandId,
|
|
1137 |
const TDesC& aText,
|
|
1138 |
const CFbsBitmap& aBitmap,
|
|
1139 |
const CFbsBitmap& aMask)
|
|
1140 |
{
|
|
1141 |
DoSetCommandL(aCommandId, &aText, &aBitmap, &aMask, ESet);
|
|
1142 |
}
|
|
1143 |
|
|
1144 |
inline void CEikButtonGroupContainer::SetCommandL(
|
|
1145 |
TInt aCommandId,
|
|
1146 |
const TDesC& aFile,
|
|
1147 |
TInt aBitmapId,
|
|
1148 |
TInt aMaskId)
|
|
1149 |
{
|
|
1150 |
DoSetCommandL(aCommandId, NULL, aFile, aBitmapId, aMaskId, ESet);
|
|
1151 |
}
|
|
1152 |
|
|
1153 |
inline void CEikButtonGroupContainer::SetCommandL(
|
|
1154 |
TInt aCommandId,
|
|
1155 |
const TDesC& aText,
|
|
1156 |
const TDesC& aFile,
|
|
1157 |
TInt aBitmapId,
|
|
1158 |
TInt aMaskId)
|
|
1159 |
{
|
|
1160 |
DoSetCommandL(aCommandId, &aText, aFile, aBitmapId, aMaskId, ESet);
|
|
1161 |
}
|
|
1162 |
|
|
1163 |
inline void CEikButtonGroupContainer::AddCommandL(
|
|
1164 |
TInt aPosition,
|
|
1165 |
TInt aCommandId,
|
|
1166 |
const TDesC& aText)
|
|
1167 |
{
|
|
1168 |
DoSetCommandL(aPosition, aCommandId, &aText, NULL, NULL, EAdd);
|
|
1169 |
}
|
|
1170 |
|
|
1171 |
inline void CEikButtonGroupContainer::AddCommandL(
|
|
1172 |
TInt aPosition,
|
|
1173 |
TInt aCommandId,
|
|
1174 |
const CFbsBitmap& aBitmap,
|
|
1175 |
const CFbsBitmap& aMask)
|
|
1176 |
{
|
|
1177 |
DoSetCommandL(aPosition, aCommandId, NULL, &aBitmap, &aMask, EAdd);
|
|
1178 |
}
|
|
1179 |
|
|
1180 |
inline void CEikButtonGroupContainer::AddCommandL(
|
|
1181 |
TInt aPosition,
|
|
1182 |
TInt aCommandId,
|
|
1183 |
const TDesC& aText,
|
|
1184 |
const CFbsBitmap& aBitmap,
|
|
1185 |
const CFbsBitmap& aMask)
|
|
1186 |
{
|
|
1187 |
DoSetCommandL(aPosition, aCommandId, &aText, &aBitmap, &aMask, EAdd);
|
|
1188 |
}
|
|
1189 |
|
|
1190 |
inline void CEikButtonGroupContainer::AddCommandL(
|
|
1191 |
TInt aPosition,
|
|
1192 |
TInt aCommandId,
|
|
1193 |
const TDesC& aFile,
|
|
1194 |
TInt aBitmapId,
|
|
1195 |
TInt aMaskId)
|
|
1196 |
{
|
|
1197 |
DoSetCommandL(aPosition, aCommandId, NULL, aFile, aBitmapId, aMaskId, EAdd);
|
|
1198 |
}
|
|
1199 |
|
|
1200 |
inline void CEikButtonGroupContainer::AddCommandL(
|
|
1201 |
TInt aPosition,
|
|
1202 |
TInt aCommandId,
|
|
1203 |
const TDesC& aText,
|
|
1204 |
const TDesC& aFile,
|
|
1205 |
TInt aBitmapId,
|
|
1206 |
TInt aMaskId)
|
|
1207 |
{
|
|
1208 |
DoSetCommandL(aPosition, aCommandId, &aText, aFile, aBitmapId, aMaskId, EAdd);
|
|
1209 |
}
|
|
1210 |
|
|
1211 |
inline void CEikButtonGroupContainer::AddCommandToStackL(
|
|
1212 |
TInt aPosition,
|
|
1213 |
TInt aCommandId,
|
|
1214 |
const TDesC& aText)
|
|
1215 |
{
|
|
1216 |
DoSetCommandL(aPosition, aCommandId, &aText, NULL, NULL, EPush);
|
|
1217 |
}
|
|
1218 |
|
|
1219 |
inline void CEikButtonGroupContainer::AddCommandToStackL(
|
|
1220 |
TInt aPosition,
|
|
1221 |
TInt aCommandId,
|
|
1222 |
const CFbsBitmap& aBitmap,
|
|
1223 |
const CFbsBitmap& aMask)
|
|
1224 |
{
|
|
1225 |
DoSetCommandL(aPosition, aCommandId, NULL, &aBitmap, &aMask, EPush);
|
|
1226 |
}
|
|
1227 |
|
|
1228 |
inline void CEikButtonGroupContainer::AddCommandToStackL(
|
|
1229 |
TInt aPosition,
|
|
1230 |
TInt aCommandId,
|
|
1231 |
const TDesC& aText,
|
|
1232 |
const CFbsBitmap& aBitmap,
|
|
1233 |
const CFbsBitmap& aMask)
|
|
1234 |
{
|
|
1235 |
DoSetCommandL(aPosition, aCommandId, &aText, &aBitmap, &aMask, EPush);
|
|
1236 |
}
|
|
1237 |
|
|
1238 |
inline void CEikButtonGroupContainer::AddCommandToStackL(
|
|
1239 |
TInt aPosition,
|
|
1240 |
TInt aCommandId,
|
|
1241 |
const TDesC& aFile,
|
|
1242 |
TInt aBitmapId,
|
|
1243 |
TInt aMaskId)
|
|
1244 |
{
|
|
1245 |
DoSetCommandL(aPosition, aCommandId, NULL, aFile, aBitmapId, aMaskId, EPush);
|
|
1246 |
}
|
|
1247 |
|
|
1248 |
inline void CEikButtonGroupContainer::AddCommandToStackL(
|
|
1249 |
TInt aPosition,
|
|
1250 |
TInt aCommandId,
|
|
1251 |
const TDesC& aText,
|
|
1252 |
const TDesC& aFile,
|
|
1253 |
TInt aBitmapId,
|
|
1254 |
TInt aMaskId)
|
|
1255 |
{
|
|
1256 |
DoSetCommandL(aPosition, aCommandId, &aText, aFile, aBitmapId, aMaskId, EPush);
|
|
1257 |
}
|
|
1258 |
|
|
1259 |
inline void CEikButtonGroupContainer::AddCommandToStackL(
|
|
1260 |
TInt aPosition,
|
|
1261 |
TInt aResourceId)
|
|
1262 |
{
|
|
1263 |
DoSetCommandL(aPosition, aResourceId, EPush);
|
|
1264 |
}
|
|
1265 |
|
|
1266 |
inline void CEikButtonGroupContainer::CleanupCommandPop()
|
|
1267 |
{
|
|
1268 |
CleanupCommandPop(1);
|
|
1269 |
}
|
|
1270 |
|
|
1271 |
inline void CEikButtonGroupContainer::CleanupCommandPopAndDestroy()
|
|
1272 |
{
|
|
1273 |
CleanupStack::PopAndDestroy();
|
|
1274 |
}
|
|
1275 |
|
|
1276 |
inline void CEikButtonGroupContainer::CleanupCommandPopAndDestroy(TInt aCount)
|
|
1277 |
{
|
|
1278 |
CleanupStack::PopAndDestroy(aCount);
|
|
1279 |
}
|
|
1280 |
|
|
1281 |
inline MEikButtonGroup* CEikButtonGroupContainer::ButtonGroup()
|
|
1282 |
{
|
|
1283 |
return iButtonGroup;
|
|
1284 |
}
|
|
1285 |
|
|
1286 |
inline CEikButtonGroupContainer::TUse CEikButtonGroupContainer::ButtonGroupType()
|
|
1287 |
{
|
|
1288 |
return iUse;
|
|
1289 |
}
|
|
1290 |
|
|
1291 |
#endif // __EIKBTGPC_H__
|