CAknButton Class Reference

class CAknButton : public CAknControl

Generic button class.

eikcoctl.lib
Since
Series 60 3.1

Inherits from

Public Member Functions
~CAknButton()
IMPORT_C voidActivateL()
IMPORT_C voidAddStateL(CGulIcon *, CGulIcon *, CGulIcon *, CGulIcon *, const TDesC &, const TDesC &, const TInt)
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()
IMPORT_C voidConstructFromResourceL(TResourceReader &)
IMPORT_C voidConstructFromResourceL(const TInt)
IMPORT_C voidDisablePictographs()
IMPORT_C voidEnableFeedback(TBool)
IMPORT_C voidEnablePictographsL(CAknPictographInterface &)
IMPORT_C voidHandlePointerEventL(const TPointerEvent &)
IMPORT_C voidHandleResourceChange(TInt)
voidHideTooltipWhenAppFaded(TBool)
IMPORT_C TRectHighlightRect()
TBool HitAreaContainsL(const TPoint &, TBool)
IMPORT_C TBoolIsDimmed()
IMPORT_C voidMakeVisible(TBool)
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 &)
IMPORT_C TKeyResponseOfferKeyEventL(const TKeyEvent &, TEventCode)
IMPORT_C voidPositionChanged()
IMPORT_C voidPrepareForFocusGainL()
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)
IMPORT_C voidSetCurrentState(const TInt, const TBool)
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 &)
IMPORT_C void *ExtensionInterface(TUid)
IMPORT_C voidFocusChanged(TDrawNow)
IMPORT_C const CGulIcon *GetCurrentIcon()
IMPORT_C const TDesC &GetCurrentText()
IMPORT_C voidHideHelp()
IMPORT_C voidShowHelpL()
IMPORT_C voidSizeChanged()
Private Member Functions
voidCalculateDefaultMargins()
TInt CalculateLuminance(const TRgb &)
TRect ContentRect()
voidConvertColorsForOutlineEffect(TRgb &, TRgb &)
voidConvertTextToVisualAndClip()
voidCreatePressedDownFrameL()
IMPORT_C voidDraw(const TRect &)
voidDrawIconButton(CWindowGc &)
voidDrawText(CWindowGc &, TRect &)
voidDrawTextAndIconButton(CWindowGc &)
voidDrawTextButton(CWindowGc &)
CAknButtonExtension *Extension()
voidGetTextColors(TRgb &, TRgb &)
TBool NeedsRedrawWhenPressed()
TInt ReportKeyRepeatL(TAny *)
TBool RequestExit()
TInt ScaleIcons()
voidSetFrameIDs()
voidSetFrameRects()
voidSetStateIndexL(TInt)
TAknsItemID SkinIID(const TInt)
voidStartKeyRepeatTimerL()
voidStartLongPressTimerL()
voidStopKeyRepeatTimer()
voidStopLongPressTimer()
TRgb TextColor()
voidUpdateTooltipPosition()
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::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()
Public Member Enumerations
enumTAlignment { ECenter, ETop, EBottom, ERight, ELeft }
enumTButtonEvent { ELongPressEvent = 100, ELongPressEndedEvent }
enumTTextAndIconAlignment { EIconBeforeText, EIconAfterText, EIconUnderText, EIconOverText, EOverlay }
enumTTooltipPosition { EPositionTop = 1, EPositionBottom, EPositionLeft, EPositionRight }
Inherited Enumerations
CCoeControl:TZoomType
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
Private Attributes
CAknButtonExtension *iExtension
Inherited Attributes
CCoeControl::iCoeEnv
CCoeControl::iContext
CCoeControl::iPosition
CCoeControl::iSize

Constructor & Destructor Documentation

CAknButton(const TInt)

IMPORT_CCAknButton(const TIntaFlags)[protected]

C++ constructor for the one state button.

Parameters

const TInt aFlagsThe flags for the button

~CAknButton()

IMPORT_C~CAknButton()[virtual]

Destructor.

Member Functions Documentation

ActivateL()

IMPORT_C voidActivateL()[virtual]

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.

Parameters

CGulIcon * aIconThe icon object containing a bitmap and a mask (if there is one) for the button.
CGulIcon * aDimmedIconThe icon object containing a bitmap and a mask (if there is one) for the dimmed case.
CGulIcon * aPressedIconThe icon object containing a bitmap and a mask (if there is one) for the case when button is pressed.
CGulIcon * aHoverIconThe icon object containingg a bitmap and a mask for the case when the pointer is hovering over the button.
const TDesC & aTextis the text.
const TDesC & aHelpTextis the text for the tooltip.
const TInt 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.

Parameters

const TDesC & aFilePathThe path to the file which contains icons.
const TInt aBmpIdThe bitmap ID for the normal state icon.
const TInt aMaskIdThe mask ID for the normal state icon.
const TInt aDimmedBmpIdThe bitmap ID for the dimmed state icon.
const TInt aDimmedMaskIdThe mask ID for the dimmed state icon.
const TInt aPressedBmpIdThe bitmap ID for the pressed down state.
const TInt aPressedMaskIdThe mask ID for the pressed down state.
const TInt aHoverBmpIdThe bitmap ID for the hover state.
const TInt aHoverMaskIdThe mask ID for the hover state.
const TDesC & aTextis the text.
const TDesC & aHelpTextis the text for the tooltip.
const TInt aStateFlagsThe flags for the state.
const TAknsItemID & aIdItem ID of the masked bitmap to be created for skin specific icon. Use KAknsIIDNone when it is not needed.
const TAknsItemID & aDimmedIdItem ID of the dimmed masked bitmap to be created for skin specific icon. Use KAknsIIDNone when it is not needed.
const TAknsItemID & aPressedIdItem ID of the pressed masked bitmap to be created for skin specific icon. Use KAknsIIDNone when it is not needed.
const TAknsItemID & 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.

Parameters

CGulIcon * aIconThe icon object containing a bitmap and a mask (if there is one) for the button.
CGulIcon * aDimmedIconThe icon object containing a bitmap and a mask (if there is one) for the dimmed case.
CGulIcon * aPressedIconThe icon object containing a bitmap and a mask (if there is one) for the case when button is pressed.
CGulIcon * aHoverIconThe icon object containingg a bitmap and a mask for the case when the pointer is hovering over the button.
const TDesC & aTextis the text.
const TDesC & aHelpTextis the text for the tooltip.
const TInt aStateFlagsThe flags for the state.
const TInt 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

CalculateDefaultMargins()

voidCalculateDefaultMargins()[private]

Calculates default margins.

CalculateLuminance(const TRgb &)

TInt CalculateLuminance(const TRgb &aColor)const [private]

Calculates color's luminance.

Parameters

const TRgb & aColor

ChangeState(TBool)

IMPORT_C TIntChangeState(TBoolaDrawNow)[protected]

Changes the state of the button to the next one.

Parameters

TBool aDrawNow

CheckHitArea()

voidCheckHitArea()

ConstructFromResourceL(TResourceReader &)

IMPORT_C voidConstructFromResourceL(TResourceReader &aReader)[virtual]

Constructs controls from a resource file.

Parameters

TResourceReader & 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.

Parameters

const TInt 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.

Parameters

CGulIcon * aIconThe icon for the normal state. Takes ownership.
CGulIcon * aDimmedIconThe icon for the dimmed state. Takes ownership.
CGulIcon * aPressedIconThe icon for the pressed down. Takes ownership.
CGulIcon * aHoverIconThe icon for the hover state.
const TDesC & aTextThe text inside the button.
const TDesC & aHelpTextThe text for the tooltip.
const TInt 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.

Parameters

const TDesC & aFilePathThe path to the file which contains icons.
const TInt aBmpIdThe bitmap ID for the normal state icon.
const TInt aMaskIdThe mask ID for the normal state icon.
const TInt aDimmedBmpIdThe bitmap ID for the dimmed state icon.
const TInt aDimmedMaskIdThe mask ID for the dimmed state icon.
const TInt aPressedBmpIdThe bitmap ID for the pressed down state.
const TInt aPressedMaskIdThe mask ID for the pressed down state.
const TInt aHoverBmpIdThe bitmap ID for the hover state icon.
const TInt aHoverMaskIdThe mask ID for the hover state icon.
const TDesC & aTextThe text inside the button.
const TDesC & aHelpTextThe text for the tooltip.
const TInt aStateFlagsThe flags for the first state.
const TAknsItemID & aId =  KAknsIIDNone Item ID of the masked bitmap to be created for skin specific icon.
const TAknsItemID & aDimmedId =  KAknsIIDNone Item ID of the dimmed masked bitmap to be created for skin specific icon.
const TAknsItemID & aPressedId =  KAknsIIDNone Item ID of the pressed masked bitmap to be created for skin specific icon.
const TAknsItemID & aHoverId =  KAknsIIDNone Item ID of the masked hover bitmap to be created for skin specific icon.

ContentRect()

TRect ContentRect()const [private]

Gets the rectangele reserved for button content excluding frame.

ConvertColorsForOutlineEffect(TRgb &, TRgb &)

voidConvertColorsForOutlineEffect(TRgb &aFillColor,
TRgb &aOutlineColor
)const [private]

Converts outline color, if fill color is too similar to outline color

fill color outline color

Parameters

TRgb & aFillColor
TRgb & aOutlineColor

ConvertTextToVisualAndClip()

voidConvertTextToVisualAndClip()const [private]

Converts text to visual and clips it. This is called when there are possible changes in visual text.

CreatePressedDownFrameL()

voidCreatePressedDownFrameL()[private]

Generates the pressed down bitmaps if flag KAknButtonPressedDownFrame is set and button has no frame

DisablePictographs()

IMPORT_C voidDisablePictographs()

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

Draw(const TRect &)

IMPORT_C voidDraw(const TRect &aRect)const [private, virtual]

From CCoeControl. Draws the control. Called by window server.

Parameters

const TRect & aRect

DrawIconButton(CWindowGc &)

voidDrawIconButton(CWindowGc &aGc)const [private]

Continues drawing of the button which has only an icon in it.

Parameters

CWindowGc & aGc

DrawText(CWindowGc &, TRect &)

voidDrawText(CWindowGc &aGc,
TRect &aTextRect
)const [private]

Continues drawing of the button which has text. Called from DrawTextButton and DrawTextAndIconButton

Parameters

CWindowGc & aGc
TRect & aTextRect

DrawTextAndIconButton(CWindowGc &)

voidDrawTextAndIconButton(CWindowGc &aGc)const [private]

Continues drawing of the button which has both text and icon.

Parameters

CWindowGc & aGc

DrawTextButton(CWindowGc &)

voidDrawTextButton(CWindowGc &aGc)const [private]

Continues drawing of the button which has only text.

Parameters

CWindowGc & aGc

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

Parameters

TBool aEnable

EnablePictographsL(CAknPictographInterface &)

IMPORT_C voidEnablePictographsL(CAknPictographInterface &aInterface)

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

Parameters

CAknPictographInterface & aInterfaceUsed pictograph interface owned by the caller.

Extension()

CAknButtonExtension *Extension()const [private]

Asserts that extension class object exists.

ExtensionInterface(TUid)

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

For future extensions

Parameters

TUid 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.

Parameters

TDrawNow 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.

GetTextColors(TRgb &, TRgb &)

voidGetTextColors(TRgb &aPenColor,
TRgb &aBrushColor
)const [private]

Gets text colors

pen color brush color

Parameters

TRgb & aPenColor
TRgb & aBrushColor

HandlePointerEventL(const TPointerEvent &)

IMPORT_C voidHandlePointerEventL(const TPointerEvent &aPointerEvent)[virtual]

Handles pointer events.

Parameters

const TPointerEvent & aPointerEventThe pointer event.

HandleResourceChange(TInt)

IMPORT_C voidHandleResourceChange(TIntaType)[virtual]

Handles a change to the control's resources.

Parameters

TInt 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

Parameters

TBool aHideshould be ETrue if hiding, EFalse if showing

HighlightRect()

IMPORT_C TRectHighlightRect()const

Gets the highlight 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

Parameters

const TPoint & aPointLocation to check.
TBool aCheckHitAreaif need to check the hit area for fixed toolbar button

IsDimmed()

IMPORT_C TBoolIsDimmed()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().

MakeVisible(TBool)

IMPORT_C voidMakeVisible(TBoolaVisible)[virtual]

Sets this control as visible or invisible.

Parameters

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

MinimumSize()

IMPORT_C TSizeMinimumSize()[virtual]

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.

NeedsRedrawWhenPressed()

TBool NeedsRedrawWhenPressed()const [private]

Checks whether button needs redrawing when it is pressed or released.

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.

Parameters

TResourceReader & 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.

Parameters

const TInt 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.

Parameters

CGulIcon * aIconThe icon for the normal state. Takes ownership.
CGulIcon * aDimmedIconThe icon for the dimmed state. Takes ownership.
CGulIcon * aPressedIconThe icon for the pressed down. Takes ownership.
CGulIcon * aHoverIconThe icon for the hover state. Takes ownership.
const TDesC & aTextThe text inside the button.
const TDesC & aHelpTextThe text for the tooltip.
const TInt aButtonFlagsThe flags for the button.
const TInt 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.

Parameters

const TDesC & aFilePathThe path to the file which contains icons.
const TInt aBmpIdThe bitmap ID for the normal state icon.
const TInt aMaskIdThe mask ID for the normal state icon.
const TInt aDimmedBmpIdThe bitmap ID for the dimmed state icon.
const TInt aDimmedMaskIdThe mask ID for the dimmed state icon.
const TInt aPressedBmpIdThe bitmap ID for the pressed down state.
const TInt aPressedMaskIdThe mask ID for the pressed down state.
const TInt aHoverBmpIdThe bitmap ID for the hover state.
const TInt aHoverMaskIdThe mask ID for the hover state.
const TDesC & aTextThe text inside the button.
const TDesC & aHelpTextThe text for the tooltip.
const TInt aButtonFlagsThe flags for the button.
const TInt aStateFlagsThe flags for the first state.
const TAknsItemID & aId =  KAknsIIDNone Item ID of the masked bitmap to be created for skin specific icon.
const TAknsItemID & aDimmedId =  KAknsIIDNone Item ID of the dimmed masked bitmap to be created for skin specific icon.
const TAknsItemID & aPressedId =  KAknsIIDNone Item ID of the pressed masked bitmap to be created for skin specific icon.
const TAknsItemID & aHoverId =  KAknsIIDNone Item 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.

Parameters

TResourceReader & 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.

Parameters

const TInt 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.

Parameters

CGulIcon * aIconThe icon for the normal state. Takes ownership.
CGulIcon * aDimmedIconThe icon for the dimmed state. Takes ownership.
CGulIcon * aPressedIconThe icon for the pressed down. Takes ownership.
CGulIcon * aHoverIconThe icon for the hover state. Takes ownership.
const TDesC & aTextThe text inside the button.
const TDesC & aHelpTextThe text for the tooltip.
const TInt aFlags
const TInt 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.

Parameters

const TDesC & aFilePathThe path to the file which contains icons.
const TInt aBmpIdThe bitmap ID for the normal state icon.
const TInt aMaskIdThe mask ID for the normal state icon.
const TInt aDimmedBmpIdThe bitmap ID for the dimmed state icon.
const TInt aDimmedMaskIdThe mask ID for the dimmed state icon.
const TInt aPressedBmpIdThe bitmap ID for the pressed down state.
const TInt aPressedMaskIdThe mask ID for the pressed down state.
const TInt aHoverBmpIdThe bitmap ID for the hover state.
const TInt aHoverMaskIdThe mask ID for the hover state.
const TDesC & aTextThe text inside the button.
const TDesC & aHelpTextThe text for the tooltip.
const TInt aButtonFlagsThe flags for the button.
const TInt aStateFlagsThe flags for the first state.
const TAknsItemID & aId =  KAknsIIDNone Item ID of the masked bitmap to be created for skin specific icon.
const TAknsItemID & aDimmedId =  KAknsIIDNone Item ID of the dimmed masked bitmap to be created for skin specific icon.
const TAknsItemID & aPressedId =  KAknsIIDNone Item ID of the pressed masked bitmap to be created for skin specific icon.
const TAknsItemID & aHoverId =  KAknsIIDNone Item 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.

Parameters

const TKeyEvent & aKeyEventThe key event.
TEventCode 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.

Parameters

CAknResourceProvider * aProviderNew resource provider.

RemoveCurrentState()

voidRemoveCurrentState()

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

ReportKeyRepeatL(TAny *)

TInt ReportKeyRepeatL(TAny *aThis)[private, static]

Called after timeout is over.

Parameters

TAny * aThis

RequestExit()

TBool RequestExit()const [private]

Checks whether toolbar should send an EEventRequestExit event to command observe on button up event.

ResetState()

IMPORT_C voidResetState()

Resets button to unpressed state.

Since
S60 5.0

ScaleIcons()

TInt ScaleIcons()[private]

Scales all icons.

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.

Parameters

const TAknsItemID & aBackgroundIdThe item ID of the entire frame.
const TAknsItemID & aLatchedBackgroundIdThe item ID of the background for the button in latched state.
const TAknsItemID & aDimmedBackgroundIdThe item ID of the background for the button in dimmed state.
const TAknsItemID & aPressedBackgroundIdThe item ID of the background for the button in pressed state.
const TAknsItemID & 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.

Parameters

const TInt 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.

Parameters

const TInt aStateIndexThe index for the state, starts from 0.
const TBool 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().

Parameters

TBool 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.

Parameters

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

Parameters

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

SetFrameIDs()

voidSetFrameIDs()const [private]

Sets frame IDs for background context. This is called when there are possible changes in frame ids.

SetFrameRects()

voidSetFrameRects()[private]

Sets frame rects for background context. This is called when button's size changes

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.

Parameters

const TInt aBeforeTimeoutThe delay in milliseconds before text help note is shown. The default is 150 milliseconds.
const TInt 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.

Parameters

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

Parameters

const CAknButton::TAlignment 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.

Parameters

const TScaleMode 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

Parameters

const TSize & aSizeNew icon size.

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.

Parameters

const CAknButton::TAlignment aVerticalAlignmentThe vertical alignment for the icon.

SetKeyRepeatInterval(const TInt, const TInt)

IMPORT_C voidSetKeyRepeatInterval(const TIntaKeyRepeatDelay,
const TIntaKeyRepeatInterval
)

Sets the interval for key repeat.

Parameters

const TInt aKeyRepeatDelayThe initial delay, after which the key repeat is started. The default is 500 milliseconds.
const TInt 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.

Parameters

const TInt 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

Parameters

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

Parameters

const TBool aRequestExitETrue if button should request exit.

SetStateIndexL(TInt)

voidSetStateIndexL(TIntaNewIndex)[private]

Sets new state index

Parameters

TInt aNewIndexNew state index

SetTextAndIconAlignment(const CAknButton::TTextAndIconAlignment)

IMPORT_C voidSetTextAndIconAlignment(const CAknButton::TTextAndIconAlignmentaAlignment)

Sets the icon and text alignment for a button having both

Parameters

const CAknButton::TTextAndIconAlignment aAlignment

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.

Parameters

const TAknsItemID & aTextColorTableIdId for the color table
const TInt aTextColorIndexIndex of the color inside color table.

SetTextFont(const CFont *)

IMPORT_C voidSetTextFont(const CFont *aFont)

Sets some specific text font.

Parameters

const CFont * 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.

Parameters

const CGraphicsContext::TTextAlign 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.

Parameters

TFontUnderline 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.

Parameters

const CAknButton::TAlignment aVerticalAlignmentThe vertical alignment for the text.

SetTooltipPosition(const TTooltipPosition)

IMPORT_C voidSetTooltipPosition(const TTooltipPositionaPosition)

Sets the tooltip position.

Parameters

const TTooltipPosition 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]

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

SkinIID(const TInt)

TAknsItemID SkinIID(const TIntaIndex)const [private]

Returns the ID of specified skin item.

Parameters

const TInt aIndex

StartKeyRepeatTimerL()

voidStartKeyRepeatTimerL()[private]

Starts the timer for the key repeat.

StartLongPressTimerL()

voidStartLongPressTimerL()[private]

Starts the long press timer.

State()

IMPORT_C CAknButtonState *State()const

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.

Parameters

const TInt aStateIndexThe index for the state.

StateIndex()

IMPORT_C TIntStateIndex()const

Returns the index of the button state.

StopKeyRepeatTimer()

voidStopKeyRepeatTimer()[private]

Stops the key repeat timer.

StopLongPressTimer()

voidStopLongPressTimer()[private]

Stops the long press timer.

TextColor()

TRgb TextColor()const [private]

Gets the correct text color.

TouchArea()

TRect TouchArea()const

Returns the button touchable area.

Since
S60 5.0

UnregisterResourceProvider()

voidUnregisterResourceProvider()

Unregisters resource provider.

UpdateTooltipPosition()

voidUpdateTooltipPosition()[private]

Updates tooltip position.

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

Parameters

TBool aMaskedDrawETrue to use additional mask.

UsesDefaultMargins()

TBool UsesDefaultMargins()const

Checks if the button uses default margins.

Since
S60 3.2

Member Enumerations Documentation

Enum TAlignment

Enumerators

ECenter
ETop
EBottom
ERight
ELeft

Enum TButtonEvent

Enumerators

ELongPressEvent = 100
ELongPressEndedEvent

Enum TTextAndIconAlignment

Enumerators

EIconBeforeText
EIconAfterText
EIconUnderText
EIconOverText
EOverlay

Enum TTooltipPosition

Enumerators

EPositionTop = 1
EPositionBottom
EPositionLeft
EPositionRight

Member Data Documentation

CAknsFrameBackgroundControlContext * iBgContext

CAknsFrameBackgroundControlContext *iBgContext[protected]

TBool iButtonPressed

TBool iButtonPressed[protected]

HBufC * iDimmedHelpText

HBufC *iDimmedHelpText[protected]

CAknButtonExtension * iExtension

CAknButtonExtension *iExtension[private]

TInt iFlags

TInt iFlags[protected]

const CFont * iFont

const CFont *iFont[protected]

CAknInfoPopupNoteController * iHelpNote

CAknInfoPopupNoteController *iHelpNote[protected]

TInt iHelpNoteInViewInterval

TInt iHelpNoteInViewInterval[protected]

TInt iHelpNoteWaitInterval

TInt iHelpNoteWaitInterval[protected]

TRect iHighlightRect

TRect iHighlightRect[protected]

CGraphicsContext::TTextAlign iHorizontalAlignment

CGraphicsContext::TTextAlign iHorizontalAlignment[protected]

TBool iKeyDownReported

TBool iKeyDownReported[protected]

TInt iKeyRepeatDelay

TInt iKeyRepeatDelay[protected]

TInt iKeyRepeatInterval

TInt iKeyRepeatInterval[protected]

CPeriodic * iKeyRepeatTimer

CPeriodic *iKeyRepeatTimer[protected]

TInt iNumberOfDragEvents

TInt iNumberOfDragEvents[protected]

TScaleMode iScaleMode

TScaleMode iScaleMode[protected]

TBool iShowHelp

TBool iShowHelp[protected]

TInt iStateIndex

TInt iStateIndex[protected]

CArrayPtrFlat< CAknButtonState > * iStates

CArrayPtrFlat< CAknButtonState > *iStates[protected]

TInt iTextColorIndex

TInt iTextColorIndex[protected]

TAknsItemID iTextColorTableId

TAknsItemID iTextColorTableId[protected]

TAlignment iVerticalAlignment

TAlignment iVerticalAlignment[protected]