56
|
1 |
/*
|
|
2 |
* Copyright (c) 2002-2010 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 control button array and cba button class definitions.
|
|
15 |
*
|
|
16 |
*/
|
|
17 |
|
|
18 |
|
|
19 |
#ifndef __EIKCBA_H__
|
|
20 |
#define __EIKCBA_H__
|
|
21 |
|
|
22 |
#include <eikctgrp.h>
|
|
23 |
#include <badesca.h>
|
|
24 |
#include <eikbtgrp.h>
|
|
25 |
#include <eiksbobs.h>
|
|
26 |
#include <eiksbfrm.h>
|
|
27 |
|
|
28 |
#include <eikimage.h>
|
|
29 |
#include <AknControl.h>
|
|
30 |
#include <AknsItemData.h> // TAknsItemID
|
|
31 |
#include <babitflags.h> // TBitFlags
|
|
32 |
|
|
33 |
class CEikLabel;
|
|
34 |
class CEikCbaButton;
|
|
35 |
class CCoeBrushAndPenContext;
|
|
36 |
class MEikCommandObserver;
|
|
37 |
class TCoeColorUse;
|
|
38 |
|
|
39 |
class CAknScrollBar;
|
|
40 |
class TEikScrollBarModel;
|
|
41 |
|
|
42 |
class CEikEnhancedCbaButton;
|
|
43 |
class CEikCommandTable;
|
|
44 |
|
|
45 |
class CAknsBasicBackgroundControlContext;
|
|
46 |
class CAknsLayeredBackgroundControlContext;
|
|
47 |
class CAknsMaskedLayerBackgroundControlContext;
|
|
48 |
class CEikCbaExtension;
|
|
49 |
|
|
50 |
const TInt KMaxCbaLabelLength = 32;
|
|
51 |
const TInt KMaxButtonsInCommandTable = 4;
|
|
52 |
|
|
53 |
/**
|
|
54 |
* Defines a Control Button Array control, used in Avkon to define the softkeys in the
|
|
55 |
* control pane.
|
|
56 |
*
|
|
57 |
* @lib eikcoctl.lib
|
|
58 |
* @since S60 0.9
|
|
59 |
*/
|
|
60 |
NONSHARABLE_CLASS(CEikCba) :
|
|
61 |
public CEikControlGroup,
|
|
62 |
public MEikEnhancedButtonGroup,
|
|
63 |
public MEikScrollBarObserver,
|
|
64 |
public MCoeControlObserver
|
|
65 |
{
|
|
66 |
public:
|
|
67 |
/**
|
|
68 |
* Declares an object type for a class, in order to allow the object
|
|
69 |
* provider mechanism to locate and provide objects from the class.
|
|
70 |
*/
|
|
71 |
DECLARE_TYPE_ID(0x101F4105)
|
|
72 |
|
|
73 |
/**
|
|
74 |
* Creates a new control button array.
|
|
75 |
*
|
|
76 |
* @internal
|
|
77 |
* @param aPrevious Previous Cba, used in MinimumSize().
|
|
78 |
* @param aCommandObserver Command observer for softkey events.
|
|
79 |
* @param aParentWg The parent window group.
|
|
80 |
* @return Control button array object.
|
|
81 |
*/
|
|
82 |
static CEikCba* NewL(
|
|
83 |
const CEikCba* aPrevious,
|
|
84 |
MEikCommandObserver* aCommandObserver,
|
|
85 |
RWindowGroup* aParentWg);
|
|
86 |
|
|
87 |
/**
|
|
88 |
* Creates a new control button array.
|
|
89 |
*
|
|
90 |
* @internal
|
|
91 |
* @param aResourceId A resource describing the Cba.
|
|
92 |
* @param aPrevious Previous Cba, used in MinimumSize().
|
|
93 |
* @param aCommandObserver Command observer for softkey events.
|
|
94 |
* @param aParentWg The parent window group.
|
|
95 |
* @return Control button array object.
|
|
96 |
*/
|
|
97 |
static CEikCba* NewL(
|
|
98 |
TInt aResourceId,
|
|
99 |
const CEikCba* aPrevious,
|
|
100 |
MEikCommandObserver* aCommandObserver,
|
|
101 |
RWindowGroup* aParentWg);
|
|
102 |
|
|
103 |
/**
|
|
104 |
* Creates a new control button array.
|
|
105 |
*
|
|
106 |
* @internal
|
|
107 |
* @param aPrevious Previous Cba, used in MinimumSize().
|
|
108 |
* @param aCommandObserver Command observer for softkey events.
|
|
109 |
* @param aParentWg The parent window group.
|
|
110 |
* @return Control button array object.
|
|
111 |
*/
|
|
112 |
static CEikCba* NewLC(
|
|
113 |
const CEikCba* aPrevious,
|
|
114 |
MEikCommandObserver* aCommandObserver,
|
|
115 |
RWindowGroup* aParentWg);
|
|
116 |
|
|
117 |
/**
|
|
118 |
* Creates a new control button array
|
|
119 |
*
|
|
120 |
* @since S60 5.2
|
|
121 |
* @internal
|
|
122 |
* @param aPrevious Previous Cba, used in MinimumSize()
|
|
123 |
* @param aCommandObserver Command observer for softkey events
|
|
124 |
* @param aParentWg The parent window group
|
|
125 |
* @param aFlags CEikButtonGroupContainer::EIsEmbedded if CBA is embedded
|
|
126 |
* inside another control (popup/dialog/setting page)
|
|
127 |
* @return Control button array object
|
|
128 |
*/
|
|
129 |
static CEikCba* NewLC(
|
|
130 |
const CEikCba* aPrevious,
|
|
131 |
MEikCommandObserver* aCommandObserver,
|
|
132 |
RWindowGroup* aParentWg, TUint aFlags );
|
|
133 |
|
|
134 |
/**
|
|
135 |
* Creates a new control button array.
|
|
136 |
*
|
|
137 |
* @internal
|
|
138 |
* @param aResourceId A resource describing the Cba.
|
|
139 |
* @param aPrevious Previous Cba, used in MinimumSize().
|
|
140 |
* @param aCommandObserver Command observer for softkey events.
|
|
141 |
* @param aParentWg The parent window group.
|
|
142 |
* @return Control button array object.
|
|
143 |
*/
|
|
144 |
static CEikCba* NewLC(
|
|
145 |
TInt aResourceId,
|
|
146 |
const CEikCba* aPrevious,
|
|
147 |
MEikCommandObserver* aCommandObserver,
|
|
148 |
RWindowGroup* aParentWg);
|
|
149 |
|
|
150 |
/**
|
|
151 |
* Creates a new control button array
|
|
152 |
*
|
|
153 |
* @since S60 5.2
|
|
154 |
* @internal
|
|
155 |
* @param aResourceId A resource describing the Cba
|
|
156 |
* @param aPrevious Previous Cba, used in MinimumSize()
|
|
157 |
* @param aCommandObserver Command observer for softkey events
|
|
158 |
* @param aParentWg The parent window group
|
|
159 |
* @param aFlags CEikButtonGroupContainer::EIsEmbedded if CBA is embedded
|
|
160 |
* inside another control (popup/dialog/setting page)
|
|
161 |
* @return Control button array object
|
|
162 |
*/
|
|
163 |
static CEikCba* NewLC(
|
|
164 |
TInt aResourceId,
|
|
165 |
const CEikCba* aPrevious,
|
|
166 |
MEikCommandObserver* aCommandObserver,
|
|
167 |
RWindowGroup* aParentWg, TUint aFlags );
|
|
168 |
|
|
169 |
/**
|
|
170 |
* Destructor.
|
|
171 |
*/
|
|
172 |
~CEikCba();
|
|
173 |
|
|
174 |
public: // new methods
|
|
175 |
/**
|
|
176 |
* Gets the maximum number of buttons that can be supported by the device.
|
|
177 |
*
|
|
178 |
* @internal
|
|
179 |
* @return The number of command buttons supported.
|
|
180 |
*/
|
|
181 |
TInt MaxCommands() const;
|
|
182 |
|
|
183 |
/**
|
|
184 |
* Updates the cba labels.
|
|
185 |
*
|
|
186 |
* @internal
|
|
187 |
* @param aScrollerOn If this is set, the short labels are used instead
|
|
188 |
* of the long ones. To be used if there is an (old style)
|
|
189 |
* scroller between the softkeys.
|
|
190 |
*/
|
|
191 |
void UpdateCbaLabels(TBool aScrollerOn);
|
|
192 |
|
|
193 |
/**
|
|
194 |
* For checking whether the middle softkey is supported in the platform.
|
|
195 |
*
|
|
196 |
* @internal
|
|
197 |
* @return ETrue if the middle softkey is supported in the plaftorm.
|
|
198 |
*/
|
|
199 |
TInt MSKEnabledInPlatform() const;
|
|
200 |
|
|
201 |
/**
|
|
202 |
* Sets the scroll bar frame observer.
|
|
203 |
*
|
|
204 |
* @internal
|
|
205 |
* @param aObserver The scroll bar frame observer.
|
|
206 |
*/
|
|
207 |
void SetSBFrameObserver(MEikScrollBarObserver* aObserver);
|
|
208 |
|
|
209 |
/**
|
|
210 |
* Sets the scroll bar model.
|
|
211 |
*
|
|
212 |
* @internal
|
|
213 |
* @param aModel The scroll bar model.
|
|
214 |
*/
|
|
215 |
void SetScrollBarModelL(TEikScrollBarModel* aModel);
|
|
216 |
|
|
217 |
/**
|
|
218 |
* Returns the scroll bar frame.
|
|
219 |
*
|
|
220 |
* @internal
|
|
221 |
* @return The scroll bar frame.
|
|
222 |
*/
|
|
223 |
const CEikCbaScrollBarFrame* ScrollBarFrame() const;
|
|
224 |
|
|
225 |
/**
|
|
226 |
* Returns the vertical scroll bar as a control.
|
|
227 |
*
|
|
228 |
* @internal The vertical scroll bar as a control
|
|
229 |
*/
|
|
230 |
CAknScrollBar* VScrollBarAsControl();
|
|
231 |
|
|
232 |
/**
|
|
233 |
* Replaces empty scroll bar with actual arrow head scroll bar.
|
|
234 |
*
|
|
235 |
* @internal
|
|
236 |
* @since S60 3.0
|
|
237 |
*/
|
|
238 |
void CreateArrowHeadScrollBarL();
|
|
239 |
|
|
240 |
/**
|
|
241 |
* For external set the MSK icon
|
|
242 |
* Returns ETrue if option is ok, EFalse is not.
|
|
243 |
* @param aId icon bitmap IID
|
|
244 |
* @param aBmpFile file path.
|
|
245 |
* @param aBmp Bitmap ID.
|
|
246 |
* @param aBmpM Bitmap mask ID.
|
|
247 |
* @param aEnable ETrue for set icon, EFalse for use default icon.
|
|
248 |
*/
|
|
249 |
IMPORT_C TBool UpdateMSKIconL(
|
|
250 |
const TAknsItemID& aId,
|
|
251 |
const TDesC& aBmpFile,
|
|
252 |
const TInt32 aBmp,
|
|
253 |
const TInt32 aBmpM,
|
|
254 |
TBool aEnable);
|
|
255 |
|
|
256 |
/**
|
|
257 |
* Enables or disables item specific softkey. If enabled then SK1's
|
|
258 |
* visibility is determined by the screen content. If there's a list or
|
|
259 |
* grid with visible highlight (i.e. highlight is brought visible via
|
|
260 |
* hardware keys) on the display or SK1's associated command is
|
|
261 |
* @c EAknSoftkeyOptions then SK1 is visible, otherwise it's hidden. This
|
|
262 |
* method has no effect if the the application isn't single click enabled.
|
|
263 |
* Item specific softkey is enabled by default.
|
|
264 |
*
|
|
265 |
* @since S60 5.2
|
|
266 |
*
|
|
267 |
* @param aEnable ETrue to enable item specific softkey, EFalse to disable.
|
|
268 |
*/
|
|
269 |
IMPORT_C void EnableItemSpecificSoftkey( TBool aEnable );
|
|
270 |
|
|
271 |
public:
|
|
272 |
/**
|
|
273 |
* From CEikControlGroup.
|
|
274 |
* Adds a wrapped control to the control group array at the given index position.
|
|
275 |
* Overridden to prevent setting container window.
|
|
276 |
*
|
|
277 |
* @param aGroupControl The control to add to the group.
|
|
278 |
* @param aIndex The index for the added control.
|
|
279 |
*/
|
|
280 |
void InsertControlL(TEikGroupControl& aGroupControl, TInt aIndex);
|
|
281 |
|
|
282 |
/**
|
|
283 |
* From MEikButtonGroup.
|
|
284 |
* Sets a command button's text and command ID. Note that this implementation does
|
|
285 |
* not support bitmap and mask.
|
|
286 |
*
|
|
287 |
* @param aPosition The position within the button group of the button to change.
|
|
288 |
* @param aCommandId Command ID the button will send.
|
|
289 |
* @param aText The text for the button.
|
|
290 |
* @param aBitmap Not used.
|
|
291 |
* @param aMask Not used.
|
|
292 |
*/
|
|
293 |
void SetCommandL(
|
|
294 |
TInt aPosition,
|
|
295 |
TInt aCommandId,
|
|
296 |
const TDesC* aText,
|
|
297 |
const CFbsBitmap* aBitmap,
|
|
298 |
const CFbsBitmap* aMask);
|
|
299 |
|
|
300 |
/**
|
|
301 |
* From MEikButtonGroup.
|
|
302 |
* Sets a command button's text label and command ID. The text and command ID are all
|
|
303 |
* read from resource. Note that this implementation does not support bitmap and mask.
|
|
304 |
*
|
|
305 |
* @internal
|
|
306 |
*
|
|
307 |
* @param aPosition The position within the button group of the button to change.
|
|
308 |
* @param aResourceId Resource ID specifying the text and command ID.
|
|
309 |
*
|
|
310 |
*/
|
|
311 |
void SetCommandL(TInt aPosition, TInt aResourceId);
|
|
312 |
|
|
313 |
/**
|
|
314 |
* From MEikButtonGroup.
|
|
315 |
* Initialises the group of command buttons from a resource.
|
|
316 |
* Note that this implementation does not support bitmap and mask.
|
|
317 |
*
|
|
318 |
* @internal
|
|
319 |
*
|
|
320 |
* @param aResourceId ID of the resource structure specifying the command buttons.
|
|
321 |
*/
|
|
322 |
void SetCommandSetL(TInt aResourceId);
|
|
323 |
|
|
324 |
/**
|
|
325 |
* From MEikButtonGroup.
|
|
326 |
* Not supported.
|
|
327 |
*
|
|
328 |
* @internal
|
|
329 |
*
|
|
330 |
* @param aPosition Not used.
|
|
331 |
* @param aCommandId Not used.
|
|
332 |
* @param aText Not used.
|
|
333 |
* @param aBitmap Not used.
|
|
334 |
* @param aMask Not used.
|
|
335 |
* @leave KErrNotSupported If called.
|
|
336 |
*/
|
|
337 |
void AddCommandL(
|
|
338 |
TInt aPosition,
|
|
339 |
TInt aCommandId,
|
|
340 |
const TDesC* aText,
|
|
341 |
const CFbsBitmap* aBitmap,
|
|
342 |
const CFbsBitmap* aMask);
|
|
343 |
|
|
344 |
/**
|
|
345 |
* From MEikButtonGroup.
|
|
346 |
* Pushes a command button with text and a command ID onto a position's button stack.
|
|
347 |
* Note that this implementation does not support bitmap and mask.
|
|
348 |
*
|
|
349 |
* @internal
|
|
350 |
*
|
|
351 |
* @param aPosition The position in the button group at which to add the command button.
|
|
352 |
* @param aCommandId Command ID the button will send.
|
|
353 |
* @param aText Text for the button.
|
|
354 |
* @param aBitmap Not used.
|
|
355 |
* @param aMask Not used.
|
|
356 |
*/
|
|
357 |
void AddCommandToStackL(
|
|
358 |
TInt aPosition,
|
|
359 |
TInt aCommandId,
|
|
360 |
const TDesC* aText,
|
|
361 |
const CFbsBitmap* aBitmap,
|
|
362 |
const CFbsBitmap* aMask);
|
|
363 |
|
|
364 |
/**
|
|
365 |
* From MEikButtonGroup.
|
|
366 |
* Pushes a command button onto a position's button stack. The text and command ID are all
|
|
367 |
* read from resource. Note that this implementation does not support bitmap and mask.
|
|
368 |
*
|
|
369 |
* @internal
|
|
370 |
*
|
|
371 |
* @param aPosition The position in the button group at which to push the command button.
|
|
372 |
* @param aResourceId ID of a resource specifying the text and command ID.
|
|
373 |
*/
|
|
374 |
void AddCommandToStackL(TInt aPosition, TInt aResourceId);
|
|
375 |
|
|
376 |
/**
|
|
377 |
* From MEikButtonGroup.
|
|
378 |
* As with SetCommandL() but for a set of buttons, also allows the previous command button
|
|
379 |
* to be retrieved by calling RemoveCommand(). Note that this implementation does not
|
|
380 |
* support bitmap and mask.
|
|
381 |
*
|
|
382 |
* @internal
|
|
383 |
*
|
|
384 |
* @param aResourceId Resource describing the set of command buttons.
|
|
385 |
*/
|
|
386 |
void AddCommandSetToStackL(TInt aResourceId);
|
|
387 |
|
|
388 |
/**
|
|
389 |
* From MEikButtonGroup.
|
|
390 |
* Not supported.
|
|
391 |
*
|
|
392 |
* @internal
|
|
393 |
*
|
|
394 |
* @param aCommandId Not used.
|
|
395 |
*/
|
|
396 |
void SetDefaultCommand(TInt aCommandId);
|
|
397 |
|
|
398 |
/**
|
|
399 |
* From MEikButtonGroup.
|
|
400 |
* Calculates minimum size required to display the buttons defined in the
|
|
401 |
* specified resource structure.
|
|
402 |
*
|
|
403 |
* @internal
|
|
404 |
*
|
|
405 |
* @param aResourceId The ID of the resource structure describing the button group.
|
|
406 |
* @return Minimum size required to display the button group defined in the specified
|
|
407 |
* resource structure.
|
|
408 |
*/
|
|
409 |
TSize CalcMinimumSizeL(TInt aResourceId);
|
|
410 |
|
|
411 |
/**
|
|
412 |
* From MEikButtonGroup.
|
|
413 |
* Removes the command identified by aCommandId, in position aPosition in the
|
|
414 |
* group, from the command stack. Automatically retrieves the previous command
|
|
415 |
* details. Commands are added to the stack by calling AddCommandToStackL.
|
|
416 |
*
|
|
417 |
* @internal
|
|
418 |
*
|
|
419 |
* @param aPosition The position in the button group from which to remove the
|
|
420 |
* command button.
|
|
421 |
* @param aCommandId Command ID.
|
|
422 |
*/
|
|
423 |
void RemoveCommandFromStack(TInt aPosition, TInt aCommandId);
|
|
424 |
|
|
425 |
/**
|
|
426 |
* From MEikButtonGroup.
|
|
427 |
* Returns the command position by command id.
|
|
428 |
*
|
|
429 |
* @internal
|
|
430 |
*
|
|
431 |
* @param aCommandId The button's command id.
|
|
432 |
* @return The command position in the button group.
|
|
433 |
*/
|
|
434 |
TInt CommandPos(TInt aCommandId) const;
|
|
435 |
|
|
436 |
/**
|
|
437 |
* From MEikButtonGroup.
|
|
438 |
* Dims or undims a button without drawing it.
|
|
439 |
*
|
|
440 |
* @internal
|
|
441 |
*
|
|
442 |
* @param aCommandId Command ID of the button to change.
|
|
443 |
* @param aDimmed ETrue to dim the specified command. EFalse to undim the specified command.
|
|
444 |
*/
|
|
445 |
void DimCommand(TInt aCommandId, TBool aDimmed);
|
|
446 |
|
|
447 |
/**
|
|
448 |
* From MEikButtonGroup.
|
|
449 |
* Determines whether the button with the specified command ID is dimmed.
|
|
450 |
*
|
|
451 |
* @internal
|
|
452 |
*
|
|
453 |
* @param aCommandId The command ID.
|
|
454 |
* @return ETrue if the specified command is dimmed. EFalse if the specified command is
|
|
455 |
* not dimmed.
|
|
456 |
*/
|
|
457 |
TBool IsCommandDimmed(TInt aCommandId) const;
|
|
458 |
|
|
459 |
/**
|
|
460 |
* From MEikButtonGroup.
|
|
461 |
* Makes the button with the specified id either visible, or invisible.
|
|
462 |
*
|
|
463 |
* @internal
|
|
464 |
*
|
|
465 |
* @param aCommandId Specifies the button to alter.
|
|
466 |
|
|
467 |
* @param aVisible ETrue to make the specified button visible. EFalse to make the specified
|
|
468 |
* button invisible.
|
|
469 |
*/
|
|
470 |
void MakeCommandVisible(TInt aCommandId, TBool aVisible);
|
|
471 |
|
|
472 |
/**
|
|
473 |
* From MEikButtonGroup.
|
|
474 |
* Tests whether the button with the specified command ID is visible.
|
|
475 |
*
|
|
476 |
* @internal
|
|
477 |
*
|
|
478 |
* @param aCommandId Specifies the button.
|
|
479 |
* @return ETrue if the specified button is visible. EFalse if the specified button is
|
|
480 |
* not visible.
|
|
481 |
*/
|
|
482 |
TBool IsCommandVisible(TInt aCommandId) const;
|
|
483 |
|
|
484 |
/**
|
|
485 |
* From MEikButtonGroup.
|
|
486 |
* Not supported.
|
|
487 |
*
|
|
488 |
* @internal
|
|
489 |
*
|
|
490 |
* @param aCommandId Not used.
|
|
491 |
*/
|
|
492 |
void AnimateCommand(TInt aCommandId);
|
|
493 |
|
|
494 |
/**
|
|
495 |
* From MEikButtonGroup.
|
|
496 |
* Returns the button group as a control.
|
|
497 |
*
|
|
498 |
* @internal
|
|
499 |
*
|
|
500 |
* @return The button group as a control.
|
|
501 |
*/
|
|
502 |
CCoeControl* AsControl();
|
|
503 |
|
|
504 |
/**
|
|
505 |
* From MEikButtonGroup.
|
|
506 |
* Returns the button group as a control.
|
|
507 |
*
|
|
508 |
* @internal
|
|
509 |
*
|
|
510 |
* @return The button group as a control.
|
|
511 |
*/
|
|
512 |
const CCoeControl* AsControl() const;
|
|
513 |
|
|
514 |
/**
|
|
515 |
* From MEikButtonGroup.
|
|
516 |
* Sets the boundary rectangle for externally-positioned button groups.
|
|
517 |
* For use by EExternal button groups only.
|
|
518 |
*
|
|
519 |
* @internal
|
|
520 |
*
|
|
521 |
* @param aBoundingRect Not used.
|
|
522 |
*/
|
|
523 |
void SetBoundingRect(const TRect& aBoundingRect);
|
|
524 |
|
|
525 |
/**
|
|
526 |
* From MEikButtonGroup.
|
|
527 |
* Subtracts the area occupied by the button group from the specified bounding rectangle.
|
|
528 |
* This method should be used in preference to querying the container's area at all times.
|
|
529 |
* For use by EExternal button groups only.
|
|
530 |
*
|
|
531 |
* @internal
|
|
532 |
*
|
|
533 |
* @param aBoundingRect Rectangle to be modified.
|
|
534 |
*/
|
|
535 |
void ReduceRect(TRect& aBoundingRect) const;
|
|
536 |
|
|
537 |
/**
|
|
538 |
* Returns a group control (a button) as a control.
|
|
539 |
*
|
|
540 |
* @internal
|
|
541 |
*
|
|
542 |
* @param aCommandId The button's command id.
|
|
543 |
* @return The group control as a control.
|
|
544 |
*/
|
|
545 |
CCoeControl* GroupControlById(TInt aCommandId);
|
|
546 |
|
|
547 |
/**
|
|
548 |
* From MEikButtonGroup.
|
|
549 |
* Returns a group control (a button) as a control.
|
|
550 |
*
|
|
551 |
* @internal
|
|
552 |
*
|
|
553 |
* @param aCommandId The button's command id.
|
|
554 |
* @return The group control as a control.
|
|
555 |
*/
|
|
556 |
CCoeControl* GroupControlById(TInt aCommandId) const;
|
|
557 |
|
|
558 |
/**
|
|
559 |
* From MEikButtonGroup.
|
|
560 |
* Returns the command id by position.
|
|
561 |
*
|
|
562 |
* @internal
|
|
563 |
*
|
|
564 |
* @param aCommandPos The command's position.
|
|
565 |
* @return The command id.
|
|
566 |
*/
|
|
567 |
TInt CommandId(TInt aCommandPos) const;
|
|
568 |
|
|
569 |
/**
|
|
570 |
* From MEikButtonGroup.
|
|
571 |
* Gets the total number of buttons currently present in the group.
|
|
572 |
*
|
|
573 |
* @internal
|
|
574 |
*
|
|
575 |
* @return The number of buttons.
|
|
576 |
*/
|
|
577 |
TInt ButtonCount() const;
|
|
578 |
|
|
579 |
/**
|
|
580 |
* Removes previous command.
|
|
581 |
*
|
|
582 |
* @internal
|
|
583 |
*
|
|
584 |
* @param aPosition The command's position.
|
|
585 |
*/
|
|
586 |
void RemovePreviousCommand(TInt aPosition);
|
|
587 |
|
|
588 |
/**
|
|
589 |
* From MEikButtonGroup.
|
|
590 |
* Not supported, because it is not possible to convert a CBA button to a
|
|
591 |
* CEikCommandButton. Calling this in debug build causes a panic, otherwise
|
|
592 |
* NULL is just returned.
|
|
593 |
*
|
|
594 |
* @internal
|
|
595 |
*
|
|
596 |
* @param aCommandId Not used.
|
|
597 |
*/
|
|
598 |
CEikCommandButton* GroupControlAsButton(TInt aCommandId) const;
|
|
599 |
|
|
600 |
/**
|
|
601 |
* From MEikButtonGroup.
|
|
602 |
* Gets the button group flags.
|
|
603 |
*
|
|
604 |
* @internal
|
|
605 |
*
|
|
606 |
* @return The button group flags.
|
|
607 |
*/
|
|
608 |
TUint ButtonGroupFlags() const;
|
|
609 |
|
|
610 |
/**
|
|
611 |
* Sets the button group flags.
|
|
612 |
*
|
|
613 |
* @internal
|
|
614 |
*
|
|
615 |
* @param aFlags The button group flags.
|
|
616 |
*/
|
|
617 |
IMPORT_C void SetButtonGroupFlags(TInt aFlags);
|
|
618 |
|
|
619 |
/**
|
|
620 |
* Sets the skin background for this control button array. The new background is used
|
|
621 |
* for all the subsequent drawing operations. This method does not itself cause a repaint.
|
|
622 |
*
|
|
623 |
* @internal
|
|
624 |
*
|
|
625 |
* @param aIID Skin item ID of the new background. This is one of the constants
|
|
626 |
* defined in AknsConstants.h, and the usual values are KAknsIIDQsnBgAreaControl,
|
|
627 |
* KAknsIIDQsnBgAreaControlPopup, and KAknsIIDQsnBgAreaControlIdle.
|
|
628 |
* @since S60 2.0
|
|
629 |
*/
|
|
630 |
IMPORT_C void SetSkinBackgroundId(const TAknsItemID& aIID);
|
|
631 |
|
|
632 |
/**
|
|
633 |
* Sets the middle softkey icon.
|
|
634 |
*
|
|
635 |
* @internal
|
|
636 |
*
|
|
637 |
* @since S60 3.1
|
|
638 |
*/
|
|
639 |
void SetMSKIconL();
|
|
640 |
|
|
641 |
/**
|
|
642 |
* From MEikButtonGroup.
|
|
643 |
* Sets the middle softkey command observer.
|
|
644 |
*
|
|
645 |
* @internal
|
|
646 |
*
|
|
647 |
* @param aCommandObserver The middle softkey command observer.
|
|
648 |
* @since S60 3.1
|
|
649 |
*/
|
|
650 |
void SetMSKCommandObserver(MEikCommandObserver* aCommandObserver);
|
|
651 |
|
|
652 |
/**
|
|
653 |
* From MEikButtonGroup.
|
|
654 |
* Dims (but doesn't draw) the button with position aPosition.
|
|
655 |
*
|
|
656 |
* @internal
|
|
657 |
*
|
|
658 |
* @param aPosition The position for command to be dimmed.
|
|
659 |
* @param aDimmed ETrue for dimming.
|
|
660 |
*/
|
|
661 |
void DimCommandByPosition(TInt aPosition, TBool aDimmed);
|
|
662 |
|
|
663 |
/**
|
|
664 |
* From MEikButtonGroup.
|
|
665 |
* Returns ETrue if the button with position aPosition is dimmed.
|
|
666 |
*
|
|
667 |
* @internal
|
|
668 |
*
|
|
669 |
* @param aPosition The position for command to be checked.
|
|
670 |
* @return The state of the button.
|
|
671 |
*/
|
|
672 |
TBool IsCommandDimmedByPosition(TInt aPosition) const;
|
|
673 |
|
|
674 |
/**
|
|
675 |
* From MEikButtonGroup.
|
|
676 |
* Sets the the button with position aPosition to be visible if aVisible is ETrue.
|
|
677 |
*
|
|
678 |
* @internal
|
|
679 |
*
|
|
680 |
* @param aPosition The position for command to be made visible.
|
|
681 |
* @param aVisible EFalse for making button invisible.
|
|
682 |
*/
|
|
683 |
void MakeCommandVisibleByPosition(TInt aPosition, TBool aVisible);
|
|
684 |
|
|
685 |
/**
|
|
686 |
* From MEikButtonGroup.
|
|
687 |
* Returns ETrue if the button with position aPosition is visible.
|
|
688 |
*
|
|
689 |
* @internal
|
|
690 |
*
|
|
691 |
* @param aPosition The position for command to be checked.
|
|
692 |
* @return The state of the button.
|
|
693 |
*/
|
|
694 |
TBool IsCommandVisibleByPosition(TInt aPosition) const;
|
|
695 |
|
|
696 |
/**
|
|
697 |
* From MEikButtonGroup.
|
|
698 |
* Not supported.
|
|
699 |
*
|
|
700 |
* @internal
|
|
701 |
*
|
|
702 |
* @param aPosition Not used.
|
|
703 |
*/
|
|
704 |
void AnimateCommandByPosition(TInt aPosition);
|
|
705 |
|
|
706 |
/**
|
|
707 |
* Returns a group control (a button) as a control.
|
|
708 |
*
|
|
709 |
* @internal
|
|
710 |
*
|
|
711 |
* @param aPosition The button's position.
|
|
712 |
* @return The group control as a control.
|
|
713 |
*/
|
|
714 |
// CCoeControl* GroupControlByPosition(TInt aPosition) const;
|
|
715 |
|
|
716 |
/**
|
|
717 |
* Gets a CBA button rectangle. This can be used in touch layouts to
|
|
718 |
* get the whole rectangle of the CBA button, as the button areas
|
|
719 |
* are larger than the actual button control in touch layouts.
|
|
720 |
*
|
|
721 |
* @param aPosition Position of the button.
|
|
722 |
* @param aRelativeToScreen If @c ETrue, the returned rectangle
|
|
723 |
* coordinates are relative to the screen
|
|
724 |
* rectangle, otherwise they are relative
|
|
725 |
* to the CBA area. Note that this parameter is
|
|
726 |
* only taken into account in touch layouts, and
|
|
727 |
* in nHD landscape mode the returned rectangle
|
|
728 |
* is always relative to the screen regardless
|
|
729 |
* of this parameter.
|
|
730 |
*
|
|
731 |
* @return Rectangle of the specified button.
|
|
732 |
*/
|
|
733 |
TRect ButtonRectByPosition( TInt aPosition,
|
|
734 |
TBool aRelativeToScreen );
|
|
735 |
|
|
736 |
/**
|
|
737 |
* Enable or disable transparent rendering.
|
|
738 |
*
|
|
739 |
* @internal
|
|
740 |
* @since S60 v5.0
|
|
741 |
* @param aEnable ETrue to enable transparency,
|
|
742 |
* EFalse to disable.
|
|
743 |
*/
|
|
744 |
void EnablePostingTransparency( TBool aEnable );
|
|
745 |
|
|
746 |
/**
|
|
747 |
* Returns TBitFlags.
|
|
748 |
*
|
|
749 |
* @internal
|
|
750 |
* @since S60 v5.2
|
|
751 |
* @return TBitFlags.
|
|
752 |
*/
|
|
753 |
TBitFlags Flags();
|
|
754 |
|
|
755 |
/**
|
|
756 |
* Sets content observer.
|
|
757 |
*
|
|
758 |
* @internal
|
|
759 |
* @since S60 v5.2
|
|
760 |
* @param aCallBack call back to notify of content changes.
|
|
761 |
*/
|
|
762 |
void SetContentObserver( TCallBack aCallBack );
|
|
763 |
|
|
764 |
public:
|
|
765 |
/**
|
|
766 |
* Formerly from MTopSetMember<CEikCba>, now reserved.
|
|
767 |
*/
|
|
768 |
virtual void Reserved_MtsmPosition();
|
|
769 |
|
|
770 |
/**
|
|
771 |
* Formerly from MTopSetMember<CEikCba>, now reserved.
|
|
772 |
*/
|
|
773 |
virtual void Reserved_MtsmObject();
|
|
774 |
|
|
775 |
public: // from CCoeControl
|
|
776 |
/**
|
|
777 |
* From CCoeControl.
|
|
778 |
* Handles key events.
|
|
779 |
*
|
|
780 |
* @param aKeyEvent The key event.
|
|
781 |
* @param aType The type of key event: EEventKey, EEventKeyUp or EEventKeyDown.
|
|
782 |
* @return Indicates whether or not the key event was used by this control.
|
|
783 |
*/
|
|
784 |
TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent,TEventCode aType);
|
|
785 |
|
|
786 |
/**
|
|
787 |
* From CCoeControl.
|
|
788 |
* Sets the control's minimum required size.
|
|
789 |
*
|
|
790 |
* @return The minimum size required by the control.
|
|
791 |
*/
|
|
792 |
TSize MinimumSize();
|
|
793 |
|
|
794 |
/**
|
|
795 |
* From CCoeControl.
|
|
796 |
* Gets the list of logical colours used to draw the control.
|
|
797 |
* The list includes an explanation of how each colour is used.
|
|
798 |
*
|
|
799 |
* @param aColorUseList The colour list.
|
|
800 |
*/
|
|
801 |
void GetColorUseListL(CArrayFix<TCoeColorUse>& aColorUseList) const;
|
|
802 |
|
|
803 |
/**
|
|
804 |
* From CCoeControl.
|
|
805 |
* Handles a change to the control's resources.
|
|
806 |
*
|
|
807 |
* @param aType A message UID value.
|
|
808 |
*/
|
|
809 |
void HandleResourceChange(TInt aType);
|
|
810 |
|
|
811 |
/**
|
|
812 |
* From CCoeControl.
|
|
813 |
* Sets this control as visible or invisible.
|
|
814 |
*
|
|
815 |
* @param aVisible ETrue to make the control visible, EFalse to make it invisible.
|
|
816 |
*/
|
|
817 |
void MakeVisible(TBool aVisible);
|
|
818 |
|
|
819 |
/**
|
|
820 |
* From CCoeControl.
|
|
821 |
* Handles pointer events.
|
|
822 |
*
|
|
823 |
* @param aPointerEvent The pointer event
|
|
824 |
*/
|
|
825 |
void HandlePointerEventL(const TPointerEvent& aPointerEvent);
|
|
826 |
|
|
827 |
/**
|
|
828 |
* From CCoeControl.
|
|
829 |
* Sets the control's containing window by copying it from aContainer.
|
|
830 |
*
|
|
831 |
* @param aContainer The compound control that is the container for this control
|
|
832 |
*/
|
|
833 |
void SetContainerWindowL( const CCoeControl& aContainer );
|
|
834 |
|
|
835 |
void ActivateL();
|
|
836 |
|
|
837 |
public: // from MEikEnhancedButtonGroup
|
|
838 |
/**
|
|
839 |
* From MEikEnhancedButtonGroup.
|
|
840 |
* Used to offer list of commands for softkeys.
|
|
841 |
*
|
|
842 |
* @param aCommandList A list of command ids to be offered for softkeys.
|
|
843 |
*/
|
|
844 |
IMPORT_C void OfferCommandListL(const RArray<TInt>& aCommandList);
|
|
845 |
|
|
846 |
/**
|
|
847 |
* From MEikEnhancedButtonGroup.
|
|
848 |
* Used to offer list of commands for softkeys.
|
|
849 |
*
|
|
850 |
* @param aResourceId Id for CBA resource that defines enhanced cba buttons.
|
|
851 |
*/
|
|
852 |
IMPORT_C void OfferCommandListL(const TInt aResourceId);
|
|
853 |
|
|
854 |
/**
|
|
855 |
* From MEikEnhancedButtonGroup.
|
|
856 |
* Used to check if a certain command have been approved to the current command set.
|
|
857 |
*
|
|
858 |
* @param aCommandId The id for command which existence should be checked.
|
|
859 |
* @return ETrue if command is in control group, otherwise EFalse.
|
|
860 |
*/
|
|
861 |
IMPORT_C TBool IsCommandInGroup(const TInt aCommandId) const;
|
|
862 |
|
|
863 |
/**
|
|
864 |
* From MEikEnhancedButtonGroup.
|
|
865 |
* Replace existing command with a new command.
|
|
866 |
*
|
|
867 |
* @param aCommandId Id for command that should be replaced.
|
|
868 |
* @param aResourceId Resource id for new enhanced cba button.
|
|
869 |
*/
|
|
870 |
IMPORT_C void ReplaceCommand(const TInt aCommandId, const TInt aResourceId);
|
|
871 |
|
|
872 |
public: // From MCoeControlObserver
|
|
873 |
void HandleControlEventL( CCoeControl* aControl, TCoeEvent aEventType );
|
|
874 |
|
|
875 |
private:
|
|
876 |
/**
|
|
877 |
* From CAknControl
|
|
878 |
*/
|
|
879 |
IMPORT_C void* ExtensionInterface( TUid aInterface );
|
|
880 |
|
|
881 |
protected:
|
|
882 |
/**
|
|
883 |
* From MEikScrollBarObserver
|
|
884 |
* Handles scroll events. This function is called by the CEikScrollBar object with which
|
|
885 |
* this scroll bar observer object is registered. Implementations should handle scroll
|
|
886 |
* events appropriately.
|
|
887 |
*
|
|
888 |
* @param aScrollBar Pointer to the originating scroll bar object.
|
|
889 |
* @param aEventType A scroll event.
|
|
890 |
*/
|
|
891 |
virtual void HandleScrollEventL(CEikScrollBar* aScrollBar, TEikScrollEvent aEventType);
|
|
892 |
|
|
893 |
/**
|
|
894 |
* From CCoeControl
|
|
895 |
* Retrieves an object of the same type as that encapsulated in aId.
|
|
896 |
* This function is used to allow controls to ask their owners for access to other
|
|
897 |
* objects that they own.
|
|
898 |
*
|
|
899 |
* @param aId An encapsulated object type ID.
|
|
900 |
* @return Encapsulates the pointer to the object provided. Note that the encapsulated
|
|
901 |
* pointer may be NULL.
|
|
902 |
*/
|
|
903 |
TTypeUid::Ptr MopSupplyObject(TTypeUid aId);
|
|
904 |
|
|
905 |
/**
|
|
906 |
* From CCoeControl.
|
|
907 |
* Draws the control.
|
|
908 |
*
|
|
909 |
* @param aRect Rectangle to draw on.
|
|
910 |
*/
|
|
911 |
void Draw(const TRect& aRect) const;
|
|
912 |
|
|
913 |
public:
|
|
914 |
|
|
915 |
/**
|
|
916 |
* Checks if the CBA contains no commands.
|
|
917 |
* Note that this returns always @c EFalse if the CBA belongs
|
|
918 |
* to a full screen query.
|
|
919 |
*
|
|
920 |
* @internal
|
|
921 |
*
|
|
922 |
* @return @c ETrue if the CBA buttons are empty, @c EFalse otherwise.
|
|
923 |
*
|
|
924 |
* @since 5.0
|
|
925 |
*/
|
|
926 |
IMPORT_C TBool IsEmpty() const;
|
|
927 |
|
|
928 |
/**
|
|
929 |
* Returns ETrue if softkey status change is allowed.
|
|
930 |
*
|
|
931 |
* @param aSofkeyPosition Softkey position.
|
|
932 |
* @param aDisabled ETrue if softkey is to be disabled.
|
|
933 |
* @return ETrue if softkey status change is allowed.
|
|
934 |
*/
|
|
935 |
TBool SoftkeyStatusChangeAllowed(
|
|
936 |
TInt aSofkeyPosition, TBool aDisabled );
|
|
937 |
|
|
938 |
/**
|
|
939 |
* Returns item specific softkey if it state should be updated.
|
|
940 |
*
|
|
941 |
* @return Item specific softkey.
|
|
942 |
*/
|
|
943 |
TEikGroupControl* ItemSpecificSoftkey() const;
|
|
944 |
|
|
945 |
/**
|
|
946 |
* Updates item specific softkey.
|
|
947 |
*
|
|
948 |
* @param aVisibleCollection ETrue if state should be updated according
|
|
949 |
* to visible collection.
|
|
950 |
*/
|
|
951 |
void UpdateItemSpecificSoftkey( TBool aVisibleCollection = ETrue );
|
|
952 |
|
|
953 |
/**
|
|
954 |
* Updates RSK when multiple marking is activated or deactivated.
|
|
955 |
*/
|
|
956 |
void UpdateMultipleMarkingSoftkey();
|
|
957 |
|
|
958 |
/**
|
|
959 |
* Checks whether softkey command change is allowed.
|
|
960 |
*
|
|
961 |
* @return ETrue if softkey command change is allowed.
|
|
962 |
*/
|
|
963 |
TBool CommandChangeAllowed() const;
|
|
964 |
|
|
965 |
private: // new methods
|
|
966 |
|
|
967 |
CEikCba(
|
|
968 |
const CEikCba* aPrevious,
|
|
969 |
MEikCommandObserver* aCommandObserver,
|
|
970 |
RWindowGroup* aParentWg,
|
|
971 |
TUint aFlags = 0 );
|
|
972 |
void BaseConstructL();
|
|
973 |
void ConstructL(TInt aResourceId);
|
|
974 |
void ConstructFromResourceL(TResourceReader& aReader);
|
|
975 |
CCoeControl* ButtonById( TInt aCommandId ) const;
|
|
976 |
void CreateScrollBarFrameL();
|
|
977 |
void InsertScrollBarL();
|
|
978 |
TEikGroupControl VScrollBarAsGroupControl();
|
|
979 |
void CheckSkinAndUpdateContext();
|
|
980 |
|
|
981 |
TInt AknLayoutFlags() const;
|
|
982 |
void SizeChangedInControlPane();
|
|
983 |
void SizeChangedInStaconPane();
|
|
984 |
void SizeChangedInRightPane();
|
|
985 |
void UpdateFonts();
|
|
986 |
|
|
987 |
void DoSkinChange();
|
|
988 |
void DoColorChange();
|
|
989 |
void DoLayoutChange();
|
|
990 |
|
|
991 |
void SizeChangedInsideDialog();
|
|
992 |
|
|
993 |
/**
|
|
994 |
* Handles size change events in case of embedded softkeys.
|
|
995 |
*/
|
|
996 |
void SizeChangedInPopup();
|
|
997 |
|
|
998 |
/**
|
|
999 |
* Updates softkey labels in case of embedded softkeys.
|
|
1000 |
*
|
|
1001 |
* @param aDrawDeferred ETrue to cause a redraw event.
|
|
1002 |
*/
|
|
1003 |
void UpdateLabels( TBool aDrawDeferred );
|
|
1004 |
|
|
1005 |
/**
|
|
1006 |
* Layouts given cba control to it's rect correctly. This function is
|
|
1007 |
* used to layout every text and image inside of @c CEikCba.
|
|
1008 |
*
|
|
1009 |
* @param aControl CBA Control that is to be layouted
|
|
1010 |
* @param aRect the rect where control should be layouted.
|
|
1011 |
*/
|
|
1012 |
void LayoutControl(CCoeControl* aControl, const TRect& aRect);
|
|
1013 |
|
|
1014 |
void DoSetLayers( const TAknsItemID& aIID );
|
|
1015 |
|
|
1016 |
/**
|
|
1017 |
* Broadcasts transparency information
|
|
1018 |
* to CEikCbaButtons.
|
|
1019 |
*/
|
|
1020 |
void BroadcastPostingTransparency( TBool aEnable );
|
|
1021 |
|
|
1022 |
/**
|
|
1023 |
* A better version of AddCommandToStackL
|
|
1024 |
* Pushes a command button with text and a command ID onto a position's button stack.
|
|
1025 |
* SizeChanged() is not called, so it need to be done after that.
|
|
1026 |
* Note that this implementation does not support bitmap and mask.
|
|
1027 |
*
|
|
1028 |
* @internal
|
|
1029 |
*
|
|
1030 |
* @param aPosition The position in the button group at which to add the command button.
|
|
1031 |
* @param aCommandId Command ID the button will send.
|
|
1032 |
* @param aText Text for the button.
|
|
1033 |
*/
|
|
1034 |
void AddCommandToStackWithoutSizeChangedL(
|
|
1035 |
TInt aPosition,
|
|
1036 |
TInt aCommandId,
|
|
1037 |
const TDesC* aText);
|
|
1038 |
|
|
1039 |
/**
|
|
1040 |
* Removes previous command but do not call SizeChanged And SetMSKIconL.
|
|
1041 |
*
|
|
1042 |
* @internal
|
|
1043 |
*
|
|
1044 |
* @param aPosition The command's position.
|
|
1045 |
*/
|
|
1046 |
void RemovePreviousCommandWithoutSizeChanged(TInt aPosition);
|
|
1047 |
|
|
1048 |
/**
|
|
1049 |
* Reports state changed event if cba changed from empty to non-empty
|
|
1050 |
* or vice versa.
|
|
1051 |
*/
|
|
1052 |
void ReportContentChangedEvent();
|
|
1053 |
|
|
1054 |
/**
|
|
1055 |
* Draws embedded softkey.
|
|
1056 |
*
|
|
1057 |
* @internal
|
|
1058 |
*
|
|
1059 |
* @param aGroupControl TEikGroupControl used to get access to CBA button.
|
|
1060 |
* @param aRect Softkey rectangle
|
|
1061 |
* @param aGc Graphics context
|
|
1062 |
* @param aMask Mask
|
|
1063 |
*/
|
|
1064 |
void DrawEmbeddedSoftkey( TEikGroupControl& aGroupControl,
|
|
1065 |
const TRect& aRect,
|
|
1066 |
CWindowGc& aGc,
|
|
1067 |
CFbsBitmap* aMask ) const;
|
|
1068 |
TBool UpdateIconL();
|
|
1069 |
|
|
1070 |
/**
|
|
1071 |
* Checks if the middle softkey should be used.
|
|
1072 |
*
|
|
1073 |
* @internal
|
|
1074 |
*
|
|
1075 |
* @return @c ETrue if MSK is to be used, @c EFalse otherwise.
|
|
1076 |
*/
|
|
1077 |
TBool MskAllowed() const;
|
|
1078 |
|
|
1079 |
/**
|
|
1080 |
* Updates item specific softkey.
|
|
1081 |
*
|
|
1082 |
* @param aControl Item specifc softkey control.
|
|
1083 |
* @param aEnable ETrue if control should be enabled, EFalse if disabled.
|
|
1084 |
*/
|
|
1085 |
void UpdateItemSpecificSoftkey( CCoeControl& aControl, TBool aEnable );
|
|
1086 |
|
|
1087 |
/**
|
|
1088 |
* Creates the skin background contexts used in StaCon layout if they
|
|
1089 |
* don't already exist.
|
|
1090 |
*/
|
|
1091 |
void CheckAndCreateStaconContextsL();
|
|
1092 |
|
|
1093 |
private: // from CCoeControl
|
|
1094 |
void SizeChanged();
|
|
1095 |
|
|
1096 |
private: // data
|
|
1097 |
TUint iCbaFlags;
|
|
1098 |
|
|
1099 |
/** Used to maintain the original settings if a client needs to temporarily change its cba. */
|
|
1100 |
const CEikCba* iLink;
|
|
1101 |
|
|
1102 |
CCoeBrushAndPenContext* iBrushAndPenContext;
|
|
1103 |
MEikCommandObserver* iCommandObserver;
|
|
1104 |
CEikCbaScrollBarFrame* iSBFrame;
|
|
1105 |
RWindowGroup* iParentWg;
|
|
1106 |
|
|
1107 |
/** New member variable that stores commands in correct order. */
|
|
1108 |
CEikCommandTable* iCommandTable;
|
|
1109 |
|
|
1110 |
/** For MSK. */
|
|
1111 |
TBool iMSKset;
|
|
1112 |
|
|
1113 |
/** For MSK, caches CenRep value. */
|
|
1114 |
TBool iMSKEnabledInPlatform;
|
|
1115 |
|
|
1116 |
/** Additional observer for MSK. This is called first and default observer after that. */
|
|
1117 |
MEikCommandObserver* iMSKCommandObserver;
|
|
1118 |
|
|
1119 |
// From extension.
|
|
1120 |
const CFont* iLabelFont;
|
|
1121 |
const CFont* iStaconLabelFont;
|
|
1122 |
const CFont* iRightPaneLabelFont;
|
|
1123 |
TBool iPopupVisible;
|
|
1124 |
TBitFlags iFlags;
|
|
1125 |
|
|
1126 |
/** Old background context. */
|
|
1127 |
CAknsBasicBackgroundControlContext* iBgContext;
|
|
1128 |
|
|
1129 |
/** Old stacon background context. */
|
|
1130 |
CAknsLayeredBackgroundControlContext* iStaconBgContext;
|
|
1131 |
|
|
1132 |
/** Masked layer backgrounds. */
|
|
1133 |
CAknsMaskedLayerBackgroundControlContext* iMLBgContext;
|
|
1134 |
CAknsMaskedLayerBackgroundControlContext* iStaconBgContextTop;
|
|
1135 |
CAknsMaskedLayerBackgroundControlContext* iStaconBgContextBottom;
|
|
1136 |
|
|
1137 |
TAknsItemID iBgIID;
|
|
1138 |
|
|
1139 |
/**
|
|
1140 |
* Skin background ID for the status pane controlled region
|
|
1141 |
* of the CBA area in bottom softkey landscape mode.
|
|
1142 |
*/
|
|
1143 |
TAknsItemID iClockIndicBgIID;
|
|
1144 |
TBool iIsClockIndicBgIIDSet;
|
|
1145 |
|
|
1146 |
CEikCbaExtension* iExtension;
|
|
1147 |
};
|
|
1148 |
|
|
1149 |
/**
|
|
1150 |
* EIKON CBA button class definition.
|
|
1151 |
*
|
|
1152 |
* @internal
|
|
1153 |
* @lib eikcoctl.lib
|
|
1154 |
* @since S60 0.9
|
|
1155 |
*/
|
|
1156 |
class CEikCbaButton : public CAknControl
|
|
1157 |
{
|
|
1158 |
public:
|
|
1159 |
/**
|
|
1160 |
* Holds information about command id and dimming status for a button.
|
|
1161 |
*/
|
|
1162 |
struct SButtonOptions
|
|
1163 |
{
|
|
1164 |
TInt iCommandId;
|
|
1165 |
TBool iDimmed;
|
|
1166 |
};
|
|
1167 |
public:
|
|
1168 |
/**
|
|
1169 |
* Destructor.
|
|
1170 |
*/
|
|
1171 |
~CEikCbaButton();
|
|
1172 |
|
|
1173 |
/**
|
|
1174 |
* Constructs a new CBA button instance.
|
|
1175 |
*
|
|
1176 |
* @param aAlignment Alignment for label.
|
|
1177 |
*/
|
|
1178 |
void ConstructL(TGulAlignmentValue aAlignment);
|
|
1179 |
public:
|
|
1180 |
/**
|
|
1181 |
* Updates the label text with the given label.
|
|
1182 |
*
|
|
1183 |
* @param aText The new label text.
|
|
1184 |
*/
|
|
1185 |
void AddCommandL(const TDesC& aText);
|
|
1186 |
|
|
1187 |
/**
|
|
1188 |
* Pushes a command into button stack.
|
|
1189 |
*
|
|
1190 |
* @param aCommandId The command to be pushed.
|
|
1191 |
* @param aText Text for the button.
|
|
1192 |
*/
|
|
1193 |
void PushCommandL(TInt aCommandId, const TDesC& aText);
|
|
1194 |
|
|
1195 |
/**
|
|
1196 |
* Pops a command from the button stack.
|
|
1197 |
*
|
|
1198 |
* @return The button's command id. KErrNotFound if the button stack is empty.
|
|
1199 |
*/
|
|
1200 |
TInt PopCommand();
|
|
1201 |
|
|
1202 |
/**
|
|
1203 |
* Removes a command from the button stack.
|
|
1204 |
*
|
|
1205 |
* @param aCommandId The command to be removed.
|
|
1206 |
*/
|
|
1207 |
void RemoveCommand(TInt aCommandId);
|
|
1208 |
|
|
1209 |
/**
|
|
1210 |
* Removes the previous command from the button stack.
|
|
1211 |
*/
|
|
1212 |
void RemovePreviousCommand();
|
|
1213 |
|
|
1214 |
/**
|
|
1215 |
* Switches the button's text to short or long depending on the parameter given.
|
|
1216 |
*
|
|
1217 |
* @param aShortText ETrue for short text, EFalse for the long text.
|
|
1218 |
*/
|
|
1219 |
void SwitchToShortTextL(TBool aShortText);
|
|
1220 |
|
|
1221 |
/**
|
|
1222 |
* Sets the labels font.
|
|
1223 |
*
|
|
1224 |
* @param aLabelFont The font to be used.
|
|
1225 |
*/
|
|
1226 |
void SetLabelFont(const CFont* aLabelFont);
|
|
1227 |
|
|
1228 |
/**
|
|
1229 |
* Truncates the label. This is done by CEikLabel.
|
|
1230 |
*/
|
|
1231 |
void TruncateLabelText();
|
|
1232 |
|
|
1233 |
/**
|
|
1234 |
* Checks if text is empty in this button.
|
|
1235 |
*/
|
|
1236 |
TBool IsEmptyText() const;
|
|
1237 |
|
|
1238 |
public:
|
|
1239 |
/**
|
|
1240 |
* From CCoeControl.
|
|
1241 |
* Sets the control's containing window by copying it from aContainer.
|
|
1242 |
*
|
|
1243 |
* @param aContainer The compound control that is the container for this control.
|
|
1244 |
*/
|
|
1245 |
void SetContainerWindowL(const CCoeControl& aContainer);
|
|
1246 |
|
|
1247 |
/**
|
|
1248 |
* Constructs the control from a resource file.
|
|
1249 |
*
|
|
1250 |
* @param aReader The resource reader.
|
|
1251 |
* @param anAlignment Alignment for label.
|
|
1252 |
*/
|
|
1253 |
void ConstructFromResourceL(TResourceReader& aReader, TGulAlignmentValue anAlignment);
|
|
1254 |
|
|
1255 |
/**
|
|
1256 |
* From CCoeControl.
|
|
1257 |
* Sets the control's minimum required size.
|
|
1258 |
*
|
|
1259 |
* @return The minimum size required by the control.
|
|
1260 |
*/
|
|
1261 |
TSize MinimumSize();
|
|
1262 |
|
|
1263 |
/**
|
|
1264 |
* From CCoeControl.
|
|
1265 |
* Sets the control to be dimmed.
|
|
1266 |
*
|
|
1267 |
* @param aDimmed ETrue to dim the control, EFalse to set the control as not dimmed.
|
|
1268 |
*/
|
|
1269 |
void SetDimmed(TBool aDimmed);
|
|
1270 |
|
|
1271 |
/**
|
|
1272 |
* From CCoeControl.
|
|
1273 |
* Handles pointer events.
|
|
1274 |
*
|
|
1275 |
* @param aPointerEvent The pointer event.
|
|
1276 |
*/
|
|
1277 |
IMPORT_C void HandlePointerEventL(const TPointerEvent& aPointerEvent);
|
|
1278 |
|
|
1279 |
public:
|
|
1280 |
/**
|
|
1281 |
* Sets the button's image.
|
|
1282 |
*
|
|
1283 |
* @param aImage The image to be set.
|
|
1284 |
*/
|
|
1285 |
void SetImage(CEikImage &aImage);
|
|
1286 |
|
|
1287 |
/**
|
|
1288 |
* Replaces the buttons image with label.
|
|
1289 |
*/
|
|
1290 |
void ReplaceImageByLabel();
|
|
1291 |
|
|
1292 |
/**
|
|
1293 |
* Returns whether the button has image set.
|
|
1294 |
*
|
|
1295 |
* @return ETrue if the button has image set, EFalse otherwise.
|
|
1296 |
*/
|
|
1297 |
inline TBool IsImageOn() const {return iDoImage;};
|
|
1298 |
|
|
1299 |
/**
|
|
1300 |
* Constructs empty button with id EAknSoftkeyEmpty
|
|
1301 |
*/
|
|
1302 |
void ConstructEmptyButtonL();
|
|
1303 |
|
|
1304 |
protected:
|
|
1305 |
/**
|
|
1306 |
* Returns the button's index by command id.
|
|
1307 |
*
|
|
1308 |
* @param aCommandId The button's command id.
|
|
1309 |
* @return The button's index.
|
|
1310 |
*/
|
|
1311 |
TInt IndexFromCommandId(TInt aCommandId);
|
|
1312 |
|
|
1313 |
/**
|
|
1314 |
* Updates the label text with the given label.
|
|
1315 |
*
|
|
1316 |
* @param aText The new label text.
|
|
1317 |
*/
|
|
1318 |
void UpdateLabelText(TPtrC aLabelText);
|
|
1319 |
|
|
1320 |
private:
|
|
1321 |
/**
|
|
1322 |
* From CCoeControl.
|
|
1323 |
* Gets the number of controls contained in a compound control.
|
|
1324 |
*
|
|
1325 |
* @return The number of component controls contained by this control.
|
|
1326 |
*/
|
|
1327 |
TInt CountComponentControls() const;
|
|
1328 |
|
|
1329 |
/**
|
|
1330 |
* From CCoeControl.
|
|
1331 |
* Gets an indexed component of a compound control.
|
|
1332 |
*
|
|
1333 |
* @param The index of the control.
|
|
1334 |
* @return The component control with an index of aIndex.
|
|
1335 |
*/
|
|
1336 |
CCoeControl* ComponentControl(TInt aIndex) const;
|
|
1337 |
|
|
1338 |
/**
|
|
1339 |
* From CCoeControl.
|
|
1340 |
* Responds to changes to the size and position of the contents of this control.
|
|
1341 |
*/
|
|
1342 |
void SizeChanged();
|
|
1343 |
|
|
1344 |
/**
|
|
1345 |
* From CAknControl.
|
|
1346 |
*/
|
|
1347 |
IMPORT_C void* ExtensionInterface( TUid aInterface );
|
|
1348 |
|
|
1349 |
public: // new functions
|
|
1350 |
/**
|
|
1351 |
* Returns the state of @c CEikCbaButton.
|
|
1352 |
*
|
|
1353 |
* @return Boolean value for CEikCbaButtons state. ETrue if button is
|
|
1354 |
* pressed down. Otherwise returns EFalse.
|
|
1355 |
*/
|
|
1356 |
TBool PressedDown() const;
|
|
1357 |
|
|
1358 |
/**
|
|
1359 |
* Changes the state of @c CEikCbaButton. Button's state is stored in a
|
|
1360 |
* member variable.
|
|
1361 |
*
|
|
1362 |
* @param aPressedDown The state that button has. @c ETrue if button's
|
|
1363 |
* state is pressed down. @c EFalse for normal,
|
|
1364 |
* not pressed state.
|
|
1365 |
*/
|
|
1366 |
void SetPressedDown( const TBool aPressedDown );
|
|
1367 |
|
|
1368 |
/**
|
|
1369 |
* Enables bitmap mode and hides the label. The text is drawn by CEikCba
|
|
1370 |
* in bitmap mode.
|
|
1371 |
* @internal
|
|
1372 |
* @since S60 v5.0
|
|
1373 |
* @param aEnableBitmap ETrue to enable bitmap mode. EFalse to work in the
|
|
1374 |
* standard way.
|
|
1375 |
*/
|
|
1376 |
void SetTextBitmapMode( TBool aEnableBitmap );
|
|
1377 |
|
|
1378 |
/**
|
|
1379 |
* Draws the button text and mask to give graphics contexts. Background
|
|
1380 |
* is not drawn.
|
|
1381 |
* @internal
|
|
1382 |
* @since S60 v5.0
|
|
1383 |
* @param aContext Graphics context to render the text itself into.
|
|
1384 |
* @param aMaskContext Graphics context to render the text mask into.
|
|
1385 |
* @param aOffset Offset between the coordinate system of the target
|
|
1386 |
* bitmap context relative to screen coordinates.
|
|
1387 |
*/
|
|
1388 |
void DrawToContext(
|
|
1389 |
CBitmapContext& aContext,
|
|
1390 |
CBitmapContext& aMaskContext,
|
|
1391 |
const TPoint& aOffset ) const;
|
|
1392 |
|
|
1393 |
/**
|
|
1394 |
* Returns the textual value of the button
|
|
1395 |
* @internal
|
|
1396 |
* @since S60 v5.0
|
|
1397 |
*/
|
|
1398 |
inline TPtrC FullLabelText() { return iFullLabelText;};
|
|
1399 |
|
|
1400 |
private:
|
|
1401 |
void PrepareImageL();
|
|
1402 |
|
|
1403 |
protected:
|
|
1404 |
TBuf<KMaxCbaLabelLength> iFullLabelText;
|
|
1405 |
TPtrC iLongLabelText;
|
|
1406 |
TPtrC iShortLabelText;
|
|
1407 |
CEikLabel* iLabel;
|
|
1408 |
CDesCArray* iText;
|
|
1409 |
CArrayFix<SButtonOptions>* iButtonOptions;
|
|
1410 |
CEikImage* iImage;
|
|
1411 |
/** Original mask for softkey image. */
|
|
1412 |
const CFbsBitmap* iMask;
|
|
1413 |
/** Feedback effects transparency mask for softkey image. */
|
|
1414 |
CFbsBitmap* iSfeMask;
|
|
1415 |
TBool iDoImage;
|
|
1416 |
/** ETrue if should use text bitmap mode. */
|
|
1417 |
TBool iUseTextBitmap;
|
|
1418 |
/** Buttons state. */
|
|
1419 |
TBool iPressedDown;
|
|
1420 |
};
|
|
1421 |
|
|
1422 |
/**
|
|
1423 |
* Specialization of CEikCbaButton for the new Enhanced CBA button.
|
|
1424 |
*
|
|
1425 |
* @lib eikcoctl.lib
|
|
1426 |
* @since S60 3.0
|
|
1427 |
*/
|
|
1428 |
class CEikEnhancedCbaButton : public CEikCbaButton
|
|
1429 |
{
|
|
1430 |
public:
|
|
1431 |
/**
|
|
1432 |
* Default constructor.
|
|
1433 |
*/
|
|
1434 |
CEikEnhancedCbaButton();
|
|
1435 |
|
|
1436 |
/**
|
|
1437 |
* Destructor.
|
|
1438 |
*/
|
|
1439 |
~CEikEnhancedCbaButton();
|
|
1440 |
|
|
1441 |
/**
|
|
1442 |
* Returns the command type for current button.
|
|
1443 |
*
|
|
1444 |
* @return The command type.
|
|
1445 |
*/
|
|
1446 |
TInt CommandType() const;
|
|
1447 |
|
|
1448 |
/**
|
|
1449 |
* Sets command type for current button.
|
|
1450 |
*
|
|
1451 |
* @param aCommandType Command type to be set.
|
|
1452 |
*/
|
|
1453 |
void SetCommandType(const TInt aCommandType);
|
|
1454 |
|
|
1455 |
/**
|
|
1456 |
* Returns the command id for current button.
|
|
1457 |
*
|
|
1458 |
* @return The command id.
|
|
1459 |
*/
|
|
1460 |
TInt CommandId() const;
|
|
1461 |
|
|
1462 |
/**
|
|
1463 |
* Constructs a button based on resource definition.
|
|
1464 |
*
|
|
1465 |
* @param aReader Resource reader for reading information from resource file.
|
|
1466 |
*/
|
|
1467 |
void ConstructFromResourceL(TResourceReader& aReader);
|
|
1468 |
|
|
1469 |
/**
|
|
1470 |
* Constructs empty button with id EAknSoftkeyEmpty.
|
|
1471 |
*/
|
|
1472 |
void ConstructEmptyButtonL();
|
|
1473 |
|
|
1474 |
/**
|
|
1475 |
* Used to get the label text for the button.
|
|
1476 |
*
|
|
1477 |
* @return Pointer to the label text.
|
|
1478 |
*/
|
|
1479 |
TPtrC* LabelText();
|
|
1480 |
|
|
1481 |
private: // data
|
|
1482 |
TInt iCommandType;
|
|
1483 |
TInt iCommandId;
|
|
1484 |
};
|
|
1485 |
|
|
1486 |
/**
|
|
1487 |
* Holds (enhanced) CBA commands and handles command ordering due to placement rules.
|
|
1488 |
*
|
|
1489 |
* @lib eikcoctl.lib
|
|
1490 |
* @since S60 3.0
|
|
1491 |
*
|
|
1492 |
* @internal
|
|
1493 |
*/
|
|
1494 |
NONSHARABLE_CLASS(CEikCommandTable) : public CBase
|
|
1495 |
{
|
|
1496 |
public:
|
|
1497 |
/**
|
|
1498 |
* Constructs a new command table instance.
|
|
1499 |
*
|
|
1500 |
* @return The new command table.
|
|
1501 |
*/
|
|
1502 |
static CEikCommandTable* NewL();
|
|
1503 |
|
|
1504 |
/**
|
|
1505 |
* Constructs a new command table instance.
|
|
1506 |
*
|
|
1507 |
* @return The new command table.
|
|
1508 |
*/
|
|
1509 |
static CEikCommandTable* NewLC();
|
|
1510 |
|
|
1511 |
/**
|
|
1512 |
* Destructor.
|
|
1513 |
*/
|
|
1514 |
~CEikCommandTable();
|
|
1515 |
|
|
1516 |
/**
|
|
1517 |
* Used to add a command to CommandTable.
|
|
1518 |
*
|
|
1519 |
* @param aButton The button to be added.
|
|
1520 |
* @return KErrNone if addition was successful.
|
|
1521 |
*/
|
|
1522 |
TInt AddCommandL(CEikEnhancedCbaButton* aButton);
|
|
1523 |
|
|
1524 |
/**
|
|
1525 |
* Used to check if command table has a button with a certain id.
|
|
1526 |
*
|
|
1527 |
* @param aCommandId The id to be checked.
|
|
1528 |
* @return ETrue if command is placed in the command table.
|
|
1529 |
*/
|
|
1530 |
TBool IsCommandPlaced(const TInt aCommandId) const;
|
|
1531 |
|
|
1532 |
/**
|
|
1533 |
* Used to replace command with a new command.
|
|
1534 |
*
|
|
1535 |
* @param aCommandId Id for command that should be replaced.
|
|
1536 |
* @param aResourceId Id for new ENHANCED_CBA_BUTTON resource to be placed in the
|
|
1537 |
* CommandTable.
|
|
1538 |
*/
|
|
1539 |
void ReplaceCommandL(const TInt aCommandId, const TInt aResourceId);
|
|
1540 |
|
|
1541 |
/**
|
|
1542 |
* Used to get CEikEnhancedCbaButton for current control button (1-4).
|
|
1543 |
*
|
|
1544 |
* @param aCommandIndex Index for requested button, use enum TCommandTableCbaPositions.
|
|
1545 |
* @return CEikCbaButton for current position, NULL if no button placed in that position.
|
|
1546 |
*/
|
|
1547 |
CEikEnhancedCbaButton* Command(const TInt aCommandIndex);
|
|
1548 |
|
|
1549 |
/**
|
|
1550 |
* Reset CommandTable.
|
|
1551 |
*/
|
|
1552 |
void Reset();
|
|
1553 |
|
|
1554 |
private: // member functions
|
|
1555 |
/**
|
|
1556 |
* Constructor.
|
|
1557 |
*/
|
|
1558 |
CEikCommandTable();
|
|
1559 |
|
|
1560 |
/**
|
|
1561 |
* Constructs command table with device button priorities.
|
|
1562 |
*/
|
|
1563 |
void ConstructL();
|
|
1564 |
|
|
1565 |
private: // data
|
|
1566 |
/** Displayed commands. */
|
|
1567 |
TFixedArray<CEikEnhancedCbaButton*, KMaxButtonsInCommandTable> iCommandButtons;
|
|
1568 |
|
|
1569 |
/** Priority order for each button. */
|
|
1570 |
RArray< RArray<TInt> > iPriorities;
|
|
1571 |
};
|
|
1572 |
|
|
1573 |
#endif // __EIKCBA_H__
|