1 /*
2 For general Scribus (>=1.3.2) copyright and licensing information please refer
3 to the COPYING file provided with the program. Following this notice may exist
4 a copyright and/or license notice that predates the release of Scribus 1.3.2
5 for which a new license (GPL+exception) is in place.
6 */
7 /***************************************************************************
8  *                                                                         *
9  *   This program is free software; you can redistribute it and/or modify  *
10  *   it under the terms of the GNU General Public License as published by  *
11  *   the Free Software Foundation; either version 2 of the License, or     *
12  *   (at your option) any later version.                                   *
13  *                                                                         *
14  ***************************************************************************/
15 #ifndef APPLYMASTERPAGEDIALOG_H
16 #define APPLYMASTERPAGEDIALOG_H
17 
18 #include <QDialog>
19 #include <QString>
20 
21 #include "scribusapi.h"
22 #include "scribusdoc.h"
23 #include "scpage.h"
24 #include "ui/scrspinbox.h"
25 
26 class QCheckBox;
27 class QComboBox;
28 class QEvent;
29 class QGroupBox;
30 class QHBoxLayout;
31 class QLabel;
32 class QPushButton;
33 class QRadioButton;
34 class QSpacerItem;
35 class QVBoxLayout;
36 
37 class SCRIBUS_API ApplyMasterPageDialog : public QDialog
38 {
39 	Q_OBJECT
40 
41 public:
42 	ApplyMasterPageDialog( QWidget* parent = nullptr );
43 	~ApplyMasterPageDialog();
44 
45 	QLabel* masterPageLabel;
46 	QComboBox* masterPageComboBox;
47 	QGroupBox* applyToPageButtonGroup;
48 	QRadioButton* currentPageRadioButton;
49 	QRadioButton* evenPagesRadioButton;
50 	QRadioButton* oddPagesRadioButton;
51 	QRadioButton* allPagesRadioButton;
52 	QCheckBox* useRangeCheckBox;
53 	ScrSpinBox* fromPageSpinBox;
54 	QLabel* toPageLabel;
55 	ScrSpinBox* toPageSpinBox;
56 	QPushButton* okButton;
57 	QPushButton* cancelButton;
58 
59 	virtual void setup(ScribusDoc* doc, const QString& Nam);
60 	virtual QString getMasterPageName();
61 	virtual int getPageSelection();
62 	virtual bool usingRange();
63 	virtual int getFromPage();
64 	virtual int getToPage();
65 
66 protected:
67 	QVBoxLayout* ApplyMasterPageDialogLayout;
68 	QHBoxLayout* templateNameLayout;
69 	QSpacerItem* spacer2;
70 	QVBoxLayout* applyToPageButtonGroupLayout;
71 	QHBoxLayout* rangeLayout;
72 	QSpacerItem* spacer3;
73 	QHBoxLayout* layout8;
74 	QSpacerItem* spacer1;
75 
76 	void changeEvent(QEvent *e) override;
77 
78 protected slots:
79 	virtual void languageChange();
80 
81 private slots:
82 	virtual void checkRangeFrom();
83 	virtual void checkRangeTo();
84 	virtual void enableRange( bool enabled );
85 	virtual void rangeSelectable();
86 	virtual void singleSelectable();
87 
88 };
89 
90 #endif // APPLYMASTERPAGEDIALOG_H
91