lib
KoUnit Class Reference
#include <KoUnit.h>
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 59 of file 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 | |
static double | toPoint (double ptValue) |
static double | toMM (double ptValue) |
static double | toCM (double ptValue) |
static double | toDM (double ptValue) |
static double | toInch (double ptValue) |
static double | toPI (double ptValue) |
static double | toDD (double ptValue) |
static double | toCC (double ptValue) |
static double | toUserValue (double ptValue, Unit unit) |
static double | ptToUnit (const double ptValue, const Unit unit) |
static QString | toUserStringValue (double ptValue, Unit unit) |
static double | fromUserValue (double value, Unit unit) |
static double | fromUserValue (const QString &value, Unit unit, bool *ok=0) |
static Unit | unit (const QString &_unitName, bool *ok=0) |
static QString | unitName (Unit _unit) |
static QString | unitDescription (Unit _unit) |
static QStringList | listOfUnitName () |
static double | parseValue (QString value, double defaultVal=0.0) |
static void | saveOasis (KoXmlWriter *settingsWriter, Unit _unit) |
Member Enumeration Documentation
|
Length units supported by KOffice.
|
Member Function Documentation
|
This method is the one to use to read a value from a dialog.
Definition at line 143 of file KoUnit.cpp. |
|
This method is the one to use to read a value from a dialog.
Definition at line 120 of file KoUnit.cpp. |
|
parse common KOffice and OO values, like "10cm", "5mm" to pt
Definition at line 148 of file KoUnit.cpp. |
|
Convert the value
Definition at line 91 of file KoUnit.cpp. |
|
Save a unit in OASIS format.
Definition at line 212 of file KoUnit.cpp. |
|
Prepare ptValue to be displayed in cicero.
|
|
Prepare ptValue to be displayed in cm.
|
|
Prepare ptValue to be displayed in didot.
|
|
Prepare ptValue to be displayed in dm.
|
|
Prepare ptValue to be displayed in inch.
|
|
Prepare ptValue to be displayed in mm.
|
|
Prepare ptValue to be displayed in pica.
|
|
Prepare ptValue to be displayed in pt.
|
|
This method is the one to use to display a value in a dialog.
Definition at line 115 of file KoUnit.cpp. |
|
This method is the one to use to display a value in a dialog.
Definition at line 68 of file KoUnit.cpp. |
|
Convert a unit name into a Unit enum.
Definition at line 182 of file KoUnit.cpp. |
|
Get the full (translated) description of a unit.
Definition at line 43 of file KoUnit.cpp. |
|
Get the name of a unit.
Definition at line 200 of file KoUnit.cpp. |
The documentation for this class was generated from the following files: