CFsControlButtonVisualiser Class Reference

class CFsControlButtonVisualiser : public CBase

Visualiser class of the button.

       

fs_generic.lib

Inherits from

Public Member Functions
~CFsControlButtonVisualiser ()
IMPORT_C void ClearBackgroundColor ()
IMPORT_C void ClearBackgroundImage ()
CAlfLayout * ContentLayout ()
TInt GetBottomRight ()
IMPORT_C void Hide ()
IMPORT_C void InitializeL (CFsControlButtonModel &)
TBool IsVisible ()
CAlfLayout * Layout ()
void MakeFocusVisible ( TBool )
CFsControlButtonVisualiser * NewL ( CAlfControl &, CAlfDeckLayout &, CFsTextStyleManager *)
const TAlfTimedPoint Pos ()
IMPORT_C void Refresh ()
IMPORT_C void Refresh ( TPoint )
IMPORT_C void SetBackgroundColor (const TRgb &)
IMPORT_C void SetBackgroundImageL (CAlfImageBrush *)
IMPORT_C void SetElemAlignL ( TFsControlButtonElem , TAlfAlignHorizontal , TAlfAlignVertical )
void SetParentControlL ( CAlfControl *)
void SetParentLayoutL ( CAlfDeckLayout *)
IMPORT_C void SetTextFontL (const TFontSpec &)
IMPORT_C void SetTextHeight (const TInt )
void SetTextStyleManager ( CFsTextStyleManager *)
IMPORT_C void ShowL ()
const TAlfTimedPoint Size ()
IMPORT_C void TextureLoadingCompleted (CAlfTexture &, TInt , TInt )
IMPORT_C void UpdateButtonSize ()
IMPORT_C void UpdateElementL ( TFsControlButtonElem )
void UpdateVisualThemeL ()
TInt Width ()
Protected Member Functions
CFsControlButtonVisualiser ( CAlfControl &, CAlfDeckLayout &, CFsTextStyleManager *)
CFsControlButtonVisualiser ()
IMPORT_C TInt CalculateButtonSize ()
IMPORT_C void ConstructL ()
IMPORT_C void CreateButtonVisualsL ()
IMPORT_C void PrepareDrawDimmed ()
IMPORT_C void PrepareDrawFocused ()
IMPORT_C void PrepareDrawNormal ()
void ResolveCharFormat ( TCharFormat &, CAlfTextVisual *)
IMPORT_C void SetImageAlign ( CAlfImageVisual *, TAlfAlignHorizontal , TAlfAlignVertical )
IMPORT_C void SetTextAlign ( CAlfTextVisual *, TAlfAlignHorizontal , TAlfAlignVertical )
void UpdateBarLayout ()
void UpdateButtonPos ()
IMPORT_C void UpdateElementsSizeL ( TFsControlButtonType )
IMPORT_C void UpdateTextStyles ()
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
TAlfAlignHorizontal iAIconHAlign
TAlfAlignVertical iAIconVAlign
TAlfAlignHorizontal iBIconHAlign
TAlfAlignVertical iBIconVAlign
TRgb iBackgroundColor
CAlfBrush * iBgBrush
CAlfGradientBrush * iBgColorBrush
CAlfLayout * iButtonContentLayout
CAlfLayout * iButtonLayout
CFsControlButtonModel * iButtonModel
CAlfVisual * iButtonPane
CAlfFrameBrush * iDefaultBgBrush
TBool iDrawFocus
TBool iFirstDraw
CAlfImageVisual * iIconA
CAlfLayout * iIconAContainer
CAlfImageVisual * iIconB
CAlfLayout * iIconBContainer
CAlfTextVisual * iLabelFirstLine
CAlfTextVisual * iLabelSecondLine
CAlfControl * iParent
CAlfDeckLayout * iParentLayout
CAlfShadowBorderBrush * iShadowBorderBrush
TBool iShowShadow
TFontSpec * iTextFontSpec
TInt iTextHeight
TBool iTextHeightSet
CFsTextStyleManager * iTextStyleManager
TBool iUpdateIconsAlign
TBool iUseDefaultBackground
TBool iVisible

Constructor & Destructor Documentation

CFsControlButtonVisualiser(CAlfControl &, CAlfDeckLayout &, CFsTextStyleManager *)

IMPORT_C CFsControlButtonVisualiser ( CAlfControl & aParent,
CAlfDeckLayout & aParentLayout,
CFsTextStyleManager * aTextStyleManager
) [protected]

Constructor.

Parameters

CAlfControl & aParent parent control.
CAlfDeckLayout & aParentLayout layout of parent control.
CFsTextStyleManager * aTextStyleManager Text style manager.

CFsControlButtonVisualiser()

IMPORT_C CFsControlButtonVisualiser ( ) [protected]

Constructor.

~CFsControlButtonVisualiser()

IMPORT_C ~CFsControlButtonVisualiser ( ) [virtual]

Destructor.

Member Functions Documentation

CalculateButtonSize()

IMPORT_C TInt CalculateButtonSize ( ) [protected, virtual]

Calculates button size according to content.

ClearBackgroundColor()

IMPORT_C void ClearBackgroundColor ( ) [virtual]

Clears button's background color. Button is transparent.

ClearBackgroundImage()

IMPORT_C void ClearBackgroundImage ( ) [virtual]

Clears button's background image.

ConstructL()

IMPORT_C void ConstructL ( ) [protected, virtual]

Second phase constructor.

ContentLayout()

CAlfLayout * ContentLayout ( )

Retrieves the content layout of the button.

CreateButtonVisualsL()

IMPORT_C void CreateButtonVisualsL ( ) [protected, virtual]

Creates needed visuals for specified button type.

GetBottomRight()

TInt GetBottomRight ( ) const

Retrieves end X coordinate of the button.

Hide()

IMPORT_C void Hide ( ) [virtual]

Disables button.

InitializeL(CFsControlButtonModel &)

IMPORT_C void InitializeL ( CFsControlButtonModel & aButtonModel ) [virtual]

Attaches model to visualiser.

Parameters

CFsControlButtonModel & aButtonModel button's model.

IsVisible()

TBool IsVisible ( ) const

Checks if button is visible or not.

Layout()

CAlfLayout * Layout ( )

Retrieves the background layout of the button.

MakeFocusVisible(TBool)

void MakeFocusVisible ( TBool aShow )

Enables focus drawing for item and draws it. NOTE: Do not change focus state. Item might be focused altough selector is not visible.

Parameters

TBool aShow If ETrue visibility of focus is drawn if EFalse visibility of focus is hidden.

NewL(CAlfControl &, CAlfDeckLayout &, CFsTextStyleManager *)

CFsControlButtonVisualiser * NewL ( CAlfControl & aParent,
CAlfDeckLayout & aParentLayout,
CFsTextStyleManager * aTextStyleManager
) [static]

Two-phased constructor..

Parameters

CAlfControl & aParent
CAlfDeckLayout & aParentLayout
CFsTextStyleManager * aTextStyleManager

Pos()

const TAlfTimedPoint Pos ( ) const

Retrieves position of the button.

PrepareDrawDimmed()

IMPORT_C void PrepareDrawDimmed ( ) [protected, virtual]

Sets colors and bitmaps for drawing button in "dimmed" state.

PrepareDrawFocused()

IMPORT_C void PrepareDrawFocused ( ) [protected, virtual]

Sets colors and bitmaps for drawing button in "focused" state.

PrepareDrawNormal()

IMPORT_C void PrepareDrawNormal ( ) [protected, virtual]

Sets colors and bitmaps for drawing button in "normal (no focus, enabled)" state.

Refresh()

IMPORT_C void Refresh ( ) [virtual]

Refreshes button on the display.

Refresh(TPoint)

IMPORT_C void Refresh ( TPoint aStartAt ) [virtual]

Refreshes button on the display placing it at specified point.

Parameters

TPoint aStartAt start point of the buton.

ResolveCharFormat(TCharFormat &, CAlfTextVisual *)

void ResolveCharFormat ( TCharFormat & aCharFormat,
CAlfTextVisual * aTextVisual
) [protected]

Resolve the character format from current text visual.

Parameters

TCharFormat & aCharFormat Place holder for resolved character format.
CAlfTextVisual * aTextVisual Text visual.

SetBackgroundColor(const TRgb &)

IMPORT_C void SetBackgroundColor ( const TRgb & aColor ) [virtual]

Sets button's background color.

Parameters

const TRgb & aColor background color to be set.

SetBackgroundImageL(CAlfImageBrush *)

IMPORT_C void SetBackgroundImageL ( CAlfImageBrush * aImage ) [virtual]

Sets background image of the button. Ownership of the object is transfered.

Parameters

CAlfImageBrush * aImage Image brush that is used at background.

SetElemAlignL(TFsControlButtonElem, TAlfAlignHorizontal, TAlfAlignVertical)

IMPORT_C void SetElemAlignL ( TFsControlButtonElem aButtonElem,
TAlfAlignHorizontal aHAlign,
TAlfAlignVertical aVAlign
) [virtual]

Sets alignment of element of the button.

Parameters

TFsControlButtonElem aButtonElem element to be aligned.
TAlfAlignHorizontal aHAlign horizontal alignement of element.
TAlfAlignVertical aVAlign vertical alignement of element.

SetImageAlign(CAlfImageVisual *, TAlfAlignHorizontal, TAlfAlignVertical)

IMPORT_C void SetImageAlign ( CAlfImageVisual * aImage,
TAlfAlignHorizontal aHAlign,
TAlfAlignVertical aVAlign
) [protected, virtual]

Sets alignment of specified image of the button.

Parameters

CAlfImageVisual * aImage image to be aligned.
TAlfAlignHorizontal aHAlign horizontal alignement of element.
TAlfAlignVertical aVAlign vertical alignement of element.

SetParentControlL(CAlfControl *)

void SetParentControlL ( CAlfControl * aParentControl )

Sets parent control.

Parameters

CAlfControl * aParentControl parent control.

SetParentLayoutL(CAlfDeckLayout *)

void SetParentLayoutL ( CAlfDeckLayout * aParentLayout )

Sets parent layout.

Parameters

CAlfDeckLayout * aParentLayout layout of parent control.

SetTextAlign(CAlfTextVisual *, TAlfAlignHorizontal, TAlfAlignVertical)

IMPORT_C void SetTextAlign ( CAlfTextVisual * aText,
TAlfAlignHorizontal aHAlign,
TAlfAlignVertical aVAlign
) [protected, virtual]

Sets alignment of specified text of the button.

Parameters

CAlfTextVisual * aText text to be aligned.
TAlfAlignHorizontal aHAlign horizontal alignement of element.
TAlfAlignVertical aVAlign vertical alignement of element.

SetTextFontL(const TFontSpec &)

IMPORT_C void SetTextFontL ( const TFontSpec & aFontSpec ) [virtual]

Change the current font.

Parameters

const TFontSpec & aFontSpec Font specification.

SetTextHeight(const TInt)

IMPORT_C void SetTextHeight ( const TInt aTextHeight ) [virtual]

Set new height for the button text. Setting a negative or zero value changes the value back to default.

Parameters

const TInt aTextHeight Height in pixels.

SetTextStyleManager(CFsTextStyleManager *)

void SetTextStyleManager ( CFsTextStyleManager * aTextStyleManager )

Assign a new text style manager.

Parameters

CFsTextStyleManager * aTextStyleManager New text style manager.

ShowL()

IMPORT_C void ShowL ( ) [virtual]

Enables button.

Size()

const TAlfTimedPoint Size ( ) const

Retrieves size of the button.

TextureLoadingCompleted(CAlfTexture &, TInt, TInt)

IMPORT_C void TextureLoadingCompleted ( CAlfTexture & aTexture,
TInt aTextureId,
TInt aErrorCode
) [virtual]

Update elemets after texture loading is completed.

Parameters

CAlfTexture & aTexture Reference to the texture that has been loaded.
TInt aTextureId Id of the texture in the texture manager. Can be used to identify the loaded texture, provided that an id was assigned to the texture.
TInt aErrorCode KErrNone if the load was successful, otherwise one of the system-wide error codes indicating reason why the texture loading failed.

UpdateBarLayout()

void UpdateBarLayout ( ) [protected]

Updates bar layout.

UpdateButtonPos()

void UpdateButtonPos ( ) [protected]

Updates position of button.

UpdateButtonSize()

IMPORT_C void UpdateButtonSize ( ) [virtual]

Updates size of button.

UpdateElementL(TFsControlButtonElem)

IMPORT_C void UpdateElementL ( TFsControlButtonElem aButtonElem ) [virtual]

Updates element content from the model.

Parameters

TFsControlButtonElem aButtonElem element to be updated.

UpdateElementsSizeL(TFsControlButtonType)

IMPORT_C void UpdateElementsSizeL ( TFsControlButtonType aButtonType ) [protected, virtual]

Updates size of columns in grid layouter for button's elements.

Parameters

TFsControlButtonType aButtonType type of button.

UpdateTextStyles()

IMPORT_C void UpdateTextStyles ( ) [protected, virtual]

Sets text styles for specified button type.

UpdateVisualThemeL()

void UpdateVisualThemeL ( ) [virtual]

Called when the colors etc should be refreshed

Width()

TInt Width ( ) const

Retrieves width of the button.

Member Data Documentation

TAlfAlignHorizontal iAIconHAlign

TAlfAlignHorizontal iAIconHAlign [protected]

Horizontal alignement of A icon.

TAlfAlignVertical iAIconVAlign

TAlfAlignVertical iAIconVAlign [protected]

Vertical alignement of A icon.

TAlfAlignHorizontal iBIconHAlign

TAlfAlignHorizontal iBIconHAlign [protected]

Horizontal alignement of B icon.

TAlfAlignVertical iBIconVAlign

TAlfAlignVertical iBIconVAlign [protected]

Vertical alignement of B icon.

TRgb iBackgroundColor

TRgb iBackgroundColor [protected]

Background color.

CAlfBrush * iBgBrush

CAlfBrush * iBgBrush [protected]

Brush with background image. Owned.

CAlfGradientBrush * iBgColorBrush

CAlfGradientBrush * iBgColorBrush [protected]

Background color. Owned.

CAlfLayout * iButtonContentLayout

CAlfLayout * iButtonContentLayout [protected]

Layout for button content. Not own.

CAlfLayout * iButtonLayout

CAlfLayout * iButtonLayout [protected]

Layout of the button control. Owned (because of possibility to change visualiser - old one has to be removed from parent and layout tree).

CFsControlButtonModel * iButtonModel

CFsControlButtonModel * iButtonModel [protected]

Model of the button. Not owned.

CAlfVisual * iButtonPane

CAlfVisual * iButtonPane [protected]

Visual for button pane. Not own.

CAlfFrameBrush * iDefaultBgBrush

CAlfFrameBrush * iDefaultBgBrush [protected]

Default brush for background. Owned.

TBool iDrawFocus

TBool iDrawFocus [protected]

States that can focus been drawn.

TBool iFirstDraw

TBool iFirstDraw [protected]

First draw.

CAlfImageVisual * iIconA

CAlfImageVisual * iIconA [protected]

Visual for the A icon. Not own.

CAlfLayout * iIconAContainer

CAlfLayout * iIconAContainer [protected]

Container for icon A. Not own.

CAlfImageVisual * iIconB

CAlfImageVisual * iIconB [protected]

Visual for the B icon. Not own.

CAlfLayout * iIconBContainer

CAlfLayout * iIconBContainer [protected]

Container for icon B. Not own.

CAlfTextVisual * iLabelFirstLine

CAlfTextVisual * iLabelFirstLine [protected]

Visual for first line of text. Not own.

CAlfTextVisual * iLabelSecondLine

CAlfTextVisual * iLabelSecondLine [protected]

Visual for second line of text. Not own.

CAlfControl * iParent

CAlfControl * iParent [protected]

Parent control. Not own.

CAlfDeckLayout * iParentLayout

CAlfDeckLayout * iParentLayout [protected]

Layout of the parent control. Not owned.

CAlfShadowBorderBrush * iShadowBorderBrush

CAlfShadowBorderBrush * iShadowBorderBrush [protected]

Brush for shadowed button borders. Owned.

TBool iShowShadow

TBool iShowShadow [protected]

Show dropdown shadow for buttons

TFontSpec * iTextFontSpec

TFontSpec * iTextFontSpec [protected]

Font specification. Owned.

TInt iTextHeight

TInt iTextHeight [protected]

Height of the button's text in pixels.

TBool iTextHeightSet

TBool iTextHeightSet [protected]

Flag to determine if the text size has been changed.

CFsTextStyleManager * iTextStyleManager

CFsTextStyleManager * iTextStyleManager [protected]

Text style manager. Not own.

TBool iUpdateIconsAlign

TBool iUpdateIconsAlign [protected]

Flag for recalculate positions of icons.

TBool iUseDefaultBackground

TBool iUseDefaultBackground [protected]

ETrue if default theme background is used

TBool iVisible

TBool iVisible [protected]

Flag for visible/hidden state.