TSize Class Reference

class TSize

Stores a two-dimensional size as a width and a height value.

Its data members are public and can be manipulated directly, or by means of the functions provided.

Public Member Functions
TSize(TUninitialized)
TSize()
TSize(TInt, TInt)
IMPORT_C TPointAsPoint()
IMPORT_C voidSetSize(TInt, TInt)
IMPORT_C TBooloperator!=(const TSize &)
IMPORT_C TSizeoperator+(const TSize &)
IMPORT_C TSizeoperator+(const TPoint &)
IMPORT_C TSize &operator+=(const TSize &)
IMPORT_C TSize &operator+=(const TPoint &)
IMPORT_C TSizeoperator-(const TSize &)
IMPORT_C TSizeoperator-(const TPoint &)
IMPORT_C TSizeoperator-()
IMPORT_C TSize &operator-=(const TSize &)
IMPORT_C TSize &operator-=(const TPoint &)
IMPORT_C TBooloperator==(const TSize &)
Public Member Enumerations
enumTUninitialized { EUninitialized }
Public Attributes
TInt iHeight
TInt iWidth

Constructor & Destructor Documentation

TSize(TUninitialized)

TSize(TUninitialized)[inline]

Constructs the size object with its iWidth and iHeight members set to zero.

Parameters

TUninitialized

TSize()

TSize()[inline]

Constructs the size object with its iWidth and iHeight members set to zero.

TSize(TInt, TInt)

TSize(TIntaWidth,
TIntaHeight
)[inline]

Constructs the size object with the specified width and height values.

Parameters

TInt aWidthThe width value.
TInt aHeightThe height value .

Member Functions Documentation

AsPoint()

IMPORT_C TPointAsPoint()const

Gets a TPoint object whose co-ordinates are the width and height of this TSize.

SetSize(TInt, TInt)

IMPORT_C voidSetSize(TIntaWidth,
TIntaHeight
)

Sets the width and height.

Parameters

TInt aWidthThe width value.
TInt aHeightThe height value.

operator!=(const TSize &)

IMPORT_C TBooloperator!=(const TSize &aSize)const

Compares two TSize for inequality.

For two TSize to be unequal, either their width or height values must be different.

Parameters

const TSize & aSizeThe TSize to be compared with this TSize.

operator+(const TSize &)

IMPORT_C TSizeoperator+(const TSize &aSize)const

TSize addition operator.

This operator adds the specified TSize to this TSize, and returns the resulting value.

Parameters

const TSize & aSizeThe TSize to be added to this Tsize.

operator+(const TPoint &)

IMPORT_C TSizeoperator+(const TPoint &aPoint)const

TPoint addition operator.

This operator adds the specified point to this TSize, and returns the resulting value.

The operation proceeds by:

1. adding the x co-ordinate value to the width

2. adding the y co-ordinate value to the height

Parameters

const TPoint & aPointThe point to be added to this TSize.

operator+=(const TSize &)

IMPORT_C TSize &operator+=(const TSize &aSize)

TSize addition assignment operator.

The operator adds the specified TSize to this TSize, and assigns the result back to this TSize.

Parameters

const TSize & aSizeThe TSize to be added.

operator+=(const TPoint &)

IMPORT_C TSize &operator+=(const TPoint &aPoint)

TPoint addition assignment operator.

The operator adds the specified point to this TSize, and assigns the result back to this TSize.

The operation proceeds by:

1. adding the point's x co-ordinate value to the width

2. adding the point's y co-ordinate value to the height.

Parameters

const TPoint & aPointThe point to be added.

operator-(const TSize &)

IMPORT_C TSizeoperator-(const TSize &aSize)const

TSize subtraction operator.

This operator subtracts the specified TSize from this TSize, and returns the resulting value.

Parameters

const TSize & aSizeThe TSize to be subtracted from this Tsize.

operator-(const TPoint &)

IMPORT_C TSizeoperator-(const TPoint &aPoint)const

TPoint subtraction operator.

This operator subtracts the specified point from this TSize, and returns the resulting value.

The operation proceeds by:

1. subtracting the x co-ordinate value from the width

2. subtracting the y co-ordinate value from the height

Parameters

const TPoint & aPointThe point to be subtracted.

operator-()

IMPORT_C TSizeoperator-()const

Unary minus operator.

The operator returns the negation of this TSize.

operator-=(const TSize &)

IMPORT_C TSize &operator-=(const TSize &aSize)

TSize subtraction assignment operator.

The operator subtracts the specified TSize from this TSize, and assigns the result back to this TSize.

Parameters

const TSize & aSizeThe TSize to be subtracted.

operator-=(const TPoint &)

IMPORT_C TSize &operator-=(const TPoint &aPoint)

TPoint subtraction assignment operator.

The operator subtracts the specified point from this TSize, and assigns the result back to this TSize.

The operation proceeds by:

1. subtracting the point's x co-ordinate value from the width

2. subtracting the point's y co-ordinate value from the height.

Parameters

const TPoint & aPointThe point to be subtracted.

operator==(const TSize &)

IMPORT_C TBooloperator==(const TSize &aSize)const

Compares this TSize with the specified TSize for equality.

For two TSizes to be equal, both their width and height values must be equal.

Parameters

const TSize & aSizeThe TSize to be compared with this TSize.

Member Enumerations Documentation

Enum TUninitialized

Enumerators

EUninitialized

Member Data Documentation

TInt iHeight

TInt iHeight

The height of this TSize object.

TInt iWidth

TInt iWidth

The width of this TSize object.