Symbian
Symbian Developer Library

SYMBIAN OS V9.4

Feedback

[Index] [Previous] [Next]

#include <GULALIGN.H>
Link against: egul.lib

Class TGulAlignment

class TGulAlignment;

Description

Provides a convenient way to describe horizontal and vertical layouts of rectangular objects and to enquire how they occupy an area given their alignment.

Members

Defined in TGulAlignment:


Construction and destruction


TGulAlignment()

inline TGulAlignment();

Description

Default constructor.


TGulAlignment(TGulAlignmentValue)

inline TGulAlignment(TGulAlignmentValue aValue);

Description

Constructor initialising the object with an alignment value.

Parameters

TGulAlignmentValue aValue

The alignment value.


TGulAlignment(CGraphicsContext::TTextAlign,TGulVAlignment)

inline TGulAlignment(CGraphicsContext::TTextAlign aHAlign, TGulVAlignment aVAlign=EVTop);

Description

Constructor initialising the object with an alignment value.

Parameters

CGraphicsContext::TTextAlign aHAlign

The horizontal alignment value.

TGulVAlignment aVAlign

The vertical alignment value.

[Top]


Member functions


operator TGulAlignmentValue()const

IMPORT_C operator TGulAlignmentValue() const;

Description

Gets the (absolute) alignment value as TGulAlignmentValue .

Note that this has the absolute horizontal alignment. I.e. left and right horizontal alignment will not be swapped depending on language directionality.

Return value


VAlignment()const

inline TGulVAlignment VAlignment() const;

Description

Gets the vertical alignment.

Return value

TGulVAlignment

Vertical alignment.


HAlignment()const

inline TGulHAlignment HAlignment() const;

Description

Gets the absolute horizontal alignment.

Note that this is the alignment in absolute terms. I.e. left and right alignment will not be swapped depending on language directionality.

Return value

TGulHAlignment

Horizontal alignment.


HAlignment(TBidiText::TDirectionality)const

IMPORT_C TGulHAlignment HAlignment(TBidiText::TDirectionality aLanguageDirectionality) const;

Description

Return the horizontal alignment, relative to the language directionality specified. Calling this method will return a horizontal alignment where left and right has been swapped for any language with RightToLeft directionality, UNLESS the alignment has been set as being absolute, by calling SetAbsoluteHAlignment() .

Parameters

TBidiText::TDirectionality aLanguageDirectionality

The language directionality to consider when swapping left and right.

Return value

TGulHAlignment

The horizontal alignment, taking language directionality into account.


HasAbsoluteHAlignment()const

IMPORT_C TBool HasAbsoluteHAlignment() const;

Description

Return whether horizontal alignment will be treated as an absolute value, or relative the specified language directionality. In the latter case, left and right will be swapped (by TGulAlignment methods for which a TBidiText::TDirectionality is provided) for languages with RightToLeft directionality.

Return value

TBool


SetAbsoluteHAlignment(TBool)

IMPORT_C void SetAbsoluteHAlignment(TBool aAbsoluteHAlignment);

Description

Set the current horizontal alignment to be used as an absolute value. If set to true, this means that the alignment will NOT be swapped depending on language directionality when calling e.g. HAlignment(TBidiText::TDirectionality) .

Note that the default is false (i.e. relative alignment), and calling any of the setters on the TGulAlignment object will reset it to relative alignment (i.e. always call this method after the horizontal alignment has been set).

Also note that support for absolute horizontal alignment was added to TGulAlignment late in Symbian OS release 9.1. Hence if this method is called on an object that is passed to a client compiled against an earlier release (or if the client does not yet support absolute alignment) then the resulting alignment may be incorrect.

Parameters

TBool aAbsoluteHAlignment


TextAlign()const

inline CGraphicsContext::TTextAlign TextAlign() const;

Description

Gets the absolute horizontal text alignment.

Note that this is the alignment in absolute terms. I.e. left and right alignment will not be swapped depending on language directionality.

Return value

CGraphicsContext::TTextAlign

The horizontal text alignment.


TextAlign(TBidiText::TDirectionality)const

IMPORT_C CGraphicsContext::TTextAlign TextAlign(TBidiText::TDirectionality aLanguageDirectionality) const;

Description

Return the horizontal alignment, relative to the language directionality specified. Calling this method will return a horizontal alignment where left and right has been swapped for any language with RightToLeft directionality, UNLESS the alignment has been set as being absolute, by calling SetAbsoluteHAlignment() .

Parameters

TBidiText::TDirectionality aLanguageDirectionality

The language directionality to consider when swapping left and right.

Return value

CGraphicsContext::TTextAlign

The horizontal alignment, taking language directionlity into account.


ParaAlign()const

IMPORT_C CParaFormat::TAlignment ParaAlign() const;

Description

Return the horizontal alignment as a CParaFormat::TAlignment object. Note that the CParaFormat::TAlignment class supports the concept of horizontal absolute alignment, so left and right alignment will not be swapped.

Return value

CParaFormat::TAlignment

The horizontal alignment, including whether it's absolute or not.


SetVAlignment(TGulVAlignment)

IMPORT_C void SetVAlignment(TGulVAlignment aVAlign);

Description

Sets the vertical alignment.

Parameters

TGulVAlignment aVAlign

The vertical alignment.


SetHAlignment(TGulHAlignment)

IMPORT_C void SetHAlignment(TGulHAlignment aHAlign);

Description

Sets the horizontal alignment. Alignment will be reset to relative. I.e. when calling HAlignment() with a TBidiText::ERightToLeft argument, left and right will be swapped. Calling HAlignment() without argument will always return the alignment in absolute terms.

Parameters

TGulHAlignment aHAlign

The horizontal alignment.


SetHAlignment(CGraphicsContext::TTextAlign)

IMPORT_C void SetHAlignment(CGraphicsContext::TTextAlign aHAlign);

Description

Sets the horizontal alignment. Alignment will be reset to relative. I.e. when calling HAlignment() with a TBidiText::ERightToLeft argument, left and right will be swapped. Calling HAlignment() without argument will always return the alignment in absolute terms.

Parameters

CGraphicsContext::TTextAlign aHAlign

The horizontal alignment.


SetHAlignment(CParaFormat::TAlignment)

IMPORT_C void SetHAlignment(CParaFormat::TAlignment aHAlign);

Description

Sets the horizontal alignment. Alignment will be set to absolute for EAbsoluteLeftAlign and EAbsoluteRightAlign , otherwise relative the language directionality (if specified).

Parameters

CParaFormat::TAlignment aHAlign

The horizontal alignment.


InnerTopLeft(const TRect &,const TSize &)const

IMPORT_C TPoint InnerTopLeft(const TRect &aOuter, const TSize &aInnerSize) const;

Description

Gets the co-ordinates of the top left corner of an object of size aInnerSize , which is placed in the area of the rectangle aOuter according to the current alignment.

Note that horizontal alignment is always treated as being in absolute terms.

Parameters

const TRect &aOuter

The outer rectangle.

const TSize &aInnerSize

The size of the inner rectangle.

Return value

TPoint

The inner top left point.


InnerTopLeft(const TRect &,const TSize &,TBidiText::TDirectionality)const

IMPORT_C TPoint InnerTopLeft(const TRect &aOuter, const TSize &aInnerSize, TBidiText::TDirectionality aLanguageDirectionality) const;

Description

Gets the co-ordinates of the top left corner of an object of size aInnerSize , which is placed in the area of the rectangle aOuter according to the current alignment.

Note that if RightToLeft language directionality is specified, left and right horizontal alignment for the inner object will be swapped.

Parameters

const TRect &aOuter

The outer rectangle.

const TSize &aInnerSize

The size of the inner rectangle.

TBidiText::TDirectionality aLanguageDirectionality

The language directionality to consider when swapping left and right.

Return value

TPoint

The inner top left point.


InnerRect(const TRect &,const TSize &)const

IMPORT_C TRect InnerRect(const TRect &aOuter, const TSize &aInnerSize) const;

Description

Gets the rectangle occupied by an object of size aInnerSize , which is placed in the area of the rectangle aOuter according to the current alignment.

Note that horizontal alignment is always treated as being in absolute terms.

Parameters

const TRect &aOuter

The outer rectangle.

const TSize &aInnerSize

The size of the inner rectangle.

Return value

TRect

The rectangle.


InnerRect(const TRect &,const TSize &,TBidiText::TDirectionality)const

IMPORT_C TRect InnerRect(const TRect &aOuter, const TSize &aInnerSize, TBidiText::TDirectionality aLanguageDirectionality) const;

Description

Gets the rectangle occupied by an object of size aInnerSize , which is placed in the area of the rectangle aOuter according to the current alignment.

Note that if RightToLeft language directionality is specified, left and right horizontal alignment for the inner object will be swapped.

Parameters

const TRect &aOuter

The outer rectangle.

const TSize &aInnerSize

The size of the inner rectangle.

TBidiText::TDirectionality aLanguageDirectionality

The language directionality to consider when swapping left and right.

Return value

TRect

The rectangle.