CEikCommandButton Class Reference

class CEikCommandButton : public CEikCommandButtonBase

Command button with a text and/or an image

This class in S60 does not function without derivation This class does NOT implement S60 look-and-feel and is not skinned.

eikcoctl.dll
Since
S60 1.0
Public Member Functions
CEikCommandButton()
~CEikCommandButton()
IMPORT_C voidAddCommandToStackL(TInt, const TDesC *, const CFbsBitmap *, const CFbsBitmap *)
IMPORT_C voidConstructFromResourceL(TResourceReader &)
IMPORT_C voidHandlePointerEventL(const TPointerEvent &)
IMPORT_C CEikLabel *Label()
IMPORT_C CEikImage *Picture()
IMPORT_C TIntPopCommandFromStack()
IMPORT_C TBoolRemoveCommandFromStack(TInt)
IMPORT_C voidSetButtonLayout(TLayout)
IMPORT_C voidSetCommandL(TInt, const TDesC *, const CFbsBitmap *, const CFbsBitmap *)
IMPORT_C voidSetDisplayContent(TDisplayContent)
IMPORT_C voidSetExcessSpace(TExcess)
IMPORT_C voidSetPictureFromFileL(const TDesC &, TInt, TInt)
IMPORT_C voidSetPictureL(const CFbsBitmap *, const CFbsBitmap *)
IMPORT_C voidSetTextL(const TDesC &)
IMPORT_C voidUpdateComponentAlignment()
Private Member Functions
IMPORT_C void *ExtensionInterface(TUid)
voidUpdateLabelReserveLengthL(const TDesC *)
Inherited Functions
CAknControl::CAknControl()
CAknControl::~CAknControl()
CBase::CBase()
CBase::Delete(CBase *)
CBase::Extension_(TUint,TAny *&,TAny *)
CBase::operator new(TUint)
CBase::operator new(TUint,TAny *)
CBase::operator new(TUint,TLeave)
CBase::operator new(TUint,TLeave,TUint)
CBase::operator new(TUint,TUint)
CBase::~CBase()
CCoeControl::AccumulatedZoom()const
CCoeControl::ActivateGc()const
CCoeControl::BackedUpWindow()const
CCoeControl::Background()const
CCoeControl::CCoeControl()
CCoeControl::CCoeControl(CCoeEnv *)
CCoeControl::CCoeControl(const CCoeControl &)
CCoeControl::CapturesPointer()const
CCoeControl::ClaimPointerGrab(TBool)
CCoeControl::ClaimPointerGrab(TInt,TBool)
CCoeControl::CloseWindow()
CCoeControl::ComponentArrayExists()const
CCoeControl::Components()
CCoeControl::Components()const
CCoeControl::ControlContext()const
CCoeControl::ControlEnv()const
CCoeControl::CopyControlContextFrom(const CCoeControl *)
CCoeControl::CreateBackedUpWindowL(RWindowTreeNode &)
CCoeControl::CreateBackedUpWindowL(RWindowTreeNode &,TDisplayMode)
CCoeControl::CreateWindowL()
CCoeControl::CreateWindowL(RWindowGroup *)
CCoeControl::CreateWindowL(RWindowTreeNode &)
CCoeControl::CreateWindowL(const CCoeControl *)
CCoeControl::CustomGc()const
CCoeControl::DeactivateGc()const
CCoeControl::DrawBackground(const TRect &)const
CCoeControl::DrawDeferred()const
CCoeControl::DrawForeground(const TRect &)const
CCoeControl::DrawNow()const
CCoeControl::DrawNow(const TRect &)const
CCoeControl::DrawableWindow()const
CCoeControl::EnableDragEvents()
CCoeControl::EnableReportControlStateChange(TBool)
CCoeControl::EnableWindowTransparency()
CCoeControl::FindBackground()const
CCoeControl::FindFontProvider()const
CCoeControl::GetColor(TInt,TRgb &)const
CCoeControl::GetGc()const
CCoeControl::GetHelpContext(TCoeHelpContext &)const
CCoeControl::GrabbingComponent()const
CCoeControl::GrabbingComponent(TInt)const
CCoeControl::HandleComponentControlsResourceChange(TInt)
CCoeControl::HandleControlArrayEventL(CCoeControlArray::TEvent,const CCoeControlArray *,CCoeControl *,TInt)
CCoeControl::HandlePointerBufferReadyL()
CCoeControl::HandleRedrawEvent(const TRect &)const
CCoeControl::HitTest()const
CCoeControl::IgnoreEventsUntilNextPointerUp()
CCoeControl::Index(const CCoeControl *)const
CCoeControl::InitComponentArrayL()
CCoeControl::IsActivated()const
CCoeControl::IsBackedUp()const
CCoeControl::IsBeingDestroyed()const
CCoeControl::IsBlank()const
CCoeControl::IsDimmed()const
CCoeControl::IsFocused()const
CCoeControl::IsNonFocusing()const
CCoeControl::IsReadyToDraw()const
CCoeControl::IsVisible()const
CCoeControl::LayoutManager()const
CCoeControl::MakeVisible(TBool)
CCoeControl::MaximumWidth()const
CCoeControl::MopSupplyObject(TTypeUid)
CCoeControl::NotifyFontChange(const CCoeFontProvider *)
CCoeControl::Observer()const
CCoeControl::OverrideColorL(TInt,TRgb)
CCoeControl::OwnsWindow()const
CCoeControl::Parent()
CCoeControl::Parent()const
CCoeControl::Position()const
CCoeControl::PositionChanged()
CCoeControl::PositionRelativeToScreen()const
CCoeControl::PrepareForFocusGainL()
CCoeControl::PrepareForFocusLossL()
CCoeControl::ProcessPointerBufferReadyL()
CCoeControl::ProcessPointerEventL(const TPointerEvent &)
CCoeControl::Rect()const
CCoeControl::RecursivelyMergeInputCapabilities(TCoeInputCapabilities &)const
CCoeControl::RecursivelyMergedInputCapabilities()const
CCoeControl::RefetchPixelMappingL()
CCoeControl::RemoveFromParent()
CCoeControl::ReportEventL(MCoeControlObserver::TCoeEvent)
CCoeControl::RequestRelayout(const CCoeControl *)
CCoeControl::ResetGc()const
CCoeControl::ScreenFont(const TCoeFont &)const
CCoeControl::SetAllowStrayPointers()
CCoeControl::SetBackground(const MCoeControlBackground *)
CCoeControl::SetBlank()
CCoeControl::SetCanDrawOutsideRect()
CCoeControl::SetComponentsToInheritVisibility(TBool)
CCoeControl::SetContainerWindowL(RBackedUpWindow &)
CCoeControl::SetContainerWindowL(RWindow &)
CCoeControl::SetControlContext(MCoeControlContext *)
CCoeControl::SetCornerAndSize(TGulAlignment,const TSize &)
CCoeControl::SetCustomGc(CWindowGc *)
CCoeControl::SetExtent(const TPoint &,const TSize &)
CCoeControl::SetExtentToWholeScreen()
CCoeControl::SetFocus(TBool,TDrawNow)
CCoeControl::SetFocusing(TBool)
CCoeControl::SetFontProviderL(const CCoeFontProvider &)
CCoeControl::SetGc(CWindowGc *)const
CCoeControl::SetGloballyCapturing(TBool)
CCoeControl::SetHitTest(const MCoeControlHitTest *)
CCoeControl::SetLayoutManagerL(MCoeLayoutManager *)
CCoeControl::SetMaximumWidth(TInt)
CCoeControl::SetMopParent(MObjectProvider *)
CCoeControl::SetNeighbor(CCoeControl *)
CCoeControl::SetNonFocusing()
CCoeControl::SetObserver(MCoeControlObserver *)
CCoeControl::SetParent(CCoeControl *)
CCoeControl::SetPointerCapture(TBool)
CCoeControl::SetPosition(const TPoint &)
CCoeControl::SetRect(const TRect &)
CCoeControl::SetSize(const TSize &)
CCoeControl::SetSizeWithoutNotification(const TSize &)
CCoeControl::SetTextBaselineSpacing(TInt)
CCoeControl::SetUniqueHandle(TInt)
CCoeControl::SetZoomFactorL(TInt,TZoomType)
CCoeControl::Size()const
CCoeControl::SystemGc()const
CCoeControl::TextBaselineOffset(const TSize &)const
CCoeControl::TextDrawer(TInt)const
CCoeControl::UniqueHandle()const
CCoeControl::Window()const
CCoeControl::WriteInternalStateNowL(RWriteStream &)const
CCoeControl::ZoomWithType()const
CCoeControl::operator=(const CCoeControl &)
CCoeControl::~CCoeControl()
CEikBorderedControl::Border()const
CEikBorderedControl::CEikBorderedControl()
CEikBorderedControl::CEikBorderedControl(const TGulBorder &)
CEikBorderedControl::HasBorder()const
CEikBorderedControl::SetAdjacent(TInt)
CEikBorderedControl::SetBorder(TGulBorder::TBorderType)
CEikBorderedControl::SetBorder(TInt)
CEikButtonBase::Animate()
CEikButtonBase::CEikButtonBase()
CEikButtonBase::CopyDrawStateTo(CEikButtonBase *)const
CEikButtonBase::DrawState()const
CEikButtonBase::InputCapabilities()const
CEikButtonBase::IsPressed()const
CEikButtonBase::SetAllowTristate()
CEikButtonBase::SetBehavior(TButtonBehavior)
CEikButtonBase::SetCoordinator(TEikButtonCoordinator *)
CEikButtonBase::SetIgnoreNextPointerUp()
CEikButtonBase::SetReportOnPointerDown()
CEikButtonBase::SetState(TState)
CEikButtonBase::State()const
CEikButtonBase::~CEikButtonBase()
CEikCommandButtonBase::ActivateL()
CEikCommandButtonBase::Behavior()const
CEikCommandButtonBase::ButFlags()const
CEikCommandButtonBase::CEikCommandButtonBase()
CEikCommandButtonBase::CheckCreateCommandStackL()
CEikCommandButtonBase::CommandStack()const
CEikCommandButtonBase::ComponentControl(TInt)const
CEikCommandButtonBase::ConstructImageFromResourceL(TResourceReader &,TWhichComponent)
CEikCommandButtonBase::ConstructLabelFromResourceL(TResourceReader &,TWhichComponent)
CEikCommandButtonBase::CountComponentControls()const
CEikCommandButtonBase::Draw(const TRect &)const
CEikCommandButtonBase::FocusChanged(TDrawNow)
CEikCommandButtonBase::GetColorUseListL(CArrayFix< TCoeColorUse > &)const
CEikCommandButtonBase::HandleResourceChange(TInt)
CEikCommandButtonBase::IsDefault()const
CEikCommandButtonBase::LayoutComponents()
CEikCommandButtonBase::MinimumSize()
CEikCommandButtonBase::OfferKeyEventL(const TKeyEvent &,TEventCode)
CEikCommandButtonBase::SetContainerWindowL(const CCoeControl &)
CEikCommandButtonBase::SetDefault(TBool)
CEikCommandButtonBase::SetDimmed(TBool)
CEikCommandButtonBase::SetImageAttributes(CEikImage *)
CEikCommandButtonBase::SetPictureFromFileL(const TDesC &,TInt,TInt,CEikAlignedControl *&)
CEikCommandButtonBase::SetPictureL(const CFbsBitmap *,const CFbsBitmap *,CEikAlignedControl *&)
CEikCommandButtonBase::SetTextL(const TDesC &,CEikAlignedControl *&)
CEikCommandButtonBase::StartConstructFromResourceL(TResourceReader &)
CEikCommandButtonBase::StateChanged()
CEikCommandButtonBase::WriteInternalStateL(RWriteStream &)const
CEikCommandButtonBase::~CEikCommandButtonBase()
Public Member Enumerations
enumTDisplayContent { ETextOnly = 0x0100, EPictureOnly = 0x0200, ETextAndPicture = 0x0300 }
enumTExcess { EShare = 0x0000, EToText = 0x0010, EToPicture = 0x0020 }
enumTLayout { ETextRightPictureLeft = 0x000, ETextBottomPictureTop = 0x001, ETextTopPictureBottom = 0x002, ETextLeftPictureRight = 0x003 }
Inherited Enumerations
CCoeControl:TZoomType
CEikButtonBase:TDrawState
CEikButtonBase:TState
CEikCommandButtonBase:TWhichComponent
Private Attributes
TInt iDummy
Inherited Attributes
CCoeControl::iCoeEnv
CCoeControl::iContext
CCoeControl::iPosition
CCoeControl::iSize
CEikBorderedControl::iBorder
CEikButtonBase::iButFlags
CEikCommandButtonBase::iCmdFlags
CEikCommandButtonBase::iComponents
CEikCommandButtonBase::iMargins

Constructor & Destructor Documentation

CEikCommandButton()

IMPORT_CCEikCommandButton()

Constructor

~CEikCommandButton()

IMPORT_C~CEikCommandButton()

C++ destructor

Member Functions Documentation

AddCommandToStackL(TInt, const TDesC *, const CFbsBitmap *, const CFbsBitmap *)

IMPORT_C voidAddCommandToStackL(TIntaCommandId,
const TDesC *aText,
const CFbsBitmap *aBitmap,
const CFbsBitmap *aMask
)

Push a command ID + text + image binding onto the command stack.

Sets the command button to respond to aCommandId. Sets aText as the text in the command button. Sets aBitmap and aMask as the bitmap and mask of the command button. The previous command can be restored on the command button by a subsequent call to PopCommandFromStack().

Since
App-Framework_6.1

Parameters

TInt aCommandIdCommand ID to be generated by pressing this button
const TDesC * aTextText to display on the button
const CFbsBitmap * aBitmapBitmap to display on the button
const CFbsBitmap * aMaskMask to use. May be Null

ConstructFromResourceL(TResourceReader &)

IMPORT_C voidConstructFromResourceL(TResourceReader &aReader)[virtual]

From CCoeControl

Construct the object from resource

Parameters

TResourceReader & aReaderFully constructed resource reader

ExtensionInterface(TUid)

IMPORT_C void *ExtensionInterface(TUidaInterface)[private, virtual]

Parameters

TUid aInterface

HandlePointerEventL(const TPointerEvent &)

IMPORT_C voidHandlePointerEventL(const TPointerEvent &aPointerEvent)[virtual]

From CCoeControl

Handle a pointer event coming from the CONE framework

Parameters

const TPointerEvent & aPointerEventEvent to handle

Label()

IMPORT_C CEikLabel *Label()const

Access the label control that implements the text label of the button. Ownership is not transferred.

Picture()

IMPORT_C CEikImage *Picture()const

Access the CEikImage that implements the picture component of the button. Ownership is not transferred.

PopCommandFromStack()

IMPORT_C TIntPopCommandFromStack()

Remove the top (most recently added) command binding from the command stack

Pops the current command from the stack, if there is one. Restores the command button to respond to the previous commandId before the last push to the stack. The text, bitmap and mask are also restored to the previous values (before the last push was made).

Since
App-Framework_6.1

RemoveCommandFromStack(TInt)

IMPORT_C TBoolRemoveCommandFromStack(TIntaCommandId)

Find the stacked command with a given command ID and remove it from the stack

Removes the command which has aCommandId from the stack of commmands.

Since
App-Framework_6.1

Parameters

TInt aCommandIdID of the command to be removed

SetButtonLayout(TLayout)

IMPORT_C voidSetButtonLayout(TLayoutaLayout)

Set the layout of the button

Parameters

TLayout aLayoutLayout to be used

SetCommandL(TInt, const TDesC *, const CFbsBitmap *, const CFbsBitmap *)

IMPORT_C voidSetCommandL(TIntaCommandId,
const TDesC *aText,
const CFbsBitmap *aBitmap,
const CFbsBitmap *aMask
)

Sets the command button's text, bitmap and bitmap mask.

Sets aText as the text in the command button. Sets aBitmap and aMask as the bitmap and mask of the command button.

Since
App-Framework_6.1

Parameters

TInt aCommandIdCommand ID to be generated by pressing this button
const TDesC * aTextText to display on the button
const CFbsBitmap * aBitmapBitmap to display on the button
const CFbsBitmap * aMaskMask to use. May be Null

SetDisplayContent(TDisplayContent)

IMPORT_C voidSetDisplayContent(TDisplayContentaContent)

Set what content is to be displayed in the button

Parameters

TDisplayContent aContentEnum value saying what content to display

SetExcessSpace(TExcess)

IMPORT_C voidSetExcessSpace(TExcessaExcess)

Sets where the excess space in the layout is to be distributed

Parameters

TExcess aExcessEnum value to say where the excess space is to go

SetPictureFromFileL(const TDesC &, TInt, TInt)

IMPORT_C voidSetPictureFromFileL(const TDesC &aFilename,
TIntaMain,
TIntaMask = -1
)

Set bitmap and mask from file.

Parameters

const TDesC & aFilename
TInt aMain
TInt aMask = -1

SetPictureL(const CFbsBitmap *, const CFbsBitmap *)

IMPORT_C voidSetPictureL(const CFbsBitmap *aMain,
const CFbsBitmap *aMask = NULL
)

Sets the bitmap and optional mask for the button

Parameters

const CFbsBitmap * aMainThe bitmap to use
const CFbsBitmap * aMask = NULLThe mask. If null, then no mask will be used

SetTextL(const TDesC &)

IMPORT_C voidSetTextL(const TDesC &aText)

Sets the label text for the button.

Parameters

const TDesC & aTextThe text to set

UpdateComponentAlignment()

IMPORT_C voidUpdateComponentAlignment()[virtual]

From CEikCommandButtonBase

Cause a recalculation of the components alignment

UpdateLabelReserveLengthL(const TDesC *)

voidUpdateLabelReserveLengthL(const TDesC *aText)[private]

Parameters

const TDesC * aText

Member Enumerations Documentation

Enum TDisplayContent

Content to diplay for this button

Enumerators

ETextOnly = 0x0100
EPictureOnly = 0x0200
ETextAndPicture = 0x0300

Enum TExcess

Where to put excess space in the layout

Enumerators

EShare = 0x0000
EToText = 0x0010
EToPicture = 0x0020

Enum TLayout

Layout options for a command button

Enumerators

ETextRightPictureLeft = 0x000
ETextBottomPictureTop = 0x001
ETextTopPictureBottom = 0x002
ETextLeftPictureRight = 0x003

Member Data Documentation

TInt iDummy

TInt iDummy[private]