williamr@2: /* williamr@2: * Copyright (c) 2002-2007 Nokia Corporation and/or its subsidiary(-ies). williamr@2: * All rights reserved. williamr@2: * This component and the accompanying materials are made available williamr@2: * under the terms of the License "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members williamr@2: * which accompanies this distribution, and is available williamr@2: * at the URL "http://www.symbianfoundation.org/legal/licencesv10.html". williamr@2: * williamr@2: * Initial Contributors: williamr@2: * Nokia Corporation - initial contribution. williamr@2: * williamr@2: * Contributors: williamr@2: * williamr@2: * Description: EIKON button group container class definition. williamr@2: * williamr@2: */ williamr@2: williamr@2: williamr@2: #ifndef __EIKBTGPC_H__ williamr@2: #define __EIKBTGPC_H__ williamr@2: williamr@2: #include williamr@2: #include williamr@2: #include williamr@2: #include williamr@2: #include williamr@2: williamr@2: #include williamr@2: williamr@2: class MEikCommandObserver; williamr@2: class CEikButtonGroupStack; williamr@2: class CEikCommandButton; williamr@2: class CEikListBox; williamr@2: williamr@2: /** williamr@2: * The CEikButtonGroupContainer class provides a wrapper around the different button arrays williamr@2: * used in pen and no-pen devices. williamr@2: * williamr@2: * @lib eikcoctl.lib williamr@2: * @since S60 0.9 williamr@2: */ williamr@2: NONSHARABLE_CLASS(CEikButtonGroupContainer) : public CAknControl, public MEikCommandObserver williamr@2: { williamr@2: public: williamr@2: /** williamr@2: * Declares an object type for a class, in order to allow the object williamr@2: * provider mechanism to locate and provide objects from the class. williamr@2: */ williamr@2: DECLARE_TYPE_ID(0x101F4107) williamr@2: williamr@2: /** williamr@2: * Describes how the container is being used. williamr@2: * williamr@2: * The enumeration is used by the system to create the appropriate (UI variant-specific) williamr@2: * button group for the specified type. williamr@2: */ williamr@2: enum TUse williamr@2: { williamr@2: EView = SLafButtonGroupContainer::EView, ///< In a view. williamr@2: EDialog = SLafButtonGroupContainer::EDialog, ///< In a dialog. williamr@2: EToolbar = SLafButtonGroupContainer::EToolbar, ///< In a toolbar. williamr@2: ECba = SLafButtonGroupContainer::ECba, ///< In a control button array. williamr@2: EDialogButtons = SLafButtonGroupContainer::EDialogButtons ///< In dialog buttons. williamr@2: }; williamr@2: williamr@2: /** williamr@2: * Describes the orientation of the container. williamr@2: */ williamr@2: enum TOrientation williamr@2: { williamr@2: EVertical = SLafButtonGroupContainer::EVertical, ///< Buttons are laid out vertically. williamr@2: EHorizontal = SLafButtonGroupContainer::EHorizontal ///< Buttons are laid out horizontally. williamr@2: }; williamr@2: williamr@2: /** williamr@2: * Relative positions of the container and the control which uses it. williamr@2: */ williamr@2: enum TLocation williamr@2: { williamr@2: /** The button group is internal to the control which is using it. E.g. dialog buttons. */ williamr@2: EInternal = SLafButtonGroupContainer::EInternal, williamr@2: williamr@2: /** The button group is external to the control which is using it. E.g. toolbar or cba. */ williamr@2: EExternal = SLafButtonGroupContainer::EExternal williamr@2: }; williamr@2: williamr@2: /** williamr@2: * Flags for the display of hotkeys. williamr@2: */ williamr@2: enum THotKeyFlags williamr@2: { williamr@2: EShowHotKey = 0x01, ///< Hotkeys for commands should be shown. williamr@2: EPlainHotKey = 0x02 ///< Hotkeys for commands should not be shown. williamr@2: }; williamr@2: williamr@2: /** williamr@2: * Additional flags. williamr@2: */ williamr@2: enum TFlags williamr@2: { williamr@2: EAddToStack = 0x01, ///< Not used. williamr@2: EDelayActivation = 0x02, ///< If set, the container is not activated during construction. williamr@2: EUseMaxSize = 0x04 ///< Not used. williamr@2: }; williamr@2: williamr@2: /** williamr@2: * Defines the positions for each command. williamr@2: */ williamr@2: enum TCommandPosition williamr@2: { williamr@2: ELeftSoftkeyPosition = 0, ///< Position for left softkey. williamr@2: ERightSoftkeyPosition = 2, ///< Position for right softkey. williamr@2: EMiddleSoftkeyPosition = 3 ///< Position for middle softkey. williamr@2: }; williamr@2: williamr@2: public: williamr@2: /** williamr@2: * Creates a button group container in its own window. williamr@2: * williamr@2: * @param aUse The button group's type. williamr@2: * @param aOrientation The button group's orientation. You need specify this williamr@2: * only for devices that can layout their buttons either williamr@2: * horizontally or vertically. williamr@2: * @param aCommandObserver A command observer to be notified of commands on williamr@2: * the container. williamr@2: * @param aResourceId A resource containing descriptions of buttons in the group. williamr@2: * This can be NULL if buttons are to be added dynamically. williamr@2: * @param aFlags The button group's flags. williamr@2: * @return Button group container object. williamr@2: */ williamr@2: IMPORT_C static CEikButtonGroupContainer* NewL( williamr@2: TUse aUse, williamr@2: TOrientation aOrientation, williamr@2: MEikCommandObserver* aCommandObserver, williamr@2: TInt aResourceId, williamr@2: TUint aFlags = EAddToStack); williamr@2: williamr@2: /** williamr@2: * Creates a button group container in its parent control's window. williamr@2: * williamr@2: * @param aUse The button group's type. williamr@2: * @param aOrientation The button group's orientation. You need specify this williamr@2: * only for devices that can layout their buttons either williamr@2: * horizontally or vertically. williamr@2: * @param aCommandObserver A command observer to be notified of commands on williamr@2: * the container. williamr@2: * @param aResourceId A resource containing descriptions of buttons in the group. williamr@2: * This can be NULL if buttons are to be added dynamically. williamr@2: * @param aParent The control's parent. williamr@2: * @param aFlags The button group's flags. williamr@2: * @return Button group container object. williamr@2: */ williamr@2: IMPORT_C static CEikButtonGroupContainer* NewL( williamr@2: TUse aUse, williamr@2: TOrientation aOrientation, williamr@2: MEikCommandObserver* aCommandObserver, williamr@2: TInt aResourceId, williamr@2: const CCoeControl& aParent, williamr@2: TUint aFlags = EAddToStack); williamr@2: williamr@2: /** williamr@2: * Creates a button group container in given window group. williamr@2: * williamr@2: * @param aUse The button group's type. williamr@2: * @param aOrientation The button group's orientation. You need specify this williamr@2: * only for devices that can layout their buttons either williamr@2: * horizontally or vertically. williamr@2: * @param aCommandObserver A command observer to be notified of commands on williamr@2: * the container. williamr@2: * @param aResourceId A resource containing descriptions of buttons in the group. williamr@2: * This can be NULL if buttons are to be added dynamically. williamr@2: * @param aParentWg The parent window group. williamr@2: * @param aFlags The button group's flags. williamr@2: * @return Button group container object. williamr@2: */ williamr@2: IMPORT_C static CEikButtonGroupContainer* NewL( williamr@2: TUse aUse, williamr@2: TOrientation aOrientation, williamr@2: MEikCommandObserver* aCommandObserver, williamr@2: TInt aResourceId, williamr@2: RWindowGroup& aParentWg, williamr@2: TUint aFlags = EAddToStack); williamr@2: williamr@2: /** williamr@2: * Destructor. williamr@2: */ williamr@2: IMPORT_C ~CEikButtonGroupContainer(); williamr@2: williamr@2: /** williamr@2: * Gets a pointer to an application's currently active CEikButtonGroupContainer (if any). williamr@2: * williamr@2: * Returns NULL if there are no containers active or none suitable for sharing. williamr@2: * Ownership of the returned pointer is not transferred. williamr@2: * williamr@2: * @return Pointer to the button group container. williamr@2: */ williamr@2: IMPORT_C static CEikButtonGroupContainer* Current(); williamr@2: williamr@2: public: williamr@2: /** williamr@2: * Sets a command button's text label and command ID. williamr@2: * williamr@2: * @param aPosition The position within the button group of the button to change. williamr@2: * If the position is out of range this function raises a panic. williamr@2: * @param aCommandId Command ID the button will send. williamr@2: * @param aText Text for the button. williamr@2: */ williamr@2: inline void SetCommandL( williamr@2: TInt aPosition, williamr@2: TInt aCommandId, williamr@2: const TDesC& aText); williamr@2: williamr@2: /** williamr@2: * Sets a command button's bitmap and command ID. williamr@2: * williamr@2: * @param aPosition The position within the button group of the button to change. williamr@2: * If the position is out of range this function raises a panic. williamr@2: * @param aCommandId Command ID the button will send. williamr@2: * @param aBitmap The bitmap for the button. williamr@2: * @param aMask The mask bitmap for aBitmap. williamr@2: */ williamr@2: inline void SetCommandL( williamr@2: TInt aPosition, williamr@2: TInt aCommandId, williamr@2: const CFbsBitmap& aBitmap, williamr@2: const CFbsBitmap& aMask); williamr@2: williamr@2: /** williamr@2: * Sets a command button's bitmap, text and command ID. williamr@2: * williamr@2: * @param aPosition The position within the button group of the button to change. williamr@2: * If the position is out of range, the function raises a panic. williamr@2: * @param aCommandId Command ID the button will send. williamr@2: * @param aText The text for the button. williamr@2: * @param aBitmap The bitmap for the button. williamr@2: * @param aMask The mask bitmap for aBitmap. williamr@2: */ williamr@2: inline void SetCommandL( williamr@2: TInt aPosition, williamr@2: TInt aCommandId, williamr@2: const TDesC& aText, williamr@2: const CFbsBitmap& aBitmap, williamr@2: const CFbsBitmap& aMask); williamr@2: williamr@2: /** williamr@2: * Sets a command button's bitmap and command ID. The bitmap and its mask are read williamr@2: * from a file. williamr@2: * williamr@2: * @param aPosition The position within the button group of the button to change. williamr@2: * If the position is out of range, the function raises a panic. williamr@2: * @param aCommandId Command ID the button will send. williamr@2: * @param aFile A multi-bitmap file, containing mask and bitmap images. williamr@2: * @param aBitmapId ID of the bitmap within aFile. williamr@2: * @param aMaskId ID of the mask within aFile. williamr@2: */ williamr@2: inline void SetCommandL( williamr@2: TInt aPosition, williamr@2: TInt aCommandId, williamr@2: const TDesC& aFile, williamr@2: TInt aBitmapId, williamr@2: TInt aMaskId); williamr@2: williamr@2: /** williamr@2: * Sets a command button's bitmap, text label and command ID. The bitmap and its williamr@2: * mask are read from a file. williamr@2: * williamr@2: * @param aPosition The position within the button group of the button to change. williamr@2: * If the position is out of range, the function raises a panic. williamr@2: * @param aCommandId Command ID the button will send. williamr@2: * @param aText The text for the button. williamr@2: * @param aFile A multi-bitmap file, containing mask and bitmap images. williamr@2: * @param aBitmapId ID of the bitmap within aFile. williamr@2: * @param aMaskId ID of the mask within aFile. williamr@2: */ williamr@2: inline void SetCommandL( williamr@2: TInt aPosition, williamr@2: TInt aCommandId, williamr@2: const TDesC& aText, williamr@2: const TDesC& aFile, williamr@2: TInt aBitmapId, williamr@2: TInt aMaskId); williamr@2: williamr@2: /** williamr@2: * Sets a command button's bitmap, text label and command ID. The bitmap, mask, williamr@2: * text and command ID are all read from resource. williamr@2: * williamr@2: * @param aPosition The position within the button group of the button to change. williamr@2: * If the position is out of range, the function raises a panic. williamr@2: * @param aResourceId Resource ID specifying the text, bitmaps and command ID. williamr@2: */ williamr@2: inline void SetCommandL( williamr@2: TInt aPosition, williamr@2: TInt aResourceId); williamr@2: williamr@2: /** williamr@2: * Sets a command button's text. The button to change is identified by its command ID. williamr@2: * williamr@2: * @param aCommandId Command ID of the button to change. williamr@2: * @param aText The text for the button. williamr@2: * @leave KErrNotFound The ID cannot be matched to any button. williamr@2: */ williamr@2: inline void SetCommandL( williamr@2: TInt aCommandId, williamr@2: const TDesC& aText); williamr@2: williamr@2: /** williamr@2: * Sets a command button's bitmap and mask. The button to change is identified williamr@2: * by its command ID. williamr@2: * williamr@2: * @param aCommandId Command ID of the button to change. williamr@2: * @param aBitmap Bitmap for the button. williamr@2: * @param aMask Mask bitmap for aBitmap. williamr@2: * @leave KErrNotFound The ID cannot be matched to any button. williamr@2: */ williamr@2: inline void SetCommandL( williamr@2: TInt aCommandId, williamr@2: const CFbsBitmap& aBitmap, williamr@2: const CFbsBitmap& aMask); williamr@2: williamr@2: /** williamr@2: * Sets a command button's bitmap, mask and text. The button to change is williamr@2: * identified by its command ID. williamr@2: * williamr@2: * @param aCommandId Command ID of the button to change. williamr@2: * @param aText Text for the button. williamr@2: * @param aBitmap Bitmap for the button. williamr@2: * @param aMask Mask bitmap for aBitmap. williamr@2: */ williamr@2: inline void SetCommandL( williamr@2: TInt aCommandId, williamr@2: const TDesC& aText, williamr@2: const CFbsBitmap& aBitmap, williamr@2: const CFbsBitmap& aMask); williamr@2: williamr@2: /** williamr@2: * Sets a command button's bitmap and mask. The bitmap and mask are read from williamr@2: * a multi bitmap file. The button to change is identified by its command ID. williamr@2: * williamr@2: * @param aCommandId Command ID of the button to change. williamr@2: * @param aFile A multi-bitmap file, containing mask and bitmap images. williamr@2: * @param aBitmapId ID of the bitmap within aFile. williamr@2: * @param aMaskId ID of the mask within aFile. williamr@2: */ williamr@2: inline void SetCommandL( williamr@2: TInt aCommandId, williamr@2: const TDesC& aFile, williamr@2: TInt aBitmapId, williamr@2: TInt aMaskId); williamr@2: williamr@2: /** williamr@2: * Sets a command button's bitmap, mask and text. The bitmap and its mask are read williamr@2: * from a multi bitmap file. The button to change is identified by its command ID. williamr@2: * williamr@2: * @param aCommandId Command ID of the button to change. williamr@2: * @param aText Text for the button. williamr@2: * @param aFile A multi-bitmap file, containing mask and bitmap images. williamr@2: * @param aBitmapId ID of the bitmap within aFile. williamr@2: * @param aMaskId ID of the mask within aFile. williamr@2: */ williamr@2: inline void SetCommandL( williamr@2: TInt aCommandId, williamr@2: const TDesC& aText, williamr@2: const TDesC& aFile, williamr@2: TInt aBitmapId, williamr@2: TInt aMaskId); williamr@2: williamr@2: /** williamr@2: * Initialises the group of command buttons from a resource. williamr@2: * williamr@2: * @param aResourceId ID of the resource structure specifying the command buttons. williamr@2: */ williamr@2: IMPORT_C void SetCommandSetL( williamr@2: TInt aResourceId); williamr@2: williamr@2: /** williamr@2: * Adds a command button with a text label and command ID. williamr@2: * williamr@2: * @param aPosition The position in the button group for the new button. williamr@2: * @param aCommandId Command ID for the new button. williamr@2: * @param aText Text for the button. williamr@2: */ williamr@2: inline void AddCommandL( williamr@2: TInt aPosition, williamr@2: TInt aCommandId, williamr@2: const TDesC& aText); williamr@2: williamr@2: /** williamr@2: * Adds a command button with a bitmap label and command ID. williamr@2: * williamr@2: * @param aPosition The position in the button group for the new button. williamr@2: * @param aCommandId Command ID for the new button. williamr@2: * @param aBitmap Bitmap for the button. williamr@2: * @param aMask Mask bitmap for aBitmap. williamr@2: */ williamr@2: inline void AddCommandL( williamr@2: TInt aPosition, williamr@2: TInt aCommandId, williamr@2: const CFbsBitmap& aBitmap, williamr@2: const CFbsBitmap& aMask); williamr@2: williamr@2: /** williamr@2: * Adds a command button with a command ID and a label containing both williamr@2: * a bitmap and text. williamr@2: * williamr@2: * @param aPosition The position in the button group for the new button. williamr@2: * @param aCommandId Command ID for the new button. williamr@2: * @param aText Text for the button. williamr@2: * @param aBitmap Bitmap for the button. williamr@2: * @param aMask Mask bitmap for aBitmap. williamr@2: */ williamr@2: inline void AddCommandL( williamr@2: TInt aPosition, williamr@2: TInt aCommandId, williamr@2: const TDesC& aText, williamr@2: const CFbsBitmap& aBitmap, williamr@2: const CFbsBitmap& aMask); williamr@2: williamr@2: /** williamr@2: * Adds a command button with a command ID and a bitmap which is read from a file. williamr@2: * williamr@2: * @param aPosition The position in the button group for the new button. williamr@2: * @param aCommandId Command ID for the new button. williamr@2: * @param aFile Multi-bitmap file containing the bitmap and mask. williamr@2: * @param aBitmapId ID of the bitmap within aFile. williamr@2: * @param aMaskId ID of the mask within aFile. williamr@2: */ williamr@2: inline void AddCommandL( williamr@2: TInt aPosition, williamr@2: TInt aCommandId, williamr@2: const TDesC& aFile, williamr@2: TInt aBitmapId, williamr@2: TInt aMaskId); williamr@2: williamr@2: /** williamr@2: * Adds a command button with a command ID and a label containing both a bitmap williamr@2: * and text. The bitmap and mask are read from file. williamr@2: * williamr@2: * @param aPosition The position in the button group for the new button. williamr@2: * @param aCommandId Command ID for the new button. williamr@2: * @param aText Text for the button. williamr@2: * @param aFile Multi-bitmap file containing the bitmap and mask. williamr@2: * @param aBitmapId ID of the bitmap within aFile. williamr@2: * @param aMaskId ID of the mask within aFile. williamr@2: */ williamr@2: inline void AddCommandL( williamr@2: TInt aPosition, williamr@2: TInt aCommandId, williamr@2: const TDesC& aText, williamr@2: const TDesC& aFile, williamr@2: TInt aBitmapId, williamr@2: TInt aMaskId); williamr@2: williamr@2: /** williamr@2: * Pushes a command button with a text label and command ID onto a position's williamr@2: * button stack. This function behaves similarly to SetCommandL() but allows williamr@2: * the previous command button to be retrieved by calling RemoveCommandFromStack(). williamr@2: * williamr@2: * @param aPosition The position in the button group at which to add the command button. williamr@2: * @param aCommandId Command ID the button will send. williamr@2: * @param aText Text for the button. williamr@2: */ williamr@2: inline void AddCommandToStackL( williamr@2: TInt aPosition, williamr@2: TInt aCommandId, williamr@2: const TDesC& aText); williamr@2: williamr@2: /** williamr@2: * Pushes a command button with a bitmap, mask and command ID onto a position's williamr@2: * button stack. This function behaves similarly to SetCommandL() but allows the williamr@2: * previous command button to be retrieved by calling RemoveCommandFromStack(). williamr@2: * williamr@2: * @param aPosition The position in the button group at which to add the command button. williamr@2: * @param aCommandId Command ID the button will send. williamr@2: * @param aBitmap Bitmap for the button. williamr@2: * @param aMask Mask bitmap for aBitmap. williamr@2: */ williamr@2: inline void AddCommandToStackL( williamr@2: TInt aPosition, williamr@2: TInt aCommandId, williamr@2: const CFbsBitmap& aBitmap, williamr@2: const CFbsBitmap& aMask); williamr@2: williamr@2: /** williamr@2: * Pushes a command button with text, bitmap, mask and a command ID onto a position's williamr@2: * button stack. This function behaves similarly to SetCommandL() but allows the williamr@2: * previous command button to be retrieved by calling RemoveCommandFromStack(). williamr@2: * williamr@2: * @param aPosition The position in the button group at which to add the command button. williamr@2: * @param aCommandId Command ID the button will send. williamr@2: * @param aText Text for the button. williamr@2: * @param aBitmap Bitmap for the button. williamr@2: * @param aMask Mask bitmap for aBitmap. williamr@2: */ williamr@2: inline void AddCommandToStackL( williamr@2: TInt aPosition, williamr@2: TInt aCommandId, williamr@2: const TDesC& aText, williamr@2: const CFbsBitmap& aBitmap, williamr@2: const CFbsBitmap& aMask); williamr@2: williamr@2: /** williamr@2: * Pushes a command button with a bitmap, mask and command ID onto a position's button williamr@2: * stack. The bitmap and mask are read from a file. This function behaves similarly to williamr@2: * SetCommandL() but allows the previous command button to be retrieved by calling williamr@2: * RemoveCommandFromStack(). williamr@2: * williamr@2: * @param aPosition The position in the button group at which to add the command button. williamr@2: * @param aCommandId Command ID the button will send. williamr@2: * @param aFile A multi-bitmap file containing mask and bitmap. williamr@2: * @param aBitmapId Index into the file of the bitmap. williamr@2: * @param aMaskId Index into the file of the bitmap mask. williamr@2: */ williamr@2: inline void AddCommandToStackL( williamr@2: TInt aPosition, williamr@2: TInt aCommandId, williamr@2: const TDesC& aFile, williamr@2: TInt aBitmapId, williamr@2: TInt aMaskId); williamr@2: williamr@2: /** williamr@2: * Pushes a command button with text, bitmap, mask and command button onto a position's williamr@2: * button stack. The bitmap and mask are read from a file. This function behaves similarly williamr@2: * to SetCommandL() but allows the previous command button to be retrieved by calling williamr@2: * RemoveCommandFromStack(). williamr@2: * williamr@2: * @param aPosition The position in the button group at which to push the command button. williamr@2: * @param aCommandId Command ID the button will send. williamr@2: * @param aText Text for the button. williamr@2: * @param aFile A multi-bitmap file containing mask and bitmap. williamr@2: * @param aBitmapId Index into the file of the bitmap. williamr@2: * @param aMaskId Index into the file of the bitmap mask. williamr@2: */ williamr@2: inline void AddCommandToStackL( williamr@2: TInt aPosition, williamr@2: TInt aCommandId, williamr@2: const TDesC& aText, williamr@2: const TDesC& aFile, williamr@2: TInt aBitmapId, williamr@2: TInt aMaskId); williamr@2: williamr@2: /** williamr@2: * Pushes a command button onto a position's button stack. The text, bitmap, mask and williamr@2: * command ID are all read from resource. This function behaves similarly to williamr@2: * SetCommandL() but allows the previous command button to be retrieved by calling williamr@2: * RemoveCommandFromStack(). williamr@2: * williamr@2: * @param aPosition The position in the button group at which to push the command button. williamr@2: * @param aResourceId ID of a resource specifying the text, bitmaps and command ID. williamr@2: */ williamr@2: inline void AddCommandToStackL( williamr@2: TInt aPosition, williamr@2: TInt aResourceId); williamr@2: williamr@2: /** williamr@2: * As with SetCommandL() but for a set of buttons, also allows the previous command williamr@2: * button to be retrieved by calling RemoveCommand(). williamr@2: * williamr@2: * @param aResourceId Resource describing the set of command buttons. williamr@2: */ williamr@2: IMPORT_C void AddCommandSetToStackL( williamr@2: TInt aResourceId); williamr@2: williamr@2: /** williamr@2: * Removes the command identified by aCommandId, in position aPosition in the group, williamr@2: * from the command stack. Automatically retrieves the previous command details. williamr@2: * Commands are added to the stack by calling AddCommandToStackL. williamr@2: * williamr@2: * @param aPosition The position in the button group from which to remove the williamr@2: * command button. williamr@2: * @param aCommandId Command ID. williamr@2: */ williamr@2: IMPORT_C void RemoveCommandFromStack(TInt aPosition, TInt aCommandId); williamr@2: williamr@2: /** williamr@2: * Sets the default command ID for buttons in this container. williamr@2: * williamr@2: * @param aCommandId Command to issue if no other is specified. williamr@2: */ williamr@2: IMPORT_C void SetDefaultCommand(TInt aCommandId); williamr@2: williamr@2: /** williamr@2: * Calculates minimum size required to display the buttons defined in the specified williamr@2: * resource structure. williamr@2: * williamr@2: * @param aResourceId The ID of the resource structure describing the button group. williamr@2: * @return Minimum size required to display the button group defined in the specified resource structure. williamr@2: */ williamr@2: IMPORT_C TSize CalcMinimumSizeL(TInt aResourceId) const; williamr@2: williamr@2: /** williamr@2: * Places the command in position aPosition in the group on the cleanup stack. Typically williamr@2: * used when a control or view changes the contents of two or more buttons on receipt of williamr@2: * focus. After altering one command with a call to AddCommandToStackL() the push is made williamr@2: * to guarantee the display will be left in a consistent state if the second (and any williamr@2: * subsequent) calls to AddCommandToStackL() fail. Only a single command can be pushed williamr@2: * for each position. williamr@2: * williamr@2: * @param aPosition Position in the container of the button to push. williamr@2: */ williamr@2: IMPORT_C void CleanupCommandPushL(TInt aPosition); williamr@2: williamr@2: /** williamr@2: * Removes a command from the cleanup stack without destroying it. williamr@2: */ williamr@2: inline void CleanupCommandPop(); williamr@2: williamr@2: /** williamr@2: * Removes one or more commands from the cleanup stack without destroying them. williamr@2: * williamr@2: * @param aCount Number of commands to pop. williamr@2: */ williamr@2: IMPORT_C void CleanupCommandPop(TInt aCount); williamr@2: williamr@2: /** williamr@2: * Removes a single command which was pushed onto the cleanup stack. It does this by williamr@2: * calling CleanupCommandPushL(), rolling back to the previous details. The command williamr@2: * button popped is destroyed. williamr@2: */ williamr@2: inline void CleanupCommandPopAndDestroy(); williamr@2: williamr@2: /** williamr@2: * Removes one or more commands which were pushed onto the cleanup stack. It does this williamr@2: * by calling CleanupCommandPushL(), rolling back to the previous details. The command williamr@2: * buttons popped are destroyed. williamr@2: * williamr@2: * @param aCount Number of commands to pop and destroy. williamr@2: */ williamr@2: inline void CleanupCommandPopAndDestroy(TInt aCount); williamr@2: williamr@2: /** williamr@2: * Gets the maximum number of buttons that can be supported by the device. williamr@2: * williamr@2: * @return The number of command buttons supported. williamr@2: */ williamr@2: IMPORT_C TInt MaxCommands() const; williamr@2: williamr@2: /** williamr@2: * Gets the total number of buttons currently present in the group. williamr@2: * williamr@2: * @return The number of buttons. williamr@2: */ williamr@2: IMPORT_C TInt ButtonCount() const; williamr@2: williamr@2: /** williamr@2: * Dims (but doesn't draw) the button with id aCommandId if aDimmed is ETrue. If two williamr@2: * buttons have the same id, the button to be dimmed is undefined. williamr@2: * williamr@2: * @param aCommandId The id for command to be dimmed. williamr@2: * @param aDimmed ETrue for dimming. williamr@2: */ williamr@2: IMPORT_C void DimCommand(TInt aCommandId, TBool aDimmed); williamr@2: williamr@2: /** williamr@2: * Returns ETrue if the button with id aCommandId is dimmed. If two buttons have williamr@2: * the same id, the results of this check are undefined. williamr@2: * williamr@2: * @param aCommandId The id for command to be checked. williamr@2: * @return The state of the button. williamr@2: */ williamr@2: IMPORT_C TBool IsCommandDimmed(TInt aCommandId) const; williamr@2: williamr@2: /** williamr@2: * Sets the the button with id aCommandId to be visible if aVisible is ETrue. If two williamr@2: * buttons have the same id, the button to be altered is undefined. williamr@2: * williamr@2: * @param aCommandId The id for command to be made visible. williamr@2: * @param aVisible EFalse for making button invisible. williamr@2: */ williamr@2: IMPORT_C void MakeCommandVisible(TInt aCommandId, TBool aVisible); williamr@2: williamr@2: /** williamr@2: * Returns ETrue if the button with id aCommandId is visible. If two buttons have williamr@2: * the same id, the results are undefined. williamr@2: * williamr@2: * @param aCommandId The id for command to be checked. williamr@2: * @return The state of the button. williamr@2: */ williamr@2: IMPORT_C TBool IsCommandVisible(TInt aCommandId) const; williamr@2: williamr@2: /** williamr@2: * Animates the button with id aCommandId. If two buttons have the same id, the williamr@2: * button to be animated is undefined. williamr@2: * williamr@2: * @since S60 3.1 williamr@2: * @param aCommandId The id for command to be animated. williamr@2: */ williamr@2: IMPORT_C void AnimateCommand(TInt aCommandId); williamr@2: williamr@2: /** williamr@2: * Dims (but doesn't draw) the button with position aPosition. williamr@2: * williamr@2: * @since S60 3.1 williamr@2: * @param aPosition The position for command to be dimmed. williamr@2: * @param aDimmed ETrue for dimming. williamr@2: */ williamr@2: IMPORT_C void DimCommandByPosition(TCommandPosition aPosition, TBool aDimmed); williamr@2: williamr@2: /** williamr@2: * Returns ETrue if the button with position aPosition is dimmed. williamr@2: * williamr@2: * @since S60 3.1 williamr@2: * @param aPosition The position for command to be checked. williamr@2: * @return The state of the button. williamr@2: */ williamr@2: IMPORT_C TBool IsCommandDimmedByPosition(TCommandPosition aPosition) const; williamr@2: williamr@2: /** williamr@2: * Sets the the button with position aPosition to be visible if aVisible is ETrue. williamr@2: * williamr@2: * @since S60 3.1 williamr@2: * @param aPosition The position for command to be made visible. williamr@2: * @param aVisible EFalse for making button invisible. williamr@2: */ williamr@2: IMPORT_C void MakeCommandVisibleByPosition(TCommandPosition aPosition, TBool aVisible); williamr@2: williamr@2: /** williamr@2: * Returns ETrue if the button with position aPosition is visible. williamr@2: * williamr@2: * @since S60 3.1 williamr@2: * @param aPosition The position for command to be checked. williamr@2: * @return The state of the button. williamr@2: */ williamr@2: IMPORT_C TBool IsCommandVisibleByPosition(TCommandPosition aPosition) const; williamr@2: williamr@2: /** williamr@2: * Animates the button with position aPosition. williamr@2: * williamr@2: * @since S60 3.1 williamr@2: * @param aPosition The position for command to be animated. williamr@2: */ williamr@2: IMPORT_C void AnimateCommandByPosition(TCommandPosition aPosition); williamr@2: williamr@2: /** williamr@2: * Gets the button group's location. Typically the button group is external to the williamr@2: * view which is using it. In some cases, such as in dialogs with button panels, williamr@2: * the button group is internal to the control which is using it. williamr@2: * williamr@2: * @return The button group's location. williamr@2: */ williamr@2: IMPORT_C TLocation Location() const; williamr@2: williamr@2: /** williamr@2: * Gets a pointer to the command button with the specified command Id. williamr@2: * williamr@2: * @param aCommandId Command ID of the button. williamr@2: * @return Pointer to the command button CEikCommandButton, NULL if there williamr@2: * was no button with Id aCommandId. williamr@2: */ williamr@2: IMPORT_C CEikCommandButton* CommandButtonOrNull(TInt aCommandId) const; williamr@2: williamr@2: /** williamr@2: * Sets the boundary rectangle for externally-positioned button groups. williamr@2: * For use by EExternal button groups only. williamr@2: * williamr@2: * @param aRect The boundary rectangle to use. The button group attaches williamr@2: * itself to the inside of this rectangle. williamr@2: */ williamr@2: IMPORT_C void SetBoundingRect(const TRect& aRect); williamr@2: williamr@2: /** williamr@2: * Subtracts the area occupied by the button group from the specified bounding williamr@2: * rectangle. This method should be used in preference to querying the container's williamr@2: * area at all times. For use by EExternal button groups only. williamr@2: * williamr@2: * @param aBoundingRect Rectangle to be modified. williamr@2: */ williamr@2: IMPORT_C void ReduceRect(TRect& aBoundingRect) const; williamr@2: williamr@2: /** williamr@2: * Gets a pointer to the control (button) with the specified command ID. williamr@2: * This method is intended to allow access to standard CCoeControl functionality williamr@2: * only. Casting the return value is likely to fail on different devices. williamr@2: * williamr@2: * @param aCommandId Command ID of the button to get. williamr@2: * @return Pointer to a CCoeControl, NULL if there was no button at aCommandId. williamr@2: */ williamr@2: IMPORT_C CCoeControl* ControlOrNull(TInt aCommandId) const; williamr@2: williamr@2: /** williamr@2: * Gets a pointer to the the button with the specified command Id. williamr@2: * williamr@2: * @param aCommandId Command ID of the button to obtain. williamr@2: * @return The button object. williamr@2: */ williamr@2: IMPORT_C CEikCommandButton* ButtonById(TInt aCommandId) const; williamr@2: williamr@2: /** williamr@2: * Gets the position in the group of the button with the specified command Id. williamr@2: * The return value is undefined if two buttons share the same id. williamr@2: * williamr@2: * @param aCommandId Identifies the command. williamr@2: * @return The command's container position. williamr@2: */ williamr@2: IMPORT_C TInt PositionById(TInt aCommandId) const; williamr@2: williamr@2: /** williamr@2: * Updates a command's hotkey and whether the key is displayed. williamr@2: * This function is only supported by containers being used for dialog buttons. williamr@2: * williamr@2: * @param aCommandId Identifies the command to update. williamr@2: * @param aFlags Whether to display the hotkey. williamr@2: * @param aKeyId Hotkey identifier. williamr@2: */ williamr@2: IMPORT_C void UpdateHotKey(TInt aCommandId, THotKeyFlags aFlags, TInt aKeyId); williamr@2: williamr@2: /** williamr@2: * Changes the command observer for the button at aPos to aCommandObserver. williamr@2: * Panics if an updated observer is already present. This function should be followed williamr@2: * by RemoveCommandObserver() when you need to put back the original observer. williamr@2: * williamr@2: * @param aPos The button's position. williamr@2: * @param aCommandObserver The command observer. williamr@2: */ williamr@2: IMPORT_C void UpdateCommandObserverL(TInt aPos, MEikCommandObserver& aCommandObserver); williamr@2: williamr@2: /** williamr@2: * Removes the temporary observer for the button at aPos, replacing it with the williamr@2: * observer that was present when UpdateCommandObserverL() was called. williamr@2: * williamr@2: * @param aPos The button's position. williamr@2: */ williamr@2: IMPORT_C void RemoveCommandObserver(TInt aPos); williamr@2: williamr@2: /** williamr@2: * Checks for existence of updated command observer for the button at aPosition. williamr@2: * williamr@2: * @since S60 3.2 williamr@2: * @param aPosition The position for button to be checked. williamr@2: * @return ETrue, if updated command observer exists. williamr@2: */ williamr@2: IMPORT_C TBool UpdatedCommandObserverExists(TCommandPosition aPosition) const; williamr@2: williamr@2: /** williamr@2: * Tests whether the button group has explicitly been instructed to suppress redraws. williamr@2: * Some button groups may not activate themselves during construction, in which williamr@2: * case, they need to be activated by the client. This method allows the client williamr@2: * to enquire whether this is necessary. williamr@2: * williamr@2: * @return ETrue if the button group will suppress redraws, otherwise EFalse. williamr@2: */ williamr@2: IMPORT_C TBool DelayActivation() const; williamr@2: williamr@2: /** williamr@2: * Returns the container's button group. williamr@2: * williamr@2: * @return Pointer to the button group object. Ownership is not transferred. williamr@2: */ williamr@2: inline MEikButtonGroup* ButtonGroup(); williamr@2: williamr@2: /** williamr@2: * Returns the button group type. williamr@2: * williamr@2: * @return The button group type. williamr@2: */ williamr@2: inline TUse ButtonGroupType(); williamr@2: williamr@2: /** williamr@2: * Internal method for setting markable list's MSK observer. williamr@2: * This observer is called before default CBA observer if MSK is pressed. williamr@2: * Observer is removed by passing NULL as parameter. williamr@2: * williamr@2: * @since S60 3.1 williamr@2: * @param aMSKObserverOwner williamr@2: * @param aCommandObserver williamr@2: */ williamr@2: void UpdateMSKCommandObserver( williamr@2: CEikListBox* aMSKObserverOwner, williamr@2: MEikCommandObserver* aCommandObserver); williamr@2: williamr@2: public: // From CCoeControl. williamr@2: /** williamr@2: * From CCoeControl. williamr@2: * Gets the control's minimum required size. williamr@2: * williamr@2: * @return The minimum size required by the control. williamr@2: */ williamr@2: IMPORT_C TSize MinimumSize(); williamr@2: williamr@2: /** williamr@2: * From CCoeControl. williamr@2: * Handles key events. williamr@2: * williamr@2: * @param aKeyEvent The key event. williamr@2: * @param aType The type of key event: EEventKey, EEventKeyUp or EEventKeyDown. williamr@2: * @return Indicates whether or not the key event was used by this control. williamr@2: */ williamr@2: IMPORT_C TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent, TEventCode aType); williamr@2: williamr@2: /** williamr@2: * From CCoeControl. williamr@2: * Sets this control as visible or invisible. williamr@2: * williamr@2: * @param aVisible ETrue to make the control visible, EFalse to make it invisible. williamr@2: */ williamr@2: void MakeVisible(TBool aVisible); williamr@2: williamr@2: /** williamr@2: * From CCoeControl. williamr@2: * Writes the internal state of the control and its components to aStream. williamr@2: * Does nothing in release mode. williamr@2: * williamr@2: * @param aWriteStream The output stream. williamr@2: */ williamr@2: IMPORT_C void WriteInternalStateL(RWriteStream& aWriteStream) const; williamr@2: williamr@2: public: williamr@2: /** williamr@2: * Formerly from MTopSetMember, now reserved. williamr@2: */ williamr@2: IMPORT_C virtual void Reserved_MtsmPosition(); williamr@2: williamr@2: /** williamr@2: * Formerly from MTopSetMember, now reserved. williamr@2: */ williamr@2: IMPORT_C virtual void Reserved_MtsmObject(); williamr@2: williamr@2: public: // New functions for enhanced cba support. williamr@2: /** williamr@2: * Used to offer list of commands for softkeys. williamr@2: * williamr@2: * @since S60 3.2 williamr@2: * @param aCommandList A list of command ids to be offered for softkeys. williamr@2: */ williamr@2: IMPORT_C void OfferCommandListL(const RArray& aCommandList); williamr@2: williamr@2: /** williamr@2: * Used to offer list of commands for softkeys. williamr@2: * williamr@2: * @since S60 3.2 williamr@2: * @param aResourceId Id for CBA resource that defines enhanced cba buttons. williamr@2: */ williamr@2: IMPORT_C void OfferCommandListL(const TInt aResourceId); williamr@2: williamr@2: /** williamr@2: * Used to check if a certain command have been approved to the current command set williamr@2: * williamr@2: * @since S60 3.2 williamr@2: * @param aCommandId The id for command which existence should be checked. williamr@2: * @return ETrue if command is in control group, otherwise EFalse. williamr@2: */ williamr@2: IMPORT_C TBool IsCommandInGroup(const TInt aCommandId) const; williamr@2: williamr@2: /** williamr@2: * Replaces command with another. williamr@2: * williamr@2: * @since S60 3.2 williamr@2: * @param aCommandId Id for command that should be replaced. williamr@2: * @param aResourceId Resource id for new enhanced cba button. williamr@2: */ williamr@2: IMPORT_C void ReplaceCommand(const TInt aCommandId, const TInt aResourceId); williamr@2: williamr@2: private: williamr@2: enum TCommandOp {ESet, EAdd, EPush}; williamr@2: williamr@2: private: williamr@2: class TCmdPos williamr@2: { williamr@2: public: williamr@2: inline TCmdPos(); williamr@2: inline TCmdPos(TInt aPos, TInt aCmd); williamr@2: public: williamr@2: TInt iPos; williamr@2: TInt iCmd; williamr@2: }; williamr@2: williamr@2: class TCmdObserver williamr@2: { williamr@2: public: williamr@2: inline TCmdObserver(TInt aPos, MEikCommandObserver& aObserver); williamr@2: public: williamr@2: TInt iPos; williamr@2: MEikCommandObserver& iObserver; williamr@2: }; williamr@2: williamr@2: class CCmdObserverArray : public CArrayFixFlat williamr@2: { williamr@2: public: williamr@2: inline CCmdObserverArray(); williamr@2: TInt FindIndex(TInt aPos); williamr@2: }; williamr@2: williamr@2: private: williamr@2: CEikButtonGroupContainer(TUse aUse); williamr@2: williamr@2: void ConstructL( williamr@2: TOrientation aOrientation, williamr@2: MEikCommandObserver* aCommandObserver, williamr@2: TInt aResourceId, williamr@2: RWindowGroup* aParentWg, williamr@2: TUint aFlags); williamr@2: williamr@2: IMPORT_C void DoSetCommandL( williamr@2: TInt aPosition, williamr@2: TInt aCommandId, williamr@2: const TDesC* aText, williamr@2: const CFbsBitmap* aBitmap, williamr@2: const CFbsBitmap* aMask, williamr@2: TCommandOp aOp); williamr@2: williamr@2: IMPORT_C void DoSetCommandL( williamr@2: TInt aPosition, williamr@2: TInt aCommandId, williamr@2: const TDesC* aText, williamr@2: const TDesC& aFile, williamr@2: TInt aBitmapId, williamr@2: TInt aMaskId, williamr@2: TCommandOp aOp); williamr@2: williamr@2: IMPORT_C void DoSetCommandL( williamr@2: TInt aCommandId, williamr@2: const TDesC* aText, williamr@2: const CFbsBitmap* aBitmap, williamr@2: const CFbsBitmap* aMask, williamr@2: TCommandOp aOp); williamr@2: williamr@2: IMPORT_C void DoSetCommandL( williamr@2: TInt aCommandId, williamr@2: const TDesC* aText, williamr@2: const TDesC& aFile, williamr@2: TInt aBitmapId, williamr@2: TInt aMaskId, williamr@2: TCommandOp aOp); williamr@2: williamr@2: IMPORT_C void DoSetCommandL( williamr@2: TInt aPosition, williamr@2: TInt aResourceId, williamr@2: TCommandOp aOp); williamr@2: williamr@2: inline CCoeControl* ButtonGroupAsControl() const; williamr@2: void UpdateRect(); williamr@2: static void CleanupCommandDestroy(TAny* aPtr); williamr@2: TCmdPos DoCleanupCommandPop(); williamr@2: void DoCleanupCommandPopAndDestroy(); williamr@2: williamr@2: private: // from CCoeControl williamr@2: TInt CountComponentControls() const; williamr@2: CCoeControl* ComponentControl(TInt aIndex) const; williamr@2: void SizeChanged(); williamr@2: williamr@2: private: // from MEikCommandObserver williamr@2: void ProcessCommandL(TInt aCommandId); williamr@2: CCoeControl* CreateCustomCommandControlL(TInt aControlType); williamr@2: williamr@2: private: williamr@2: MEikButtonGroup* iButtonGroup; williamr@2: TUse iUse; williamr@2: CArrayFix* iCommandsCleanup; williamr@2: MEikCommandObserver* iCommandObserver; williamr@2: CCmdObserverArray* iObserverArray; williamr@2: TDblQueLink iBtLink; williamr@2: CEikListBox* iMSKObserverOwner; williamr@2: TInt iSpare; williamr@2: williamr@2: private: williamr@2: friend class CCmdObserverArray; williamr@2: friend class CEikButtonGroupStack; williamr@2: }; williamr@2: williamr@2: williamr@2: // Inline function implementations. williamr@2: williamr@2: inline void CEikButtonGroupContainer::SetCommandL( williamr@2: TInt aPosition, williamr@2: TInt aCommandId, williamr@2: const TDesC& aText) williamr@2: { williamr@2: DoSetCommandL(aPosition, aCommandId, &aText, NULL, NULL, ESet); williamr@2: } williamr@2: williamr@2: inline void CEikButtonGroupContainer::SetCommandL( williamr@2: TInt aPosition, williamr@2: TInt aCommandId, williamr@2: const CFbsBitmap& aBitmap, williamr@2: const CFbsBitmap& aMask) williamr@2: { williamr@2: DoSetCommandL(aPosition, aCommandId, NULL, &aBitmap, &aMask, ESet); williamr@2: } williamr@2: williamr@2: inline void CEikButtonGroupContainer::SetCommandL( williamr@2: TInt aPosition, williamr@2: TInt aCommandId, williamr@2: const TDesC& aText, williamr@2: const CFbsBitmap& aBitmap, williamr@2: const CFbsBitmap& aMask) williamr@2: { williamr@2: DoSetCommandL(aPosition, aCommandId, &aText, &aBitmap, &aMask, ESet); williamr@2: } williamr@2: williamr@2: inline void CEikButtonGroupContainer::SetCommandL( williamr@2: TInt aPosition, williamr@2: TInt aCommandId, williamr@2: const TDesC& aFile, williamr@2: TInt aBitmapId, williamr@2: TInt aMaskId) williamr@2: { williamr@2: DoSetCommandL(aPosition, aCommandId, NULL, aFile, aBitmapId, aMaskId, ESet); williamr@2: } williamr@2: williamr@2: inline void CEikButtonGroupContainer::SetCommandL( williamr@2: TInt aPosition, williamr@2: TInt aCommandId, williamr@2: const TDesC& aText, williamr@2: const TDesC& aFile, williamr@2: TInt aBitmapId, williamr@2: TInt aMaskId) williamr@2: { williamr@2: DoSetCommandL(aPosition, aCommandId, &aText, aFile, aBitmapId, aMaskId, ESet); williamr@2: } williamr@2: williamr@2: inline void CEikButtonGroupContainer::SetCommandL( williamr@2: TInt aPosition, williamr@2: TInt aResourceId) williamr@2: { williamr@2: DoSetCommandL(aPosition, aResourceId, ESet); williamr@2: } williamr@2: williamr@2: inline void CEikButtonGroupContainer::SetCommandL( williamr@2: TInt aCommandId, williamr@2: const TDesC& aText) williamr@2: { williamr@2: DoSetCommandL(aCommandId, &aText, NULL, NULL, ESet); williamr@2: } williamr@2: williamr@2: inline void CEikButtonGroupContainer::SetCommandL( williamr@2: TInt aCommandId, williamr@2: const CFbsBitmap& aBitmap, williamr@2: const CFbsBitmap& aMask) williamr@2: { williamr@2: DoSetCommandL(aCommandId, NULL, &aBitmap, &aMask, ESet); williamr@2: } williamr@2: williamr@2: inline void CEikButtonGroupContainer::SetCommandL( williamr@2: TInt aCommandId, williamr@2: const TDesC& aText, williamr@2: const CFbsBitmap& aBitmap, williamr@2: const CFbsBitmap& aMask) williamr@2: { williamr@2: DoSetCommandL(aCommandId, &aText, &aBitmap, &aMask, ESet); williamr@2: } williamr@2: williamr@2: inline void CEikButtonGroupContainer::SetCommandL( williamr@2: TInt aCommandId, williamr@2: const TDesC& aFile, williamr@2: TInt aBitmapId, williamr@2: TInt aMaskId) williamr@2: { williamr@2: DoSetCommandL(aCommandId, NULL, aFile, aBitmapId, aMaskId, ESet); williamr@2: } williamr@2: williamr@2: inline void CEikButtonGroupContainer::SetCommandL( williamr@2: TInt aCommandId, williamr@2: const TDesC& aText, williamr@2: const TDesC& aFile, williamr@2: TInt aBitmapId, williamr@2: TInt aMaskId) williamr@2: { williamr@2: DoSetCommandL(aCommandId, &aText, aFile, aBitmapId, aMaskId, ESet); williamr@2: } williamr@2: williamr@2: inline void CEikButtonGroupContainer::AddCommandL( williamr@2: TInt aPosition, williamr@2: TInt aCommandId, williamr@2: const TDesC& aText) williamr@2: { williamr@2: DoSetCommandL(aPosition, aCommandId, &aText, NULL, NULL, EAdd); williamr@2: } williamr@2: williamr@2: inline void CEikButtonGroupContainer::AddCommandL( williamr@2: TInt aPosition, williamr@2: TInt aCommandId, williamr@2: const CFbsBitmap& aBitmap, williamr@2: const CFbsBitmap& aMask) williamr@2: { williamr@2: DoSetCommandL(aPosition, aCommandId, NULL, &aBitmap, &aMask, EAdd); williamr@2: } williamr@2: williamr@2: inline void CEikButtonGroupContainer::AddCommandL( williamr@2: TInt aPosition, williamr@2: TInt aCommandId, williamr@2: const TDesC& aText, williamr@2: const CFbsBitmap& aBitmap, williamr@2: const CFbsBitmap& aMask) williamr@2: { williamr@2: DoSetCommandL(aPosition, aCommandId, &aText, &aBitmap, &aMask, EAdd); williamr@2: } williamr@2: williamr@2: inline void CEikButtonGroupContainer::AddCommandL( williamr@2: TInt aPosition, williamr@2: TInt aCommandId, williamr@2: const TDesC& aFile, williamr@2: TInt aBitmapId, williamr@2: TInt aMaskId) williamr@2: { williamr@2: DoSetCommandL(aPosition, aCommandId, NULL, aFile, aBitmapId, aMaskId, EAdd); williamr@2: } williamr@2: williamr@2: inline void CEikButtonGroupContainer::AddCommandL( williamr@2: TInt aPosition, williamr@2: TInt aCommandId, williamr@2: const TDesC& aText, williamr@2: const TDesC& aFile, williamr@2: TInt aBitmapId, williamr@2: TInt aMaskId) williamr@2: { williamr@2: DoSetCommandL(aPosition, aCommandId, &aText, aFile, aBitmapId, aMaskId, EAdd); williamr@2: } williamr@2: williamr@2: inline void CEikButtonGroupContainer::AddCommandToStackL( williamr@2: TInt aPosition, williamr@2: TInt aCommandId, williamr@2: const TDesC& aText) williamr@2: { williamr@2: DoSetCommandL(aPosition, aCommandId, &aText, NULL, NULL, EPush); williamr@2: } williamr@2: williamr@2: inline void CEikButtonGroupContainer::AddCommandToStackL( williamr@2: TInt aPosition, williamr@2: TInt aCommandId, williamr@2: const CFbsBitmap& aBitmap, williamr@2: const CFbsBitmap& aMask) williamr@2: { williamr@2: DoSetCommandL(aPosition, aCommandId, NULL, &aBitmap, &aMask, EPush); williamr@2: } williamr@2: williamr@2: inline void CEikButtonGroupContainer::AddCommandToStackL( williamr@2: TInt aPosition, williamr@2: TInt aCommandId, williamr@2: const TDesC& aText, williamr@2: const CFbsBitmap& aBitmap, williamr@2: const CFbsBitmap& aMask) williamr@2: { williamr@2: DoSetCommandL(aPosition, aCommandId, &aText, &aBitmap, &aMask, EPush); williamr@2: } williamr@2: williamr@2: inline void CEikButtonGroupContainer::AddCommandToStackL( williamr@2: TInt aPosition, williamr@2: TInt aCommandId, williamr@2: const TDesC& aFile, williamr@2: TInt aBitmapId, williamr@2: TInt aMaskId) williamr@2: { williamr@2: DoSetCommandL(aPosition, aCommandId, NULL, aFile, aBitmapId, aMaskId, EPush); williamr@2: } williamr@2: williamr@2: inline void CEikButtonGroupContainer::AddCommandToStackL( williamr@2: TInt aPosition, williamr@2: TInt aCommandId, williamr@2: const TDesC& aText, williamr@2: const TDesC& aFile, williamr@2: TInt aBitmapId, williamr@2: TInt aMaskId) williamr@2: { williamr@2: DoSetCommandL(aPosition, aCommandId, &aText, aFile, aBitmapId, aMaskId, EPush); williamr@2: } williamr@2: williamr@2: inline void CEikButtonGroupContainer::AddCommandToStackL( williamr@2: TInt aPosition, williamr@2: TInt aResourceId) williamr@2: { williamr@2: DoSetCommandL(aPosition, aResourceId, EPush); williamr@2: } williamr@2: williamr@2: inline void CEikButtonGroupContainer::CleanupCommandPop() williamr@2: { williamr@2: CleanupCommandPop(1); williamr@2: } williamr@2: williamr@2: inline void CEikButtonGroupContainer::CleanupCommandPopAndDestroy() williamr@2: { williamr@2: CleanupStack::PopAndDestroy(); williamr@2: } williamr@2: williamr@2: inline void CEikButtonGroupContainer::CleanupCommandPopAndDestroy(TInt aCount) williamr@2: { williamr@2: CleanupStack::PopAndDestroy(aCount); williamr@2: } williamr@2: williamr@2: inline MEikButtonGroup* CEikButtonGroupContainer::ButtonGroup() williamr@2: { williamr@2: return iButtonGroup; williamr@2: } williamr@2: williamr@2: inline CEikButtonGroupContainer::TUse CEikButtonGroupContainer::ButtonGroupType() williamr@2: { williamr@2: return iUse; williamr@2: } williamr@2: williamr@2: #endif // __EIKBTGPC_H__