units.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #ifndef UNITS_H
00023 #define UNITS_H
00024
00025 #include "scribusapi.h"
00026 #include <QString>
00027 #include <QStringList>
00028
00029 #define UNITMIN 0
00030 #define UNITMAX 7
00031
00032 enum scUnit {
00033 SC_POINTS = 0,
00034 SC_PT = 0,
00035 SC_MILLIMETERS = 1,
00036 SC_MM = 1,
00037 SC_INCHES = 2,
00038 SC_IN = 2,
00039 SC_PICAS = 3,
00040 SC_P = 3,
00041 SC_CENTIMETERS = 4,
00042 SC_CM = 4,
00043 SC_CICERO = 5,
00044 SC_C = 5,
00045 SC_DEGREES = 6,
00046 SC_DEG = 6,
00047 SC_PERCENT = 7,
00048 SC_PCT = 7
00049 };
00050
00051 double SCRIBUS_API unitGetRatioFromIndex(const int index);
00052 int SCRIBUS_API unitGetBaseFromIndex(const int index);
00053 const QString SCRIBUS_API unitGetStrFromIndex(const int index);
00054 const QString SCRIBUS_API unitGetUntranslatedStrFromIndex(const int index);
00055 const QString SCRIBUS_API unitGetSuffixFromIndex(const int index);
00056 int SCRIBUS_API unitGetDecimalsFromIndex(const int index);
00057 int SCRIBUS_API unitGetPrecisionFromIndex(const int index);
00058 double SCRIBUS_API unitValueFromString(const QString& value);
00059 scUnit SCRIBUS_API unitIndexFromString(const QString& value);
00060 const QStringList SCRIBUS_API unitGetTextUnitList();
00061 int SCRIBUS_API unitGetMaxIndex();
00062 double SCRIBUS_API mm2pts(double mm);
00063 double SCRIBUS_API in2pts(double in);
00064 double SCRIBUS_API p2pts(double p);
00065 double SCRIBUS_API cm2pts(double cm);
00066 double SCRIBUS_API c2pts(double c);
00067 double SCRIBUS_API pts2mm(double pts);
00068 double SCRIBUS_API pts2in(double pts);
00069 double SCRIBUS_API pts2p(double pts);
00070 double SCRIBUS_API pts2cm(double pts);
00071 double SCRIBUS_API pts2c(double pts);
00072 double SCRIBUS_API pts2value(double Val, int unit);
00073 double SCRIBUS_API value2pts(double unitValue, int unit);
00074 double SCRIBUS_API value2value(double unitValue, int primaryUnit, int secondaryUnit);
00075
00076 double SCRIBUS_API unitRulerGetIter1FromIndex(const int index);
00077 double SCRIBUS_API unitRulerGetIter2FromIndex(const int index);
00078 bool SCRIBUS_API unitValidForDocUnit(const int index);
00079
00080 #endif // UNITS_H
00081