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 void ActivateL ()
IMPORT_C void AddStateL ( CGulIcon *, CGulIcon *, CGulIcon *, CGulIcon *, const TDesC &, const TDesC &, const TInt )
IMPORT_C void 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 &)
void AddStateL ( CGulIcon *, CGulIcon *, CGulIcon *, CGulIcon *, const TDesC &, const TDesC &, const TInt , const TInt )
CAknsFrameBackgroundControlContext * BgContext ()
IMPORT_C TInt ButtonFlags ()
void CheckHitArea ()
IMPORT_C void ConstructFromResourceL ( TResourceReader &)
IMPORT_C void ConstructFromResourceL (const TInt )
IMPORT_C void DisablePictographs ()
IMPORT_C void EnableFeedback ( TBool )
IMPORT_C void EnablePictographsL (CAknPictographInterface &)
IMPORT_C void HandlePointerEventL (const TPointerEvent &)
IMPORT_C void HandleResourceChange ( TInt )
void HideTooltipWhenAppFaded ( TBool )
IMPORT_C TRect HighlightRect ()
TBool HitAreaContainsL (const TPoint &, TBool )
IMPORT_C TBool IsDimmed ()
IMPORT_C void MakeVisible ( TBool )
IMPORT_C TSize MinimumSize ()
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 TKeyResponse OfferKeyEventL (const TKeyEvent &, TEventCode )
IMPORT_C void PositionChanged ()
IMPORT_C void PrepareForFocusGainL ()
IMPORT_C void PrepareForFocusLossL ()
void RegisterResourceProvider (CAknResourceProvider *)
void RemoveCurrentState ()
IMPORT_C void ResetState ()
IMPORT_C void SetBackgroundIds (const TAknsItemID &, const TAknsItemID &, const TAknsItemID &, const TAknsItemID &, const TAknsItemID &)
IMPORT_C void SetButtonFlags (const TInt )
IMPORT_C void SetCurrentState (const TInt , const TBool )
IMPORT_C void SetDimmed ( TBool )
IMPORT_C void SetDimmedHelpTextL (const TDesC &)
IMPORT_C void SetFrameAndCenterIds (const TAknsItemID &, const TAknsItemID &, const TAknsItemID &, const TAknsItemID &, const TAknsItemID &, const TAknsItemID &, const TAknsItemID &, const TAknsItemID &, const TAknsItemID &, const TAknsItemID &)
IMPORT_C void SetHelpNoteTimeouts (const TInt , const TInt )
IMPORT_C void SetHighlightRect (const TRect &)
IMPORT_C void SetIconHorizontalAlignment (const CAknButton::TAlignment )
IMPORT_C void SetIconScaleMode (const TScaleMode )
IMPORT_C TInt SetIconSize (const TSize &)
IMPORT_C void SetIconVerticalAlignment (const CAknButton::TAlignment )
IMPORT_C void SetKeyRepeatInterval (const TInt , const TInt )
IMPORT_C void SetLongPressInterval (const TInt )
IMPORT_C void SetMargins (const TMargins8 &)
IMPORT_C void SetRequestExit (const TBool )
IMPORT_C void SetTextAndIconAlignment (const CAknButton::TTextAndIconAlignment )
IMPORT_C void SetTextColorIds (const TAknsItemID &, const TInt )
IMPORT_C void SetTextFont (const CFont *)
IMPORT_C void SetTextHorizontalAlignment (const CGraphicsContext::TTextAlign )
IMPORT_C void SetTextUnderlineStyle ( TFontUnderline )
IMPORT_C void SetTextVerticalAlignment (const CAknButton::TAlignment )
IMPORT_C void SetTooltipPosition (const TTooltipPosition )
IMPORT_C CAknButtonState * State ()
IMPORT_C CAknButtonState * State (const TInt )
IMPORT_C TInt StateIndex ()
TRect TouchArea ()
void UnregisterResourceProvider ()
void UseMaskedDraw ( TBool )
TBool UsesDefaultMargins ()
Protected Member Functions
CAknButton (const TInt )
IMPORT_C TInt ChangeState ( TBool )
IMPORT_C void ConstructL ()
IMPORT_C void ConstructL ( CGulIcon *, CGulIcon *, CGulIcon *, CGulIcon *, const TDesC &, const TDesC &, const TInt )
IMPORT_C void 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 void * ExtensionInterface ( TUid )
IMPORT_C void FocusChanged ( TDrawNow )
IMPORT_C const CGulIcon * GetCurrentIcon ()
IMPORT_C const TDesC & GetCurrentText ()
IMPORT_C void HideHelp ()
IMPORT_C void ShowHelpL ()
IMPORT_C void SizeChanged ()
Private Member Functions
void CalculateDefaultMargins ()
TInt CalculateLuminance (const TRgb &)
TRect ContentRect ()
void ConvertColorsForOutlineEffect ( TRgb &, TRgb &)
void ConvertTextToVisualAndClip ()
void CreatePressedDownFrameL ()
IMPORT_C void Draw (const TRect &)
void DrawIconButton ( CWindowGc &)
void DrawText ( CWindowGc &, TRect &)
void DrawTextAndIconButton ( CWindowGc &)
void DrawTextButton ( CWindowGc &)
CAknButtonExtension * Extension ()
void GetTextColors ( TRgb &, TRgb &)
TBool NeedsRedrawWhenPressed ()
TInt ReportKeyRepeatL ( TAny *)
TBool RequestExit ()
TInt ScaleIcons ()
void SetFrameIDs ()
void SetFrameRects ()
void SetStateIndexL ( TInt )
TAknsItemID SkinIID (const TInt )
void StartKeyRepeatTimerL ()
void StartLongPressTimerL ()
void StopKeyRepeatTimer ()
void StopLongPressTimer ()
TRgb TextColor ()
void UpdateTooltipPosition ()
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
enum TAlignment { ECenter , ETop , EBottom , ERight , ELeft }
enum TButtonEvent { ELongPressEvent  = 100, ELongPressEndedEvent }
enum TTextAndIconAlignment { EIconBeforeText , EIconAfterText , EIconUnderText , EIconOverText , EOverlay }
enum TTooltipPosition { 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_C CAknButton ( const TInt aFlags ) [protected]

C++ constructor for the one state button.

Parameters

const TInt aFlags The flags for the button

~CAknButton()

IMPORT_C ~CAknButton ( ) [virtual]

Destructor.

Member Functions Documentation

ActivateL()

IMPORT_C void ActivateL ( ) [virtual]

Sets control as ready to be drawn.

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

IMPORT_C void AddStateL ( CGulIcon * aIcon,
CGulIcon * aDimmedIcon,
CGulIcon * aPressedIcon,
CGulIcon * aHoverIcon,
const TDesC & aText,
const TDesC & aHelpText,
const TInt aStateFlags
) [virtual]

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

Parameters

CGulIcon * aIcon The icon object containing a bitmap and a mask (if there is one) for the button.
CGulIcon * aDimmedIcon The icon object containing a bitmap and a mask (if there is one) for the dimmed case.
CGulIcon * aPressedIcon The icon object containing a bitmap and a mask (if there is one) for the case when button is pressed.
CGulIcon * aHoverIcon The icon object containingg a bitmap and a mask for the case when the pointer is hovering over the button.
const TDesC & aText is the text.
const TDesC & aHelpText is the text for the tooltip.
const TInt aStateFlags The 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 void AddStateL ( const TDesC & aFilePath,
const TInt aBmpId,
const TInt aMaskId,
const TInt aDimmedBmpId,
const TInt aDimmedMaskId,
const TInt aPressedBmpId,
const TInt aPressedMaskId,
const TInt aHoverBmpId,
const TInt aHoverMaskId,
const TDesC & aText,
const TDesC & aHelpText,
const TInt aStateFlags,
const TAknsItemID & aId,
const TAknsItemID & aDimmedId,
const TAknsItemID & aPressedId,
const TAknsItemID & aHoverId
) [virtual]

Adds one more state for the button.

Parameters

const TDesC & aFilePath The path to the file which contains icons.
const TInt aBmpId The bitmap ID for the normal state icon.
const TInt aMaskId The mask ID for the normal state icon.
const TInt aDimmedBmpId The bitmap ID for the dimmed state icon.
const TInt aDimmedMaskId The mask ID for the dimmed state icon.
const TInt aPressedBmpId The bitmap ID for the pressed down state.
const TInt aPressedMaskId The mask ID for the pressed down state.
const TInt aHoverBmpId The bitmap ID for the hover state.
const TInt aHoverMaskId The mask ID for the hover state.
const TDesC & aText is the text.
const TDesC & aHelpText is the text for the tooltip.
const TInt aStateFlags The flags for the state.
const TAknsItemID & aId Item ID of the masked bitmap to be created for skin specific icon. Use KAknsIIDNone when it is not needed.
const TAknsItemID & aDimmedId Item ID of the dimmed masked bitmap to be created for skin specific icon. Use KAknsIIDNone when it is not needed.
const TAknsItemID & aPressedId Item ID of the pressed masked bitmap to be created for skin specific icon. Use KAknsIIDNone when it is not needed.
const TAknsItemID & aHoverId Item 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)

void AddStateL ( CGulIcon * aIcon,
CGulIcon * aDimmedIcon,
CGulIcon * aPressedIcon,
CGulIcon * aHoverIcon,
const TDesC & aText,
const TDesC & aHelpText,
const TInt aStateFlags,
const TInt aCommandId
)

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

Parameters

CGulIcon * aIcon The icon object containing a bitmap and a mask (if there is one) for the button.
CGulIcon * aDimmedIcon The icon object containing a bitmap and a mask (if there is one) for the dimmed case.
CGulIcon * aPressedIcon The icon object containing a bitmap and a mask (if there is one) for the case when button is pressed.
CGulIcon * aHoverIcon The icon object containingg a bitmap and a mask for the case when the pointer is hovering over the button.
const TDesC & aText is the text.
const TDesC & aHelpText is the text for the tooltip.
const TInt aStateFlags The flags for the state.
const TInt aCommandId Command to be attached with the state.

BgContext()

CAknsFrameBackgroundControlContext * BgContext ( )

ButtonFlags()

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

CalculateDefaultMargins()

void CalculateDefaultMargins ( ) [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 TInt ChangeState ( TBool aDrawNow ) [protected]

Changes the state of the button to the next one.

Parameters

TBool aDrawNow

CheckHitArea()

void CheckHitArea ( )

ConstructFromResourceL(TResourceReader &)

IMPORT_C void ConstructFromResourceL ( TResourceReader & aReader ) [virtual]

Constructs controls from a resource file.

Parameters

TResourceReader & aReader The resource reader, with which to access the control's resource values.

ConstructFromResourceL(const TInt)

IMPORT_C void ConstructFromResourceL ( const TInt aResourceId )

Constructs controls from a resource file.

Parameters

const TInt aResourceId The ID for this component's resource.

ConstructL()

IMPORT_C void ConstructL ( ) [protected]

Symbian 2nd phase constructor.

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

IMPORT_C void ConstructL ( CGulIcon * aIcon,
CGulIcon * aDimmedIcon,
CGulIcon * aPressedIcon,
CGulIcon * aHoverIcon,
const TDesC & aText,
const TDesC & aHelpText,
const TInt aStateFlags
) [protected]

Symbian 2nd phase constructor.

Parameters

CGulIcon * aIcon The icon for the normal state. Takes ownership.
CGulIcon * aDimmedIcon The icon for the dimmed state. Takes ownership.
CGulIcon * aPressedIcon The icon for the pressed down. Takes ownership.
CGulIcon * aHoverIcon The icon for the hover state.
const TDesC & aText The text inside the button.
const TDesC & aHelpText The text for the tooltip.
const TInt aStateFlags The 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 void ConstructL ( const TDesC & aFilePath,
const TInt aBmpId,
const TInt aMaskId,
const TInt aDimmedBmpId,
const TInt aDimmedMaskId,
const TInt aPressedBmpId,
const TInt aPressedMaskId,
const TInt aHoverBmpId,
const TInt aHoverMaskId,
const TDesC & aText,
const TDesC & aHelpText,
const TInt aStateFlags,
const TAknsItemID & aId =  KAknsIIDNone ,
const TAknsItemID & aDimmedId =  KAknsIIDNone ,
const TAknsItemID & aPressedId =  KAknsIIDNone ,
const TAknsItemID & aHoverId =  KAknsIIDNone
) [protected]

Symbian 2nd phase constructor.

Parameters

const TDesC & aFilePath The path to the file which contains icons.
const TInt aBmpId The bitmap ID for the normal state icon.
const TInt aMaskId The mask ID for the normal state icon.
const TInt aDimmedBmpId The bitmap ID for the dimmed state icon.
const TInt aDimmedMaskId The mask ID for the dimmed state icon.
const TInt aPressedBmpId The bitmap ID for the pressed down state.
const TInt aPressedMaskId The mask ID for the pressed down state.
const TInt aHoverBmpId The bitmap ID for the hover state icon.
const TInt aHoverMaskId The mask ID for the hover state icon.
const TDesC & aText The text inside the button.
const TDesC & aHelpText The text for the tooltip.
const TInt aStateFlags The 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 &)

void ConvertColorsForOutlineEffect ( 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()

void ConvertTextToVisualAndClip ( ) const [private]

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

CreatePressedDownFrameL()

void CreatePressedDownFrameL ( ) [private]

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

DisablePictographs()

IMPORT_C void DisablePictographs ( )

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

Draw(const TRect &)

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

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

Parameters

const TRect & aRect

DrawIconButton(CWindowGc &)

void DrawIconButton ( CWindowGc & aGc ) const [private]

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

Parameters

CWindowGc & aGc

DrawText(CWindowGc &, TRect &)

void DrawText ( 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 &)

void DrawTextAndIconButton ( CWindowGc & aGc ) const [private]

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

Parameters

CWindowGc & aGc

DrawTextButton(CWindowGc &)

void DrawTextButton ( CWindowGc & aGc ) const [private]

Continues drawing of the button which has only text.

Parameters

CWindowGc & aGc

EnableFeedback(TBool)

IMPORT_C void EnableFeedback ( TBool aEnable )

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 void EnablePictographsL ( CAknPictographInterface & aInterface )

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

Parameters

CAknPictographInterface & aInterface Used pictograph interface owned by the caller.

Extension()

CAknButtonExtension * Extension ( ) const [private]

Asserts that extension class object exists.

ExtensionInterface(TUid)

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

For future extensions

Parameters

TUid aInterface The ID for the extension interface.

FocusChanged(TDrawNow)

IMPORT_C void FocusChanged ( TDrawNow aDrawNow ) [protected, virtual]

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

Parameters

TDrawNow aDrawNow Contains 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 &)

void GetTextColors ( TRgb & aPenColor,
TRgb & aBrushColor
) const [private]

Gets text colors

pen color brush color

Parameters

TRgb & aPenColor
TRgb & aBrushColor

HandlePointerEventL(const TPointerEvent &)

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

Handles pointer events.

Parameters

const TPointerEvent & aPointerEvent The pointer event.

HandleResourceChange(TInt)

IMPORT_C void HandleResourceChange ( TInt aType ) [virtual]

Handles a change to the control's resources.

Parameters

TInt aType is a message UID value.

HideHelp()

IMPORT_C void HideHelp ( ) [protected]

Hides help text after certain interval.

HideTooltipWhenAppFaded(TBool)

void HideTooltipWhenAppFaded ( TBool aHide )

Sets tooltip to hide or show itself when background faded.

Since
S60 3.2

Parameters

TBool aHide should be ETrue if hiding, EFalse if showing

HighlightRect()

IMPORT_C TRect HighlightRect ( ) const

Gets the highlight rectangle around the button.

HitAreaContainsL(const TPoint &, TBool)

TBool HitAreaContainsL ( const TPoint & aPoint,
TBool aCheckHitArea
) const

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

Parameters

const TPoint & aPoint Location to check.
TBool aCheckHitArea if need to check the hit area for fixed toolbar button

IsDimmed()

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

MakeVisible(TBool)

IMPORT_C void MakeVisible ( TBool aVisible ) [virtual]

Sets this control as visible or invisible.

Parameters

TBool aVisible ETrue to make the control visible, EFalse to make it invisible.

MinimumSize()

IMPORT_C TSize MinimumSize ( ) [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 & aReader is the resource reader with which to access the control's resource values.

NewL(const TInt)

IMPORT_C CAknButton * NewL ( const TInt aResourceId ) [static]

Two-phased constructor. Constructs the button from resources.

Parameters

const TInt aResourceId is 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 TInt aButtonFlags,
const TInt aStateFlags
) [static]

Two-phased constructor. Constructs one state button.

Parameters

CGulIcon * aIcon The icon for the normal state. Takes ownership.
CGulIcon * aDimmedIcon The icon for the dimmed state. Takes ownership.
CGulIcon * aPressedIcon The icon for the pressed down. Takes ownership.
CGulIcon * aHoverIcon The icon for the hover state. Takes ownership.
const TDesC & aText The text inside the button.
const TDesC & aHelpText The text for the tooltip.
const TInt aButtonFlags The flags for the button.
const TInt aStateFlags The 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 TInt aBmpId,
const TInt aMaskId,
const TInt aDimmedBmpId,
const TInt aDimmedMaskId,
const TInt aPressedBmpId,
const TInt aPressedMaskId,
const TInt aHoverBmpId,
const TInt aHoverMaskId,
const TDesC & aText,
const TDesC & aHelpText,
const TInt aButtonFlags,
const TInt aStateFlags,
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 & aFilePath The path to the file which contains icons.
const TInt aBmpId The bitmap ID for the normal state icon.
const TInt aMaskId The mask ID for the normal state icon.
const TInt aDimmedBmpId The bitmap ID for the dimmed state icon.
const TInt aDimmedMaskId The mask ID for the dimmed state icon.
const TInt aPressedBmpId The bitmap ID for the pressed down state.
const TInt aPressedMaskId The mask ID for the pressed down state.
const TInt aHoverBmpId The bitmap ID for the hover state.
const TInt aHoverMaskId The mask ID for the hover state.
const TDesC & aText The text inside the button.
const TDesC & aHelpText The text for the tooltip.
const TInt aButtonFlags The flags for the button.
const TInt aStateFlags The 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 & aReader is the resource reader with which to access the control's resource values.

NewLC(const TInt)

IMPORT_C CAknButton * NewLC ( const TInt aResourceId ) [static]

Two-phased constructor. Constructs the button from resources.

Parameters

const TInt aResourceId is 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 TInt aFlags,
const TInt aStateFlags
) [static]

Two-phased constructor. Constructs one state button.

Parameters

CGulIcon * aIcon The icon for the normal state. Takes ownership.
CGulIcon * aDimmedIcon The icon for the dimmed state. Takes ownership.
CGulIcon * aPressedIcon The icon for the pressed down. Takes ownership.
CGulIcon * aHoverIcon The icon for the hover state. Takes ownership.
const TDesC & aText The text inside the button.
const TDesC & aHelpText The text for the tooltip.
const TInt aFlags
const TInt aStateFlags The 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 TInt aBmpId,
const TInt aMaskId,
const TInt aDimmedBmpId,
const TInt aDimmedMaskId,
const TInt aPressedBmpId,
const TInt aPressedMaskId,
const TInt aHoverBmpId,
const TInt aHoverMaskId,
const TDesC & aText,
const TDesC & aHelpText,
const TInt aButtonFlags,
const TInt aStateFlags,
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 & aFilePath The path to the file which contains icons.
const TInt aBmpId The bitmap ID for the normal state icon.
const TInt aMaskId The mask ID for the normal state icon.
const TInt aDimmedBmpId The bitmap ID for the dimmed state icon.
const TInt aDimmedMaskId The mask ID for the dimmed state icon.
const TInt aPressedBmpId The bitmap ID for the pressed down state.
const TInt aPressedMaskId The mask ID for the pressed down state.
const TInt aHoverBmpId The bitmap ID for the hover state.
const TInt aHoverMaskId The mask ID for the hover state.
const TDesC & aText The text inside the button.
const TDesC & aHelpText The text for the tooltip.
const TInt aButtonFlags The flags for the button.
const TInt aStateFlags The 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 TKeyResponse OfferKeyEventL ( const TKeyEvent & aKeyEvent,
TEventCode aType
) [virtual]

Handles key events.

Parameters

const TKeyEvent & aKeyEvent The key event.
TEventCode aType The type of key event: EEventKey, EEventKeyUp or EEventKeyDown.

PositionChanged()

IMPORT_C void PositionChanged ( ) [virtual]

Responds to changes in the position of a control.

PrepareForFocusGainL()

IMPORT_C void PrepareForFocusGainL ( ) [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 void PrepareForFocusLossL ( ) [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 *)

void RegisterResourceProvider ( CAknResourceProvider * aProvider )

Registers resource provider.

Parameters

CAknResourceProvider * aProvider New resource provider.

RemoveCurrentState()

void RemoveCurrentState ( )

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 void ResetState ( )

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 void SetBackgroundIds ( 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 & aBackgroundId The item ID of the entire frame.
const TAknsItemID & aLatchedBackgroundId The item ID of the background for the button in latched state.
const TAknsItemID & aDimmedBackgroundId The item ID of the background for the button in dimmed state.
const TAknsItemID & aPressedBackgroundId The item ID of the background for the button in pressed state.
const TAknsItemID & aLatchedDimmedBackgroundId The item ID of the background for the button in latched and dimmed state.

SetButtonFlags(const TInt)

IMPORT_C void SetButtonFlags ( const TInt aFlags )

Sets the button flags.

Parameters

const TInt aFlags which can be combination of: KAknButtonTextLeft, KAknButtonSizeFitText, KAknButtonNoFrame, KAknButtonKeyRepeat, KAknButtonReportOnKeyDown, KAknButtonNoFramePressEvent, KAknButtonRequestExitOnButtonUpEvent, KAknButtonReportOnLongPress.

SetCurrentState(const TInt, const TBool)

IMPORT_C void SetCurrentState ( const TInt aStateIndex,
const TBool aDrawNow
) [virtual]

Sets button state.

Parameters

const TInt aStateIndex The index for the state, starts from 0.
const TBool aDrawNow ETrue to redraw the button.

SetDimmed(TBool)

IMPORT_C void SetDimmed ( TBool aDimmed ) [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 aDimmed is ETrue to dim the button, EFalse to set the button as not dimmed.

SetDimmedHelpTextL(const TDesC &)

IMPORT_C void SetDimmedHelpTextL ( const TDesC & aHelpText )

Sets the help text for dimmed button.

Parameters

const TDesC & aHelpText The 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 void SetFrameAndCenterIds ( 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 & aFrameId The item ID of the entire frame.
const TAknsItemID & aCenterId The item ID of the center part of the frame.
const TAknsItemID & aLatchedFrameId The item ID of the entire frame for button in latched state.
const TAknsItemID & aLatchedCenterId The item ID of the center part of the frame for button in latched state.
const TAknsItemID & aDimmedFrameId The item ID of the entire frame for a button in dimmed state.
const TAknsItemID & aDimmedCenterId The item ID of the center part of the frame for a button in dimmed state.
const TAknsItemID & aPressedFrameId The item ID of the entire frame for a button in pressed state.
const TAknsItemID & aPressedCenterId is the item ID of the center part of the frame for a button in pressed state.
const TAknsItemID & aLatchedDimmedFrameId The item ID of the entire frame for a button in latched and dimmed state.
const TAknsItemID & aLatchedDimmedCenterId The item ID of the center part of the frame for a button in latched and dimmed state.

SetFrameIDs()

void SetFrameIDs ( ) const [private]

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

SetFrameRects()

void SetFrameRects ( ) [private]

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

SetHelpNoteTimeouts(const TInt, const TInt)

IMPORT_C void SetHelpNoteTimeouts ( const TInt aBeforeTimeout,
const TInt aInViewTimeout
)

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

Parameters

const TInt aBeforeTimeout The delay in milliseconds before text help note is shown. The default is 150 milliseconds.
const TInt aInViewTimeout The interval in milliseconds during which help text note is shown. The default is 3000 milliseconds.

SetHighlightRect(const TRect &)

IMPORT_C void SetHighlightRect ( const TRect & aRect )

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

Parameters

const TRect & aRect The highlight rectangle.

SetIconHorizontalAlignment(const CAknButton::TAlignment)

IMPORT_C void SetIconHorizontalAlignment ( const CAknButton::TAlignment aHorizontalAlignment )

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

Parameters

const CAknButton::TAlignment aHorizontalAlignment The horizontal alignment for the icon.

SetIconScaleMode(const TScaleMode)

IMPORT_C void SetIconScaleMode ( const TScaleMode aScaleMode )

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

Parameters

const TScaleMode aScaleMode The scale mode.

SetIconSize(const TSize &)

IMPORT_C TInt SetIconSize ( 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 & aSize New icon size.

SetIconVerticalAlignment(const CAknButton::TAlignment)

IMPORT_C void SetIconVerticalAlignment ( const CAknButton::TAlignment aVerticalAlignment )

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

Parameters

const CAknButton::TAlignment aVerticalAlignment The vertical alignment for the icon.

SetKeyRepeatInterval(const TInt, const TInt)

IMPORT_C void SetKeyRepeatInterval ( const TInt aKeyRepeatDelay,
const TInt aKeyRepeatInterval
)

Sets the interval for key repeat.

Parameters

const TInt aKeyRepeatDelay The initial delay, after which the key repeat is started. The default is 500 milliseconds.
const TInt aKeyRepeatInterval The interval in milliseconds, in which key repeat events should be reported. The default is 500 milliseconds.

SetLongPressInterval(const TInt)

IMPORT_C void SetLongPressInterval ( const TInt aLongPressInterval )

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 aLongPressInterval The time interval in milliseconds, after which the long press event should be reported. The default value is 800 milliseconds.

SetMargins(const TMargins8 &)

IMPORT_C void SetMargins ( 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 & aMargins New marginals.

SetRequestExit(const TBool)

IMPORT_C void SetRequestExit ( const TBool aRequestExit )

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

Parameters

const TBool aRequestExit ETrue if button should request exit.

SetStateIndexL(TInt)

void SetStateIndexL ( TInt aNewIndex ) [private]

Sets new state index

Parameters

TInt aNewIndex New state index

SetTextAndIconAlignment(const CAknButton::TTextAndIconAlignment)

IMPORT_C void SetTextAndIconAlignment ( const CAknButton::TTextAndIconAlignment aAlignment )

Sets the icon and text alignment for a button having both

Parameters

const CAknButton::TTextAndIconAlignment aAlignment

SetTextColorIds(const TAknsItemID &, const TInt)

IMPORT_C void SetTextColorIds ( const TAknsItemID & aTextColorTableId,
const TInt aTextColorIndex
)

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 & aTextColorTableId Id for the color table
const TInt aTextColorIndex Index of the color inside color table.

SetTextFont(const CFont *)

IMPORT_C void SetTextFont ( const CFont * aFont )

Sets some specific text font.

Parameters

const CFont * aFont The font, which should be used for the text inside the text button.

SetTextHorizontalAlignment(const CGraphicsContext::TTextAlign)

IMPORT_C void SetTextHorizontalAlignment ( const CGraphicsContext::TTextAlign aHorizontalAlignment )

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 aHorizontalAlignment The horizontal alignment for the text.

SetTextUnderlineStyle(TFontUnderline)

IMPORT_C void SetTextUnderlineStyle ( TFontUnderline aUnderlineStyle )

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

Parameters

TFontUnderline aUnderlineStyle The style of underline.

SetTextVerticalAlignment(const CAknButton::TAlignment)

IMPORT_C void SetTextVerticalAlignment ( const CAknButton::TAlignment aVerticalAlignment )

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 aVerticalAlignment The vertical alignment for the text.

SetTooltipPosition(const TTooltipPosition)

IMPORT_C void SetTooltipPosition ( const TTooltipPosition aPosition )

Sets the tooltip position.

Parameters

const TTooltipPosition aPosition The position of the tooltip.

ShowHelpL()

IMPORT_C void ShowHelpL ( ) [protected]

Shows help text for a certain period of time.

SizeChanged()

IMPORT_C void SizeChanged ( ) [protected, virtual]

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

SkinIID(const TInt)

TAknsItemID SkinIID ( const TInt aIndex ) const [private]

Returns the ID of specified skin item.

Parameters

const TInt aIndex

StartKeyRepeatTimerL()

void StartKeyRepeatTimerL ( ) [private]

Starts the timer for the key repeat.

StartLongPressTimerL()

void StartLongPressTimerL ( ) [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 TInt aStateIndex ) const

Returns the state of the button under specified index.

Parameters

const TInt aStateIndex The index for the state.

StateIndex()

IMPORT_C TInt StateIndex ( ) const

Returns the index of the button state.

StopKeyRepeatTimer()

void StopKeyRepeatTimer ( ) [private]

Stops the key repeat timer.

StopLongPressTimer()

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

void UnregisterResourceProvider ( )

Unregisters resource provider.

UpdateTooltipPosition()

void UpdateTooltipPosition ( ) [private]

Updates tooltip position.

UseMaskedDraw(TBool)

void UseMaskedDraw ( TBool aMaskedDraw )

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 aMaskedDraw ETrue 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]