TSize Class Reference

#include <e32cmn.h>

class TSize
Public Attributes
TInt iHeight
TInt iWidth
Public Member Enumerations
enumTUninitialized { EUninitialized }
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 &)

Detailed Description

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.

Member Attribute Documentation

iHeight

TInt iHeight

The height of this TSize object.

iWidth

TInt iWidth

The width of this TSize object.

Member Enumeration Documentation

Enum TUninitialized

EnumeratorValueDescription
EUninitialized

Constructor & Destructor Documentation

TSize ( TUninitialized )

TSize(TUninitialized)[inline]

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

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
aWidthThe width value.
aHeightThe height value .

Member Function Documentation

AsPoint ( )

IMPORT_C TPointAsPoint()const

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

Return Value
The co-ordinates of this TSize converted to a point.

SetSize ( TInt, TInt )

IMPORT_C voidSetSize(TIntaWidth,
TIntaHeight
)

Sets the width and height.

Parameters
aWidthThe width value.
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
aSizeThe TSize to be compared with this TSize.
Return Value
True, if the two TSize are unequal; false, otherwise.

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
aSizeThe TSize to be added to this Tsize.
Return Value
The result of the operation.

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
aPointThe point to be added to this TSize.
Return Value
The result of the operation.

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
aSizeThe TSize to be added.
Return Value
A reference to this size object.

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
aPointThe point to be added.
Return Value
A reference to this size object.

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
aSizeThe TSize to be subtracted from this Tsize.
Return Value
The result of the operation.

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
aPointThe point to be subtracted.
Return Value
The result of the operation.

operator- ( )

IMPORT_C TSizeoperator-()const

Unary minus operator.

The operator returns the negation of this TSize.

Return Value
The result of the operation.

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
aSizeThe TSize to be subtracted.
Return Value
A reference to this TSize object.

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
aPointThe point to be subtracted.
Return Value
A reference to this size object.

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
aSizeThe TSize to be compared with this TSize.
Return Value
True, if the two TSize are equal; false, otherwise.