Symbian Developer Library

SYMBIAN OS V6.1 EDITION FOR C++

[Index] [Glossary] [Previous] [Next]



Location: e32std.h
Link against: euser.lib

Class TSize

TSize

Support

Supported from 5.0

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.

Defined in TSize:
AsPoint(), SetSize(), TSize(), iHeight, iWidth, operator!=(), operator+(), operator+=(), operator-(), operator-=(), operator==()


Construction and destruction


TSize()

TSize();

Description

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


TSize()

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]


Assignment


SetSize()

void SetSize(TInt aWidth,TInt aHeight);

Description

Sets the width and height.

Parameters

TInt aWidth

The width value.

TInt aHeight

The height value.

[Top]


Overloaded operators


operator-=()

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-=()

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:

Parameters

const TPoint& aPoint

The point to be subtracted.

Return value

TSize&

A reference to this size object.


operator+=()

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+=()

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:

Parameters

const TPoint& aPoint

The point to be added.

Return value

TSize&

A reference to this size object.


operator==()

TInt operator==(const TSize& aSize) const;

Description

Compares two 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

TInt

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


operator!=()

TInt 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

TInt

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


operator-()

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-()

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:

Parameters

const TPoint& aPoint

The point to be subtracted.

Return value

TSize

The result of the operation.


operator+()

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+()

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:

Parameters

const TPoint& aPoint

The point to be added to this TSize.

Return value

TSize

The result of the operation.


operator-()

TSize operator-() const;

Description

Unary minus operator.

The operator returns the negation of this TSize.

Return value

TSize

The result of the operation.

[Top]


Conversion to a point


AsPoint()

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]


Public data members


iHeight

TInt iHeight

Description

The width of this TSize object.


iWidth

TInt iWidth

Description

The height of this TSize object.