Attempt to represent the S^2->S^3 header reorganisation as a series of "hg rename" operations
2 * Copyright (c) 2002-2007 Nokia Corporation and/or its subsidiary(-ies).
4 * This component and the accompanying materials are made available
5 * under the terms of the License "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members
6 * which accompanies this distribution, and is available
7 * at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
9 * Initial Contributors:
10 * Nokia Corporation - initial contribution.
14 * Description: EIKON button group container class definition.
19 #ifndef __EIKBTGPC_H__
20 #define __EIKBTGPC_H__
28 #include <akncontrol.h>
30 class MEikCommandObserver;
31 class CEikButtonGroupStack;
32 class CEikCommandButton;
36 * The CEikButtonGroupContainer class provides a wrapper around the different button arrays
37 * used in pen and no-pen devices.
42 NONSHARABLE_CLASS(CEikButtonGroupContainer) : public CAknControl, public MEikCommandObserver
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.
49 DECLARE_TYPE_ID(0x101F4107)
52 * Describes how the container is being used.
54 * The enumeration is used by the system to create the appropriate (UI variant-specific)
55 * button group for the specified type.
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.
67 * Describes the orientation of the container.
71 EVertical = SLafButtonGroupContainer::EVertical, ///< Buttons are laid out vertically.
72 EHorizontal = SLafButtonGroupContainer::EHorizontal ///< Buttons are laid out horizontally.
76 * Relative positions of the container and the control which uses it.
80 /** The button group is internal to the control which is using it. E.g. dialog buttons. */
81 EInternal = SLafButtonGroupContainer::EInternal,
83 /** The button group is external to the control which is using it. E.g. toolbar or cba. */
84 EExternal = SLafButtonGroupContainer::EExternal
88 * Flags for the display of hotkeys.
92 EShowHotKey = 0x01, ///< Hotkeys for commands should be shown.
93 EPlainHotKey = 0x02 ///< Hotkeys for commands should not be shown.
101 EAddToStack = 0x01, ///< Not used.
102 EDelayActivation = 0x02, ///< If set, the container is not activated during construction.
103 EUseMaxSize = 0x04 ///< Not used.
107 * Defines the positions for each command.
109 enum TCommandPosition
111 ELeftSoftkeyPosition = 0, ///< Position for left softkey.
112 ERightSoftkeyPosition = 2, ///< Position for right softkey.
113 EMiddleSoftkeyPosition = 3 ///< Position for middle softkey.
118 * Creates a button group container in its own window.
120 * @param aUse The button group's type.
121 * @param aOrientation The button group's orientation. You need specify this
122 * only for devices that can layout their buttons either
123 * horizontally or vertically.
124 * @param aCommandObserver A command observer to be notified of commands on
126 * @param aResourceId A resource containing descriptions of buttons in the group.
127 * This can be NULL if buttons are to be added dynamically.
128 * @param aFlags The button group's flags.
129 * @return Button group container object.
131 IMPORT_C static CEikButtonGroupContainer* NewL(
133 TOrientation aOrientation,
134 MEikCommandObserver* aCommandObserver,
136 TUint aFlags = EAddToStack);
139 * Creates a button group container in its parent control's window.
141 * @param aUse The button group's type.
142 * @param aOrientation The button group's orientation. You need specify this
143 * only for devices that can layout their buttons either
144 * horizontally or vertically.
145 * @param aCommandObserver A command observer to be notified of commands on
147 * @param aResourceId A resource containing descriptions of buttons in the group.
148 * This can be NULL if buttons are to be added dynamically.
149 * @param aParent The control's parent.
150 * @param aFlags The button group's flags.
151 * @return Button group container object.
153 IMPORT_C static CEikButtonGroupContainer* NewL(
155 TOrientation aOrientation,
156 MEikCommandObserver* aCommandObserver,
158 const CCoeControl& aParent,
159 TUint aFlags = EAddToStack);
162 * Creates a button group container in given window group.
164 * @param aUse The button group's type.
165 * @param aOrientation The button group's orientation. You need specify this
166 * only for devices that can layout their buttons either
167 * horizontally or vertically.
168 * @param aCommandObserver A command observer to be notified of commands on
170 * @param aResourceId A resource containing descriptions of buttons in the group.
171 * This can be NULL if buttons are to be added dynamically.
172 * @param aParentWg The parent window group.
173 * @param aFlags The button group's flags.
174 * @return Button group container object.
176 IMPORT_C static CEikButtonGroupContainer* NewL(
178 TOrientation aOrientation,
179 MEikCommandObserver* aCommandObserver,
181 RWindowGroup& aParentWg,
182 TUint aFlags = EAddToStack);
187 IMPORT_C ~CEikButtonGroupContainer();
190 * Gets a pointer to an application's currently active CEikButtonGroupContainer (if any).
192 * Returns NULL if there are no containers active or none suitable for sharing.
193 * Ownership of the returned pointer is not transferred.
195 * @return Pointer to the button group container.
197 IMPORT_C static CEikButtonGroupContainer* Current();
201 * Sets a command button's text label and command ID.
203 * @param aPosition The position within the button group of the button to change.
204 * If the position is out of range this function raises a panic.
205 * @param aCommandId Command ID the button will send.
206 * @param aText Text for the button.
208 inline void SetCommandL(
214 * Sets a command button's bitmap and command ID.
216 * @param aPosition The position within the button group of the button to change.
217 * If the position is out of range this function raises a panic.
218 * @param aCommandId Command ID the button will send.
219 * @param aBitmap The bitmap for the button.
220 * @param aMask The mask bitmap for aBitmap.
222 inline void SetCommandL(
225 const CFbsBitmap& aBitmap,
226 const CFbsBitmap& aMask);
229 * Sets a command button's bitmap, text and command ID.
231 * @param aPosition The position within the button group of the button to change.
232 * If the position is out of range, the function raises a panic.
233 * @param aCommandId Command ID the button will send.
234 * @param aText The text for the button.
235 * @param aBitmap The bitmap for the button.
236 * @param aMask The mask bitmap for aBitmap.
238 inline void SetCommandL(
242 const CFbsBitmap& aBitmap,
243 const CFbsBitmap& aMask);
246 * Sets a command button's bitmap and command ID. The bitmap and its mask are read
249 * @param aPosition The position within the button group of the button to change.
250 * If the position is out of range, the function raises a panic.
251 * @param aCommandId Command ID the button will send.
252 * @param aFile A multi-bitmap file, containing mask and bitmap images.
253 * @param aBitmapId ID of the bitmap within aFile.
254 * @param aMaskId ID of the mask within aFile.
256 inline void SetCommandL(
264 * Sets a command button's bitmap, text label and command ID. The bitmap and its
265 * mask are read from a file.
267 * @param aPosition The position within the button group of the button to change.
268 * If the position is out of range, the function raises a panic.
269 * @param aCommandId Command ID the button will send.
270 * @param aText The text for the button.
271 * @param aFile A multi-bitmap file, containing mask and bitmap images.
272 * @param aBitmapId ID of the bitmap within aFile.
273 * @param aMaskId ID of the mask within aFile.
275 inline void SetCommandL(
284 * Sets a command button's bitmap, text label and command ID. The bitmap, mask,
285 * text and command ID are all read from resource.
287 * @param aPosition The position within the button group of the button to change.
288 * If the position is out of range, the function raises a panic.
289 * @param aResourceId Resource ID specifying the text, bitmaps and command ID.
291 inline void SetCommandL(
296 * Sets a command button's text. The button to change is identified by its command ID.
298 * @param aCommandId Command ID of the button to change.
299 * @param aText The text for the button.
300 * @leave KErrNotFound The ID cannot be matched to any button.
302 inline void SetCommandL(
307 * Sets a command button's bitmap and mask. The button to change is identified
310 * @param aCommandId Command ID of the button to change.
311 * @param aBitmap Bitmap for the button.
312 * @param aMask Mask bitmap for aBitmap.
313 * @leave KErrNotFound The ID cannot be matched to any button.
315 inline void SetCommandL(
317 const CFbsBitmap& aBitmap,
318 const CFbsBitmap& aMask);
321 * Sets a command button's bitmap, mask and text. The button to change is
322 * identified by its command ID.
324 * @param aCommandId Command ID of the button to change.
325 * @param aText Text for the button.
326 * @param aBitmap Bitmap for the button.
327 * @param aMask Mask bitmap for aBitmap.
329 inline void SetCommandL(
332 const CFbsBitmap& aBitmap,
333 const CFbsBitmap& aMask);
336 * Sets a command button's bitmap and mask. The bitmap and mask are read from
337 * a multi bitmap file. The button to change is identified by its command ID.
339 * @param aCommandId Command ID of the button to change.
340 * @param aFile A multi-bitmap file, containing mask and bitmap images.
341 * @param aBitmapId ID of the bitmap within aFile.
342 * @param aMaskId ID of the mask within aFile.
344 inline void SetCommandL(
351 * Sets a command button's bitmap, mask and text. The bitmap and its mask are read
352 * from a multi bitmap file. The button to change is identified by its command ID.
354 * @param aCommandId Command ID of the button to change.
355 * @param aText Text for the button.
356 * @param aFile A multi-bitmap file, containing mask and bitmap images.
357 * @param aBitmapId ID of the bitmap within aFile.
358 * @param aMaskId ID of the mask within aFile.
360 inline void SetCommandL(
368 * Initialises the group of command buttons from a resource.
370 * @param aResourceId ID of the resource structure specifying the command buttons.
372 IMPORT_C void SetCommandSetL(
376 * Adds a command button with a text label and command ID.
378 * @param aPosition The position in the button group for the new button.
379 * @param aCommandId Command ID for the new button.
380 * @param aText Text for the button.
382 inline void AddCommandL(
388 * Adds a command button with a bitmap label and command ID.
390 * @param aPosition The position in the button group for the new button.
391 * @param aCommandId Command ID for the new button.
392 * @param aBitmap Bitmap for the button.
393 * @param aMask Mask bitmap for aBitmap.
395 inline void AddCommandL(
398 const CFbsBitmap& aBitmap,
399 const CFbsBitmap& aMask);
402 * Adds a command button with a command ID and a label containing both
405 * @param aPosition The position in the button group for the new button.
406 * @param aCommandId Command ID for the new button.
407 * @param aText Text for the button.
408 * @param aBitmap Bitmap for the button.
409 * @param aMask Mask bitmap for aBitmap.
411 inline void AddCommandL(
415 const CFbsBitmap& aBitmap,
416 const CFbsBitmap& aMask);
419 * Adds a command button with a command ID and a bitmap which is read from a file.
421 * @param aPosition The position in the button group for the new button.
422 * @param aCommandId Command ID for the new button.
423 * @param aFile Multi-bitmap file containing the bitmap and mask.
424 * @param aBitmapId ID of the bitmap within aFile.
425 * @param aMaskId ID of the mask within aFile.
427 inline void AddCommandL(
435 * Adds a command button with a command ID and a label containing both a bitmap
436 * and text. The bitmap and mask are read from file.
438 * @param aPosition The position in the button group for the new button.
439 * @param aCommandId Command ID for the new button.
440 * @param aText Text for the button.
441 * @param aFile Multi-bitmap file containing the bitmap and mask.
442 * @param aBitmapId ID of the bitmap within aFile.
443 * @param aMaskId ID of the mask within aFile.
445 inline void AddCommandL(
454 * Pushes a command button with a text label and command ID onto a position's
455 * button stack. This function behaves similarly to SetCommandL() but allows
456 * the previous command button to be retrieved by calling RemoveCommandFromStack().
458 * @param aPosition The position in the button group at which to add the command button.
459 * @param aCommandId Command ID the button will send.
460 * @param aText Text for the button.
462 inline void AddCommandToStackL(
468 * Pushes a command button with a bitmap, mask and command ID onto a position's
469 * button stack. This function behaves similarly to SetCommandL() but allows the
470 * previous command button to be retrieved by calling RemoveCommandFromStack().
472 * @param aPosition The position in the button group at which to add the command button.
473 * @param aCommandId Command ID the button will send.
474 * @param aBitmap Bitmap for the button.
475 * @param aMask Mask bitmap for aBitmap.
477 inline void AddCommandToStackL(
480 const CFbsBitmap& aBitmap,
481 const CFbsBitmap& aMask);
484 * Pushes a command button with text, bitmap, mask and a command ID onto a position's
485 * button stack. This function behaves similarly to SetCommandL() but allows the
486 * previous command button to be retrieved by calling RemoveCommandFromStack().
488 * @param aPosition The position in the button group at which to add the command button.
489 * @param aCommandId Command ID the button will send.
490 * @param aText Text for the button.
491 * @param aBitmap Bitmap for the button.
492 * @param aMask Mask bitmap for aBitmap.
494 inline void AddCommandToStackL(
498 const CFbsBitmap& aBitmap,
499 const CFbsBitmap& aMask);
502 * Pushes a command button with a bitmap, mask and command ID onto a position's button
503 * stack. The bitmap and mask are read from a file. This function behaves similarly to
504 * SetCommandL() but allows the previous command button to be retrieved by calling
505 * RemoveCommandFromStack().
507 * @param aPosition The position in the button group at which to add the command button.
508 * @param aCommandId Command ID the button will send.
509 * @param aFile A multi-bitmap file containing mask and bitmap.
510 * @param aBitmapId Index into the file of the bitmap.
511 * @param aMaskId Index into the file of the bitmap mask.
513 inline void AddCommandToStackL(
521 * Pushes a command button with text, bitmap, mask and command button onto a position's
522 * button stack. The bitmap and mask are read from a file. This function behaves similarly
523 * to SetCommandL() but allows the previous command button to be retrieved by calling
524 * RemoveCommandFromStack().
526 * @param aPosition The position in the button group at which to push the command button.
527 * @param aCommandId Command ID the button will send.
528 * @param aText Text for the button.
529 * @param aFile A multi-bitmap file containing mask and bitmap.
530 * @param aBitmapId Index into the file of the bitmap.
531 * @param aMaskId Index into the file of the bitmap mask.
533 inline void AddCommandToStackL(
542 * Pushes a command button onto a position's button stack. The text, bitmap, mask and
543 * command ID are all read from resource. This function behaves similarly to
544 * SetCommandL() but allows the previous command button to be retrieved by calling
545 * RemoveCommandFromStack().
547 * @param aPosition The position in the button group at which to push the command button.
548 * @param aResourceId ID of a resource specifying the text, bitmaps and command ID.
550 inline void AddCommandToStackL(
555 * As with SetCommandL() but for a set of buttons, also allows the previous command
556 * button to be retrieved by calling RemoveCommand().
558 * @param aResourceId Resource describing the set of command buttons.
560 IMPORT_C void AddCommandSetToStackL(
564 * Removes the command identified by aCommandId, in position aPosition in the group,
565 * from the command stack. Automatically retrieves the previous command details.
566 * Commands are added to the stack by calling AddCommandToStackL.
568 * @param aPosition The position in the button group from which to remove the
570 * @param aCommandId Command ID.
572 IMPORT_C void RemoveCommandFromStack(TInt aPosition, TInt aCommandId);
575 * Sets the default command ID for buttons in this container.
577 * @param aCommandId Command to issue if no other is specified.
579 IMPORT_C void SetDefaultCommand(TInt aCommandId);
582 * Calculates minimum size required to display the buttons defined in the specified
583 * resource structure.
585 * @param aResourceId The ID of the resource structure describing the button group.
586 * @return Minimum size required to display the button group defined in the specified resource structure.
588 IMPORT_C TSize CalcMinimumSizeL(TInt aResourceId) const;
591 * Places the command in position aPosition in the group on the cleanup stack. Typically
592 * used when a control or view changes the contents of two or more buttons on receipt of
593 * focus. After altering one command with a call to AddCommandToStackL() the push is made
594 * to guarantee the display will be left in a consistent state if the second (and any
595 * subsequent) calls to AddCommandToStackL() fail. Only a single command can be pushed
598 * @param aPosition Position in the container of the button to push.
600 IMPORT_C void CleanupCommandPushL(TInt aPosition);
603 * Removes a command from the cleanup stack without destroying it.
605 inline void CleanupCommandPop();
608 * Removes one or more commands from the cleanup stack without destroying them.
610 * @param aCount Number of commands to pop.
612 IMPORT_C void CleanupCommandPop(TInt aCount);
615 * Removes a single command which was pushed onto the cleanup stack. It does this by
616 * calling CleanupCommandPushL(), rolling back to the previous details. The command
617 * button popped is destroyed.
619 inline void CleanupCommandPopAndDestroy();
622 * Removes one or more commands which were pushed onto the cleanup stack. It does this
623 * by calling CleanupCommandPushL(), rolling back to the previous details. The command
624 * buttons popped are destroyed.
626 * @param aCount Number of commands to pop and destroy.
628 inline void CleanupCommandPopAndDestroy(TInt aCount);
631 * Gets the maximum number of buttons that can be supported by the device.
633 * @return The number of command buttons supported.
635 IMPORT_C TInt MaxCommands() const;
638 * Gets the total number of buttons currently present in the group.
640 * @return The number of buttons.
642 IMPORT_C TInt ButtonCount() const;
645 * Dims (but doesn't draw) the button with id aCommandId if aDimmed is ETrue. If two
646 * buttons have the same id, the button to be dimmed is undefined.
648 * @param aCommandId The id for command to be dimmed.
649 * @param aDimmed ETrue for dimming.
651 IMPORT_C void DimCommand(TInt aCommandId, TBool aDimmed);
654 * Returns ETrue if the button with id aCommandId is dimmed. If two buttons have
655 * the same id, the results of this check are undefined.
657 * @param aCommandId The id for command to be checked.
658 * @return The state of the button.
660 IMPORT_C TBool IsCommandDimmed(TInt aCommandId) const;
663 * Sets the the button with id aCommandId to be visible if aVisible is ETrue. If two
664 * buttons have the same id, the button to be altered is undefined.
666 * @param aCommandId The id for command to be made visible.
667 * @param aVisible EFalse for making button invisible.
669 IMPORT_C void MakeCommandVisible(TInt aCommandId, TBool aVisible);
672 * Returns ETrue if the button with id aCommandId is visible. If two buttons have
673 * the same id, the results are undefined.
675 * @param aCommandId The id for command to be checked.
676 * @return The state of the button.
678 IMPORT_C TBool IsCommandVisible(TInt aCommandId) const;
681 * Animates the button with id aCommandId. If two buttons have the same id, the
682 * button to be animated is undefined.
685 * @param aCommandId The id for command to be animated.
687 IMPORT_C void AnimateCommand(TInt aCommandId);
690 * Dims (but doesn't draw) the button with position aPosition.
693 * @param aPosition The position for command to be dimmed.
694 * @param aDimmed ETrue for dimming.
696 IMPORT_C void DimCommandByPosition(TCommandPosition aPosition, TBool aDimmed);
699 * Returns ETrue if the button with position aPosition is dimmed.
702 * @param aPosition The position for command to be checked.
703 * @return The state of the button.
705 IMPORT_C TBool IsCommandDimmedByPosition(TCommandPosition aPosition) const;
708 * Sets the the button with position aPosition to be visible if aVisible is ETrue.
711 * @param aPosition The position for command to be made visible.
712 * @param aVisible EFalse for making button invisible.
714 IMPORT_C void MakeCommandVisibleByPosition(TCommandPosition aPosition, TBool aVisible);
717 * Returns ETrue if the button with position aPosition is visible.
720 * @param aPosition The position for command to be checked.
721 * @return The state of the button.
723 IMPORT_C TBool IsCommandVisibleByPosition(TCommandPosition aPosition) const;
726 * Animates the button with position aPosition.
729 * @param aPosition The position for command to be animated.
731 IMPORT_C void AnimateCommandByPosition(TCommandPosition aPosition);
734 * Gets the button group's location. Typically the button group is external to the
735 * view which is using it. In some cases, such as in dialogs with button panels,
736 * the button group is internal to the control which is using it.
738 * @return The button group's location.
740 IMPORT_C TLocation Location() const;
743 * Gets a pointer to the command button with the specified command Id.
745 * @param aCommandId Command ID of the button.
746 * @return Pointer to the command button CEikCommandButton, NULL if there
747 * was no button with Id aCommandId.
749 IMPORT_C CEikCommandButton* CommandButtonOrNull(TInt aCommandId) const;
752 * Sets the boundary rectangle for externally-positioned button groups.
753 * For use by EExternal button groups only.
755 * @param aRect The boundary rectangle to use. The button group attaches
756 * itself to the inside of this rectangle.
758 IMPORT_C void SetBoundingRect(const TRect& aRect);
761 * Subtracts the area occupied by the button group from the specified bounding
762 * rectangle. This method should be used in preference to querying the container's
763 * area at all times. For use by EExternal button groups only.
765 * @param aBoundingRect Rectangle to be modified.
767 IMPORT_C void ReduceRect(TRect& aBoundingRect) const;
770 * Gets a pointer to the control (button) with the specified command ID.
771 * This method is intended to allow access to standard CCoeControl functionality
772 * only. Casting the return value is likely to fail on different devices.
774 * @param aCommandId Command ID of the button to get.
775 * @return Pointer to a CCoeControl, NULL if there was no button at aCommandId.
777 IMPORT_C CCoeControl* ControlOrNull(TInt aCommandId) const;
780 * Gets a pointer to the the button with the specified command Id.
782 * @param aCommandId Command ID of the button to obtain.
783 * @return The button object.
785 IMPORT_C CEikCommandButton* ButtonById(TInt aCommandId) const;
788 * Gets the position in the group of the button with the specified command Id.
789 * The return value is undefined if two buttons share the same id.
791 * @param aCommandId Identifies the command.
792 * @return The command's container position.
794 IMPORT_C TInt PositionById(TInt aCommandId) const;
797 * Updates a command's hotkey and whether the key is displayed.
798 * This function is only supported by containers being used for dialog buttons.
800 * @param aCommandId Identifies the command to update.
801 * @param aFlags Whether to display the hotkey.
802 * @param aKeyId Hotkey identifier.
804 IMPORT_C void UpdateHotKey(TInt aCommandId, THotKeyFlags aFlags, TInt aKeyId);
807 * Changes the command observer for the button at aPos to aCommandObserver.
808 * Panics if an updated observer is already present. This function should be followed
809 * by RemoveCommandObserver() when you need to put back the original observer.
811 * @param aPos The button's position.
812 * @param aCommandObserver The command observer.
814 IMPORT_C void UpdateCommandObserverL(TInt aPos, MEikCommandObserver& aCommandObserver);
817 * Removes the temporary observer for the button at aPos, replacing it with the
818 * observer that was present when UpdateCommandObserverL() was called.
820 * @param aPos The button's position.
822 IMPORT_C void RemoveCommandObserver(TInt aPos);
825 * Checks for existence of updated command observer for the button at aPosition.
828 * @param aPosition The position for button to be checked.
829 * @return ETrue, if updated command observer exists.
831 IMPORT_C TBool UpdatedCommandObserverExists(TCommandPosition aPosition) const;
834 * Tests whether the button group has explicitly been instructed to suppress redraws.
835 * Some button groups may not activate themselves during construction, in which
836 * case, they need to be activated by the client. This method allows the client
837 * to enquire whether this is necessary.
839 * @return ETrue if the button group will suppress redraws, otherwise EFalse.
841 IMPORT_C TBool DelayActivation() const;
844 * Returns the container's button group.
846 * @return Pointer to the button group object. Ownership is not transferred.
848 inline MEikButtonGroup* ButtonGroup();
851 * Returns the button group type.
853 * @return The button group type.
855 inline TUse ButtonGroupType();
858 * Internal method for setting markable list's MSK observer.
859 * This observer is called before default CBA observer if MSK is pressed.
860 * Observer is removed by passing NULL as parameter.
863 * @param aMSKObserverOwner
864 * @param aCommandObserver
866 void UpdateMSKCommandObserver(
867 CEikListBox* aMSKObserverOwner,
868 MEikCommandObserver* aCommandObserver);
870 public: // From CCoeControl.
873 * Gets the control's minimum required size.
875 * @return The minimum size required by the control.
877 IMPORT_C TSize MinimumSize();
881 * Handles key events.
883 * @param aKeyEvent The key event.
884 * @param aType The type of key event: EEventKey, EEventKeyUp or EEventKeyDown.
885 * @return Indicates whether or not the key event was used by this control.
887 IMPORT_C TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent, TEventCode aType);
891 * Sets this control as visible or invisible.
893 * @param aVisible ETrue to make the control visible, EFalse to make it invisible.
895 void MakeVisible(TBool aVisible);
899 * Writes the internal state of the control and its components to aStream.
900 * Does nothing in release mode.
902 * @param aWriteStream The output stream.
904 IMPORT_C void WriteInternalStateL(RWriteStream& aWriteStream) const;
908 * Formerly from MTopSetMember<CEikButtonGroupContainer>, now reserved.
910 IMPORT_C virtual void Reserved_MtsmPosition();
913 * Formerly from MTopSetMember<CEikButtonGroupContainer>, now reserved.
915 IMPORT_C virtual void Reserved_MtsmObject();
917 public: // New functions for enhanced cba support.
919 * Used to offer list of commands for softkeys.
922 * @param aCommandList A list of command ids to be offered for softkeys.
924 IMPORT_C void OfferCommandListL(const RArray<TInt>& aCommandList);
927 * Used to offer list of commands for softkeys.
930 * @param aResourceId Id for CBA resource that defines enhanced cba buttons.
932 IMPORT_C void OfferCommandListL(const TInt aResourceId);
935 * Used to check if a certain command have been approved to the current command set
938 * @param aCommandId The id for command which existence should be checked.
939 * @return ETrue if command is in control group, otherwise EFalse.
941 IMPORT_C TBool IsCommandInGroup(const TInt aCommandId) const;
944 * Replaces command with another.
947 * @param aCommandId Id for command that should be replaced.
948 * @param aResourceId Resource id for new enhanced cba button.
950 IMPORT_C void ReplaceCommand(const TInt aCommandId, const TInt aResourceId);
953 enum TCommandOp {ESet, EAdd, EPush};
960 inline TCmdPos(TInt aPos, TInt aCmd);
969 inline TCmdObserver(TInt aPos, MEikCommandObserver& aObserver);
972 MEikCommandObserver& iObserver;
975 class CCmdObserverArray : public CArrayFixFlat<TCmdObserver>
978 inline CCmdObserverArray();
979 TInt FindIndex(TInt aPos);
983 CEikButtonGroupContainer(TUse aUse);
986 TOrientation aOrientation,
987 MEikCommandObserver* aCommandObserver,
989 RWindowGroup* aParentWg,
992 IMPORT_C void DoSetCommandL(
996 const CFbsBitmap* aBitmap,
997 const CFbsBitmap* aMask,
1000 IMPORT_C void DoSetCommandL(
1009 IMPORT_C void DoSetCommandL(
1012 const CFbsBitmap* aBitmap,
1013 const CFbsBitmap* aMask,
1016 IMPORT_C void DoSetCommandL(
1024 IMPORT_C void DoSetCommandL(
1029 inline CCoeControl* ButtonGroupAsControl() const;
1031 static void CleanupCommandDestroy(TAny* aPtr);
1032 TCmdPos DoCleanupCommandPop();
1033 void DoCleanupCommandPopAndDestroy();
1035 private: // from CCoeControl
1036 TInt CountComponentControls() const;
1037 CCoeControl* ComponentControl(TInt aIndex) const;
1040 private: // from MEikCommandObserver
1041 void ProcessCommandL(TInt aCommandId);
1042 CCoeControl* CreateCustomCommandControlL(TInt aControlType);
1045 MEikButtonGroup* iButtonGroup;
1047 CArrayFix<TCmdPos>* iCommandsCleanup;
1048 MEikCommandObserver* iCommandObserver;
1049 CCmdObserverArray* iObserverArray;
1050 TDblQueLink iBtLink;
1051 CEikListBox* iMSKObserverOwner;
1055 friend class CCmdObserverArray;
1056 friend class CEikButtonGroupStack;
1060 // Inline function implementations.
1062 inline void CEikButtonGroupContainer::SetCommandL(
1067 DoSetCommandL(aPosition, aCommandId, &aText, NULL, NULL, ESet);
1070 inline void CEikButtonGroupContainer::SetCommandL(
1073 const CFbsBitmap& aBitmap,
1074 const CFbsBitmap& aMask)
1076 DoSetCommandL(aPosition, aCommandId, NULL, &aBitmap, &aMask, ESet);
1079 inline void CEikButtonGroupContainer::SetCommandL(
1083 const CFbsBitmap& aBitmap,
1084 const CFbsBitmap& aMask)
1086 DoSetCommandL(aPosition, aCommandId, &aText, &aBitmap, &aMask, ESet);
1089 inline void CEikButtonGroupContainer::SetCommandL(
1096 DoSetCommandL(aPosition, aCommandId, NULL, aFile, aBitmapId, aMaskId, ESet);
1099 inline void CEikButtonGroupContainer::SetCommandL(
1107 DoSetCommandL(aPosition, aCommandId, &aText, aFile, aBitmapId, aMaskId, ESet);
1110 inline void CEikButtonGroupContainer::SetCommandL(
1114 DoSetCommandL(aPosition, aResourceId, ESet);
1117 inline void CEikButtonGroupContainer::SetCommandL(
1121 DoSetCommandL(aCommandId, &aText, NULL, NULL, ESet);
1124 inline void CEikButtonGroupContainer::SetCommandL(
1126 const CFbsBitmap& aBitmap,
1127 const CFbsBitmap& aMask)
1129 DoSetCommandL(aCommandId, NULL, &aBitmap, &aMask, ESet);
1132 inline void CEikButtonGroupContainer::SetCommandL(
1135 const CFbsBitmap& aBitmap,
1136 const CFbsBitmap& aMask)
1138 DoSetCommandL(aCommandId, &aText, &aBitmap, &aMask, ESet);
1141 inline void CEikButtonGroupContainer::SetCommandL(
1147 DoSetCommandL(aCommandId, NULL, aFile, aBitmapId, aMaskId, ESet);
1150 inline void CEikButtonGroupContainer::SetCommandL(
1157 DoSetCommandL(aCommandId, &aText, aFile, aBitmapId, aMaskId, ESet);
1160 inline void CEikButtonGroupContainer::AddCommandL(
1165 DoSetCommandL(aPosition, aCommandId, &aText, NULL, NULL, EAdd);
1168 inline void CEikButtonGroupContainer::AddCommandL(
1171 const CFbsBitmap& aBitmap,
1172 const CFbsBitmap& aMask)
1174 DoSetCommandL(aPosition, aCommandId, NULL, &aBitmap, &aMask, EAdd);
1177 inline void CEikButtonGroupContainer::AddCommandL(
1181 const CFbsBitmap& aBitmap,
1182 const CFbsBitmap& aMask)
1184 DoSetCommandL(aPosition, aCommandId, &aText, &aBitmap, &aMask, EAdd);
1187 inline void CEikButtonGroupContainer::AddCommandL(
1194 DoSetCommandL(aPosition, aCommandId, NULL, aFile, aBitmapId, aMaskId, EAdd);
1197 inline void CEikButtonGroupContainer::AddCommandL(
1205 DoSetCommandL(aPosition, aCommandId, &aText, aFile, aBitmapId, aMaskId, EAdd);
1208 inline void CEikButtonGroupContainer::AddCommandToStackL(
1213 DoSetCommandL(aPosition, aCommandId, &aText, NULL, NULL, EPush);
1216 inline void CEikButtonGroupContainer::AddCommandToStackL(
1219 const CFbsBitmap& aBitmap,
1220 const CFbsBitmap& aMask)
1222 DoSetCommandL(aPosition, aCommandId, NULL, &aBitmap, &aMask, EPush);
1225 inline void CEikButtonGroupContainer::AddCommandToStackL(
1229 const CFbsBitmap& aBitmap,
1230 const CFbsBitmap& aMask)
1232 DoSetCommandL(aPosition, aCommandId, &aText, &aBitmap, &aMask, EPush);
1235 inline void CEikButtonGroupContainer::AddCommandToStackL(
1242 DoSetCommandL(aPosition, aCommandId, NULL, aFile, aBitmapId, aMaskId, EPush);
1245 inline void CEikButtonGroupContainer::AddCommandToStackL(
1253 DoSetCommandL(aPosition, aCommandId, &aText, aFile, aBitmapId, aMaskId, EPush);
1256 inline void CEikButtonGroupContainer::AddCommandToStackL(
1260 DoSetCommandL(aPosition, aResourceId, EPush);
1263 inline void CEikButtonGroupContainer::CleanupCommandPop()
1265 CleanupCommandPop(1);
1268 inline void CEikButtonGroupContainer::CleanupCommandPopAndDestroy()
1270 CleanupStack::PopAndDestroy();
1273 inline void CEikButtonGroupContainer::CleanupCommandPopAndDestroy(TInt aCount)
1275 CleanupStack::PopAndDestroy(aCount);
1278 inline MEikButtonGroup* CEikButtonGroupContainer::ButtonGroup()
1280 return iButtonGroup;
1283 inline CEikButtonGroupContainer::TUse CEikButtonGroupContainer::ButtonGroupType()
1288 #endif // __EIKBTGPC_H__