File indexing completed on 2024-04-28 04:20:34

0001 /************************************************************************
0002  *                                  *
0003  *  This file is part of Kooka, a scanning/OCR application using    *
0004  *  Qt <http://www.qt.io> and KDE Frameworks <http://www.kde.org>.  *
0005  *                                  *
0006  *  Copyright (C) 2003-2016 Klaas Freitag <freitag@suse.de>     *
0007  *                          Jonathan Marten <jjm@keelhaul.me.uk>    *
0008  *                                  *
0009  *  Kooka is free software; you can redistribute it and/or modify it    *
0010  *  under the terms of the GNU Library General Public License as    *
0011  *  published by the Free Software Foundation and appearing in the  *
0012  *  file COPYING included in the packaging of this file;  either    *
0013  *  version 2 of the License, or (at your option) any later version.    *
0014  *                                  *
0015  *  As a special exception, permission is given to link this program    *
0016  *  with any version of the KADMOS OCR/ICR engine (a product of     *
0017  *  reRecognition GmbH, Kreuzlingen), and distribute the resulting  *
0018  *  executable without including the source code for KADMOS in the  *
0019  *  source distribution.                        *
0020  *                                  *
0021  *  This program is distributed in the hope that it will be useful, *
0022  *  but WITHOUT ANY WARRANTY; without even the implied warranty of  *
0023  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the   *
0024  *  GNU General Public License for more details.            *
0025  *                                  *
0026  *  You should have received a copy of the GNU General Public       *
0027  *  License along with this program;  see the file COPYING.  If     *
0028  *  not, see <http://www.gnu.org/licenses/>.                *
0029  *                                  *
0030  ************************************************************************/
0031 
0032 #ifndef IMGPRINTDIALOG_H
0033 #define IMGPRINTDIALOG_H
0034 
0035 #include <qmap.h>
0036 #include <qcheckbox.h>
0037 #include <qwidget.h>
0038 
0039 #include "scanimage.h"
0040 
0041 #include "kookacore_export.h"
0042 
0043 class QLabel;
0044 class QButtonGroup;
0045 class QCheckBox;
0046 class QComboBox;
0047 class QLineEdit;
0048 class QSpinBox;
0049 class QTimer;
0050 
0051 class KookaPrint;
0052 
0053 
0054 class KOOKACORE_EXPORT ImgPrintDialog : public QWidget
0055 {
0056     Q_OBJECT
0057 
0058 public:
0059     explicit ImgPrintDialog(ScanImage::Ptr img, KookaPrint *prt, QWidget *pnt = nullptr);
0060     virtual ~ImgPrintDialog() = default;
0061 
0062     QString checkValid() const;
0063 
0064 public slots:
0065     void updatePrintParameters();
0066 
0067 protected slots:
0068     void slotScaleChanged(int id);
0069     void slotCustomWidthChanged(int);
0070     void slotCustomHeightChanged(int);
0071     void slotAdjustCustomSize();
0072 
0073 private:
0074     void initOptions();
0075 
0076 private:
0077     QButtonGroup  *m_scaleRadios;
0078 
0079     QSpinBox *m_sizeW;
0080     QSpinBox *m_sizeH;
0081     QSpinBox *m_dpi;
0082 
0083     QCheckBox *m_psDraft;
0084     QCheckBox *m_ratio;
0085     QComboBox *m_cutsCombo;
0086 
0087     QLineEdit *m_screenRes;
0088 
0089     QLabel *mImageSize;
0090     QLabel *mPrintArea;
0091     QLabel *mImageArea;
0092     QLabel *mPrintPages;
0093 
0094     ScanImage::Ptr m_image;
0095     QTimer *mUpdateTimer;
0096     KookaPrint *mPrinter;
0097 };
0098 
0099 #endif                          // IMGPRINTDIALOG_H