Scribus Developer Documentation - API
logo-pen

Scribus Developer Documentation - API

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>
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 //Ruler specific functions
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 
Created with personalized Doxygen. This is documentation for GPL software Scribus - Open Source Desktop Publishing.