24#include <tqstringlist.h>
26#include <koffice_export.h>
38#define POINT_TO_MM(px) ((px)*0.352777167)
39#define MM_TO_POINT(mm) ((mm)*2.83465058)
40#define POINT_TO_CM(px) ((px)*0.0352777167)
41#define CM_TO_POINT(cm) ((cm)*28.3465058)
42#define POINT_TO_DM(px) ((px)*0.00352777167)
43#define DM_TO_POINT(dm) ((dm)*283.465058)
44#define POINT_TO_INCH(px) ((px)*0.01388888888889)
45#define INCH_TO_POINT(inch) ((inch)*72.0)
46#define MM_TO_INCH(mm) ((mm)*0.039370147)
47#define INCH_TO_MM(inch) ((inch)*25.399956)
48#define POINT_TO_PI(px)((px)*0.083333333)
49#define POINT_TO_DD(px)((px)*0.006490083)
50#define POINT_TO_CC(px)((px)*0.077880997)
51#define PI_TO_POINT(pi)((pi)*12)
52#define DD_TO_POINT(dd)((dd)*154.08124)
53#define CC_TO_POINT(cc)((cc)*12.840103)
79 return floor( ptValue * 1000.0 ) / 1000.0;
83 static double toMM( double ptValue ) {
85 return floor( POINT_TO_MM( ptValue ) * 10000.0 ) / 10000.0;
89 static double toCM( double ptValue ) {
90 return floor( POINT_TO_CM( ptValue ) * 10000.0 ) / 10000.0;
94 static double toDM( double ptValue ) {
95 return floor( POINT_TO_DM( ptValue ) * 10000.0 ) / 10000.0;
99 static double toInch( double ptValue ) {
101 return floor( POINT_TO_INCH( ptValue ) * 100000.0 ) / 100000.0;
105 static double toPI( double ptValue ) {
107 return floor( POINT_TO_PI( ptValue ) * 100000.0 ) / 100000.0;
111 static double toDD( double ptValue ) {
113 return floor( POINT_TO_DD( ptValue ) * 100000.0 ) / 100000.0;
117 static double toCC( double ptValue ) {
119 return floor( POINT_TO_CC( ptValue ) * 100000.0 ) / 100000.0;
127 static double toUserValue( double ptValue, Unit unit );
135 static double ptToUnit( const double ptValue, const Unit unit );
140 static TQString toUserStringValue( double ptValue, Unit unit );
145 static double fromUserValue( double value, Unit unit );
153 static double fromUserValue( const TQString& value, Unit unit, bool* ok = 0 );
158 static Unit unit( const TQString &_unitName, bool* ok = 0 );
160 static TQString unitName( Unit _unit );
162 static TQString unitDescription( Unit _unit );
163 static TQStringList listOfUnitName();
166 static double parseValue( TQString value, double defaultVal = 0.0 );
170 static void saveOasis( KoXmlWriter* settingsWriter, Unit _unit);
KOffice stores everything in pt (using "double") internally.
static double toInch(double ptValue) Prepare ptValue to be displayed in inch.
static double toDM(double ptValue) Prepare ptValue to be displayed in dm.
static double toCM(double ptValue) Prepare ptValue to be displayed in cm.
static double toMM(double ptValue) Prepare ptValue to be displayed in mm.
static double toPI(double ptValue) Prepare ptValue to be displayed in pica.
static double toCC(double ptValue) Prepare ptValue to be displayed in cicero.
static double toDD(double ptValue) Prepare ptValue to be displayed in didot.
Unit Length units supported by KOffice.
static double toPoint(double ptValue) Prepare ptValue to be displayed in pt.
A class for writing out XML (to any TQIODevice), with a special attention on performance.
|