File indexing completed on 2024-05-19 15:27:53

0001 /* This file is part of KGraphViewer.
0002    Copyright (C) 2005-2006 Gaël de Chalendar <kleag@free.fr>
0003 
0004    KGraphViewer is free software; you can redistribute it and/or
0005    modify it under the terms of the GNU General Public
0006    License as published by the Free Software Foundation, version 2.
0007 
0008    This program is distributed in the hope that it will be useful,
0009    but WITHOUT ANY WARRANTY; without even the implied warranty of
0010    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
0011    General Public License for more details.
0012 
0013    You should have received a copy of the GNU General Public License
0014    along with this program; if not, write to the Free Software
0015    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
0016    02110-1301, USA
0017 */
0018 
0019 /* This file was part of the KDE project
0020    Copyright (C) 2005 Jarosław Staniek <staniek@kde.org>
0021 
0022    This program is free software; you can redistribute it and/or
0023    modify it under the terms of the GNU Library General Public
0024    License as published by the Free Software Foundation; either
0025    version 2 of the License, or (at your option) any later version.
0026  */
0027 
0028 #ifndef KGVSIMPLEPRINTINGPAGESETUP_H
0029 #define KGVSIMPLEPRINTINGPAGESETUP_H
0030 
0031 #include "simpleprintingengine.h"
0032 
0033 #include <QButtonGroup>
0034 
0035 namespace Ui
0036 {
0037 class KGVSimplePrintingPageSetupBase;
0038 }
0039 namespace KGraphViewer
0040 {
0041 class DotGraphView;
0042 class KGVSimplePrintingCommand;
0043 class KgvPageLayoutSize;
0044 
0045 //! @short A window for displaying settings for simple printing.
0046 class KGVSimplePrintingPageSetup : public QWidget
0047 {
0048     Q_OBJECT
0049 
0050 public:
0051     KGVSimplePrintingPageSetup(KGVSimplePrintingCommand *command, DotGraphView *mainWin, QWidget *parent, QMap<QString, QString> *args);
0052     ~KGVSimplePrintingPageSetup();
0053 
0054 public Q_SLOTS:
0055     void slotPrint();
0056     void slotPrintPreview();
0057 
0058 Q_SIGNALS:
0059     void print(KGVSimplePrintingSettings *settings, const QString &titleText);
0060     void printPreview(KGVSimplePrintingSettings *settings, const QString &titleText, bool reload);
0061     void print();
0062     void printPreview();
0063     void needsRedraw();
0064 
0065 protected Q_SLOTS:
0066     void slotSaveSetup();
0067     void slotChangeTitleFont();
0068     void slotChangePageSizeAndMargins();
0069     void slotAddPageNumbersCheckboxToggled(bool set);
0070     void slotAddDateTimeCheckboxToggled(bool set);
0071     void slotAddTableBordersCheckboxToggled(bool set);
0072     void slotTitleTextChanged(const QString &);
0073     void slotClose();
0074     void slotFittingButtonClicked(int id);
0075     void slotHorizFitChanged(int newValue);
0076     void slotVertFitChanged(int newValue);
0077     void slotMaintainAspectButtonToggled();
0078 
0079 protected:
0080     void setupPrintingCommand();
0081     void updatePageLayoutAndUnitInfo();
0082     void setDirty(bool set);
0083 
0084     KGVSimplePrintingSettings *m_settings;
0085 
0086     //      KGVSimplePrintingEngine *m_engine;
0087     //    get engine with m_command->engine()
0088 
0089     KgvUnit::Unit m_unit;
0090     Ui::KGVSimplePrintingPageSetupBase *m_contents;
0091     KgvPageLayoutSize *m_pageLayoutWidget;
0092     DotGraphView *m_graphView;
0093     KGVSimplePrintingCommand *m_command;
0094     bool m_printPreviewNeedsReloading : 1;
0095 
0096     QButtonGroup m_fittingModeButtons;
0097 };
0098 
0099 }
0100 
0101 #endif