CEikCommandButtonBase Class Reference

class CEikCommandButtonBase : public CEikButtonBase

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

eikcoctl.dll
Since
S60 1.0
Public Member Functions
~CEikCommandButtonBase()
IMPORT_C voidActivateL()
TInt ButFlags()
CEikCommandStack *CommandStack()
IMPORT_C CCoeControl *ComponentControl(TInt)
IMPORT_C voidConstructImageFromResourceL(TResourceReader &, TWhichComponent)
IMPORT_C voidConstructLabelFromResourceL(TResourceReader &, TWhichComponent)
IMPORT_C TIntCountComponentControls()
IMPORT_C voidFocusChanged(TDrawNow)
IMPORT_C voidGetColorUseListL(CArrayFix< TCoeColorUse > &)
IMPORT_C voidHandlePointerEventL(const TPointerEvent &)
IMPORT_C voidHandleResourceChange(TInt)
TBool IsDefault()
IMPORT_C voidLayoutComponents()
IMPORT_C TSizeMinimumSize()
IMPORT_C TKeyResponseOfferKeyEventL(const TKeyEvent &, TEventCode)
IMPORT_C voidSetButtonLayout(TLayout)
IMPORT_C voidSetContainerWindowL(const CCoeControl &)
IMPORT_C voidSetDefault(TBool)
IMPORT_C voidSetDimmed(TBool)
IMPORT_C voidSetDisplayContent(TDisplayContent)
IMPORT_C voidSetExcessSpace(TExcess)
IMPORT_C voidStartConstructFromResourceL(TResourceReader &)
IMPORT_C voidUpdateComponentAlignment()
Protected Member Functions
CEikCommandButtonBase()
TInt Behavior()
voidCheckCreateCommandStackL()
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 *&)
IMPORT_C voidStateChanged()
IMPORT_C voidWriteInternalStateL(RWriteStream &)
Private Member Functions
IMPORT_C void *ExtensionInterface(TUid)
TBool LayoutIsVertical()
IMPORT_C voidPrepareContext(CWindowGc &)
IMPORT_C voidReserved_2()
IMPORT_C voidReserved_3()
IMPORT_C voidReserved_4()
voidSetComponentExtents(const TRect &)
voidSetNewComponentExtentL()
IMPORT_C voidSizeChanged()
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::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()
Public Member Enumerations
enumTDisplayContent { EFirstOnly = 0x0100, ESecondOnly = 0x0200, EBoth = 0x0300 }
enumTExcess { EShare = 0x0000, EToFirst = 0x0010, EToSecond = 0x0020 }
enumTLayout { EFirstRightSecondLeft = 0x0000, EFirstBottomSecondTop = 0x0001, EFirstTopSecondBottom = 0x0002, EFirstLeftSecondRight = 0x0003, EDenseFont = 0x0008 }
enumTWhichComponent { EFirst, ESecond }
Inherited Enumerations
CCoeControl:TZoomType
CEikButtonBase:TDrawState
CEikButtonBase:TState
Protected Attributes
TInt iCmdFlags
CEikAlignedControl *iComponents
TMargins8 iMargins
Private Attributes
CEikCommandStack *iCommandStack
TBool iDefault
TInt iDrawOffset
TInt iDummy
Inherited Attributes
CCoeControl::iCoeEnv
CCoeControl::iContext
CCoeControl::iPosition
CCoeControl::iSize
CEikBorderedControl::iBorder
CEikButtonBase::iButFlags

Constructor & Destructor Documentation

CEikCommandButtonBase()

IMPORT_CCEikCommandButtonBase()[protected]

Constructor

~CEikCommandButtonBase()

IMPORT_C~CEikCommandButtonBase()

C++ destructor

Member Functions Documentation

ActivateL()

IMPORT_C voidActivateL()[virtual]

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

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

ComponentControl(TInt)

IMPORT_C CCoeControl *ComponentControl(TIntaIndex)const [virtual]

From CCoeControl

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

Parameters

TInt aIndex

ConstructImageFromResourceL(TResourceReader &, TWhichComponent)

IMPORT_C voidConstructImageFromResourceL(TResourceReader &aReader,
TWhichComponentaWhich
)

Constructs an image component for the button

aWhich Which component to construct in this call

Parameters

TResourceReader & aReader
TWhichComponent aWhich

ConstructLabelFromResourceL(TResourceReader &, TWhichComponent)

IMPORT_C voidConstructLabelFromResourceL(TResourceReader &aReader,
TWhichComponentaWhich
)

Constructs a label component for the button

aWhich Which component to construct in this call

Parameters

TResourceReader & aReader
TWhichComponent aWhich

CountComponentControls()

IMPORT_C TIntCountComponentControls()const [virtual]

From CCoeControl

Returns the 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

Parameters

const TRect & aRectTRect to draw

ExtensionInterface(TUid)

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

Parameters

TUid aInterface

FocusChanged(TDrawNow)

IMPORT_C voidFocusChanged(TDrawNowaDrawNow)[virtual]

From CCoeControl

Called when the focus has changed

Parameters

TDrawNow 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

Since
ER5U

Parameters

CArrayFix< TCoeColorUse > & aColorUseListGets the list of logical colors employed in the drawing of the control, paired with an explanation of how they are used. Appends the list to aColorUseList.

HandlePointerEventL(const TPointerEvent &)

IMPORT_C voidHandlePointerEventL(const TPointerEvent &aPointerEvent)[virtual]

From CCoeControl

Handle a pointer event that has been routed to this control

Parameters

const TPointerEvent & 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.

Handles a change to the control's resources of type aType which are shared across the environment, e.g. colors or fonts.

Since
ER5U

Parameters

TInt aTypeType of resource or setting that has changed

IsDefault()

TBool IsDefault()const

Access to whether the button is default

LayoutComponents()

IMPORT_C voidLayoutComponents()

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

LayoutIsVertical()

TBool LayoutIsVertical()const [private]

MinimumSize()

IMPORT_C TSizeMinimumSize()[virtual]

From CCoeControl

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

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.

Parameters

const TKeyEvent & aKeyEventWserv event type
TEventCode

PrepareContext(CWindowGc &)

IMPORT_C voidPrepareContext(CWindowGc &aGc)const [private]

From MCoeControlContext

Modify the passed-in graphics context ready for use in this control

Prepares the basic graphic contents according to the the type of command button, e.g. pen and brush colors.

Since
ER5U

Parameters

CWindowGc & aGcGraphics context to set up

Reserved_2()

IMPORT_C voidReserved_2()[private, virtual]

Reserved_3()

IMPORT_C voidReserved_3()[private, virtual]

Reserved_4()

IMPORT_C voidReserved_4()[private, virtual]

SetButtonLayout(TLayout)

IMPORT_C voidSetButtonLayout(TLayoutaLayout)

Sets the layout of the button

Parameters

TLayout aLayoutLayout enumeration

SetComponentExtents(const TRect &)

voidSetComponentExtents(const TRect &aRect)[private]

Parameters

const TRect & aRect

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

Parameters

const CCoeControl & aContainercontrol

SetDefault(TBool)

IMPORT_C voidSetDefault(TBoolaIsDefault)

Sets this button to be the default.

Parameters

TBool aIsDefault

SetDimmed(TBool)

IMPORT_C voidSetDimmed(TBoolaDimmed)[virtual]

From CCoeControl

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

Parameters

TBool 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

Parameters

TDisplayContent aContent

SetExcessSpace(TExcess)

IMPORT_C voidSetExcessSpace(TExcessaExcess)

Sets where excess space is to be put

Parameters

TExcess aExcessExcess space enumeration

SetImageAttributes(CEikImage *)

voidSetImageAttributes(CEikImage *aImage)[protected]

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

Parameters

CEikImage * aImage

SetNewComponentExtentL()

voidSetNewComponentExtentL()[private]

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.

Parameters

const TDesC & aFilename
TInt aMainIndex of the bitmap to use
TInt aMaskIndex of the mask. If -1, then a null mask will be used
CEikAlignedControl *& 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

Parameters

const CFbsBitmap * aMainThe bitmap to use
const CFbsBitmap * aMaskThe mask. If null, then no mask will be used
CEikAlignedControl *& 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.

Parameters

const TDesC & aTextThe text to set
CEikAlignedControl *& aComponentThe component for which the text is to be set.

SizeChanged()

IMPORT_C voidSizeChanged()[private, virtual]

From CCoeControl

Framework method called when the size or layout changes

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.

Parameters

TResourceReader & aReader

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

Writes the internal state of the control and its components to aStream. Does nothing in release mode. Designed to be overidden and base called by subclasses.

Parameters

RWriteStream & aWriteStreamOutput stream for the serialization

Member Enumerations Documentation

Enum TDisplayContent

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

Enumerators

EFirstOnly = 0x0100
ESecondOnly = 0x0200
EBoth = 0x0300

Enum TExcess

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

Enumerators

EShare = 0x0000
EToFirst = 0x0010
EToSecond = 0x0020

Enum TLayout

Enumerators

EFirstRightSecondLeft = 0x0000
EFirstBottomSecondTop = 0x0001
EFirstTopSecondBottom = 0x0002
EFirstLeftSecondRight = 0x0003
EDenseFont = 0x0008

Enum TWhichComponent

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

Enumerators

EFirst
ESecond

Member Data Documentation

TInt iCmdFlags

TInt iCmdFlags[protected]

CEikCommandStack * iCommandStack

CEikCommandStack *iCommandStack[private]

Owned

CEikAlignedControl * iComponents

CEikAlignedControl *iComponents[protected]

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

TBool iDefault

TBool iDefault[private]

TInt iDrawOffset

TInt iDrawOffset[private]

TInt iDummy

TInt iDummy[private]

TMargins8 iMargins

TMargins8 iMargins[protected]