rwlogo
Rogue Wave Views 5.5.1

Rogue Wave Views
Foundation Package API Reference Guide

Product Documentation:

Rogue Wave Views
Documentation Home

IlvPrintUnit Class Reference

Base class for the measurement system classes. More...

#include <ilviews/printing/units.h>

Inheritance diagram for IlvPrintUnit:
IlvPrintCMUnit IlvPrintInchUnit IlvPrintPicaUnit IlvPrintPointUnit

List of all members.

Public Member Functions

 IlvPrintUnit (double units)
 Conversion constructor from a double.
 IlvPrintUnit ()
 Default constructor.
virtual ~IlvPrintUnit ()
 Destructor.
virtual double getPoints () const =0
 Returns the value expressed in points.
virtual IlString getUnitName () const =0
 Returns a string that is the name of the unit.
double getUnits () const
 Returns the value expressed in units.
IlBoolean operator!= (IlvPrintUnit const &other) const
 InEquality test.
IlvPrintUnitoperator*= (double units)
 Multiplies the current object by the value expressed in units given as parameter.
IlvPrintUnitoperator+= (double units)
 Adds to the current object the value expressed in units given as parameter.
IlvPrintUnitoperator+= (IlvPrintUnit const &other)
 Adds to the current object the value of the object given as parameter.
IlvPrintUnitoperator-= (double units)
 Subtracts from the current object the value expressed in units given as parameter.
IlvPrintUnitoperator-= (IlvPrintUnit const &other)
 Subtracts from the current object the value of the object given as parameter.
IlvPrintUnitoperator/= (double units)
 Divides the current object by the value expressed in units given as parameter.
IlvPrintUnitoperator= (double units)
 Assignment operator.
IlvPrintUnitoperator= (IlvPrintUnit const &other)
 Assignment operator.
IlBoolean operator== (IlvPrintUnit const &other) const
 Equality test.
virtual void setPoints (double points)=0
 Sets the value expressed in points.
void setUnits (double units)
 Sets the value expressed in units.
IlString toString () const
 Returns a string representation of the value expressed in units.

Protected Member Functions

virtual IlString getUnitNamePlural () const =0
 Returns a string that is the plural name of the unit.

Detailed Description

Base class for the measurement system classes.

Library: ilvprint

This class is intended to be derived by implementing the member functions getPoints() and setPoints(). It stores the value expressed in the current units of the class.


Constructor & Destructor Documentation

virtual IlvPrintUnit::~IlvPrintUnit (  )  [virtual]

Destructor.

The destructor actually does nothing, but it is declared as virtual so that inherited classes may override it.

IlvPrintUnit::IlvPrintUnit (  ) 

Default constructor.

It initializes the object in a coherent state.

IlvPrintUnit::IlvPrintUnit ( double  units  ) 

Conversion constructor from a double.

This constructor creates an IlvPrint from a double.

Parameters:
units A double, the number of units of the IlvPrintUnit.

Member Function Documentation

virtual double IlvPrintUnit::getPoints (  )  const [pure virtual]

Returns the value expressed in points.

This function is a pure virtual one and must be overridden by the inherited classes.

Its purpose is to translate the value returned by getUnits into a value expressed in points.

Returns:
A double, the value expressed in points.

Implemented in IlvPrintCMUnit, IlvPrintInchUnit, IlvPrintPicaUnit, and IlvPrintPointUnit.

virtual IlString IlvPrintUnit::getUnitName (  )  const [pure virtual]

Returns a string that is the name of the unit.

This function is a pure virtual one and must be overridden by the inherited classes.

Returns:
An IlString, the unit name.

Implemented in IlvPrintCMUnit, IlvPrintInchUnit, IlvPrintPicaUnit, and IlvPrintPointUnit.

virtual IlString IlvPrintUnit::getUnitNamePlural (  )  const [protected, pure virtual]

Returns a string that is the plural name of the unit.

Returns:
An IlString, the plural name unit.

Implemented in IlvPrintCMUnit, IlvPrintInchUnit, IlvPrintPicaUnit, and IlvPrintPointUnit.

double IlvPrintUnit::getUnits (  )  const

Returns the value expressed in units.

This functions gets the value expressed in units and stores it in the object.

Returns:
A double, the value expressed in units.
IlBoolean IlvPrintUnit::operator!= ( IlvPrintUnit const &  other  )  const

InEquality test.

Tests whether both objects have different values. The comparison is done on the values expressed in points.

Parameters:
other The other object to be compared with the current one.
Returns:
An IlBoolean, IlFalse when both objects are equal, IlTrue otherwise.
IlvPrintUnit & IlvPrintUnit::operator*= ( double  units  ) 

Multiplies the current object by the value expressed in units given as parameter.

The calculation is done in points.

Parameters:
units A double, the value to be multiplied by.
Returns:
A reference to this object.
IlvPrintUnit & IlvPrintUnit::operator+= ( double  units  ) 

Adds to the current object the value expressed in units given as parameter.

The calculation is done in points.

Parameters:
units A double, the value expressed in units.
Returns:
A reference to this object.
IlvPrintUnit & IlvPrintUnit::operator+= ( IlvPrintUnit const &  other  ) 

Adds to the current object the value of the object given as parameter.

The calculation is done in points.

Parameters:
other A const reference to an object.
Returns:
A reference to this object.
IlvPrintUnit & IlvPrintUnit::operator-= ( double  units  ) 

Subtracts from the current object the value expressed in units given as parameter.

The calculation is done in points.

Parameters:
units A double, the value expressed in units.
Returns:
A reference to this object.
IlvPrintUnit & IlvPrintUnit::operator-= ( IlvPrintUnit const &  other  ) 

Subtracts from the current object the value of the object given as parameter.

The calculation is done in points.

Parameters:
other A const reference to an object.
Returns:
A reference to this object.
IlvPrintUnit & IlvPrintUnit::operator/= ( double  units  ) 

Divides the current object by the value expressed in units given as parameter.

The calculation is done in points.

Parameters:
units A double, the value to be divided by.
Returns:
A reference to this object.
IlvPrintUnit & IlvPrintUnit::operator= ( double  units  ) 

Assignment operator.

This operator assigns to the current object the value given as parameter and expressed in units.

Parameters:
units A double, the value expressed in units.
Returns:
A reference to this object.
IlvPrintUnit & IlvPrintUnit::operator= ( IlvPrintUnit const &  other  ) 

Assignment operator.

This operator assigns to the current object the value stored in the object given as parameter.

Parameters:
other A const reference to an object.
Returns:
A reference to this object.
IlBoolean IlvPrintUnit::operator== ( IlvPrintUnit const &  other  )  const

Equality test.

Tests whether both objects have the same value. The comparison is done on the values expressed in points.

Parameters:
other The other object to be compared with the current one.
Returns:
An IlBoolean, IlTrue when both objects are equal, IlFalse otherwise.
virtual void IlvPrintUnit::setPoints ( double  points  )  [pure virtual]

Sets the value expressed in points.

This function is a pure virtual one and must be overridden by the inherited classes.

Its purpose is to translate the value given as parameter into units and then stores it (through setUnits).

Parameters:
points A double, the value expressed in points.

Implemented in IlvPrintCMUnit, IlvPrintInchUnit, IlvPrintPicaUnit, and IlvPrintPointUnit.

void IlvPrintUnit::setUnits ( double  units  ) 

Sets the value expressed in units.

This function stores the value expressed in units.

Parameters:
units A double, the value expressed in units.
IlString IlvPrintUnit::toString (  )  const

Returns a string representation of the value expressed in units.

This function actually calls getUnits() and getUnitName().

Returns:
An IlString, the value expressed in units.

© Copyright 2012, Rogue Wave Software, Inc. All Rights Reserved.
Rogue Wave is a registered trademark of Rogue Wave Software, Inc. in the United States and other countries. All other trademarks are the property of their respective owners.