Scribus
Open source desktop publishing at your fingertips
marginwidget.h
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 #ifndef MARGINWIDGET_H
8 #define MARGINWIDGET_H
9 
10 #include "scribusapi.h"
11 #include "scribusstructs.h"
12 
13 #include <QComboBox>
14 #include <QTabWidget>
15 #include "linkbutton.h"
16 #include "marginpresetlayout.h"
17 class QCheckBox;
18 class QPushButton;
19 class QLabel;
20 class QGridLayout;
21 class QHBoxLayout;
22 class ScrSpinBox;
23 
24 
28 class SCRIBUS_API MarginWidget : public QTabWidget
29 {
30  Q_OBJECT
31 
32 public:
40  MarginWidget( QWidget* parent, QString title, const MarginStruct* margs, int unitIndex, bool showChangeAll=false, bool showBleeds=true);
41  ~MarginWidget() {};
43  void setFacingPages(bool facing, int pagetype = 0);
45  void setPageWidthHeight(double width, double height);
47  void setPageWidth(double width);
49  void setPageHeight(double heigth);
51  void setNewUnit(int newUnitIndex);
53  void setPageSize(const QString& pageSize);
54 
57  const MarginStruct& margins() const;
60  double top() const;
63  double bottom() const;
66  double left() const;
69  double right() const;
70 
76  void setNewMargins(MarginStruct& m);
77 
79  void setMarginPreset(int p);
80  int getMarginPreset();
81 
84  double topBleed() const;
87  double bottomBleed() const;
90  double leftBleed() const;
93  double rightBleed() const;
94 
98  void setNewBleeds(MarginStruct& b);
99 
102  bool getMarginsForAllPages() const;
103  bool getMarginsForAllMasterPages() const;
104 
105 private:
107  QWidget *marginPage;
108  QWidget* bleedPage;
110  ScrSpinBox* topR;
111  ScrSpinBox* bottomR;
112  ScrSpinBox* rightR;
113  ScrSpinBox* leftR;
114  ScrSpinBox* BleedBottom;
115  ScrSpinBox* BleedLeft;
116  ScrSpinBox* BleedRight;
117  ScrSpinBox* BleedTop;
118  PresetLayout* presetCombo;
120  QLabel* lText;
121  QLabel* rText;
122  QLabel* tText;
123  QLabel* bText;
124  QLabel* presetLabel;
125  QLabel* marginsForPages;
126  QLabel* BleedTxt1;
127  QLabel* BleedTxt2;
128  QLabel* BleedTxt3;
129  QLabel* BleedTxt4;
130  QCheckBox* marginsForAllPages;
131  QCheckBox* marginsForAllMasterPages;
132  QPushButton* usePrinterMarginsButton;
133  LinkButton* linkBleeds;
134  LinkButton* linkMargins;
136  MarginStruct marginData;
137  /*
139  double RandT;
141  double RandB;
143  double RandL;
145  double RandR;
146  */
148  double pageWidth;
150  double pageHeight;
151 
152 public slots:
154  void setTop();
155  void setBottom();
156  void setLeft();
157  void setRight();
159  void setPreset();
160  void slotLinkBleeds();
161  void slotLinkMargins();
162  void changeBleeds();
163 
164 protected slots:
165  virtual void setMarginsToPrinterMargins();
166 
167 protected:
168  void updateMarginSpinValues();
169  QGridLayout* GroupLayout;
170  QHBoxLayout* marginsForPagesLayout;
171  QGridLayout* BleedGroupLayout;
172  QString m_pageSize;
173  int m_unitIndex;
174  double m_unitRatio;
177  bool useBleeds;
178  int pageType;
179  MarginStruct savedMargins;
180  int savedPresetItem;
181 };
182 
183 #endif
Widget for Margins setting. Used e.g. in "New Doc Dialog" or "Preferences".
Definition: marginwidget.h:28
Pagemargins and bleeds.
Definition: margins.h:25
bool facingPages
if the outer facing palette points to the facing pages item
Definition: marginwidget.h:176
ScrSpinBox is a Qt4 replacement for our old ScrSpinBox using Qt3.
Definition: scrspinbox.h:21
This is inherited QComboBox widget used in MarginWidget as "Preset List". It contains functionality f...
Definition: marginpresetlayout.h:19