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. Referenced by ptToUnit(). |
|
Prepare ptValue to be displayed in mm.
Definition at line 76 of file koUnit.h. Referenced by ptToUnit(). |
|
Prepare ptValue to be displayed in cm.
Definition at line 82 of file koUnit.h. Referenced by ptToUnit(). |
|
Prepare ptValue to be displayed in dm.
Definition at line 87 of file koUnit.h. Referenced by ptToUnit(). |
|
Prepare ptValue to be displayed in inch.
Definition at line 92 of file koUnit.h. Referenced by ptToUnit(). |
|
Prepare ptValue to be displayed in pica.
Definition at line 98 of file koUnit.h. Referenced by ptToUnit(). |
|
Prepare ptValue to be displayed in didot.
Definition at line 104 of file koUnit.h. Referenced by ptToUnit(). |
|
Prepare ptValue to be displayed in cicero.
Definition at line 110 of file koUnit.h. Referenced by ptToUnit(). |
|
This method is the one to use to display a value in a dialog.
Definition at line 63 of file koUnit.cc. References toCC(), toCM(), toDD(), toDM(), toInch(), toMM(), toPI(), and toPoint(). Referenced by 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(). |
|
This method is the one to use to read a value from a dialog.
Definition at line 91 of file koUnit.cc. Referenced by fromUserValue(), and parseValue(). |
|
This method is the one to use to read a value from a dialog.
Definition at line 114 of file koUnit.cc. References ptFromUnit(). |
|
Convert a unit name into a Unit enum.
Definition at line 132 of file koUnit.h. Referenced by parseValue(). |
|
Get the name of a unit.
|
|
Get the full (translated) description of a unit.
|
|
parse common koffice and OO values, like "10cm", "5mm" to pt
Definition at line 120 of file koUnit.cc. References ptFromUnit(), and unit(). Referenced by KoTextFormat::parseShadowFromCss(). |
The documentation for this class was generated from the following files: