CEikCbaButton Class Reference

class CEikCbaButton : public CAknControl

EIKON CBA button class definition.

Inherits from

Nested Classes and Structures

Public Member Functions
~CEikCbaButton()
voidAddCommandL(const TDesC &)
voidConstructEmptyButtonL()
voidConstructFromResourceL(TResourceReader &, TGulAlignmentValue)
voidConstructL(TGulAlignmentValue)
voidDrawToContext(CBitmapContext &, CBitmapContext &, const TPoint &)
TPtrC FullLabelText()
IMPORT_C voidHandlePointerEventL(const TPointerEvent &)
TBool IsEmptyText()
TBool IsImageOn()
TSize MinimumSize()
TInt PopCommand()
TBool PressedDown()
voidPushCommandL(TInt, const TDesC &)
voidRemoveCommand(TInt)
voidRemovePreviousCommand()
voidReplaceImageByLabel()
voidSetContainerWindowL(const CCoeControl &)
voidSetDimmed(TBool)
voidSetImage(CEikImage &)
voidSetLabelFont(const CFont *)
voidSetPressedDown(const TBool)
voidSetTextBitmapMode(TBool)
voidSwitchToShortTextL(TBool)
voidTruncateLabelText()
Protected Member Functions
TInt IndexFromCommandId(TInt)
voidUpdateLabelText(TPtrC)
Private Member Functions
CCoeControl *ComponentControl(TInt)
TInt CountComponentControls()
IMPORT_C void *ExtensionInterface(TUid)
voidPrepareImageL()
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::ActivateL()
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::FocusChanged(TDrawNow)
CCoeControl::GetColor(TInt,TRgb &)const
CCoeControl::GetColorUseListL(CArrayFix< TCoeColorUse > &)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::HandleResourceChange(TInt)
CCoeControl::HasBorder()const
CCoeControl::HitTest()const
CCoeControl::IgnoreEventsUntilNextPointerUp()
CCoeControl::Index(const CCoeControl *)const
CCoeControl::InitComponentArrayL()
CCoeControl::InputCapabilities()const
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::OfferKeyEventL(const TKeyEvent &,TEventCode)
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::SetAdjacent(TInt)
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::WriteInternalStateL(RWriteStream &)const
CCoeControl::WriteInternalStateNowL(RWriteStream &)const
CCoeControl::ZoomWithType()const
CCoeControl::operator=(const CCoeControl &)
CCoeControl::~CCoeControl()
Inherited Enumerations
CCoeControl:TZoomType
Protected Attributes
CArrayFix< SButtonOptions > *iButtonOptions
TBool iDoImage
TBuf< KMaxCbaLabelLength >iFullLabelText
CEikImage *iImage
CEikLabel *iLabel
TPtrC iLongLabelText
const CFbsBitmap *iMask
TBool iPressedDown
CFbsBitmap *iSfeMask
TPtrC iShortLabelText
CDesCArray *iText
TBool iUseTextBitmap
Inherited Attributes
CCoeControl::iCoeEnv
CCoeControl::iContext
CCoeControl::iPosition
CCoeControl::iSize

Constructor & Destructor Documentation

~CEikCbaButton()

~CEikCbaButton()

Destructor.

Member Functions Documentation

AddCommandL(const TDesC &)

voidAddCommandL(const TDesC &aText)

Updates the label text with the given label.

Parameters

const TDesC & aTextThe new label text.

ComponentControl(TInt)

CCoeControl *ComponentControl(TIntaIndex)const [private, virtual]

From CCoeControl. Gets an indexed component of a compound control.

Parameters

TInt aIndex

ConstructEmptyButtonL()

voidConstructEmptyButtonL()

Constructs empty button with id EAknSoftkeyEmpty

ConstructFromResourceL(TResourceReader &, TGulAlignmentValue)

voidConstructFromResourceL(TResourceReader &aReader,
TGulAlignmentValueanAlignment
)

Constructs the control from a resource file.

Parameters

TResourceReader & aReaderThe resource reader.
TGulAlignmentValue anAlignmentAlignment for label.

ConstructL(TGulAlignmentValue)

voidConstructL(TGulAlignmentValueaAlignment)

Constructs a new CBA button instance.

Parameters

TGulAlignmentValue aAlignmentAlignment for label.

CountComponentControls()

TInt CountComponentControls()const [private, virtual]

From CCoeControl. Gets the number of controls contained in a compound control.

DrawToContext(CBitmapContext &, CBitmapContext &, const TPoint &)

voidDrawToContext(CBitmapContext &aContext,
CBitmapContext &aMaskContext,
const TPoint &aOffset
)const

Draws the button text and mask to give graphics contexts. Background is not drawn.

Parameters

CBitmapContext & aContext
CBitmapContext & aMaskContext
const TPoint & aOffset

ExtensionInterface(TUid)

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

From CAknControl.

Parameters

TUid aInterface

FullLabelText()

TPtrC FullLabelText()[inline]

Returns the textual value of the button

HandlePointerEventL(const TPointerEvent &)

IMPORT_C voidHandlePointerEventL(const TPointerEvent &aPointerEvent)[virtual]

From CCoeControl. Handles pointer events.

Parameters

const TPointerEvent & aPointerEventThe pointer event.

IndexFromCommandId(TInt)

TInt IndexFromCommandId(TIntaCommandId)[protected]

Returns the button's index by command id.

Parameters

TInt aCommandIdThe button's command id.

IsEmptyText()

TBool IsEmptyText()const

Checks if text is empty in this button.

IsImageOn()

TBool IsImageOn()const [inline]

Returns whether the button has image set.

MinimumSize()

TSize MinimumSize()[virtual]

From CCoeControl. Sets the control's minimum required size.

PopCommand()

TInt PopCommand()

Pops a command from the button stack.

PrepareImageL()

voidPrepareImageL()[private]

PressedDown()

TBool PressedDown()const

Returns the state of CEikCbaButton.

PushCommandL(TInt, const TDesC &)

voidPushCommandL(TIntaCommandId,
const TDesC &aText
)

Pushes a command into button stack.

Parameters

TInt aCommandIdThe command to be pushed.
const TDesC & aTextText for the button.

RemoveCommand(TInt)

voidRemoveCommand(TIntaCommandId)

Removes a command from the button stack.

Parameters

TInt aCommandIdThe command to be removed.

RemovePreviousCommand()

voidRemovePreviousCommand()

Removes the previous command from the button stack.

ReplaceImageByLabel()

voidReplaceImageByLabel()

Replaces the buttons image with label.

SetContainerWindowL(const CCoeControl &)

voidSetContainerWindowL(const CCoeControl &aContainer)[virtual]

From CCoeControl. Sets the control's containing window by copying it from aContainer.

Parameters

const CCoeControl & aContainerThe compound control that is the container for this control.

SetDimmed(TBool)

voidSetDimmed(TBoolaDimmed)[virtual]

From CCoeControl. Sets the control to be dimmed.

Parameters

TBool aDimmedETrue to dim the control, EFalse to set the control as not dimmed.

SetImage(CEikImage &)

voidSetImage(CEikImage &aImage)

Sets the button's image.

Parameters

CEikImage & aImageThe image to be set.

SetLabelFont(const CFont *)

voidSetLabelFont(const CFont *aLabelFont)

Sets the labels font.

Parameters

const CFont * aLabelFontThe font to be used.

SetPressedDown(const TBool)

voidSetPressedDown(const TBoolaPressedDown)

Changes the state of CEikCbaButton. Button's state is stored in a member variable.

Parameters

const TBool aPressedDownThe state that button has. ETrue if button's state is pressed down. EFalse for normal, not pressed state.

SetTextBitmapMode(TBool)

voidSetTextBitmapMode(TBoolaEnableBitmap)

Enables bitmap mode and hides the label. The text is drawn by CEikCba in bitmap mode.

Parameters

TBool aEnableBitmap

SizeChanged()

voidSizeChanged()[private, virtual]

From CCoeControl. Responds to changes to the size and position of the contents of this control.

SwitchToShortTextL(TBool)

voidSwitchToShortTextL(TBoolaShortText)

Switches the button's text to short or long depending on the parameter given.

Parameters

TBool aShortTextETrue for short text, EFalse for the long text.

TruncateLabelText()

voidTruncateLabelText()

Truncates the label. This is done by CEikLabel.

UpdateLabelText(TPtrC)

voidUpdateLabelText(TPtrCaLabelText)[protected]

Updates the label text with the given label.

Parameters

TPtrC aLabelText

Member Data Documentation

CArrayFix< SButtonOptions > * iButtonOptions

CArrayFix< SButtonOptions > *iButtonOptions[protected]

TBool iDoImage

TBool iDoImage[protected]

TBuf< KMaxCbaLabelLength > iFullLabelText

TBuf< KMaxCbaLabelLength >iFullLabelText[protected]

CEikImage * iImage

CEikImage *iImage[protected]

CEikLabel * iLabel

CEikLabel *iLabel[protected]

TPtrC iLongLabelText

TPtrC iLongLabelText[protected]

const CFbsBitmap * iMask

const CFbsBitmap *iMask[protected]

Original mask for softkey image.

TBool iPressedDown

TBool iPressedDown[protected]

Buttons state.

CFbsBitmap * iSfeMask

CFbsBitmap *iSfeMask[protected]

Feedback effects transparency mask for softkey image.

TPtrC iShortLabelText

TPtrC iShortLabelText[protected]

CDesCArray * iText

CDesCArray *iText[protected]

TBool iUseTextBitmap

TBool iUseTextBitmap[protected]

ETrue if should use text bitmap mode.