CFsControlButtonVisualiser Class Reference

class CFsControlButtonVisualiser : public CBase

Visualiser class of the button.


			

fs_generic.lib

Inherits from

  • CFsControlButtonVisualiser
Public Member Functions
~CFsControlButtonVisualiser()
IMPORT_C voidClearBackgroundColor()
IMPORT_C voidClearBackgroundImage()
CAlfLayout *ContentLayout()
TInt GetBottomRight()
IMPORT_C voidHide()
IMPORT_C voidInitializeL(CFsControlButtonModel &)
TBool IsVisible()
CAlfLayout *Layout()
voidMakeFocusVisible(TBool)
CFsControlButtonVisualiser *NewL(CAlfControl &, CAlfDeckLayout &, CFsTextStyleManager *)
const TAlfTimedPointPos()
IMPORT_C voidRefresh()
IMPORT_C voidRefresh(TPoint)
IMPORT_C voidSetBackgroundColor(const TRgb &)
IMPORT_C voidSetBackgroundImageL(CAlfImageBrush *)
IMPORT_C voidSetElemAlignL(TFsControlButtonElem, TAlfAlignHorizontal, TAlfAlignVertical)
voidSetParentControlL(CAlfControl *)
voidSetParentLayoutL(CAlfDeckLayout *)
IMPORT_C voidSetTextFontL(const TFontSpec &)
IMPORT_C voidSetTextHeight(const TInt)
voidSetTextStyleManager(CFsTextStyleManager *)
IMPORT_C voidShowL()
const TAlfTimedPointSize()
IMPORT_C voidTextureLoadingCompleted(CAlfTexture &, TInt, TInt)
IMPORT_C voidUpdateButtonSize()
IMPORT_C voidUpdateElementL(TFsControlButtonElem)
voidUpdateVisualThemeL()
TInt Width()
Protected Member Functions
CFsControlButtonVisualiser(CAlfControl &, CAlfDeckLayout &, CFsTextStyleManager *)
CFsControlButtonVisualiser()
IMPORT_C TIntCalculateButtonSize()
IMPORT_C voidConstructL()
IMPORT_C voidCreateButtonVisualsL()
IMPORT_C voidPrepareDrawDimmed()
IMPORT_C voidPrepareDrawFocused()
IMPORT_C voidPrepareDrawNormal()
voidResolveCharFormat(TCharFormat &, CAlfTextVisual *)
IMPORT_C voidSetImageAlign(CAlfImageVisual *, TAlfAlignHorizontal, TAlfAlignVertical)
IMPORT_C voidSetTextAlign(CAlfTextVisual *, TAlfAlignHorizontal, TAlfAlignVertical)
voidUpdateBarLayout()
voidUpdateButtonPos()
IMPORT_C voidUpdateElementsSizeL(TFsControlButtonType)
IMPORT_C voidUpdateTextStyles()
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_CCFsControlButtonVisualiser(CAlfControl &aParent,
CAlfDeckLayout &aParentLayout,
CFsTextStyleManager *aTextStyleManager
)[protected]

Constructor.

Parameters

CAlfControl & aParentparent control.
CAlfDeckLayout & aParentLayoutlayout of parent control.
CFsTextStyleManager * aTextStyleManagerText style manager.

CFsControlButtonVisualiser()

IMPORT_CCFsControlButtonVisualiser()[protected]

Constructor.

~CFsControlButtonVisualiser()

IMPORT_C~CFsControlButtonVisualiser()[virtual]

Destructor.

Member Functions Documentation

CalculateButtonSize()

IMPORT_C TIntCalculateButtonSize()[protected, virtual]

Calculates button size according to content.

ClearBackgroundColor()

IMPORT_C voidClearBackgroundColor()[virtual]

Clears button's background color. Button is transparent.

ClearBackgroundImage()

IMPORT_C voidClearBackgroundImage()[virtual]

Clears button's background image.

ConstructL()

IMPORT_C voidConstructL()[protected, virtual]

Second phase constructor.

ContentLayout()

CAlfLayout *ContentLayout()

Retrieves the content layout of the button.

CreateButtonVisualsL()

IMPORT_C voidCreateButtonVisualsL()[protected, virtual]

Creates needed visuals for specified button type.

GetBottomRight()

TInt GetBottomRight()const

Retrieves end X coordinate of the button.

Hide()

IMPORT_C voidHide()[virtual]

Disables button.

InitializeL(CFsControlButtonModel &)

IMPORT_C voidInitializeL(CFsControlButtonModel &aButtonModel)[virtual]

Attaches model to visualiser.

Parameters

CFsControlButtonModel & aButtonModelbutton'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)

voidMakeFocusVisible(TBoolaShow)

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 aShowIf 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 TAlfTimedPointPos()const

Retrieves position of the button.

PrepareDrawDimmed()

IMPORT_C voidPrepareDrawDimmed()[protected, virtual]

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

PrepareDrawFocused()

IMPORT_C voidPrepareDrawFocused()[protected, virtual]

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

PrepareDrawNormal()

IMPORT_C voidPrepareDrawNormal()[protected, virtual]

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

Refresh()

IMPORT_C voidRefresh()[virtual]

Refreshes button on the display.

Refresh(TPoint)

IMPORT_C voidRefresh(TPointaStartAt)[virtual]

Refreshes button on the display placing it at specified point.

Parameters

TPoint aStartAtstart point of the buton.

ResolveCharFormat(TCharFormat &, CAlfTextVisual *)

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

Resolve the character format from current text visual.

Parameters

TCharFormat & aCharFormatPlace holder for resolved character format.
CAlfTextVisual * aTextVisualText visual.

SetBackgroundColor(const TRgb &)

IMPORT_C voidSetBackgroundColor(const TRgb &aColor)[virtual]

Sets button's background color.

Parameters

const TRgb & aColorbackground color to be set.

SetBackgroundImageL(CAlfImageBrush *)

IMPORT_C voidSetBackgroundImageL(CAlfImageBrush *aImage)[virtual]

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

Parameters

CAlfImageBrush * aImageImage brush that is used at background.

SetElemAlignL(TFsControlButtonElem, TAlfAlignHorizontal, TAlfAlignVertical)

IMPORT_C voidSetElemAlignL(TFsControlButtonElemaButtonElem,
TAlfAlignHorizontalaHAlign,
TAlfAlignVerticalaVAlign
)[virtual]

Sets alignment of element of the button.

Parameters

TFsControlButtonElem aButtonElemelement to be aligned.
TAlfAlignHorizontal aHAlignhorizontal alignement of element.
TAlfAlignVertical aVAlignvertical alignement of element.

SetImageAlign(CAlfImageVisual *, TAlfAlignHorizontal, TAlfAlignVertical)

IMPORT_C voidSetImageAlign(CAlfImageVisual *aImage,
TAlfAlignHorizontalaHAlign,
TAlfAlignVerticalaVAlign
)[protected, virtual]

Sets alignment of specified image of the button.

Parameters

CAlfImageVisual * aImageimage to be aligned.
TAlfAlignHorizontal aHAlignhorizontal alignement of element.
TAlfAlignVertical aVAlignvertical alignement of element.

SetParentControlL(CAlfControl *)

voidSetParentControlL(CAlfControl *aParentControl)

Sets parent control.

Parameters

CAlfControl * aParentControlparent control.

SetParentLayoutL(CAlfDeckLayout *)

voidSetParentLayoutL(CAlfDeckLayout *aParentLayout)

Sets parent layout.

Parameters

CAlfDeckLayout * aParentLayoutlayout of parent control.

SetTextAlign(CAlfTextVisual *, TAlfAlignHorizontal, TAlfAlignVertical)

IMPORT_C voidSetTextAlign(CAlfTextVisual *aText,
TAlfAlignHorizontalaHAlign,
TAlfAlignVerticalaVAlign
)[protected, virtual]

Sets alignment of specified text of the button.

Parameters

CAlfTextVisual * aTexttext to be aligned.
TAlfAlignHorizontal aHAlignhorizontal alignement of element.
TAlfAlignVertical aVAlignvertical alignement of element.

SetTextFontL(const TFontSpec &)

IMPORT_C voidSetTextFontL(const TFontSpec &aFontSpec)[virtual]

Change the current font.

Parameters

const TFontSpec & aFontSpecFont specification.

SetTextHeight(const TInt)

IMPORT_C voidSetTextHeight(const TIntaTextHeight)[virtual]

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

Parameters

const TInt aTextHeightHeight in pixels.

SetTextStyleManager(CFsTextStyleManager *)

voidSetTextStyleManager(CFsTextStyleManager *aTextStyleManager)

Assign a new text style manager.

Parameters

CFsTextStyleManager * aTextStyleManagerNew text style manager.

ShowL()

IMPORT_C voidShowL()[virtual]

Enables button.

Size()

const TAlfTimedPointSize()const

Retrieves size of the button.

TextureLoadingCompleted(CAlfTexture &, TInt, TInt)

IMPORT_C voidTextureLoadingCompleted(CAlfTexture &aTexture,
TIntaTextureId,
TIntaErrorCode
)[virtual]

Update elemets after texture loading is completed.

Parameters

CAlfTexture & aTextureReference to the texture that has been loaded.
TInt aTextureIdId 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 aErrorCodeKErrNone if the load was successful, otherwise one of the system-wide error codes indicating reason why the texture loading failed.

UpdateBarLayout()

voidUpdateBarLayout()[protected]

Updates bar layout.

UpdateButtonPos()

voidUpdateButtonPos()[protected]

Updates position of button.

UpdateButtonSize()

IMPORT_C voidUpdateButtonSize()[virtual]

Updates size of button.

UpdateElementL(TFsControlButtonElem)

IMPORT_C voidUpdateElementL(TFsControlButtonElemaButtonElem)[virtual]

Updates element content from the model.

Parameters

TFsControlButtonElem aButtonElemelement to be updated.

UpdateElementsSizeL(TFsControlButtonType)

IMPORT_C voidUpdateElementsSizeL(TFsControlButtonTypeaButtonType)[protected, virtual]

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

Parameters

TFsControlButtonType aButtonTypetype of button.

UpdateTextStyles()

IMPORT_C voidUpdateTextStyles()[protected, virtual]

Sets text styles for specified button type.

UpdateVisualThemeL()

voidUpdateVisualThemeL()[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.