Back to index

scribus-ng  1.3.4.dfsg+svn20071115
units.h
Go to the documentation of this file.
00001 /*
00002 For general Scribus (>=1.3.2) copyright and licensing information please refer
00003 to the COPYING file provided with the program. Following this notice may exist
00004 a copyright and/or license notice that predates the release of Scribus 1.3.2
00005 for which a new license (GPL+exception) is in place.
00006 */
00007 /***************************************************************************
00008     begin                : Jan 2005
00009     copyright            : (C) 2005 by Craig Bradney
00010     email                : cbradney@zip.com.au
00011  ***************************************************************************/
00012 
00013 /***************************************************************************
00014  *                                                                         *
00015  *   This program is free software; you can redistribute it and/or modify  *
00016  *   it under the terms of the GNU General Public License as published by  *
00017  *   the Free Software Foundation; either version 2 of the License, or     *
00018  *   (at your option) any later version.                                   *
00019  *                                                                         *
00020  ***************************************************************************/
00021 
00022 #ifndef UNITS_H
00023 #define UNITS_H
00024 
00025 #include "scribusapi.h"
00026 #include <qstring.h>
00027 #include <qstringlist.h>
00028 
00029 #define UNITMIN 0
00030 #define UNITMAX 5
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 };
00046 
00047 const double SCRIBUS_API unitGetRatioFromIndex(const int index);
00048 const QString SCRIBUS_API unitGetStrFromIndex(const int index);
00049 const QString SCRIBUS_API unitGetUntranslatedStrFromIndex(const int index);
00050 const QString SCRIBUS_API unitGetSuffixFromIndex(const int index);
00051 const int SCRIBUS_API unitGetDecimalsFromIndex(const int index);
00052 const int SCRIBUS_API unitGetPrecisionFromIndex(const int index);
00053 const double SCRIBUS_API unitValueFromString(const QString& value);
00054 const scUnit SCRIBUS_API unitIndexFromString(const QString& value);
00055 const QStringList SCRIBUS_API unitGetTextUnitList();
00056 const int SCRIBUS_API unitGetMaxIndex();
00057 const double SCRIBUS_API mm2pts(double mm);
00058 const double SCRIBUS_API in2pts(double in);
00059 const double SCRIBUS_API p2pts(double p);
00060 const double SCRIBUS_API cm2pts(double cm);
00061 const double SCRIBUS_API c2pts(double c);
00062 const double SCRIBUS_API pts2mm(double pts);
00063 const double SCRIBUS_API pts2in(double pts);
00064 const double SCRIBUS_API pts2p(double pts);
00065 const double SCRIBUS_API pts2cm(double pts);
00066 const double SCRIBUS_API pts2c(double pts);
00067 double SCRIBUS_API pts2value(double Val, int unit);
00068 double SCRIBUS_API value2pts(double unitValue, int unit);
00069 double SCRIBUS_API value2value(double unitValue, int primaryUnit, int secondaryUnit);
00070 //Ruler specific functions
00071 double SCRIBUS_API unitRulerGetIter1FromIndex(const int index);
00072 double SCRIBUS_API unitRulerGetIter2FromIndex(const int index);
00073 
00074 
00075 #endif // UNITS_H
00076