filters

ImportHelpers.h

Go to the documentation of this file.
00001 /* This file is part of the KDE project
00002    Copyright (C) 2001, 2004 Nicolas GOUTTE <goutte@kde.org>
00003 
00004    This library is free software; you can redistribute it and/or
00005    modify it under the terms of the GNU Library General Public
00006    License as published by the Free Software Foundation; either
00007    version 2 of the License, or (at your option) any later version.
00008 
00009    This library is distributed in the hope that it will be useful,
00010    but WITHOUT ANY WARRANTY; without even the implied warranty of
00011    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00012    Library General Public License for more details.
00013 
00014    You should have received a copy of the GNU Library General Public License
00015    along with this library; see the file COPYING.LIB.  If not, write to
00016    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
00017  * Boston, MA 02110-1301, USA.
00018 */
00019 
00020 #ifndef _IMPORT_HELPERS_H
00021 #define _IMPORT_HELPERS_H
00022 
00023 #include <qstring.h>
00024 #include <qmap.h>
00025 
00034 class AbiProps
00035 {
00036 public:
00037     AbiProps() {};
00038     AbiProps(QString newValue) : m_value(newValue) {};
00039     virtual ~AbiProps() {};
00040 public:
00041     inline QString getValue(void) const { return m_value; }
00042 private:
00043     QString m_value;
00044 };
00045 
00046 class AbiPropsMap : public QMap<QString,AbiProps>
00047 {
00048 public:
00049     AbiPropsMap() {};
00050     virtual ~AbiPropsMap() {};
00051 public:
00052     bool setProperty(const QString& newName, const QString& newValue);
00053     void splitAndAddAbiProps(const QString& strProps);
00054 };
00055 
00056 inline double CentimetresToPoints(const double d)
00057 {
00058     return d * 72.0 / 2.54;
00059 }
00060 
00061 inline double MillimetresToPoints(const double d)
00062 {
00063     return d * 72.0 / 25.4;
00064 }
00065 
00066 inline double InchesToPoints(const double d)
00067 {
00068     return d * 72.0;
00069 }
00070 
00071 inline double PicaToPoints(const double d)
00072 {
00073     // 1 pica = 12 pt
00074     return d * 12.0;
00075 }
00076 
00083 double ValueWithLengthUnit( const QString& _str, bool* atleast = NULL );
00084 
00085 #endif // _IMPORT_HELPERS_H
KDE Home | KDE Accessibility Home | Description of Access Keys