Symbian
Symbian Developer Library

SYMBIAN OS V9.4

Feedback

[Index] [Previous] [Next]

#include <e32cmn.h>
Link against: euser.lib

Class TSize

class TSize;

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.

Members

Defined in TSize:


Construction and destruction


TSize(TUninitialized)

inline TSize(TUninitialized);

Description

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

Parameters

TSize::TUninitialized


TSize()

inline TSize();

Description

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


TSize(TInt,TInt)

inline TSize(TInt aWidth, TInt aHeight);

Description

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

Parameters

TInt aWidth

The width value.

TInt aHeight

The height value .

[Top]


Member functions


operator==(const TSize &)const

IMPORT_C TBool operator==(const TSize &aSize) const;

Description

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 &aSize

The TSize to be compared with this TSize.

Return value

TBool

True, if the two TSize are equal; false, otherwise.


operator!=(const TSize &)const

IMPORT_C TBool operator!=(const TSize &aSize) const;

Description

Compares two TSize for inequality.

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

Parameters

const TSize &aSize

The TSize to be compared with this TSize.

Return value

TBool

True, if the two TSize are unequal; false, otherwise.


operator-=(const TSize &)

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

Description

TSize subtraction assignment operator.

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

Parameters

const TSize &aSize

The TSize to be subtracted.

Return value

TSize &

A reference to this TSize object.


operator-=(const TPoint &)

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

Description

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 &aPoint

The point to be subtracted.

Return value

TSize &

A reference to this size object.


operator+=(const TSize &)

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

Description

TSize addition assignment operator.

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

Parameters

const TSize &aSize

The TSize to be added.

Return value

TSize &

A reference to this size object.


operator+=(const TPoint &)

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

Description

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 &aPoint

The point to be added.

Return value

TSize &

A reference to this size object.


operator-(const TSize &)const

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

Description

TSize subtraction operator.

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

Parameters

const TSize &aSize

The TSize to be subtracted from this Tsize.

Return value

TSize

The result of the operation.


operator-(const TPoint &)const

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

Description

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 &aPoint

The point to be subtracted.

Return value

TSize

The result of the operation.


operator+(const TSize &)const

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

Description

TSize addition operator.

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

Parameters

const TSize &aSize

The TSize to be added to this Tsize.

Return value

TSize

The result of the operation.


operator+(const TPoint &)const

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

Description

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 &aPoint

The point to be added to this TSize.

Return value

TSize

The result of the operation.


operator-()const

IMPORT_C TSize operator-() const;

Description

Unary minus operator.

The operator returns the negation of this TSize.

Return value

TSize

The result of the operation.


SetSize(TInt,TInt)

IMPORT_C void SetSize(TInt aWidth, TInt aHeight);

Description

Sets the width and height.

Parameters

TInt aWidth

The width value.

TInt aHeight

The height value.


AsPoint()const

IMPORT_C TPoint AsPoint() const;

Description

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

Return value

TPoint

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

[Top]


Member enumerations


Enum TUninitialized

TUninitialized

Description

EUninitialized

[Top]


Member data


iWidth

TInt iWidth;

Description

The width of this TSize object.


iHeight

TInt iHeight;

Description

The height of this TSize object.