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 TInt Flags ()
IMPORT_C const TDesC & HelpText ()
IMPORT_C const CGulIcon * HoverIcon ()
IMPORT_C const CGulIcon * Icon ()
IMPORT_C const CGulIcon * PressedIcon ()
IMPORT_C void SetDimmedIcon ( CGulIcon *)
IMPORT_C void SetFlags (const TInt )
IMPORT_C void SetHelpTextL (const TDesC &)
IMPORT_C void SetHoverIcon ( CGulIcon *)
IMPORT_C void SetIcon ( CGulIcon *)
IMPORT_C void SetPressedIcon ( CGulIcon *)
IMPORT_C void SetTextL (const TDesC &)
IMPORT_C const TDesC & Text ()
void UpdateExtensionInfoL ( TInt )
void 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 &)
Protected Member Functions
CAknButtonState (const TInt )
IMPORT_C void ConstructFromResourceL ( TResourceReader &)
IMPORT_C void ConstructL ( CGulIcon *, CGulIcon *, CGulIcon *, CGulIcon *, const TDesC &, const TDesC &)
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 TAknsItemID &, const TAknsItemID &, const TAknsItemID &, const TAknsItemID &)
void HandleResourceChange ( TInt )
IMPORT_C TBool HasHelp ()
IMPORT_C TBool HasText ()
void SetIconScaleMode (const TScaleMode )
IMPORT_C void SizeChanged (const TRect &, TScaleMode )
Private Member Functions
void CreateButtonIconL ( CGulIcon *&, const TDesC &, TInt , TInt , const TAknsItemID &)
CAknButtonStateExtension * Extension ()
TBool FlagsChanged ()
void LoadButtonIcon ( CGulIcon *&)
void ReplaceIcon ( CGulIcon *&, CGulIcon *)
void ResetFlagsChanged ()
void ResetTextChanged ()
TInt ScaleIcons (const TSize &, TScaleMode )
TScaleMode ScaleMode ()
void SetGeneratedDimmedIcon ( 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_C CAknButtonState ( const TInt aFlags ) [protected]

Constructor.

Parameters

const TInt aFlags The flags for the button state

~CAknButtonState()

IMPORT_C ~CAknButtonState ( )

Destructor.

Member Functions Documentation

ConstructFromResourceL(TResourceReader &)

IMPORT_C void ConstructFromResourceL ( TResourceReader & aReader ) [protected, virtual]

Constructs controls from a resource file.

Parameters

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

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

IMPORT_C void ConstructL ( CGulIcon * aIcon,
CGulIcon * aDimmedIcon,
CGulIcon * aPressedIcon,
CGulIcon * aHoverIcon,
const TDesC & aText,
const TDesC & aHelpText
) [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. Takes ownership.
const TDesC & aText The text inside the button.
const TDesC & aHelpText The 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 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 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 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 &)

void CreateButtonIconL ( CGulIcon *& aIcon,
const TDesC & aFilePath,
TInt aBmpId,
TInt aMaskId,
const TAknsItemID & aId =  KAknsIIDNone
) const [private]

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

Parameters

CGulIcon *& aIcon The icon object which is created and returned. Will be deleted if it is not NULL on entry.
const TDesC & aFilePath The path to the file which contains icons.
TInt aBmpId The bitmap ID for the icon.
TInt aMaskId The 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 TInt Flags ( ) 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)

void HandleResourceChange ( TInt aType ) [protected]

Handles changes in state's environment.

Since
S60 3.2.

Parameters

TInt aType Resource change's type.

HasHelp()

IMPORT_C TBool HasHelp ( ) const [protected]

HasText()

IMPORT_C TBool HasText ( ) 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 *&)

void LoadButtonIcon ( 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 *& aIcon The 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 *)

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

void ResetFlagsChanged ( ) [private]

Frame has been updated. No need to update anymore.

ResetTextChanged()

void ResetTextChanged ( ) [private]

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

ScaleIcons(const TSize &, TScaleMode)

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

Scales all icons.

Since
S60 3.2

Parameters

const TSize & aSize New icon size.
TScaleMode aScaleMode Scaling mode.

ScaleMode()

TScaleMode ScaleMode ( ) const [private]

SetDimmedIcon(CGulIcon *)

IMPORT_C void SetDimmedIcon ( CGulIcon * aDimmedIcon )

Sets the icon for the dimmed state. Takes ownership.

Parameters

CGulIcon * aDimmedIcon The icon for the dimmed state.

SetFlags(const TInt)

IMPORT_C void SetFlags ( const TInt aFlags )

Sets the flags for the state.

Parameters

const TInt aFlags The flags for the state.

SetGeneratedDimmedIcon(TBool)

void SetGeneratedDimmedIcon ( TBool aDimmedIconCreatedByButton ) [private]

Parameters

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

SetHelpTextL(const TDesC &)

IMPORT_C void SetHelpTextL ( const TDesC & aHelpText )

Sets the text inside the help note.

Parameters

const TDesC & aHelpText The text inside the tooltip.

SetHoverIcon(CGulIcon *)

IMPORT_C void SetHoverIcon ( CGulIcon * aHoverIcon )

Sets the icon for the hover state. Takes ownership.

Parameters

CGulIcon * aHoverIcon The icon for the hover state.

SetIcon(CGulIcon *)

IMPORT_C void SetIcon ( CGulIcon * aIcon )

Sets the icon for the normal state. Takes ownership.

Parameters

CGulIcon * aIcon The icon for the normal state.

SetIconScaleMode(const TScaleMode)

void SetIconScaleMode ( const TScaleMode aScaleMode ) [protected]

Sets default scaling mode.

Since
S60 3.2

Parameters

const TScaleMode aScaleMode Scaling mode.

SetPressedIcon(CGulIcon *)

IMPORT_C void SetPressedIcon ( CGulIcon * aPressedIcon )

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

Parameters

CGulIcon * aPressedIcon The icon for the pressed down state.

SetTextL(const TDesC &)

IMPORT_C void SetTextL ( const TDesC & aText )

Sets the text inside the button.

Parameters

const TDesC & aText The text inside the button.

SizeChanged(const TRect &, TScaleMode)

IMPORT_C void SizeChanged ( const TRect & aRect,
TScaleMode aScaleMode
) [protected, virtual]

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

Parameters

const TRect & aRect The new rectangle for the icons.
TScaleMode aScaleMode The 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)

void UpdateExtensionInfoL ( TInt aResource )

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 &)

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

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]