QGpGuiTools/PrintParametersInt.h
Go to the documentation of this file.
00001 /***************************************************************************
00002 **
00003 **  This file is part of QGpGuiTools.
00004 **
00005 **  This library is free software; you can redistribute it and/or
00006 **  modify it under the terms of the GNU Lesser General Public
00007 **  License as published by the Free Software Foundation; either
00008 **  version 2.1 of the License, or (at your option) any later version.
00009 **
00010 **  This file is distributed in the hope that it will be useful, but WITHOUT
00011 **  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
00012 **  FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
00013 **  License for more details.
00014 **
00015 **  You should have received a copy of the GNU Lesser General Public
00016 **  License along with this library; if not, write to the Free Software
00017 **  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
00018 **
00019 **  See http://www.geopsy.org for more information.
00020 **
00021 **  Created : 2003-08-22
00022 **  Authors :
00023 **    Marc Wathelet
00024 **    Marc Wathelet (ULg, Liège, Belgium)
00025 **    Marc Wathelet (LGIT, Grenoble, France)
00026 **
00027 ***************************************************************************/
00028 
00029 #ifndef PrintParametersInt_H
00030 #define PrintParametersInt_H
00031 
00032 #include <QtGui>
00033 #include <QGpCoreTools.h>
00034 
00035 namespace QGpGuiTools {
00036 
00037 class PrintParametersInt :  public QObject
00038 {
00039   Q_OBJECT
00040   Q_PROPERTY (QString orientationHelp READ orientationHelp)
00041   Q_PROPERTY (QString pageSizeHelp READ pageSizeHelp)
00042   Q_PROPERTY (QString colorModeHelp READ colorModeHelp)
00043   Q_PROPERTY (QString pageOrderHelp READ pageOrderHelp)
00044   Q_PROPERTY (QString orientation READ orientation WRITE setOrientation)
00045   Q_PROPERTY (QString pageSize READ pageSize WRITE setPageSize)
00046   Q_PROPERTY (QString colorMode READ colorMode WRITE setColorMode)
00047   Q_PROPERTY (QString pageOrder READ pageOrder WRITE setPageOrder)
00048   Q_PROPERTY (int fromPage READ fromPage WRITE setFromPage)
00049   Q_PROPERTY (int toPage READ toPage WRITE setToPage)
00050   Q_PROPERTY (int numCopies READ numCopies WRITE setNumCopies)
00051   Q_PROPERTY (QString currentSettings READ currentSettings)
00052 public:
00053   PrintParametersInt(QObject * parent=0);
00054   QString orientationHelp() const {return "Portrait, Landscape";}
00055   QString pageSizeHelp() const {return "A4, B5, Letter, Legal, Executive, A0, A1, A2, A3, A5, A6, "
00056                                 "A7, A8, A9, B0, B1, B10, B2, B3, B4, B6, B7, B8, B9, C5E, "
00057                                 "Comm10E, DLE, Folio, Ledger, Tabloid,Custom";}
00058   QString colorModeHelp() const {return "GrayScale, Color";}
00059   QString pageOrderHelp() const {return "FirstPageFirst, LastPageFirst";}
00060   
00061   QString orientation() const;
00062   QString pageSize() const;
00063   QString colorMode() const;
00064   QString pageOrder() const;
00065   int fromPage() const {return _from;}
00066   int toPage() const {return _to;}
00067   int numCopies() const  {return _numCopies;}
00068   
00069   void setOrientation(QString val);
00070   void setPageSize(QString val);
00071   void setColorMode(QString val);
00072   void setPageOrder(QString val);
00073   void setFromPage(int val) {if(val>_to) {_from=_to;_to=val;} else _from=val;}
00074   void setToPage(int val) {if(val<_from) {_to=_from;_from=val;} else _to=val;}
00075   void setNumCopies (int val) {if(val>0) _numCopies=val;}
00076   
00077   QString currentSettings() const;
00078 protected:
00079   friend class QSA;
00080   QPrinter::Orientation _orientation;
00081   QPrinter::PageSize _pageSize;
00082   QPrinter::ColorMode _colorMode;
00083   QPrinter::PageOrder _pageOrder;
00084   int _from;
00085   int _to;
00086   int _numCopies;
00087 };
00088 
00089 } // namespace QGpGuiTools
00090 
00091 #endif // PRINTPARAMETERSINT_H
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines