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 | |
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) |
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.
Member Function Documentation
|
Prepare ptValue to be displayed in pt.
Definition at line 76 of file koUnit.h. Referenced by KoLineWidthAction::setCurrentWidth(), and toUserValue(). |
|
Prepare ptValue to be displayed in mm.
Definition at line 82 of file koUnit.h. Referenced by toUserValue(). |
|
Prepare ptValue to be displayed in cm.
Definition at line 88 of file koUnit.h. Referenced by toUserValue(). |
|
Prepare ptValue to be displayed in dm.
Definition at line 93 of file koUnit.h. Referenced by toUserValue(). |
|
Prepare ptValue to be displayed in inch.
Definition at line 98 of file koUnit.h. Referenced by toUserValue(). |
|
Prepare ptValue to be displayed in pica.
Definition at line 104 of file koUnit.h. Referenced by toUserValue(). |
|
Prepare ptValue to be displayed in didot.
Definition at line 110 of file koUnit.h. Referenced by toUserValue(). |
|
Prepare ptValue to be displayed in cicero.
Definition at line 116 of file koUnit.h. Referenced by toUserValue(). |
|
This method is the one to use to display a value in a dialog.
Definition at line 66 of file koUnit.cc. References toCC(), toCM(), toDD(), toDM(), toInch(), toMM(), toPI(), and toPoint(). Referenced by KoUnitDoubleSpinBox::setLineStep(), KoUnitDoubleSpinBox::setMaxValue(), KoUnitDoubleSpinBox::setMinValue(), and toUserStringValue(). |
|
Convert the value
|
|
This method is the one to use to display a value in a dialog.
Definition at line 113 of file koUnit.cc. References toUserValue(). |
|
This method is the one to use to read a value from a dialog.
Definition at line 118 of file koUnit.cc. Referenced by fromUserValue(), parseValue(), KoUnitDoubleComboBox::value(), KoUnitDoubleLineEdit::value(), and KoUnitDoubleSpinBox::value(). |
|
This method is the one to use to read a value from a dialog.
Definition at line 141 of file koUnit.cc. References fromUserValue(). |
|
Convert a unit name into a Unit enum.
Definition at line 180 of file koUnit.cc. Referenced by parseValue(), and KoRuler::setUnit(). |
|
Get the name of a unit.
Definition at line 198 of file koUnit.cc. Referenced by KoUnitDoubleBase::getVisibleText(), saveOasis(), and KoUnitDoubleBase::toDouble(). |
|
Get the full (translated) description of a unit.
|
|
parse common KOffice and OO values, like "10cm", "5mm" to pt
Definition at line 146 of file koUnit.cc. References fromUserValue(), and unit(). Referenced by KoStyleStack::fontSize(), KoPageLayout::loadOasis(), KoParagLayout::loadOasisParagLayout(), and KoTextFormat::parseShadowFromCss(). |
|
Save a unit in OASIS format.
Definition at line 210 of file koUnit.cc. References KoXmlWriter::addConfigItem(), and unitName(). |
The documentation for this class was generated from the following files: