CAknButton Class Reference

#include <mw/aknbutton.h>

Link against: eikcoctl.lib

class CAknButton : public CAknControl

Inherits from

Protected Attributes
CAknsFrameBackgroundControlContext *iBgContext
TBool iButtonPressed
HBufC *iDimmedHelpText
TInt iFlags
const CFont *iFont
CAknInfoPopupNoteController *iHelpNote
TInt iHelpNoteInViewInterval
TInt iHelpNoteWaitInterval
TRect iHighlightRect
CGraphicsContext::TTextAlign iHorizontalAlignment
TBool iKeyDownReported
TInt iKeyRepeatDelay
TInt iKeyRepeatInterval
CPeriodic *iKeyRepeatTimer
TInt iNumberOfDragEvents
TScaleMode iScaleMode
TBool iShowHelp
TInt iStateIndex
CArrayPtrFlat< CAknButtonState > *iStates
TInt iTextColorIndex
TAknsItemID iTextColorTableId
TAlignment iVerticalAlignment
Public Member Enumerations
enumTAlignment { ECenter, ETop, EBottom, ERight, ELeft }
enumTButtonEvent { ELongPressEvent, ELongPressEndedEvent }
enumTTextAndIconAlignment { EIconBeforeText, EIconAfterText, EIconUnderText, EIconOverText, EOverlay }
enumTTooltipPosition { EPositionTop, EPositionBottom, EPositionLeft, EPositionRight }
Public Member Functions
virtual ~CAknButton()
virtual IMPORT_C voidActivateL()
virtual IMPORT_C voidAddStateL(CGulIcon *, CGulIcon *, CGulIcon *, CGulIcon *, const TDesC &, const TDesC &, const TInt)
virtual IMPORT_C voidAddStateL(const TDesC &, const TInt, const TInt, const TInt, const TInt, const TInt, const TInt, const TInt, const TInt, const TDesC &, const TDesC &, const TInt, const TAknsItemID &, const TAknsItemID &, const TAknsItemID &, const TAknsItemID &)
voidAddStateL(CGulIcon *, CGulIcon *, CGulIcon *, CGulIcon *, const TDesC &, const TDesC &, const TInt, const TInt)
CAknsFrameBackgroundControlContext *BgContext()
IMPORT_C TIntButtonFlags()
voidCheckHitArea()
virtual IMPORT_C voidConstructFromResourceL(TResourceReader &)
IMPORT_C voidConstructFromResourceL(const TInt)
IMPORT_C voidDisablePictographs()
IMPORT_C voidEnableFeedback(TBool)
IMPORT_C voidEnablePictographsL(CAknPictographInterface &)
virtual IMPORT_C voidHandlePointerEventL(const TPointerEvent &)
virtual IMPORT_C voidHandleResourceChange(TInt)
voidHideTooltipWhenAppFaded(TBool)
IMPORT_C TRectHighlightRect()
TBool HitAreaContainsL(const TPoint &, TBool)
IMPORT_C TBoolIsDimmed()
virtual IMPORT_C voidMakeVisible(TBool)
virtual IMPORT_C TSizeMinimumSize()
IMPORT_C CAknButton *NewL()
IMPORT_C CAknButton *NewL(TResourceReader &)
IMPORT_C CAknButton *NewL(const TInt)
IMPORT_C CAknButton *NewL(CGulIcon *, CGulIcon *, CGulIcon *, CGulIcon *, const TDesC &, const TDesC &, const TInt, const TInt)
IMPORT_C CAknButton *NewL(const TDesC &, const TInt, const TInt, const TInt, const TInt, const TInt, const TInt, const TInt, const TInt, const TDesC &, const TDesC &, const TInt, const TInt, const TAknsItemID &, const TAknsItemID &, const TAknsItemID &, const TAknsItemID &)
IMPORT_C CAknButton *NewLC()
IMPORT_C CAknButton *NewLC(TResourceReader &)
IMPORT_C CAknButton *NewLC(const TInt)
IMPORT_C CAknButton *NewLC(CGulIcon *, CGulIcon *, CGulIcon *, CGulIcon *, const TDesC &, const TDesC &, const TInt, const TInt)
IMPORT_C CAknButton *NewLC(const TDesC &, const TInt, const TInt, const TInt, const TInt, const TInt, const TInt, const TInt, const TInt, const TDesC &, const TDesC &, const TInt, const TInt, const TAknsItemID &, const TAknsItemID &, const TAknsItemID &, const TAknsItemID &)
virtual IMPORT_C TKeyResponseOfferKeyEventL(const TKeyEvent &, TEventCode)
virtual IMPORT_C voidPositionChanged()
virtual IMPORT_C voidPrepareForFocusGainL()
virtual IMPORT_C voidPrepareForFocusLossL()
voidRegisterResourceProvider(CAknResourceProvider *)
voidRemoveCurrentState()
IMPORT_C voidResetState()
IMPORT_C voidSetBackgroundIds(const TAknsItemID &, const TAknsItemID &, const TAknsItemID &, const TAknsItemID &, const TAknsItemID &)
IMPORT_C voidSetButtonFlags(const TInt)
virtual IMPORT_C voidSetCurrentState(const TInt, const TBool)
virtual IMPORT_C voidSetDimmed(TBool)
IMPORT_C voidSetDimmedHelpTextL(const TDesC &)
IMPORT_C voidSetFrameAndCenterIds(const TAknsItemID &, const TAknsItemID &, const TAknsItemID &, const TAknsItemID &, const TAknsItemID &, const TAknsItemID &, const TAknsItemID &, const TAknsItemID &, const TAknsItemID &, const TAknsItemID &)
IMPORT_C voidSetHelpNoteTimeouts(const TInt, const TInt)
IMPORT_C voidSetHighlightRect(const TRect &)
IMPORT_C voidSetIconHorizontalAlignment(const CAknButton::TAlignment)
IMPORT_C voidSetIconScaleMode(const TScaleMode)
IMPORT_C TIntSetIconSize(const TSize &)
IMPORT_C voidSetIconVerticalAlignment(const CAknButton::TAlignment)
IMPORT_C voidSetKeyRepeatInterval(const TInt, const TInt)
IMPORT_C voidSetLongPressInterval(const TInt)
IMPORT_C voidSetMargins(const TMargins8 &)
IMPORT_C voidSetRequestExit(const TBool)
IMPORT_C voidSetTextAndIconAlignment(const CAknButton::TTextAndIconAlignment)
IMPORT_C voidSetTextColorIds(const TAknsItemID &, const TInt)
IMPORT_C voidSetTextFont(const CFont *)
IMPORT_C voidSetTextHorizontalAlignment(const CGraphicsContext::TTextAlign)
IMPORT_C voidSetTextUnderlineStyle(TFontUnderline)
IMPORT_C voidSetTextVerticalAlignment(const CAknButton::TAlignment)
IMPORT_C voidSetTooltipPosition(const TTooltipPosition)
IMPORT_C CAknButtonState *State()
IMPORT_C CAknButtonState *State(const TInt)
IMPORT_C TIntStateIndex()
TRect TouchArea()
voidUnregisterResourceProvider()
voidUseMaskedDraw(TBool)
TBool UsesDefaultMargins()
Protected Member Functions
CAknButton(const TInt)
IMPORT_C TIntChangeState(TBool)
IMPORT_C voidConstructL()
IMPORT_C voidConstructL(CGulIcon *, CGulIcon *, CGulIcon *, CGulIcon *, const TDesC &, const TDesC &, const TInt)
IMPORT_C voidConstructL(const TDesC &, const TInt, const TInt, const TInt, const TInt, const TInt, const TInt, const TInt, const TInt, const TDesC &, const TDesC &, const TInt, const TAknsItemID &, const TAknsItemID &, const TAknsItemID &, const TAknsItemID &)
virtual IMPORT_C void *ExtensionInterface(TUid)
virtual IMPORT_C voidFocusChanged(TDrawNow)
IMPORT_C const CGulIcon *GetCurrentIcon()
IMPORT_C const TDesC &GetCurrentText()
IMPORT_C voidHideHelp()
IMPORT_C voidShowHelpL()
virtual IMPORT_C voidSizeChanged()
Inherited Attributes
CCoeControl::iCoeEnv
CCoeControl::iContext
CCoeControl::iPosition
CCoeControl::iSize
Inherited Enumerations
CCoeControl:TZoomType
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::ComponentControl(TInt)const
CCoeControl::Components()
CCoeControl::Components()const
CCoeControl::ControlContext()const
CCoeControl::ControlEnv()const
CCoeControl::CopyControlContextFrom(const CCoeControl *)
CCoeControl::CountComponentControls()const
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::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::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::IsFocused()const
CCoeControl::IsNonFocusing()const
CCoeControl::IsReadyToDraw()const
CCoeControl::IsVisible()const
CCoeControl::LayoutManager()const
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::PositionRelativeToScreen()const
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::SetContainerWindowL(const CCoeControl &)
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()

Detailed Description

Generic button class.

Since
Series 60 3.1

Member Attribute Documentation

iBgContext

CAknsFrameBackgroundControlContext *iBgContext[protected]

iButtonPressed

TBool iButtonPressed[protected]

iDimmedHelpText

HBufC *iDimmedHelpText[protected]

iFlags

TInt iFlags[protected]

iFont

const CFont *iFont[protected]

iHelpNote

CAknInfoPopupNoteController *iHelpNote[protected]

iHelpNoteInViewInterval

TInt iHelpNoteInViewInterval[protected]

iHelpNoteWaitInterval

TInt iHelpNoteWaitInterval[protected]

iHighlightRect

TRect iHighlightRect[protected]

iHorizontalAlignment

CGraphicsContext::TTextAlign iHorizontalAlignment[protected]

iKeyDownReported

TBool iKeyDownReported[protected]

iKeyRepeatDelay

TInt iKeyRepeatDelay[protected]

iKeyRepeatInterval

TInt iKeyRepeatInterval[protected]

iKeyRepeatTimer

CPeriodic *iKeyRepeatTimer[protected]

iNumberOfDragEvents

TInt iNumberOfDragEvents[protected]

iScaleMode

TScaleMode iScaleMode[protected]

iShowHelp

TBool iShowHelp[protected]

iStateIndex

TInt iStateIndex[protected]

iStates

CArrayPtrFlat< CAknButtonState > *iStates[protected]

iTextColorIndex

TInt iTextColorIndex[protected]

iTextColorTableId

TAknsItemID iTextColorTableId[protected]

iVerticalAlignment

TAlignment iVerticalAlignment[protected]

Member Enumeration Documentation

Enum TAlignment

EnumeratorValueDescription
ECenter
ETop
EBottom
ERight
ELeft

Enum TButtonEvent

EnumeratorValueDescription
ELongPressEvent100
ELongPressEndedEvent

Enum TTextAndIconAlignment

Enum TTooltipPosition

Constructor & Destructor Documentation

CAknButton ( const TInt )

IMPORT_CCAknButton(const TIntaFlags)[protected]

C++ constructor for the one state button.

ParameterDescription
aFlagsThe flags for the button

~CAknButton ( )

IMPORT_C~CAknButton()[virtual]

Destructor.

Member Function Documentation

ActivateL ( )

IMPORT_C voidActivateL()[virtual]

Reimplemented from CCoeControl::ActivateL()

Sets control as ready to be drawn.

AddStateL ( CGulIcon *, CGulIcon *, CGulIcon *, CGulIcon *, const TDesC &, const TDesC &, const TInt )

IMPORT_C voidAddStateL(CGulIcon *aIcon,
CGulIcon *aDimmedIcon,
CGulIcon *aPressedIcon,
CGulIcon *aHoverIcon,
const TDesC &aText,
const TDesC &aHelpText,
const TIntaStateFlags
)[virtual]

Adds one more state for the button to the end of state array.

ParameterDescription
aIconThe icon object containing a bitmap and a mask (if there is one) for the button.
aDimmedIconThe icon object containing a bitmap and a mask (if there is one) for the dimmed case.
aPressedIconThe icon object containing a bitmap and a mask (if there is one) for the case when button is pressed.
aHoverIconThe icon object containingg a bitmap and a mask for the case when the pointer is hovering over the button.
aTextis the text.
aHelpTextis the text for the tooltip.
aStateFlagsThe flags for the state.

AddStateL ( const TDesC &, const TInt, const TInt, const TInt, const TInt, const TInt, const TInt, const TInt, const TInt, const TDesC &, const TDesC &, const TInt, const TAknsItemID &, const TAknsItemID &, const TAknsItemID &, const TAknsItemID & )

IMPORT_C voidAddStateL(const TDesC &aFilePath,
const TIntaBmpId,
const TIntaMaskId,
const TIntaDimmedBmpId,
const TIntaDimmedMaskId,
const TIntaPressedBmpId,
const TIntaPressedMaskId,
const TIntaHoverBmpId,
const TIntaHoverMaskId,
const TDesC &aText,
const TDesC &aHelpText,
const TIntaStateFlags,
const TAknsItemID &aId,
const TAknsItemID &aDimmedId,
const TAknsItemID &aPressedId,
const TAknsItemID &aHoverId
)[virtual]

Adds one more state for the button.

ParameterDescription
aFilePathThe path to the file which contains icons.
aBmpIdThe bitmap ID for the normal state icon.
aMaskIdThe mask ID for the normal state icon.
aDimmedBmpIdThe bitmap ID for the dimmed state icon.
aDimmedMaskIdThe mask ID for the dimmed state icon.
aPressedBmpIdThe bitmap ID for the pressed down state.
aPressedMaskIdThe mask ID for the pressed down state.
aHoverBmpIdThe bitmap ID for the hover state.
aHoverMaskIdThe mask ID for the hover state.
aTextis the text.
aHelpTextis the text for the tooltip.
aStateFlagsThe flags for the state.
aIdItem ID of the masked bitmap to be created for skin specific icon. Use KAknsIIDNone when it is not needed.
aDimmedIdItem ID of the dimmed masked bitmap to be created for skin specific icon. Use KAknsIIDNone when it is not needed.
aPressedIdItem ID of the pressed masked bitmap to be created for skin specific icon. Use KAknsIIDNone when it is not needed.
aHoverIdItem ID of the hover state masked bitmap to be created for skin specific icon.

AddStateL ( CGulIcon *, CGulIcon *, CGulIcon *, CGulIcon *, const TDesC &, const TDesC &, const TInt, const TInt )

voidAddStateL(CGulIcon *aIcon,
CGulIcon *aDimmedIcon,
CGulIcon *aPressedIcon,
CGulIcon *aHoverIcon,
const TDesC &aText,
const TDesC &aHelpText,
const TIntaStateFlags,
const TIntaCommandId
)

Adds one more state for the button to the end of state array.

ParameterDescription
aIconThe icon object containing a bitmap and a mask (if there is one) for the button.
aDimmedIconThe icon object containing a bitmap and a mask (if there is one) for the dimmed case.
aPressedIconThe icon object containing a bitmap and a mask (if there is one) for the case when button is pressed.
aHoverIconThe icon object containingg a bitmap and a mask for the case when the pointer is hovering over the button.
aTextis the text.
aHelpTextis the text for the tooltip.
aStateFlagsThe flags for the state.
aCommandIdCommand to be attached with the state.

BgContext ( )

CAknsFrameBackgroundControlContext *BgContext()

ButtonFlags ( )

IMPORT_C TIntButtonFlags()const
Returns the flags of button. The flags are defined in eikon.hrh.
Since
S60 3.2

Returns: Button flags.

ChangeState ( TBool )

IMPORT_C TIntChangeState(TBoolaDrawNow)[protected]

Changes the state of the button to the next one.

Returns: the current state index

CheckHitArea ( )

voidCheckHitArea()

ConstructFromResourceL ( TResourceReader & )

IMPORT_C voidConstructFromResourceL(TResourceReader &aReader)[virtual]

Constructs controls from a resource file.

ParameterDescription
aReaderThe resource reader, with which to access the control's resource values.

ConstructFromResourceL ( const TInt )

IMPORT_C voidConstructFromResourceL(const TIntaResourceId)

Constructs controls from a resource file.

ParameterDescription
aResourceIdThe ID for this component's resource.

ConstructL ( )

IMPORT_C voidConstructL()[protected]

Symbian 2nd phase constructor.

ConstructL ( CGulIcon *, CGulIcon *, CGulIcon *, CGulIcon *, const TDesC &, const TDesC &, const TInt )

IMPORT_C voidConstructL(CGulIcon *aIcon,
CGulIcon *aDimmedIcon,
CGulIcon *aPressedIcon,
CGulIcon *aHoverIcon,
const TDesC &aText,
const TDesC &aHelpText,
const TIntaStateFlags
)[protected]

Symbian 2nd phase constructor.

ParameterDescription
aIconThe icon for the normal state. Takes ownership.
aDimmedIconThe icon for the dimmed state. Takes ownership.
aPressedIconThe icon for the pressed down. Takes ownership.
aHoverIconThe icon for the hover state.
aTextThe text inside the button.
aHelpTextThe text for the tooltip.
aStateFlagsThe flags for the first state.

ConstructL ( const TDesC &, const TInt, const TInt, const TInt, const TInt, const TInt, const TInt, const TInt, const TInt, const TDesC &, const TDesC &, const TInt, const TAknsItemID &, const TAknsItemID &, const TAknsItemID &, const TAknsItemID & )

IMPORT_C voidConstructL(const TDesC &aFilePath,
const TIntaBmpId,
const TIntaMaskId,
const TIntaDimmedBmpId,
const TIntaDimmedMaskId,
const TIntaPressedBmpId,
const TIntaPressedMaskId,
const TIntaHoverBmpId,
const TIntaHoverMaskId,
const TDesC &aText,
const TDesC &aHelpText,
const TIntaStateFlags,
const TAknsItemID &aId =  KAknsIIDNone ,
const TAknsItemID &aDimmedId =  KAknsIIDNone ,
const TAknsItemID &aPressedId =  KAknsIIDNone ,
const TAknsItemID &aHoverId =  KAknsIIDNone
)[protected]

Symbian 2nd phase constructor.

ParameterDescription
aFilePathThe path to the file which contains icons.
aBmpIdThe bitmap ID for the normal state icon.
aMaskIdThe mask ID for the normal state icon.
aDimmedBmpIdThe bitmap ID for the dimmed state icon.
aDimmedMaskIdThe mask ID for the dimmed state icon.
aPressedBmpIdThe bitmap ID for the pressed down state.
aPressedMaskIdThe mask ID for the pressed down state.
aHoverBmpIdThe bitmap ID for the hover state icon.
aHoverMaskIdThe mask ID for the hover state icon.
aTextThe text inside the button.
aHelpTextThe text for the tooltip.
aStateFlagsThe flags for the first state.
aIdItem ID of the masked bitmap to be created for skin specific icon.
aDimmedIdItem ID of the dimmed masked bitmap to be created for skin specific icon.
aPressedIdItem ID of the pressed masked bitmap to be created for skin specific icon.
aHoverIdItem ID of the masked hover bitmap to be created for skin specific icon.

DisablePictographs ( )

IMPORT_C voidDisablePictographs()

Disables pictograph drawing in the button text. Only effective in Japanese variant. By default, it is disabled.

EnableFeedback ( TBool )

IMPORT_C voidEnableFeedback(TBoolaEnable)

Enables or disables tactile feedback for button. By default it is enabled. Should be used to temporarily prevent updating of tactile feedback area for performance reasons when button is moved constantly.

Since
S60 5.2

EnablePictographsL ( CAknPictographInterface & )

IMPORT_C voidEnablePictographsL(CAknPictographInterface &aInterface)

Enables pictograph drawing in the button text. Only effective in Japanese variant. By default, it is disabled.

ParameterDescription
aInterfaceUsed pictograph interface owned by the caller.

ExtensionInterface ( TUid )

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

For future extensions

ParameterDescription
aInterfaceThe ID for the extension interface.

FocusChanged ( TDrawNow )

IMPORT_C voidFocusChanged(TDrawNowaDrawNow)[protected, virtual]

This function is called whenever a control gains or loses focus.

ParameterDescription
aDrawNowContains the value that was passed to it by SetFocus().

GetCurrentIcon ( )

IMPORT_C const CGulIcon *GetCurrentIcon()const [protected]

Returns icon for the current state.

GetCurrentText ( )

IMPORT_C const TDesC &GetCurrentText()const [protected]

Returns the text, which will be displayed inside the button for the current state.

HandlePointerEventL ( const TPointerEvent & )

IMPORT_C voidHandlePointerEventL(const TPointerEvent &aPointerEvent)[virtual]

Handles pointer events.

ParameterDescription
aPointerEventThe pointer event.

HandleResourceChange ( TInt )

IMPORT_C voidHandleResourceChange(TIntaType)[virtual]

Handles a change to the control's resources.

ParameterDescription
aTypeis a message UID value.

HideHelp ( )

IMPORT_C voidHideHelp()[protected]

Hides help text after certain interval.

HideTooltipWhenAppFaded ( TBool )

voidHideTooltipWhenAppFaded(TBoolaHide)

Sets tooltip to hide or show itself when background faded.

Since
S60 3.2
ParameterDescription
aHideshould be ETrue if hiding, EFalse if showing

HighlightRect ( )

IMPORT_C TRectHighlightRect()const

Gets the highlight rectangle around the button.

Returns: The higlight rectangle around the button.

HitAreaContainsL ( const TPoint &, TBool )

TBool HitAreaContainsL(const TPoint &aPoint,
TBoolaCheckHitArea
)const

Check if point is within buttons visible area, when KAknButtonHitTest flag is enabled

ParameterDescription
aPointLocation to check.
aCheckHitAreaif need to check the hit area for fixed toolbar button

IsDimmed ( )

IMPORT_C TBoolIsDimmed()const

Reimplemented from CCoeControl::IsDimmed()const

Tests if the control is dimmed. This function overrides the function declared in CCoeControl, and returns the value which is set and unset using CAknButton::SetDimmed().

Returns: ETrue if the control is dimmed, EFalse if it is not dimmed.

MakeVisible ( TBool )

IMPORT_C voidMakeVisible(TBoolaVisible)[virtual]

Sets this control as visible or invisible.

ParameterDescription
aVisibleETrue to make the control visible, EFalse to make it invisible.

MinimumSize ( )

IMPORT_C TSizeMinimumSize()[virtual]

Reimplemented from CCoeControl::MinimumSize()

Returns the control's minimum required size. It does not include the size of the highlight. However, it includes current margins. Use HighlightRect() function to get highlight rectangle for the focused button.

Returns: The minimum size required by the control.

NewL ( )

IMPORT_C CAknButton *NewL()[static]

Two-phased constructor. Constructs an empty button.

NewL ( TResourceReader & )

IMPORT_C CAknButton *NewL(TResourceReader &aReader)[static]

Two-phased constructor. Constructs the button from resources.

ParameterDescription
aReaderis the resource reader with which to access the control's resource values.

NewL ( const TInt )

IMPORT_C CAknButton *NewL(const TIntaResourceId)[static]

Two-phased constructor. Constructs the button from resources.

ParameterDescription
aResourceIdis the ID for this component's resource.

NewL ( CGulIcon *, CGulIcon *, CGulIcon *, CGulIcon *, const TDesC &, const TDesC &, const TInt, const TInt )

IMPORT_C CAknButton *NewL(CGulIcon *aIcon,
CGulIcon *aDimmedIcon,
CGulIcon *aPressedIcon,
CGulIcon *aHoverIcon,
const TDesC &aText,
const TDesC &aHelpText,
const TIntaButtonFlags,
const TIntaStateFlags
)[static]

Two-phased constructor. Constructs one state button.

ParameterDescription
aIconThe icon for the normal state. Takes ownership.
aDimmedIconThe icon for the dimmed state. Takes ownership.
aPressedIconThe icon for the pressed down. Takes ownership.
aHoverIconThe icon for the hover state. Takes ownership.
aTextThe text inside the button.
aHelpTextThe text for the tooltip.
aButtonFlagsThe flags for the button.
aStateFlagsThe flags for the first state.

NewL ( const TDesC &, const TInt, const TInt, const TInt, const TInt, const TInt, const TInt, const TInt, const TInt, const TDesC &, const TDesC &, const TInt, const TInt, const TAknsItemID &, const TAknsItemID &, const TAknsItemID &, const TAknsItemID & )

IMPORT_C CAknButton *NewL(const TDesC &aFilePath,
const TIntaBmpId,
const TIntaMaskId,
const TIntaDimmedBmpId,
const TIntaDimmedMaskId,
const TIntaPressedBmpId,
const TIntaPressedMaskId,
const TIntaHoverBmpId,
const TIntaHoverMaskId,
const TDesC &aText,
const TDesC &aHelpText,
const TIntaButtonFlags,
const TIntaStateFlags,
const TAknsItemID &aId =  KAknsIIDNone ,
const TAknsItemID &aDimmedId =  KAknsIIDNone ,
const TAknsItemID &aPressedId =  KAknsIIDNone ,
const TAknsItemID &aHoverId =  KAknsIIDNone
)[static]

Two-phased constructor. Constructs one state button.

ParameterDescription
aFilePathThe path to the file which contains icons.
aBmpIdThe bitmap ID for the normal state icon.
aMaskIdThe mask ID for the normal state icon.
aDimmedBmpIdThe bitmap ID for the dimmed state icon.
aDimmedMaskIdThe mask ID for the dimmed state icon.
aPressedBmpIdThe bitmap ID for the pressed down state.
aPressedMaskIdThe mask ID for the pressed down state.
aHoverBmpIdThe bitmap ID for the hover state.
aHoverMaskIdThe mask ID for the hover state.
aTextThe text inside the button.
aHelpTextThe text for the tooltip.
aButtonFlagsThe flags for the button.
aStateFlagsThe flags for the first state.
aIdItem ID of the masked bitmap to be created for skin specific icon.
aDimmedIdItem ID of the dimmed masked bitmap to be created for skin specific icon.
aPressedIdItem ID of the pressed masked bitmap to be created for skin specific icon.
aHoverIdItem ID of the masked hover bitmap to be created for skin specific icon.

NewLC ( )

IMPORT_C CAknButton *NewLC()[static]

Two-phased constructor. Constructs an empty button.

NewLC ( TResourceReader & )

IMPORT_C CAknButton *NewLC(TResourceReader &aReader)[static]

Two-phased constructor. Constructs the button from resources.

ParameterDescription
aReaderis the resource reader with which to access the control's resource values.

NewLC ( const TInt )

IMPORT_C CAknButton *NewLC(const TIntaResourceId)[static]

Two-phased constructor. Constructs the button from resources.

ParameterDescription
aResourceIdis the ID for this component's resource.

NewLC ( CGulIcon *, CGulIcon *, CGulIcon *, CGulIcon *, const TDesC &, const TDesC &, const TInt, const TInt )

IMPORT_C CAknButton *NewLC(CGulIcon *aIcon,
CGulIcon *aDimmedIcon,
CGulIcon *aPressedIcon,
CGulIcon *aHoverIcon,
const TDesC &aText,
const TDesC &aHelpText,
const TIntaFlags,
const TIntaStateFlags
)[static]

Two-phased constructor. Constructs one state button.

ParameterDescription
aIconThe icon for the normal state. Takes ownership.
aDimmedIconThe icon for the dimmed state. Takes ownership.
aPressedIconThe icon for the pressed down. Takes ownership.
aHoverIconThe icon for the hover state. Takes ownership.
aTextThe text inside the button.
aHelpTextThe text for the tooltip.
aStateFlagsThe flags for the first state.

NewLC ( const TDesC &, const TInt, const TInt, const TInt, const TInt, const TInt, const TInt, const TInt, const TInt, const TDesC &, const TDesC &, const TInt, const TInt, const TAknsItemID &, const TAknsItemID &, const TAknsItemID &, const TAknsItemID & )

IMPORT_C CAknButton *NewLC(const TDesC &aFilePath,
const TIntaBmpId,
const TIntaMaskId,
const TIntaDimmedBmpId,
const TIntaDimmedMaskId,
const TIntaPressedBmpId,
const TIntaPressedMaskId,
const TIntaHoverBmpId,
const TIntaHoverMaskId,
const TDesC &aText,
const TDesC &aHelpText,
const TIntaButtonFlags,
const TIntaStateFlags,
const TAknsItemID &aId =  KAknsIIDNone ,
const TAknsItemID &aDimmedId =  KAknsIIDNone ,
const TAknsItemID &aPressedId =  KAknsIIDNone ,
const TAknsItemID &aHoverId =  KAknsIIDNone
)[static]

Two-phased constructor. Constructs one state button.

ParameterDescription
aFilePathThe path to the file which contains icons.
aBmpIdThe bitmap ID for the normal state icon.
aMaskIdThe mask ID for the normal state icon.
aDimmedBmpIdThe bitmap ID for the dimmed state icon.
aDimmedMaskIdThe mask ID for the dimmed state icon.
aPressedBmpIdThe bitmap ID for the pressed down state.
aPressedMaskIdThe mask ID for the pressed down state.
aHoverBmpIdThe bitmap ID for the hover state.
aHoverMaskIdThe mask ID for the hover state.
aTextThe text inside the button.
aHelpTextThe text for the tooltip.
aButtonFlagsThe flags for the button.
aStateFlagsThe flags for the first state.
aIdItem ID of the masked bitmap to be created for skin specific icon.
aDimmedIdItem ID of the dimmed masked bitmap to be created for skin specific icon.
aPressedIdItem ID of the pressed masked bitmap to be created for skin specific icon.
aHoverIdItem ID of the hover state masked bitmap to be created for skin specific icon.

OfferKeyEventL ( const TKeyEvent &, TEventCode )

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

Handles key events.

ParameterDescription
aKeyEventThe key event.
aTypeThe type of key event: EEventKey, EEventKeyUp or EEventKeyDown.

PositionChanged ( )

IMPORT_C voidPositionChanged()[virtual]

Responds to changes in the position of a control.

PrepareForFocusGainL ( )

IMPORT_C voidPrepareForFocusGainL()[virtual]

Prepares the control for gaining focus. Must be used before calling SetFocus() function in case when help note should be shown.

PrepareForFocusLossL ( )

IMPORT_C voidPrepareForFocusLossL()[virtual]

This function is called by the dialog framework immediately before it removes keyboard focus from a control within a dialog. Currently has empty implementation.

RegisterResourceProvider ( CAknResourceProvider * )

voidRegisterResourceProvider(CAknResourceProvider *aProvider)

Registers resource provider.

ParameterDescription
aProviderNew resource provider.

RemoveCurrentState ( )

voidRemoveCurrentState()

Removes the currently active state from the button, and sets the current state to the previous one.

ResetState ( )

IMPORT_C voidResetState()

Resets button to unpressed state.

Since
S60 5.0

SetBackgroundIds ( const TAknsItemID &, const TAknsItemID &, const TAknsItemID &, const TAknsItemID &, const TAknsItemID & )

IMPORT_C voidSetBackgroundIds(const TAknsItemID &aBackgroundId,
const TAknsItemID &aLatchedBackgroundId,
const TAknsItemID &aDimmedBackgroundId,
const TAknsItemID &aPressedBackgroundId,
const TAknsItemID &aLatchedDimmedBackgroundId
)

Sets specified background IDs. Can be used when default frame is not suitable and the backgound is composed of only single image instead of frame and center. SetFrameAndCenterIds() function can also be used for this purpose by giving the same backround ID for both frame and center. This allows also some of the states to be composed of frames and the others from single backgound images. Use KAknsIIDNone value in case when some backgound drawing is not needed or KAknsIIDDefault when the default button frame should be used.

ParameterDescription
aBackgroundIdThe item ID of the entire frame.
aLatchedBackgroundIdThe item ID of the background for the button in latched state.
aDimmedBackgroundIdThe item ID of the background for the button in dimmed state.
aPressedBackgroundIdThe item ID of the background for the button in pressed state.
aLatchedDimmedBackgroundIdThe item ID of the background for the button in latched and dimmed state.

SetButtonFlags ( const TInt )

IMPORT_C voidSetButtonFlags(const TIntaFlags)

Sets the button flags.

ParameterDescription
aFlagswhich can be combination of: KAknButtonTextLeft, KAknButtonSizeFitText, KAknButtonNoFrame, KAknButtonKeyRepeat, KAknButtonReportOnKeyDown, KAknButtonNoFramePressEvent, KAknButtonRequestExitOnButtonUpEvent, KAknButtonReportOnLongPress.

SetCurrentState ( const TInt, const TBool )

IMPORT_C voidSetCurrentState(const TIntaStateIndex,
const TBoolaDrawNow
)[virtual]

Sets button state.

ParameterDescription
aStateIndexThe index for the state, starts from 0.
aDrawNowETrue to redraw the button.

SetDimmed ( TBool )

IMPORT_C voidSetDimmed(TBoolaDimmed)[virtual]

Sets button dimmed. Does not redraw the button. Note: This function does not affect the flag set with function CCoeControl::SetDimmed(), since button needs to get pointer events, even if it is dimmed. The value of the flag can be enquired using CAknButotn::IsDimmed().

ParameterDescription
aDimmedis ETrue to dim the button, EFalse to set the button as not dimmed.

SetDimmedHelpTextL ( const TDesC & )

IMPORT_C voidSetDimmedHelpTextL(const TDesC &aHelpText)

Sets the help text for dimmed button.

ParameterDescription
aHelpTextThe text inside the tooltip.

SetFrameAndCenterIds ( const TAknsItemID &, const TAknsItemID &, const TAknsItemID &, const TAknsItemID &, const TAknsItemID &, const TAknsItemID &, const TAknsItemID &, const TAknsItemID &, const TAknsItemID &, const TAknsItemID & )

IMPORT_C voidSetFrameAndCenterIds(const TAknsItemID &aFrameId,
const TAknsItemID &aCenterId,
const TAknsItemID &aLatchedFrameId,
const TAknsItemID &aLatchedCenterId,
const TAknsItemID &aDimmedFrameId,
const TAknsItemID &aDimmedCenterId,
const TAknsItemID &aPressedFrameId,
const TAknsItemID &aPressedCenterId,
const TAknsItemID &aLatchedDimmedFrameId,
const TAknsItemID &aLatchedDimmedCenterId
)

Sets specified frame IDs. Can be used when default frame is not suitable. Use KAknsIIDNone value in case when some frame or center drawing is not needed or KAknsIIDDefault when the default button frame should be used.

ParameterDescription
aFrameIdThe item ID of the entire frame.
aCenterIdThe item ID of the center part of the frame.
aLatchedFrameIdThe item ID of the entire frame for button in latched state.
aLatchedCenterIdThe item ID of the center part of the frame for button in latched state.
aDimmedFrameIdThe item ID of the entire frame for a button in dimmed state.
aDimmedCenterIdThe item ID of the center part of the frame for a button in dimmed state.
aPressedFrameIdThe item ID of the entire frame for a button in pressed state.
aPressedCenterIdis the item ID of the center part of the frame for a button in pressed state.
aLatchedDimmedFrameIdThe item ID of the entire frame for a button in latched and dimmed state.
aLatchedDimmedCenterIdThe item ID of the center part of the frame for a button in latched and dimmed state.

SetHelpNoteTimeouts ( const TInt, const TInt )

IMPORT_C voidSetHelpNoteTimeouts(const TIntaBeforeTimeout,
const TIntaInViewTimeout
)

Sets the delay before the help text is shown and also specifies the time for how long help text is visible.

ParameterDescription
aBeforeTimeoutThe delay in milliseconds before text help note is shown. The default is 150 milliseconds.
aInViewTimeoutThe interval in milliseconds during which help text note is shown. The default is 3000 milliseconds.

SetHighlightRect ( const TRect & )

IMPORT_C voidSetHighlightRect(const TRect &aRect)

It will change the default highlight rectangle around the focused button.

ParameterDescription
aRectThe highlight rectangle.

SetIconHorizontalAlignment ( const CAknButton::TAlignment )

IMPORT_C voidSetIconHorizontalAlignment(const CAknButton::TAlignmentaHorizontalAlignment)

Sets the horizontal alignment for the icon inside the button. By default it will be centered.

ParameterDescription
aHorizontalAlignmentThe horizontal alignment for the icon.

SetIconScaleMode ( const TScaleMode )

IMPORT_C voidSetIconScaleMode(const TScaleModeaScaleMode)

Sets the scale mode for the icon inside the button. The default is EAspectRatioNotPreserved.

ParameterDescription
aScaleModeThe scale mode.

SetIconSize ( const TSize & )

IMPORT_C TIntSetIconSize(const TSize &aSize)

Sets icon size for the button. Calling this function overrides the default size that is scaled automatically depending on the current screen layout. If this function is called then the caller is responsible for updating icon size whenever the layout changes.

Since
S60 3.2
ParameterDescription
aSizeNew icon size.

Returns: KErrNone if the operation succeeded, otherwise an error code.

SetIconVerticalAlignment ( const CAknButton::TAlignment )

IMPORT_C voidSetIconVerticalAlignment(const CAknButton::TAlignmentaVerticalAlignment)

Sets the vertical alignment for the icon inside the button. By default it will be centered.

ParameterDescription
aVerticalAlignmentThe vertical alignment for the icon.

SetKeyRepeatInterval ( const TInt, const TInt )

IMPORT_C voidSetKeyRepeatInterval(const TIntaKeyRepeatDelay,
const TIntaKeyRepeatInterval
)

Sets the interval for key repeat.

ParameterDescription
aKeyRepeatDelayThe initial delay, after which the key repeat is started. The default is 500 milliseconds.
aKeyRepeatIntervalThe interval in milliseconds, in which key repeat events should be reported. The default is 500 milliseconds.

SetLongPressInterval ( const TInt )

IMPORT_C voidSetLongPressInterval(const TIntaLongPressInterval)

Sets the interval for long press. When KAknButtonReportOnLongPress flag is set for the button, button will notify observer with KAknButtonLongPressEvent as the event type, after button has been pressed for the specified time.

ParameterDescription
aLongPressIntervalThe time interval in milliseconds, after which the long press event should be reported. The default value is 800 milliseconds.

SetMargins ( const TMargins8 & )

IMPORT_C voidSetMargins(const TMargins8 &aMargins)

Sets button's margins. These define the free area inside the button where content is placed. Note that calling this function overrides default margins that are scaled automatically depending on the current screen layout. If this function is called then the caller is responsible for updating margins whenever the layout changes.

Since
S60 3.2
ParameterDescription
aMarginsNew marginals.

SetRequestExit ( const TBool )

IMPORT_C voidSetRequestExit(const TBoolaRequestExit)

Sets whether button should send an EEventRequestExit event to command observer on button up event.

ParameterDescription
aRequestExitETrue if button should request exit.

SetTextAndIconAlignment ( const CAknButton::TTextAndIconAlignment )

IMPORT_C voidSetTextAndIconAlignment(const CAknButton::TTextAndIconAlignmentaAlignment)

Sets the icon and text alignment for a button having both

SetTextColorIds ( const TAknsItemID &, const TInt )

IMPORT_C voidSetTextColorIds(const TAknsItemID &aTextColorTableId,
const TIntaTextColorIndex
)

Sets the color table and color index for the button text. It will be used on button drawing, if color of the text shouldn't be taken from text layout.

ParameterDescription
aTextColorTableIdId for the color table
aTextColorIndexIndex of the color inside color table.

SetTextFont ( const CFont * )

IMPORT_C voidSetTextFont(const CFont *aFont)

Sets some specific text font.

ParameterDescription
aFontThe font, which should be used for the text inside the text button.

SetTextHorizontalAlignment ( const CGraphicsContext::TTextAlign )

IMPORT_C voidSetTextHorizontalAlignment(const CGraphicsContext::TTextAlignaHorizontalAlignment)

Sets the horizontal alignment for the text inside the button. It will be used, if alignment shouldn't be taken from text layout. By default it will be centered.

ParameterDescription
aHorizontalAlignmentThe horizontal alignment for the text.

SetTextUnderlineStyle ( TFontUnderline )

IMPORT_C voidSetTextUnderlineStyle(TFontUnderlineaUnderlineStyle)

Sets the text underline style for the text inside the button. By default no underline is used.

ParameterDescription
aUnderlineStyleThe style of underline.

SetTextVerticalAlignment ( const CAknButton::TAlignment )

IMPORT_C voidSetTextVerticalAlignment(const CAknButton::TAlignmentaVerticalAlignment)

Sets the vertical alignment for the text inside the button. It will be used if alignment shouldn't be taken from text layout. By default it will be centered.

ParameterDescription
aVerticalAlignmentThe vertical alignment for the text.

SetTooltipPosition ( const TTooltipPosition )

IMPORT_C voidSetTooltipPosition(const TTooltipPositionaPosition)

Sets the tooltip position.

ParameterDescription
aPositionThe position of the tooltip.

ShowHelpL ( )

IMPORT_C voidShowHelpL()[protected]

Shows help text for a certain period of time.

SizeChanged ( )

IMPORT_C voidSizeChanged()[protected, virtual]

Reimplemented from CCoeControl::SizeChanged()

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

State ( )

IMPORT_C CAknButtonState *State()const

Returns the current state of the button.

Returns: the current state of the button

State ( const TInt )

IMPORT_C CAknButtonState *State(const TIntaStateIndex)const

Returns the state of the button under specified index.

ParameterDescription
aStateIndexThe index for the state.

Returns: the state of the button.

StateIndex ( )

IMPORT_C TIntStateIndex()const

Returns the index of the button state.

TouchArea ( )

TRect TouchArea()const

Returns the button touchable area.

Since
S60 5.0

Returns: Button touch area

UnregisterResourceProvider ( )

voidUnregisterResourceProvider()

Unregisters resource provider.

UseMaskedDraw ( TBool )

voidUseMaskedDraw(TBoolaMaskedDraw)

Sets button to use additional masks during drawing. Calling this method forces button to bypass the normal drawing routine i.e. method DrawMaskedL is executed instead of Draw.

Since
S60 5.0
ParameterDescription
aMaskedDrawETrue to use additional mask.

UsesDefaultMargins ( )

TBool UsesDefaultMargins()const

Checks if the button uses default margins.

Since
S60 3.2

Returns: ETrue if default margins are used.