2008-02-24 20:13:45 +00:00
|
|
|
/*
|
2009-04-03 19:30:25 +00:00
|
|
|
Copyright 2006-2009 Xavier Guerrin
|
2008-02-24 20:13:45 +00:00
|
|
|
This file is part of QElectroTech.
|
|
|
|
|
|
|
|
QElectroTech is free software: you can redistribute it and/or modify
|
|
|
|
it under the terms of the GNU General Public License as published by
|
|
|
|
the Free Software Foundation, either version 2 of the License, or
|
|
|
|
(at your option) any later version.
|
|
|
|
|
|
|
|
QElectroTech is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
GNU General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
along with QElectroTech. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
|
|
|
#ifndef DIAGRAM_PRINT_DIALOG_H
|
|
|
|
#define DIAGRAM_PRINT_DIALOG_H
|
|
|
|
#include <QtGui>
|
2009-04-03 19:30:25 +00:00
|
|
|
#include "qetproject.h"
|
2008-02-24 20:13:45 +00:00
|
|
|
#include "diagram.h"
|
2009-10-04 01:32:45 +00:00
|
|
|
#include "exportproperties.h"
|
2008-02-24 20:13:45 +00:00
|
|
|
/**
|
|
|
|
Cette classe represente le dialogue de configuration de l'impression d'un
|
|
|
|
schema electrique.
|
|
|
|
Elle se charge egalement de l'impression elle-meme
|
|
|
|
*/
|
|
|
|
class DiagramPrintDialog : public QWidget {
|
|
|
|
Q_OBJECT
|
|
|
|
// Constructeurs, destructeur
|
|
|
|
public:
|
2009-04-03 19:30:25 +00:00
|
|
|
DiagramPrintDialog(QETProject *, QWidget * = 0);
|
2008-02-24 20:13:45 +00:00
|
|
|
virtual ~DiagramPrintDialog();
|
|
|
|
private:
|
|
|
|
DiagramPrintDialog(const DiagramPrintDialog &);
|
|
|
|
|
|
|
|
// methodes
|
|
|
|
public:
|
2009-04-03 19:30:25 +00:00
|
|
|
void setFileName(const QString &);
|
|
|
|
QString fileName() const;
|
2008-08-17 16:16:44 +00:00
|
|
|
void setDocName(const QString &);
|
|
|
|
QString docName() const;
|
2009-09-13 14:41:40 +00:00
|
|
|
QRect diagramRect(Diagram *) const;
|
2009-04-03 19:30:25 +00:00
|
|
|
int pagesCount(Diagram *, bool = false) const;
|
|
|
|
int horizontalPagesCount(Diagram *, bool = false) const;
|
|
|
|
int verticalPagesCount(Diagram *, bool = false) const;
|
2008-02-24 20:13:45 +00:00
|
|
|
void exec();
|
|
|
|
|
|
|
|
private:
|
2009-04-03 19:30:25 +00:00
|
|
|
void buildPrintTypeDialog();
|
2008-02-24 20:13:45 +00:00
|
|
|
void buildDialog();
|
2009-10-04 01:32:45 +00:00
|
|
|
void saveReloadDiagramParameters(Diagram *, const ExportProperties, bool);
|
2008-02-24 20:13:45 +00:00
|
|
|
|
|
|
|
private slots:
|
2009-10-04 01:32:45 +00:00
|
|
|
void print(const QList<Diagram *> &, bool, const ExportProperties, QPrinter *);
|
|
|
|
void printDiagram(Diagram *, bool, const ExportProperties, QPainter *, QPrinter * = 0);
|
2009-04-03 19:30:25 +00:00
|
|
|
void updatePrintTypeDialog();
|
|
|
|
void acceptPrintTypeDialog();
|
|
|
|
void browseFilePrintTypeDialog();
|
2008-02-24 20:13:45 +00:00
|
|
|
|
|
|
|
// attributs
|
|
|
|
private:
|
2009-04-03 19:30:25 +00:00
|
|
|
QETProject *project_;
|
|
|
|
QPrinter *printer_;
|
|
|
|
QString doc_name_;
|
|
|
|
QString file_name_;
|
|
|
|
|
|
|
|
/// Attributs relatifs au 1er dialogue
|
|
|
|
QDialog *dialog_;
|
|
|
|
QLabel *printtype_label_;
|
|
|
|
QGridLayout *glayout0_;
|
|
|
|
QVBoxLayout *vlayout0_;
|
|
|
|
QHBoxLayout *hlayout0_;
|
|
|
|
QLabel *printer_icon_;
|
|
|
|
QLabel *pdf_icon_;
|
|
|
|
QLabel *ps_icon_;
|
|
|
|
QButtonGroup *printtype_choice_;
|
|
|
|
QRadioButton *printer_choice_;
|
|
|
|
QRadioButton *pdf_choice_;
|
|
|
|
QRadioButton *ps_choice_;
|
|
|
|
QLineEdit *filepath_field_;
|
|
|
|
QPushButton *browse_button_;
|
|
|
|
QDialogButtonBox *buttons_;
|
2008-02-24 20:13:45 +00:00
|
|
|
};
|
|
|
|
#endif
|