QtViewerPrintGui.qo.h

Go to the documentation of this file.
00001 //# QtViewerPrintGui.qo.h:  Printing dialog for QtViewer
00002 //# Copyright (C) 2005
00003 //# Associated Universities, Inc. Washington DC, USA.
00004 //#
00005 //# This library is free software; you can redistribute it and/or modify it
00006 //# under the terms of the GNU Library General Public License as published by
00007 //# the Free Software Foundation; either version 2 of the License, or (at your
00008 //# option) any later version.
00009 //#
00010 //# This library 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 Library General Public
00013 //# License for more details.
00014 //#
00015 //# You should have received a copy of the GNU Library General Public License
00016 //# along with this library; if not, write to the Free Software Foundation,
00017 //# Inc., 675 Massachusetts Ave, Cambridge, MA 02139, USA.
00018 //#
00019 //# Correspondence concerning AIPS++ should be addressed as follows:
00020 //#        Internet email: aips2-request@nrao.edu.
00021 //#        Postal address: AIPS++ Project Office
00022 //#                        National Radio Astronomy Observatory
00023 //#                        520 Edgemont Road
00024 //#                        Charlottesville, VA 22903-2475 USA
00025 //#
00026 //# $Id$
00027 
00028 #ifndef QTVIEWERPRINTGUI_H
00029 #define QTVIEWERPRINTGUI_H
00030 
00031 
00032 #include <casa/aips.h>
00033 
00034 #include <graphics/X11/X_enter.h>
00035 #  include <QtCore>
00036 #  include <QtGui>
00037 #  include <QtXml/QDomDocument>
00038 //#dk Be careful to put *.ui.h within X_enter/exit bracket too,
00039 //#   because they'll have Qt includes.
00040 //#   E.g. <QApplication> needs the X11 definition of 'Display'
00041 #  include <display/QtViewer/printControl.ui.h>
00042 #include <graphics/X11/X_exit.h>
00043 
00044 
00045 #include <display/QtAutoGui/QtGuiEntry.qo.h>
00046 #include <display/QtAutoGui/QtXmlRecord.h>
00047 #include <display/QtViewer/QtDisplayPanel.qo.h>
00048 
00049 
00050 namespace casa { //# NAMESPACE CASA - BEGIN
00051 
00052 
00054 
00055 // <summary>
00056 // viewer print widget
00057 // </summary>
00058 
00059         class QtViewerPrintGui : public QWidget {
00060                 Q_OBJECT
00061 
00062         public:
00063 
00064                 QtViewerPrintGui(QtDisplayPanel *dp);
00065                 ~QtViewerPrintGui();
00066 
00067                 QString printFileName() const;
00068                 QString printerName() const;
00069                 bool load(QDomDocument &doc);
00070                 void loadRecord(Record rec);
00071                 static const QString printRecord;
00072                 void adjustEpsBoundingBox( const char *from, const char *to,
00073                                            const QSize &wcmax, const QRect &viewport );
00074                 void printPS(QPrinter *printer, const QString printerType);
00075                 friend ostream& operator <<(ostream &os,const QtViewerPrintGui &obj);
00076                 friend ostream& operator <<(ostream &os,const QPrinter &printer);
00077         signals:
00078 
00079         private slots:
00080         public slots:
00081                 void saveXPM();
00082                 void savePS(QPixmap*, int, int);
00083                 void print();
00084                 void dismiss();
00085                 void itemValueChanged(QString name, QString value, int action, bool apply);
00086                 void ps2eps(const QString &filename, QRect rect);
00087                 void printToFile(const QString &filename,bool isEPS);
00088                 void selectOutputType( const QString & text );
00089 
00090         private:
00091                 QDomDocument m_doc;
00092                 QVBoxLayout *vboxLayout;
00093                 QLabel* sizeLabel;
00094                 QString printfilename;
00095                 QString savefiletype;
00096                 QString printmedia;
00097                 QString printorientation;
00098                 int printresolution;
00099                 float printmagnification;
00100                 QString printepsformat;
00101                 std::pair<int, int> printimgresolution;
00102                 double printimgsizefactor;
00103                 QPrinter *printer;
00104                 QtDisplayPanel *pDP;
00105 
00106         private slots:
00107                 void dpResized(QSize panelSize, QSize canvasSize);
00108         };
00109 
00110 // <summary>
00111 // viewer print widget
00112 // </summary>
00113 
00114 // <synopsis>
00115 //  synopsis for the QtViewerPrintGui
00116 // </synopsis>
00117 
00119         class QtViewerPrintCtl : public QDialog, private Ui::PrintControl {
00120                 Q_OBJECT
00121         public:
00122 
00123                 QtViewerPrintCtl(QtViewerPrintGui *parent = 0);
00124                 ~QtViewerPrintCtl();
00125                 QString fileName() const;
00126                 QString printerName() const;
00127                 QString orientation() const;
00128                 QString paper() const;
00129 
00130         signals:
00131                 void printIt();
00132         private slots:
00133                 void checkPrinter();
00134         public slots:
00135 
00136         private:
00137 
00138         };
00139 
00140 
00141 } //# NAMESPACE CASA - END
00142 
00143 #endif
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

Generated on 31 Aug 2016 for casa by  doxygen 1.6.1