KoUnit Class Reference
KOffice stores everything in pt (using "double") internally. More...
#include <koUnit.h>
Public Types | |
enum | Unit { U_MM = 0, U_PT = 1, U_INCH = 2, U_CM = 3, U_DM = 4, U_PI = 5, U_DD = 6, U_CC = 7, U_LASTUNIT = U_CC } |
Static Public Member Functions | |
double | toPoint (double ptValue) |
double | toMM (double ptValue) |
double | toCM (double ptValue) |
double | toDM (double ptValue) |
double | toInch (double ptValue) |
double | toPI (double ptValue) |
double | toDD (double ptValue) |
double | toCC (double ptValue) |
double | ptToUnit (double ptValue, Unit unit) |
QString | userValue (double ptValue, Unit unit) |
double | ptFromUnit (double value, Unit unit) |
double | fromUserValue (const QString &value, Unit unit) |
Unit | unit (const QString &_unitName) |
QString | unitName (Unit _unit) |
QString | unitDescription (Unit _unit) |
QStringList | listOfUnitName () |
double | parseValue (QString value, double defaultVal=0.0) |
Detailed Description
KOffice stores everything in pt (using "double") internally.When displaying a value to the user, the value is converted to the user's unit of choice, and rounded to a reasonable precision to avoid 0.999999
Definition at line 53 of file koUnit.h.
Member Function Documentation
|
Prepare ptValue to be displayed in pt.
Definition at line 70 of file koUnit.h. References toPoint(). Referenced by ptToUnit(), and toPoint(). |
|
Prepare ptValue to be displayed in mm.
Definition at line 76 of file koUnit.h. References toMM(). Referenced by ptToUnit(), and toMM(). |
|
Prepare ptValue to be displayed in cm.
Definition at line 82 of file koUnit.h. References toCM(). Referenced by ptToUnit(), and toCM(). |
|
Prepare ptValue to be displayed in dm.
Definition at line 87 of file koUnit.h. References toDM(). Referenced by ptToUnit(), and toDM(). |
|
Prepare ptValue to be displayed in inch.
Definition at line 92 of file koUnit.h. References toInch(). Referenced by ptToUnit(), and toInch(). |
|
Prepare ptValue to be displayed in pica.
Definition at line 98 of file koUnit.h. References toPI(). Referenced by ptToUnit(), and toPI(). |
|
Prepare ptValue to be displayed in didot.
Definition at line 104 of file koUnit.h. References toDD(). Referenced by ptToUnit(), and toDD(). |
|
Prepare ptValue to be displayed in cicero.
Definition at line 110 of file koUnit.h. References toCC(). Referenced by ptToUnit(), and toCC(). |
|
This method is the one to use to display a value in a dialog.
Definition at line 63 of file koUnit.cc. References ptToUnit(), toCC(), toCM(), toDD(), toDM(), toInch(), toMM(), toPI(), and toPoint(). Referenced by ptToUnit(), and userValue(). |
|
This method is the one to use to display a value in a dialog.
Definition at line 86 of file koUnit.cc. References ptToUnit(), and userValue(). Referenced by userValue(). |
|
This method is the one to use to read a value from a dialog.
Definition at line 91 of file koUnit.cc. References ptFromUnit(). Referenced by fromUserValue(), parseValue(), and ptFromUnit(). |
|
This method is the one to use to read a value from a dialog.
Definition at line 114 of file koUnit.cc. References fromUserValue(), and ptFromUnit(). Referenced by fromUserValue(). |
|
Convert a unit name into a Unit enum.
Definition at line 132 of file koUnit.h. References unit(). Referenced by parseValue(), and unit(). |
|
Get the name of a unit.
Definition at line 144 of file koUnit.h. References unitName(). Referenced by unitName(). |
|
Get the full (translated) description of a unit.
Definition at line 38 of file koUnit.cc. References unitDescription(). Referenced by unitDescription(). |
|
parse common koffice and OO values, like "10cm", "5mm" to pt
Definition at line 120 of file koUnit.cc. References parseValue(), ptFromUnit(), and unit(). Referenced by parseValue(). |
The documentation for this class was generated from the following files: