CHuiBrush Class Reference

class CHuiBrush : public CBase

A brush implements a series of graphics drawing operations. Brushes are attached to visuals and drawn whenever the visual is drawn. Brushes can be used for augmenting the normal appearance of visuals with graphical features such as background pictures, gradients, overlay icons, and selection highlights. Technically, a brush is a simple class whose most important method is Draw() that draws the brush into the specified area of the display.

CHuiVisual::EnableBrushesL() CHuiBrushArray

Inherits from

Constructor & Destructor Documentation

CHuiBrush()

IMPORT_C CHuiBrush ( ) [protected]

Constructor.

~CHuiBrush()

IMPORT_C ~CHuiBrush ( )

Destructor.

Member Functions Documentation

ActivateBrushGuide(const CHuiVisual *)

void ActivateBrushGuide ( const CHuiVisual * aNewGuide ) const

Notifies change in the brush guide

Parameters

const CHuiVisual * aNewGuide

BeginDraw(CHuiGc &, const MHuiBrushGuide &)

IMPORT_C void BeginDraw ( CHuiGc & aGc,
const MHuiBrushGuide & aGuide
) const [virtual]

The brush is about to get drawn, usually gc parameters are set here

Parameters

CHuiGc & aGc
const MHuiBrushGuide & aGuide

BrushExtension(const TUid &, TAny **)

IMPORT_C void BrushExtension ( const TUid & aExtensionUid,
TAny ** aExtensionParameters
) [protected, virtual]

Parameters

const TUid & aExtensionUid
TAny ** aExtensionParameters

BrushGuide()

CHuiVisual * BrushGuide ( ) const

Returns active brush guide as a visual if it exist.

Changed()

IMPORT_C TBool Changed ( ) const [virtual]

Determines whether the brush has been changed and needs to be redrawn.

ClearChanged()

IMPORT_C void ClearChanged ( ) [virtual]

Clears the changed status of the brush. This is called automatically by the refresh loop after a frame has been drawn.

ClipToVisual()

IMPORT_C TBool ClipToVisual ( ) const

Draw(CHuiGc &, const MHuiBrushGuide &)

IMPORT_C void Draw ( CHuiGc & aGc,
const MHuiBrushGuide & aGuide
) const [virtual]

Draw the brush using the current drawing parameters.

Parameters

CHuiGc & aGc
const MHuiBrushGuide & aGuide

EndDraw(CHuiGc &, const MHuiBrushGuide &)

IMPORT_C void EndDraw ( CHuiGc & aGc,
const MHuiBrushGuide & aGuide
) const [virtual]

The brush has been drawn, usually parameters changed in BeginDraw are reset here

Parameters

CHuiGc & aGc
const MHuiBrushGuide & aGuide

ExpandVisualRect(TRect &)

IMPORT_C void ExpandVisualRect ( TRect & aRect ) const [virtual]

Expands the dirty region of a visual. Called when a visual's dirty region is being determined. The brush is allowed to expand the rectangle to cover any additional drawing the brush is doing. This is not called when the brush is clipped to the visual rectangle, because in that case no drawing can occur outside the visual's area.

Parameters

TRect & aRect Rectangle to expand. Visual's dirty region.

Layer()

IMPORT_C THuiBrushLayer Layer ( ) const

SessionId()

IMPORT_C TInt SessionId ( ) const

Gets the session id for object.

SetChanged()

IMPORT_C void SetChanged ( )

Mark the brush as changed or unchanged.

SetClipToVisual(TBool)

IMPORT_C void SetClipToVisual ( TBool aClipToVisual )

Defines whether the brush can draw outside brush guide (i.e. visual's) rect

Parameters

TBool aClipToVisual

SetLayer(THuiBrushLayer)

IMPORT_C void SetLayer ( THuiBrushLayer aLayer )

Defines the layer where brush is drawn (on top of / below visual) THuiBrushLayer

Parameters

THuiBrushLayer aLayer

SetSessionId(TInt)

IMPORT_C void SetSessionId ( TInt aSessionId )

Sets the session id for object.

Parameters

TInt aSessionId

Type()

IMPORT_C TType Type ( ) const

Gets the object type.

Type2()

TInt Type2 ( ) const [inline, virtual]

Member Enumerations Documentation

Enum TType2

Enumerators

ENotKnown
EImageBrush
ECmdBufferBrush

Member Data Documentation

TBool iChanged

TBool iChanged [private]

ETrue if the brush needs to be redrawn.

TBool iClipToVisual

TBool iClipToVisual [private]

Clip brush to the visual.

TBool iEnabled

TBool iEnabled [private]

ETrue if the brush will be drawn.

CHuiVisual * iGuideVisual

CHuiVisual * iGuideVisual [private]

THuiBrushLayer iLayer

THuiBrushLayer iLayer [private]

Layer determines drawing order.

THuiTimedValue iOpacity

THuiTimedValue iOpacity

Opacity of the shadow.

TInt iSessionId

TInt iSessionId [private]

Session id