Scribus
Open source desktop publishing at your fingertips
newmarginwidget.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 
8 #ifndef NEWMARGINWIDGET_H
9 #define NEWMARGINWIDGET_H
10 
11 #include "ui_newmarginwidgetbase.h"
12 #include "scribusapi.h"
13 #include "scribusstructs.h"
14 
15 class SCRIBUS_API NewMarginWidget : public QWidget, Ui::NewMarginWidget
16 {
17  Q_OBJECT
18 
19  public:
20  NewMarginWidget(QWidget* parent=0);
21  ~NewMarginWidget();
22 
23  enum SetupFlags
24  {
25  ShowPreset = 1,
26  ShowPrinterMargins = 2,
27  MarginWidgetFlags = 3,
28  BleedWidgetFlags = 4,
29  };
30 
31  void setup(const MarginStruct& margs, int layoutType, int unitIndex, int flags = MarginWidgetFlags);
33  void setFacingPages(bool facing, int pagetype = 0);
35  void setPageWidth(double);
37  void setPageHeight(double);
39  void setPageSize(const QString&);
40  void setNewUnit(int unitIndex);
41  void setNewValues(const MarginStruct& margs);
43  void setMarginPreset(int p);
44  const MarginStruct & margins() const { return marginData; };
45 
46  public slots:
47  void languageChange();
48  void setTop();
49  void setBottom();
50  void setLeft();
51  void setRight();
52  void slotLinkMargins();
53  void setPreset();
54 
55  protected slots:
56  void setMarginsToPrinterMargins();
57 
58  protected:
59  void updateMarginSpinValues();
60 
61  MarginStruct marginData;
62  MarginStruct savedMarginData;
63  int savedPresetItem;
64  bool facingPages;
65  int m_flags;
66  int m_unitIndex;
67  double m_unitRatio;
68  QString m_pageSize;
69  double pageWidth;
70  double pageHeight;
71  int pageType;
72 };
73 
74 #endif // NEWMARGINWIDGET_H
75 
76 
77 
Pagemargins and bleeds.
Definition: margins.h:25