Back to index

scribus-ng  1.3.4.dfsg+svn20071115
gtmeasure.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  *   Copyright (C) 2004 by Riku Leino                                      *
00009  *   tsoots@gmail.com                                                      *
00010  *                                                                         *
00011  *   This program is free software; you can redistribute it and/or modify  *
00012  *   it under the terms of the GNU General Public License as published by  *
00013  *   the Free Software Foundation; either version 2 of the License, or     *
00014  *   (at your option) any later version.                                   *
00015  *                                                                         *
00016  *   This program is distributed in the hope that it will be useful,       *
00017  *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
00018  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
00019  *   GNU General Public License for more details.                          *
00020  *                                                                         *
00021  *   You should have received a copy of the GNU General Public License     *
00022  *   along with this program; if not, write to the                         *
00023  *   Free Software Foundation, Inc.,                                       *
00024  *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
00025  ***************************************************************************/
00026 
00027 #ifndef GTMEASURE_H
00028 #define GTMEASURE_H
00029 
00030 #include <qstring.h>
00031 
00032 #include "scribusapi.h"
00033 #include "units.h"
00034 
00035 class SCRIBUS_API gtMeasure
00036 {
00037 private:
00038        gtMeasure();
00039        static double ratio;
00040        static void   init(scUnit u);
00041        static double convert(double value);
00042        static double convert(int value);
00043        static double convert2(double value);
00044        static double convert2(int value);
00045        static double parse(const QString& value);
00046 public:
00047        static double convert(double value, scUnit from, scUnit to = SC_PT);
00048        static double convert(int value, scUnit from, scUnit to = SC_PT);
00049        static double d2d(double value, scUnit from, scUnit to = SC_PT);
00050        static double i2d(int value, scUnit from, scUnit to = SC_PT);
00051        static double qs2d(const QString& value, scUnit to = SC_PT);
00052 
00053 };
00054 
00055 #endif // GTMEASURE_H