CEikCommandButtonBase Class Reference

#include <mw/eikcmbut.h>

Link against: eikcoctl.dll

class CEikCommandButtonBase : public CEikButtonBase

Inherits from

Protected Attributes
TInt iCmdFlags
CEikAlignedControl *iComponents
TMargins8 iMargins
Public Member Enumerations
enumTDisplayContent { EFirstOnly, ESecondOnly, EBoth }
enumTExcess { EShare, EToFirst, EToSecond }
enumTLayout { EFirstRightSecondLeft, EFirstBottomSecondTop, EFirstTopSecondBottom, EFirstLeftSecondRight, EDenseFont }
enumTWhichComponent { EFirst, ESecond }
Public Member Functions
~CEikCommandButtonBase()
virtual IMPORT_C voidActivateL()
TInt ButFlags()
CEikCommandStack *CommandStack()
virtual IMPORT_C CCoeControl *ComponentControl(TInt)
IMPORT_C voidConstructImageFromResourceL(TResourceReader &, TWhichComponent)
IMPORT_C voidConstructLabelFromResourceL(TResourceReader &, TWhichComponent)
virtual IMPORT_C TIntCountComponentControls()
virtual IMPORT_C voidFocusChanged(TDrawNow)
virtual IMPORT_C voidGetColorUseListL(CArrayFix< TCoeColorUse > &)
virtual IMPORT_C voidHandlePointerEventL(const TPointerEvent &)
virtual IMPORT_C voidHandleResourceChange(TInt)
TBool IsDefault()
IMPORT_C voidLayoutComponents()
virtual IMPORT_C TSizeMinimumSize()
virtual IMPORT_C TKeyResponseOfferKeyEventL(const TKeyEvent &, TEventCode)
IMPORT_C voidSetButtonLayout(TLayout)
virtual IMPORT_C voidSetContainerWindowL(const CCoeControl &)
IMPORT_C voidSetDefault(TBool)
virtual IMPORT_C voidSetDimmed(TBool)
IMPORT_C voidSetDisplayContent(TDisplayContent)
IMPORT_C voidSetExcessSpace(TExcess)
IMPORT_C voidStartConstructFromResourceL(TResourceReader &)
virtual IMPORT_C voidUpdateComponentAlignment()
Protected Member Functions
CEikCommandButtonBase()
TInt Behavior()
voidCheckCreateCommandStackL()
virtual IMPORT_C voidDraw(const TRect &)
voidSetImageAttributes(CEikImage *)
IMPORT_C voidSetPictureFromFileL(const TDesC &, TInt, TInt, CEikAlignedControl *&)
IMPORT_C voidSetPictureL(const CFbsBitmap *, const CFbsBitmap *, CEikAlignedControl *&)
IMPORT_C voidSetTextL(const TDesC &, CEikAlignedControl *&)
virtual IMPORT_C voidStateChanged()
virtual IMPORT_C voidWriteInternalStateL(RWriteStream &)
Inherited Attributes
CCoeControl::iCoeEnv
CCoeControl::iContext
CCoeControl::iPosition
CCoeControl::iSize
CEikBorderedControl::iBorder
CEikButtonBase::iButFlags
Inherited Enumerations
CCoeControl:TZoomType
CEikButtonBase:TDrawState
CEikButtonBase:TState
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::CCoeControlArray
CCoeControl::CapturesPointer()const
CCoeControl::ClaimPointerGrab(TBool)
CCoeControl::ClaimPointerGrab(TInt,TBool)
CCoeControl::CloseWindow()
CCoeControl::ComponentArrayExists()const
CCoeControl::Components()
CCoeControl::Components()const
CCoeControl::ConstructFromResourceL(TResourceReader &)
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()

Detailed Description

Base class for buttons that generate commands.

MControlContext is mixed in. This class is used as the interface to the button member of CEikLabeledButton, as well as being the base class for CEikCommandButton, CEikTextButton, and CEikBitmapButton

Since
S60 1.0

Member Attribute Documentation

iCmdFlags

TInt iCmdFlags[protected]

iComponents

CEikAlignedControl *iComponents[protected]

The components of the button: the image or the text (order determined by construction)

iMargins

TMargins8 iMargins[protected]

Member Enumeration Documentation

Enum TDisplayContent

Controls which of the components of the command button are shown.

EnumeratorValueDescription
EFirstOnly0x0100
ESecondOnly0x0200
EBoth0x0300

Enum TExcess

Options for where excess space between the two components of the command button is distrubuted

EnumeratorValueDescription
EShare0x0000
EToFirst0x0010
EToSecond0x0020

Enum TLayout

Enum TWhichComponent

Enumeration to tag the components of a command button (text or image)

EnumeratorValueDescription
EFirst
ESecond

Constructor & Destructor Documentation

CEikCommandButtonBase ( )

IMPORT_CCEikCommandButtonBase()[protected]

Constructor

~CEikCommandButtonBase ( )

IMPORT_C~CEikCommandButtonBase()

C++ destructor

Member Function Documentation

ActivateL ( )

IMPORT_C voidActivateL()[virtual]

Reimplemented from CCoeControl::ActivateL()

From CCoeControl

Make the control ready for display.

Behavior ( )

TInt Behavior()const [protected, inline]

Access the behaviour set into the button

ButFlags ( )

TInt ButFlags()const

Access to the button flags

Returns: The button flag pattern

CheckCreateCommandStackL ( )

voidCheckCreateCommandStackL()[protected, inline]

Utility routine. Calling this without a leave will ensure the internal command stack is constructed.

CommandStack ( )

CEikCommandStack *CommandStack()const

Access to the command stack

Returns: pointer to the command stack

ComponentControl ( TInt )

IMPORT_C CCoeControl *ComponentControl(TIntaIndex)const [virtual]

From CCoeControl

Return a pointer to the component control at the give index.

Returns: Pointer to the conponent control. No ownership is transferred

ConstructImageFromResourceL ( TResourceReader &, TWhichComponent )

IMPORT_C voidConstructImageFromResourceL(TResourceReader &aReader,
TWhichComponentaWhich
)

Constructs an image component for the button

aWhich Which component to construct in this call

ConstructLabelFromResourceL ( TResourceReader &, TWhichComponent )

IMPORT_C voidConstructLabelFromResourceL(TResourceReader &aReader,
TWhichComponentaWhich
)

Constructs a label component for the button

aWhich Which component to construct in this call

CountComponentControls ( )

IMPORT_C TIntCountComponentControls()const [virtual]

From CCoeControl

Returns the number of component controls

Returns: Number of component controls

Draw ( const TRect & )

IMPORT_C voidDraw(const TRect &aRect)const [protected, virtual]

From CCoeControl

Request for the control to draw itself within the given rectangle

ParameterDescription
aRectTRect to draw

FocusChanged ( TDrawNow )

IMPORT_C voidFocusChanged(TDrawNowaDrawNow)[virtual]

From CCoeControl

Called when the focus has changed

ParameterDescription
aDrawNowIff not EFalse, then the control is requested to redraw.

GetColorUseListL ( CArrayFix< TCoeColorUse > & )

IMPORT_C voidGetColorUseListL(CArrayFix< TCoeColorUse > &aColorUseList)const [virtual]

From CCoeControl

Obtain the list of colors to be used by this control

HandlePointerEventL ( const TPointerEvent & )

IMPORT_C voidHandlePointerEventL(const TPointerEvent &aPointerEvent)[virtual]

From CCoeControl

Handle a pointer event that has been routed to this control

ParameterDescription
aPointerEventPointer event to handle

HandleResourceChange ( TInt )

IMPORT_C voidHandleResourceChange(TIntaType)[virtual]

From CCoeControl

This is called when resource or layout or other display-affecting setting has changed. Change the internals of the control so that it is ready for a subsequent SizeChanged call.

ParameterDescription
aTypeType of resource or setting that has changed

IsDefault ( )

TBool IsDefault()const

Access to whether the button is default

Returns: EFalse iff the button is not default.

LayoutComponents ( )

IMPORT_C voidLayoutComponents()

Causes the content to be (re-)laid out.

MinimumSize ( )

IMPORT_C TSizeMinimumSize()[virtual]

Reimplemented from CCoeControl::MinimumSize()

From CCoeControl

Reports to the caller the minimum size that the control can be, given its contents.

Returns: The minimum size

OfferKeyEventL ( const TKeyEvent &, TEventCode )

IMPORT_C TKeyResponseOfferKeyEventL(const TKeyEvent &aKeyEvent,
TEventCode
)[virtual]

From CCoeControl

CONE framework is requesting that the passed-in key be handled.

ParameterDescription
aKeyEventWserv event type

SetButtonLayout ( TLayout )

IMPORT_C voidSetButtonLayout(TLayoutaLayout)

Sets the layout of the button

ParameterDescription
aLayoutLayout enumeration

SetContainerWindowL ( const CCoeControl & )

IMPORT_C voidSetContainerWindowL(const CCoeControl &aContainer)[virtual]

From CCoeControl

Sets the control whose window is to be used as a container for this control

ParameterDescription
aContainercontrol

SetDefault ( TBool )

IMPORT_C voidSetDefault(TBoolaIsDefault)

Sets this button to be the default.

SetDimmed ( TBool )

IMPORT_C voidSetDimmed(TBoolaDimmed)[virtual]

From CCoeControl

Sets the button to be inactive. The button is drawn with a dimmed effect.

ParameterDescription
aDimmedIf not EFalse, set the state to dimmed. Otherwise set to non-dimmed

SetDisplayContent ( TDisplayContent )

IMPORT_C voidSetDisplayContent(TDisplayContentaContent)

Sets the content of the button

SetExcessSpace ( TExcess )

IMPORT_C voidSetExcessSpace(TExcessaExcess)

Sets where excess space is to be put

ParameterDescription
aExcessExcess space enumeration

SetImageAttributes ( CEikImage * )

voidSetImageAttributes(CEikImage *aImage)[protected]

Utility routine. Sets additional look and feel attributes for the image

SetPictureFromFileL ( const TDesC &, TInt, TInt, CEikAlignedControl *& )

IMPORT_C voidSetPictureFromFileL(const TDesC &aFilename,
TIntaMain,
TIntaMask,
CEikAlignedControl *&aComponent
)[protected]

Sets the bitmap and optional mask from an mbm file.

ParameterDescription
aMainIndex of the bitmap to use
aMaskIndex of the mask. If -1, then a null mask will be used
aComponentThe component for which the picture is to be set.

SetPictureL ( const CFbsBitmap *, const CFbsBitmap *, CEikAlignedControl *& )

IMPORT_C voidSetPictureL(const CFbsBitmap *aMain,
const CFbsBitmap *aMask,
CEikAlignedControl *&aComponent
)[protected]

Sets the bitmap and optional mask for the button

ParameterDescription
aMainThe bitmap to use
aMaskThe mask. If null, then no mask will be used
aComponentThe component for which the picture is to be set.

SetTextL ( const TDesC &, CEikAlignedControl *& )

IMPORT_C voidSetTextL(const TDesC &aText,
CEikAlignedControl *&aComponent
)[protected]

Sets the label text for the button.

ParameterDescription
aTextThe text to set
aComponentThe component for which the text is to be set.

StartConstructFromResourceL ( TResourceReader & )

IMPORT_C voidStartConstructFromResourceL(TResourceReader &aReader)

Read preamble part of the resource. This call can be followed by calls to ConstructLabelFromResourceL and/or ConstructImageFromResourceL to complete contruction.

StateChanged ( )

IMPORT_C voidStateChanged()[protected, virtual]

From CEikButtonBase

Framework method called when the state changes

UpdateComponentAlignment ( )

IMPORT_C voidUpdateComponentAlignment()[virtual]

Cause a recalculation of the components alignment

WriteInternalStateL ( RWriteStream & )

IMPORT_C voidWriteInternalStateL(RWriteStream &aWriteStream)const [protected, virtual]

From CCoeControl

Serialize the state of the control

ParameterDescription
aWriteStreamOutput stream for the serialization