CEikCbaButton Class Reference

class CEikCbaButton : public CAknControl

EIKON CBA button class definition.

Inherits from

Nested Classes and Structures

Public Member Functions
~CEikCbaButton ()
void AddCommandL (const TDesC &)
void ConstructEmptyButtonL ()
void ConstructFromResourceL ( TResourceReader &, TGulAlignmentValue )
void ConstructL ( TGulAlignmentValue )
void DrawToContext ( CBitmapContext &, CBitmapContext &, const TPoint &)
TPtrC FullLabelText ()
IMPORT_C void HandlePointerEventL (const TPointerEvent &)
TBool IsEmptyText ()
TBool IsImageOn ()
TSize MinimumSize ()
TInt PopCommand ()
TBool PressedDown ()
void PushCommandL ( TInt , const TDesC &)
void RemoveCommand ( TInt )
void RemovePreviousCommand ()
void ReplaceImageByLabel ()
void SetContainerWindowL (const CCoeControl &)
void SetDimmed ( TBool )
void SetImage ( CEikImage &)
void SetLabelFont (const CFont *)
void SetPressedDown (const TBool )
void SetTextBitmapMode ( TBool )
void SwitchToShortTextL ( TBool )
void TruncateLabelText ()
Protected Member Functions
TInt IndexFromCommandId ( TInt )
void UpdateLabelText ( TPtrC )
Private Member Functions
CCoeControl * ComponentControl ( TInt )
TInt CountComponentControls ()
IMPORT_C void * ExtensionInterface ( TUid )
void PrepareImageL ()
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::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 &)

void AddCommandL ( const TDesC & aText )

Updates the label text with the given label.

Parameters

const TDesC & aText The new label text.

ComponentControl(TInt)

CCoeControl * ComponentControl ( TInt aIndex ) const [private, virtual]

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

Parameters

TInt aIndex

ConstructEmptyButtonL()

void ConstructEmptyButtonL ( )

Constructs empty button with id EAknSoftkeyEmpty

ConstructFromResourceL(TResourceReader &, TGulAlignmentValue)

void ConstructFromResourceL ( TResourceReader & aReader,
TGulAlignmentValue anAlignment
)

Constructs the control from a resource file.

Parameters

TResourceReader & aReader The resource reader.
TGulAlignmentValue anAlignment Alignment for label.

ConstructL(TGulAlignmentValue)

void ConstructL ( TGulAlignmentValue aAlignment )

Constructs a new CBA button instance.

Parameters

TGulAlignmentValue aAlignment Alignment 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 &)

void DrawToContext ( 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 ( TUid aInterface ) [private, virtual]

Parameters

TUid aInterface

FullLabelText()

TPtrC FullLabelText ( ) [inline]

Returns the textual value of the button

HandlePointerEventL(const TPointerEvent &)

IMPORT_C void HandlePointerEventL ( const TPointerEvent & aPointerEvent ) [virtual]

From CCoeControl . Handles pointer events.

Parameters

const TPointerEvent & aPointerEvent The pointer event.

IndexFromCommandId(TInt)

TInt IndexFromCommandId ( TInt aCommandId ) [protected]

Returns the button's index by command id.

Parameters

TInt aCommandId The 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()

void PrepareImageL ( ) [private]

PressedDown()

TBool PressedDown ( ) const

Returns the state of CEikCbaButton .

PushCommandL(TInt, const TDesC &)

void PushCommandL ( TInt aCommandId,
const TDesC & aText
)

Pushes a command into button stack.

Parameters

TInt aCommandId The command to be pushed.
const TDesC & aText Text for the button.

RemoveCommand(TInt)

void RemoveCommand ( TInt aCommandId )

Removes a command from the button stack.

Parameters

TInt aCommandId The command to be removed.

RemovePreviousCommand()

void RemovePreviousCommand ( )

Removes the previous command from the button stack.

ReplaceImageByLabel()

void ReplaceImageByLabel ( )

Replaces the buttons image with label.

SetContainerWindowL(const CCoeControl &)

void SetContainerWindowL ( const CCoeControl & aContainer ) [virtual]

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

Parameters

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

SetDimmed(TBool)

void SetDimmed ( TBool aDimmed ) [virtual]

From CCoeControl . Sets the control to be dimmed.

Parameters

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

SetImage(CEikImage &)

void SetImage ( CEikImage & aImage )

Sets the button's image.

Parameters

CEikImage & aImage The image to be set.

SetLabelFont(const CFont *)

void SetLabelFont ( const CFont * aLabelFont )

Sets the labels font.

Parameters

const CFont * aLabelFont The font to be used.

SetPressedDown(const TBool)

void SetPressedDown ( const TBool aPressedDown )

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

Parameters

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

SetTextBitmapMode(TBool)

void SetTextBitmapMode ( TBool aEnableBitmap )

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

Parameters

TBool aEnableBitmap

SizeChanged()

void SizeChanged ( ) [private, virtual]

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

SwitchToShortTextL(TBool)

void SwitchToShortTextL ( TBool aShortText )

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

Parameters

TBool aShortText ETrue for short text, EFalse for the long text.

TruncateLabelText()

void TruncateLabelText ( )

Truncates the label. This is done by CEikLabel .

UpdateLabelText(TPtrC)

void UpdateLabelText ( TPtrC aLabelText ) [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.