1 /**************************************************************************** 2 ** 3 ** This file is part of the LibreCAD project, a 2D CAD program 4 ** 5 ** Copyright (C) 2010 R. van Twisk (librecad@rvt.dds.nl) 6 ** Copyright (C) 2001-2003 RibbonSoft. All rights reserved. 7 ** 8 ** 9 ** This file may be distributed and/or modified under the terms of the 10 ** GNU General Public License version 2 as published by the Free Software 11 ** Foundation and appearing in the file gpl-2.0.txt included in the 12 ** packaging of this file. 13 ** 14 ** This program is distributed in the hope that it will be useful, 15 ** but WITHOUT ANY WARRANTY; without even the implied warranty of 16 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 ** GNU General Public License for more details. 18 ** 19 ** You should have received a copy of the GNU General Public License 20 ** along with this program; if not, write to the Free Software 21 ** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 22 ** 23 ** This copyright notice MUST APPEAR in all copies of the script! 24 ** 25 **********************************************************************/ 26 #ifndef QG_PRINTPREVIEWOPTIONS_H 27 #define QG_PRINTPREVIEWOPTIONS_H 28 29 #include<memory> 30 #include<QWidget> 31 32 class RS_ActionInterface; 33 class RS_ActionPrintPreview; 34 namespace Ui { 35 class Ui_PrintPreviewOptions; 36 } 37 38 class QG_PrintPreviewOptions : public QWidget 39 { 40 Q_OBJECT 41 42 public: 43 QG_PrintPreviewOptions(QWidget* parent = 0, Qt::WindowFlags fl = 0); 44 ~QG_PrintPreviewOptions(); 45 46 public slots: 47 virtual void setAction( RS_ActionInterface * a, bool update ); 48 virtual void updateData(); 49 virtual void center(); 50 virtual void setLineWidthScaling( bool state ); 51 virtual void setBlackWhite( bool on ); 52 virtual void fit(); 53 virtual void scale( const QString & s ); 54 virtual void scale( const double & factor ); 55 virtual void updateScaleBox(); 56 virtual void updateScaleBox(const double& f); 57 /** print scale fixed to saved value **/ 58 virtual void setScaleFixed(bool fixed); 59 // virtual void updateScaleBox(const QString& s); 60 virtual void calcPagesNum(); 61 62 protected: 63 RS_ActionPrintPreview* action; 64 65 protected slots: 66 virtual void languageChange(); 67 68 private: 69 void init(); 70 void saveSettings(); 71 QStringList imperialScales; 72 QStringList metricScales; 73 bool updateDisabled{false}; 74 bool scaleLineWidth; 75 bool blackWhiteDisabled; 76 int defaultScales; 77 std::unique_ptr<Ui::Ui_PrintPreviewOptions> ui; 78 }; 79 80 #endif // QG_PRINTPREVIEWOPTIONS_H 81