"Fossies" - the Fresh Open Source Software Archive

Member "src/types.h" (28 Sep 2008, 2410 Bytes) of package /windows/misc/PosteRazor-1.9.5-Source.zip:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. For more information about "types.h" see the Fossies "Dox" file reference documentation.

    1 /*
    2     PosteRazor - Make your own poster!
    3     Copyright (C) 2005-2008 by Alessandro Portale
    4     http://posterazor.sourceforge.net/
    5 
    6     This file is part of PosteRazor
    7 
    8     PosteRazor is free software; you can redistribute it and/or modify
    9     it under the terms of the GNU General Public License as published by
   10     the Free Software Foundation, either version 3 of the License, or
   11     (at your option) any later version.
   12 
   13     PosteRazor is distributed in the hope that it will be useful,
   14     but WITHOUT ANY WARRANTY; without even the implied warranty of
   15     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   16     GNU General Public License for more details.
   17 
   18     You should have received a copy of the GNU General Public License
   19     along with PosteRazor; if not, write to the Free Software
   20     Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
   21 */
   22 
   23 #ifndef TYPES_H
   24 #define TYPES_H
   25 
   26 #include <QSizeF>
   27 #include <QHash>
   28 #include <QString>
   29 #include <QPrinter>
   30 
   31 class Types
   32 {
   33 public:
   34     enum PosterSizeModes {
   35         PosterSizeModeAbsolute,
   36         PosterSizeModePercentual,
   37         PosterSizeModePages,
   38         PosterSizeModeNone
   39     };
   40 
   41     enum ColorTypes {
   42         ColorTypeMonochrome,
   43         ColorTypeGreyscale,
   44         ColorTypePalette,
   45         ColorTypeRGB,
   46         ColorTypeRGBA,
   47         ColorTypeCMYK
   48     };
   49 
   50     enum UnitsOfLength {
   51         UnitOfLengthMeter,
   52         UnitOfLengthMillimeter,
   53         UnitOfLengthCentimeter,
   54         UnitOfLengthInch,
   55         UnitOfLengthFeet,
   56         UnitOfLengthPoints
   57     };
   58 
   59     static const QHash<UnitsOfLength, QPair<QString, double> > &unitsOfLength();
   60     static double convertBetweenUnitsOfLength(double distance, UnitsOfLength sourceUnit, UnitsOfLength targetUnit);
   61     static QSizeF convertBetweenUnitsOfLength(const QSizeF &size, UnitsOfLength sourceUnit, UnitsOfLength targetUnit);
   62     static UnitsOfLength unitOfLenthFromString(const QString &string);
   63     static const QHash<QString, QSizeF> &paperFormats();
   64     static QSizeF paperSize(const QString &format, QPrinter::Orientation orientation, UnitsOfLength unit);
   65 
   66     // These two functions help to format help text. I know, they do not belong, here.
   67     static QString cleanString(const QString &dirtyString);
   68     static QString newlineToParagraph(const QString &nlText);
   69 };
   70 
   71 #endif // TYPES_H