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 void ActivateL ()
TInt ButFlags ()
CEikCommandStack * CommandStack ()
IMPORT_C CCoeControl * ComponentControl ( TInt )
IMPORT_C void ConstructImageFromResourceL ( TResourceReader &, TWhichComponent )
IMPORT_C void ConstructLabelFromResourceL ( TResourceReader &, TWhichComponent )
IMPORT_C TInt CountComponentControls ()
IMPORT_C void FocusChanged ( TDrawNow )
IMPORT_C void GetColorUseListL ( CArrayFix < TCoeColorUse > &)
IMPORT_C void HandlePointerEventL (const TPointerEvent &)
IMPORT_C void HandleResourceChange ( TInt )
TBool IsDefault ()
IMPORT_C void LayoutComponents ()
IMPORT_C TSize MinimumSize ()
IMPORT_C TKeyResponse OfferKeyEventL (const TKeyEvent &, TEventCode )
IMPORT_C void SetButtonLayout ( TLayout )
IMPORT_C void SetContainerWindowL (const CCoeControl &)
IMPORT_C void SetDefault ( TBool )
IMPORT_C void SetDimmed ( TBool )
IMPORT_C void SetDisplayContent ( TDisplayContent )
IMPORT_C void SetExcessSpace ( TExcess )
IMPORT_C void StartConstructFromResourceL ( TResourceReader &)
IMPORT_C void UpdateComponentAlignment ()
Protected Member Functions
CEikCommandButtonBase ()
TInt Behavior ()
void CheckCreateCommandStackL ()
IMPORT_C void Draw (const TRect &)
void SetImageAttributes ( CEikImage *)
IMPORT_C void SetPictureFromFileL (const TDesC &, TInt , TInt , CEikAlignedControl *&)
IMPORT_C void SetPictureL (const CFbsBitmap *, const CFbsBitmap *, CEikAlignedControl *&)
IMPORT_C void SetTextL (const TDesC &, CEikAlignedControl *&)
IMPORT_C void StateChanged ()
IMPORT_C void WriteInternalStateL ( RWriteStream &)
Private Member Functions
IMPORT_C void * ExtensionInterface ( TUid )
TBool LayoutIsVertical ()
IMPORT_C void PrepareContext ( CWindowGc &)
IMPORT_C void Reserved_2 ()
IMPORT_C void Reserved_3 ()
IMPORT_C void Reserved_4 ()
void SetComponentExtents (const TRect &)
void SetNewComponentExtentL ()
IMPORT_C void SizeChanged ()
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
enum TDisplayContent { EFirstOnly  = 0x0100, ESecondOnly  = 0x0200, EBoth  = 0x0300 }
enum TExcess { EShare  = 0x0000, EToFirst  = 0x0010, EToSecond  = 0x0020 }
enum TLayout { EFirstRightSecondLeft  = 0x0000, EFirstBottomSecondTop  = 0x0001, EFirstTopSecondBottom  = 0x0002, EFirstLeftSecondRight  = 0x0003, EDenseFont  = 0x0008 }
enum TWhichComponent { 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_C CEikCommandButtonBase ( ) [protected]

Constructor

~CEikCommandButtonBase()

IMPORT_C ~CEikCommandButtonBase ( )

C++ destructor

Member Functions Documentation

ActivateL()

IMPORT_C void ActivateL ( ) [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()

void CheckCreateCommandStackL ( ) [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 ( TInt aIndex ) const [virtual]

From CCoeControl

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

Parameters

TInt aIndex

ConstructImageFromResourceL(TResourceReader &, TWhichComponent)

IMPORT_C void ConstructImageFromResourceL ( TResourceReader & aReader,
TWhichComponent aWhich
)

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 void ConstructLabelFromResourceL ( TResourceReader & aReader,
TWhichComponent aWhich
)

Constructs a label component for the button

aWhich Which component to construct in this call

Parameters

TResourceReader & aReader
TWhichComponent aWhich

CountComponentControls()

IMPORT_C TInt CountComponentControls ( ) const [virtual]

From CCoeControl

Returns the number of component controls

Draw(const TRect &)

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

From CCoeControl

Request for the control to draw itself within the given rectangle

Parameters

const TRect & aRect TRect to draw

ExtensionInterface(TUid)

IMPORT_C void * ExtensionInterface ( TUid aInterface ) [private, virtual]

Parameters

TUid aInterface

FocusChanged(TDrawNow)

IMPORT_C void FocusChanged ( TDrawNow aDrawNow ) [virtual]

From CCoeControl

Called when the focus has changed

Parameters

TDrawNow aDrawNow Iff not EFalse, then the control is requested to redraw.

GetColorUseListL(CArrayFix< TCoeColorUse > &)

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

From CCoeControl

Obtain the list of colors to be used by this control

Since
ER5U

Parameters

CArrayFix < TCoeColorUse > & aColorUseList Gets 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 void HandlePointerEventL ( const TPointerEvent & aPointerEvent ) [virtual]

From CCoeControl

Handle a pointer event that has been routed to this control

Parameters

const TPointerEvent & aPointerEvent Pointer event to handle

HandleResourceChange(TInt)

IMPORT_C void HandleResourceChange ( TInt aType ) [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 aType Type of resource or setting that has changed

IsDefault()

TBool IsDefault ( ) const

Access to whether the button is default

LayoutComponents()

IMPORT_C void LayoutComponents ( )

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

LayoutIsVertical()

TBool LayoutIsVertical ( ) const [private]

MinimumSize()

IMPORT_C TSize MinimumSize ( ) [virtual]

From CCoeControl

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

OfferKeyEventL(const TKeyEvent &, TEventCode)

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

From CCoeControl

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

Parameters

const TKeyEvent & aKeyEvent Wserv event type
TEventCode

PrepareContext(CWindowGc &)

IMPORT_C void PrepareContext ( 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 & aGc Graphics context to set up

Reserved_2()

IMPORT_C void Reserved_2 ( ) [private, virtual]

Reserved_3()

IMPORT_C void Reserved_3 ( ) [private, virtual]

Reserved_4()

IMPORT_C void Reserved_4 ( ) [private, virtual]

SetButtonLayout(TLayout)

IMPORT_C void SetButtonLayout ( TLayout aLayout )

Sets the layout of the button

Parameters

TLayout aLayout Layout enumeration

SetComponentExtents(const TRect &)

void SetComponentExtents ( const TRect & aRect ) [private]

Parameters

const TRect & aRect

SetContainerWindowL(const CCoeControl &)

IMPORT_C void SetContainerWindowL ( const CCoeControl & aContainer ) [virtual]

From CCoeControl

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

Parameters

const CCoeControl & aContainer control

SetDefault(TBool)

IMPORT_C void SetDefault ( TBool aIsDefault )

Sets this button to be the default.

Parameters

TBool aIsDefault

SetDimmed(TBool)

IMPORT_C void SetDimmed ( TBool aDimmed ) [virtual]

From CCoeControl

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

Parameters

TBool aDimmed If not EFalse, set the state to dimmed. Otherwise set to non-dimmed

SetDisplayContent(TDisplayContent)

IMPORT_C void SetDisplayContent ( TDisplayContent aContent )

Sets the content of the button

Parameters

TDisplayContent aContent

SetExcessSpace(TExcess)

IMPORT_C void SetExcessSpace ( TExcess aExcess )

Sets where excess space is to be put

Parameters

TExcess aExcess Excess space enumeration

SetImageAttributes(CEikImage *)

void SetImageAttributes ( CEikImage * aImage ) [protected]

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

Parameters

CEikImage * aImage

SetNewComponentExtentL()

void SetNewComponentExtentL ( ) [private]

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

IMPORT_C void SetPictureFromFileL ( const TDesC & aFilename,
TInt aMain,
TInt aMask,
CEikAlignedControl *& aComponent
) [protected]

Sets the bitmap and optional mask from an mbm file.

Parameters

const TDesC & aFilename
TInt aMain Index of the bitmap to use
TInt aMask Index of the mask. If -1, then a null mask will be used
CEikAlignedControl *& aComponent The component for which the picture is to be set.

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

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

Sets the bitmap and optional mask for the button

Parameters

const CFbsBitmap * aMain The bitmap to use
const CFbsBitmap * aMask The mask. If null, then no mask will be used
CEikAlignedControl *& aComponent The component for which the picture is to be set.

SetTextL(const TDesC &, CEikAlignedControl *&)

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

Sets the label text for the button.

Parameters

const TDesC & aText The text to set
CEikAlignedControl *& aComponent The component for which the text is to be set.

SizeChanged()

IMPORT_C void SizeChanged ( ) [private, virtual]

From CCoeControl

Framework method called when the size or layout changes

StartConstructFromResourceL(TResourceReader &)

IMPORT_C void StartConstructFromResourceL ( 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 void StateChanged ( ) [protected, virtual]

From CEikButtonBase

Framework method called when the state changes

UpdateComponentAlignment()

IMPORT_C void UpdateComponentAlignment ( ) [virtual]

Cause a recalculation of the components alignment

WriteInternalStateL(RWriteStream &)

IMPORT_C void WriteInternalStateL ( 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 & aWriteStream Output 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]