CAknButtonState Class Reference

class CAknButtonState : public CBase

Class which represents one of the button states.

eikcoctl.lib
Since
Series 60 3.1

Inherits from

Public Member Functions
~CAknButtonState()
IMPORT_C const CGulIcon *DimmedIcon()
IMPORT_C TIntFlags()
IMPORT_C const TDesC &HelpText()
IMPORT_C const CGulIcon *HoverIcon()
IMPORT_C const CGulIcon *Icon()
IMPORT_C const CGulIcon *PressedIcon()
IMPORT_C voidSetDimmedIcon(CGulIcon *)
IMPORT_C voidSetFlags(const TInt)
IMPORT_C voidSetHelpTextL(const TDesC &)
IMPORT_C voidSetHoverIcon(CGulIcon *)
IMPORT_C voidSetIcon(CGulIcon *)
IMPORT_C voidSetPressedIcon(CGulIcon *)
IMPORT_C voidSetTextL(const TDesC &)
IMPORT_C const TDesC &Text()
voidUpdateExtensionInfoL(TInt)
voidUpdateIconL(const TDesC &, const TInt, const TInt, const TInt, const TInt, const TInt, const TInt, const TInt, const TInt, const TAknsItemID &, const TAknsItemID &, const TAknsItemID &, const TAknsItemID &)
Protected Member Functions
CAknButtonState(const TInt)
IMPORT_C voidConstructFromResourceL(TResourceReader &)
IMPORT_C voidConstructL(CGulIcon *, CGulIcon *, CGulIcon *, CGulIcon *, const TDesC &, const TDesC &)
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 TAknsItemID &, const TAknsItemID &, const TAknsItemID &, const TAknsItemID &)
voidHandleResourceChange(TInt)
IMPORT_C TBoolHasHelp()
IMPORT_C TBoolHasText()
voidSetIconScaleMode(const TScaleMode)
IMPORT_C voidSizeChanged(const TRect &, TScaleMode)
Private Member Functions
voidCreateButtonIconL(CGulIcon *&, const TDesC &, TInt, TInt, const TAknsItemID &)
CAknButtonStateExtension *Extension()
TBool FlagsChanged()
voidLoadButtonIcon(CGulIcon *&)
voidReplaceIcon(CGulIcon *&, CGulIcon *)
voidResetFlagsChanged()
voidResetTextChanged()
TInt ScaleIcons(const TSize &, TScaleMode)
TScaleMode ScaleMode()
voidSetGeneratedDimmedIcon(TBool)
TBool TextChanged()
Inherited Functions
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()
Protected Attributes
CGulIcon *iDimmedIcon
CAknButtonStateExtension *iExtension
TInt iFlags
HBufC *iHelpText
CGulIcon *iHoverIcon
CGulIcon *iIcon
CGulIcon *iPressedIcon
HBufC *iText

Constructor & Destructor Documentation

CAknButtonState(const TInt)

IMPORT_CCAknButtonState(const TIntaFlags)[protected]

Constructor.

Parameters

const TInt aFlagsThe flags for the button state

~CAknButtonState()

IMPORT_C~CAknButtonState()

Destructor.

Member Functions Documentation

ConstructFromResourceL(TResourceReader &)

IMPORT_C voidConstructFromResourceL(TResourceReader &aReader)[protected, virtual]

Constructs controls from a resource file.

Parameters

TResourceReader & aReaderThe resource reader with which to access the control's resource values.

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

IMPORT_C voidConstructL(CGulIcon *aIcon,
CGulIcon *aDimmedIcon,
CGulIcon *aPressedIcon,
CGulIcon *aHoverIcon,
const TDesC &aText,
const TDesC &aHelpText
)[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. Takes ownership.
const TDesC & aTextThe text inside the button.
const TDesC & aHelpTextThe text for the tooltip.

ConstructL(const TDesC &, const TInt, const TInt, const TInt, const TInt, const TInt, const TInt, const TInt, const TInt, const TDesC &, const TDesC &, 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 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 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.

CreateButtonIconL(CGulIcon *&, const TDesC &, TInt, TInt, const TAknsItemID &)

voidCreateButtonIconL(CGulIcon *&aIcon,
const TDesC &aFilePath,
TIntaBmpId,
TIntaMaskId,
const TAknsItemID &aId =  KAknsIIDNone
)const [private]

Creates one icon based on the specified file path and IDs.

Parameters

CGulIcon *& aIconThe icon object which is created and returned. Will be deleted if it is not NULL on entry.
const TDesC & aFilePathThe path to the file which contains icons.
TInt aBmpIdThe bitmap ID for the icon.
TInt aMaskIdThe mask ID for the icon.
const TAknsItemID & aId =  KAknsIIDNone Item ID of the masked bitmap to be created for skin specific icon.

DimmedIcon()

IMPORT_C const CGulIcon *DimmedIcon()const

Provides the icon for the dimmed state.

Extension()

CAknButtonStateExtension *Extension()const [private]

Flags()

IMPORT_C TIntFlags()const

Provides the flags for the state.

FlagsChanged()

TBool FlagsChanged()[private]

Tells if frame update is needed, it is needed when the flag KAknButtonStateHasLatchedFrame has changed.

HandleResourceChange(TInt)

voidHandleResourceChange(TIntaType)[protected]

Handles changes in state's environment.

Since
S60 3.2.

Parameters

TInt aTypeResource change's type.

HasHelp()

IMPORT_C TBoolHasHelp()const [protected]

HasText()

IMPORT_C TBoolHasText()const [protected]

HelpText()

IMPORT_C const TDesC &HelpText()const

Provides the text inside the help note.

HoverIcon()

IMPORT_C const CGulIcon *HoverIcon()const

Provides the icon for the hover state.

Icon()

IMPORT_C const CGulIcon *Icon()const

Provides the icon for the normal state.

LoadButtonIcon(CGulIcon *&)

voidLoadButtonIcon(CGulIcon *&aIcon)const [private]

Loads one icon based on the specified file path and IDs. If the icon is already loaded it is deleted and replaced with a reloaded copy.

Since
S60 3.2

Parameters

CGulIcon *& aIconThe icon object which is created and returned. Will be deleted if it is not NULL on entry.

PressedIcon()

IMPORT_C const CGulIcon *PressedIcon()const

Provides the icon for the pressed down (not released) state.

ReplaceIcon(CGulIcon *&, CGulIcon *)

voidReplaceIcon(CGulIcon *&aIcon,
CGulIcon *aNewIcon
)[private]

Replaces the given icon with a new one. If the original icon had its size set then the new icon is scaled to that size.

Since
S60 3.2

Parameters

CGulIcon *& aIcon
CGulIcon * aNewIcon

ResetFlagsChanged()

voidResetFlagsChanged()[private]

Frame has been updated. No need to update anymore.

ResetTextChanged()

voidResetTextChanged()[private]

Visual text has been updated, so iTextChanged can be set to EFalse.

ScaleIcons(const TSize &, TScaleMode)

TInt ScaleIcons(const TSize &aSize,
TScaleModeaScaleMode
)[private]

Scales all icons.

Since
S60 3.2

Parameters

const TSize & aSizeNew icon size.
TScaleMode aScaleModeScaling mode.

ScaleMode()

TScaleMode ScaleMode()const [private]

SetDimmedIcon(CGulIcon *)

IMPORT_C voidSetDimmedIcon(CGulIcon *aDimmedIcon)

Sets the icon for the dimmed state. Takes ownership.

Parameters

CGulIcon * aDimmedIconThe icon for the dimmed state.

SetFlags(const TInt)

IMPORT_C voidSetFlags(const TIntaFlags)

Sets the flags for the state.

Parameters

const TInt aFlagsThe flags for the state.

SetGeneratedDimmedIcon(TBool)

voidSetGeneratedDimmedIcon(TBoolaDimmedIconCreatedByButton)[private]

Parameters

TBool aDimmedIconCreatedByButtonETrue, if the dimmed icon of the state is created by owning Button

SetHelpTextL(const TDesC &)

IMPORT_C voidSetHelpTextL(const TDesC &aHelpText)

Sets the text inside the help note.

Parameters

const TDesC & aHelpTextThe text inside the tooltip.

SetHoverIcon(CGulIcon *)

IMPORT_C voidSetHoverIcon(CGulIcon *aHoverIcon)

Sets the icon for the hover state. Takes ownership.

Parameters

CGulIcon * aHoverIconThe icon for the hover state.

SetIcon(CGulIcon *)

IMPORT_C voidSetIcon(CGulIcon *aIcon)

Sets the icon for the normal state. Takes ownership.

Parameters

CGulIcon * aIconThe icon for the normal state.

SetIconScaleMode(const TScaleMode)

voidSetIconScaleMode(const TScaleModeaScaleMode)[protected]

Sets default scaling mode.

Since
S60 3.2

Parameters

const TScaleMode aScaleModeScaling mode.

SetPressedIcon(CGulIcon *)

IMPORT_C voidSetPressedIcon(CGulIcon *aPressedIcon)

Sets the icon for the pressed down state. Takes ownership.

Parameters

CGulIcon * aPressedIconThe icon for the pressed down state.

SetTextL(const TDesC &)

IMPORT_C voidSetTextL(const TDesC &aText)

Sets the text inside the button.

Parameters

const TDesC & aTextThe text inside the button.

SizeChanged(const TRect &, TScaleMode)

IMPORT_C voidSizeChanged(const TRect &aRect,
TScaleModeaScaleMode
)[protected, virtual]

Updates the size of icons. Called from CAknButton::SizeChanged() function.

Parameters

const TRect & aRectThe new rectangle for the icons.
TScaleMode aScaleModeThe scale mode which was set for the button.

Text()

IMPORT_C const TDesC &Text()const

Provides the text inside the button.

TextChanged()

TBool TextChanged()[private]

Checks if text has changed.

UpdateExtensionInfoL(TInt)

voidUpdateExtensionInfoL(TIntaResource)

Parameters

TInt aResource

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

voidUpdateIconL(const TDesC &aFilePath,
const TIntaBmpId,
const TIntaMaskId,
const TIntaDimmedBmpId,
const TIntaDimmedMaskId,
const TIntaPressedBmpId,
const TIntaPressedMaskId,
const TIntaHoverBmpId,
const TIntaHoverMaskId,
const TAknsItemID &aId =  KAknsIIDNone ,
const TAknsItemID &aDimmedId =  KAknsIIDNone ,
const TAknsItemID &aPressedId =  KAknsIIDNone ,
const TAknsItemID &aHoverId =  KAknsIIDNone
)

Sets the icon for the normal state

Parameters

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 TAknsItemID & aId =  KAknsIIDNone
const TAknsItemID & aDimmedId =  KAknsIIDNone
const TAknsItemID & aPressedId =  KAknsIIDNone
const TAknsItemID & aHoverId =  KAknsIIDNone

Member Data Documentation

CGulIcon * iDimmedIcon

CGulIcon *iDimmedIcon[protected]

CAknButtonStateExtension * iExtension

CAknButtonStateExtension *iExtension[protected]

TInt iFlags

TInt iFlags[protected]

HBufC * iHelpText

HBufC *iHelpText[protected]

CGulIcon * iHoverIcon

CGulIcon *iHoverIcon[protected]

CGulIcon * iIcon

CGulIcon *iIcon[protected]

CGulIcon * iPressedIcon

CGulIcon *iPressedIcon[protected]

HBufC * iText

HBufC *iText[protected]