Scribus
Open source desktop publishing at your fingertips
newfile.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 NEWDOC_H
8 #define NEWDOC_H
9 
10 #include <QDialog>
11 #include <QDropEvent>
12 #include <QDragEnterEvent>
13 #include <QDragLeaveEvent>
14 #include <QDragMoveEvent>
15 #include <QListWidget>
16 class QFormLayout;
17 class QGridLayout;
18 class QHBoxLayout;
19 class QVBoxLayout;
20 class QFrame;
21 class QListWidgetItem;
22 class QGroupBox;
23 class QSpinBox;
24 class QLabel;
25 class QCheckBox;
26 class QPushButton;
27 #include "scribusapi.h"
28 #include "scribusstructs.h"
29 
30 #include "ui/customfdialog.h"
31 #include "ui/nftwidget.h"
32 
33 class PrefsManager;
34 class MarginWidget;
35 class ScrSpinBox;
36 class ScComboBox;
37 class QFileDialog;
38 
39 class SCRIBUS_API PageLayoutsWidget : public QListWidget
40 {
41  Q_OBJECT
42 
43 public:
44  PageLayoutsWidget(QWidget* parent);
45  ~PageLayoutsWidget() {};
46  void arrangeIcons();
47  QSize minimumSizeHint() const;
48  int maxX;
49  int maxY;
50 };
51 
52 
53 class SCRIBUS_API NewDoc : public QDialog
54 {
55  Q_OBJECT
56 
57 public:
58 
60  enum {
61  NewDocumentTab = 0,
62  NewFromTemplateTab,
63  OpenExistingTab,
64  OpenRecentTab
65  } ActionSelected;
66 
67  NewDoc( QWidget* parent, const QStringList& recentDocs, bool startUp = false, QString lang = "");
68  ~NewDoc() {};
69  void createNewDocPage();
70  void createNewFromTempPage();
71  void createOpenDocPage();
72  void createRecentDocPage();
73  void setSize(QString gr);
74  QTabWidget* tabWidget;
75  QFrame* newDocFrame;
76  PageLayoutsWidget* layoutsView;
77  QLabel* layoutLabel1;
78  ScComboBox* firstPage;
79  QGroupBox* pageSizeGroupBox;
80  MarginWidget* marginGroup;
81  QGroupBox* optionsGroupBox;
82  QLabel* TextLabel1;
83  QLabel* TextLabel2;
84  QLabel* TextLabel3;
85  QLabel* TextLabel4;
86  QLabel* TextLabel1_2;
87  QLabel* TextLabel1_3;
88  QLabel* pageCountLabel;
89  QLabel* TextLabel2_2;
90  QLabel* unitOfMeasureLabel;
91  QComboBox* pageSizeComboBox;
92  QComboBox* pageOrientationComboBox;
93  QComboBox* unitOfMeasureComboBox;
94  QCheckBox* startUpDialog;
95  QCheckBox* autoTextFrame;
96  QCheckBox* startDocSetup;
97  ScrSpinBox* Distance;
98  QSpinBox* numberOfCols;
99  QSpinBox* pageCountSpinBox;
100  ScrSpinBox* widthSpinBox;
101  ScrSpinBox* heightSpinBox;
102  QFrame* openDocFrame;
103  QFileDialog *fileDialog;
104  QFrame* newFromTempFrame;
105  nftwidget *nftGui;
106  QFrame* recentDocFrame;
107  QListWidget* recentDocListBox;
108  QPushButton* OKButton;
109  QPushButton* CancelB;
110 
111  bool onStartup(void) const { return m_onStartup;}
112  int tabSelected(void) const { return m_tabSelected;}
113  QString selectedFile(void) const { return m_selectedFile; }
114 
115  int unitIndex(void) const { return m_unitIndex;}
116  QString unitSuffix(void) const { return m_unitSuffix;}
117  double unitRatio(void) const { return m_unitRatio; }
118 
119  int orientation(void) const { return m_orientation;}
120  int precision(void) const { return m_precision;}
121  int choosenLayout(void) const { return m_choosenLayout;}
122  double pageWidth(void) const { return m_pageWidth;}
123  double pageHeight(void) const { return m_pageHeight;}
124  double distance(void) const { return m_distance;}
125  double bleedBottom(void) const { return m_bleedBottom;}
126  double bleedTop(void) const { return m_bleedTop;}
127  double bleedLeft(void) const { return m_bleedLeft;}
128  double bleedRight(void) const { return m_bleedRight;}
129 
130 public slots:
131  void setHeight(double v);
132  void setWidth(double v);
133  void selectItem(uint nr);
134  void itemSelected(QListWidgetItem* ic);
135  void handleAutoFrame();
136  void setDistance(double v);
137  void setUnit(int u);
138  void ExitOK();
139  void setOrientation(int ori);
140  void setPageSize(const QString &);
141  void setDocLayout(int layout);
145  void recentDocListBox_doubleClicked();
146  void openFile();
147  void adjustTitles(int tab);
148  void locationDropped(QString fileUrl);
149  void gotoParentDirectory();
150  void gotoSelectedDirectory();
151  void gotoDesktopDirectory();
152  void gotoHomeDirectory();
153 
154 protected:
155  QVBoxLayout* TabbedNewDocLayout;
156  QHBoxLayout* Layout1;
157  QGridLayout* NewDocLayout;
158  QGridLayout* pageSizeGroupBoxLayout;
159  QFormLayout* optionsGroupBoxLayout;
160  QVBoxLayout* openDocLayout;
161  QVBoxLayout* recentDocLayout;
162  QVBoxLayout *verticalLayout;
163  PrefsManager* prefsManager;
164  QStringList recentDocList;
165 
166  double m_unitRatio;
167  int m_orientation;
168  int m_precision;
169  int m_choosenLayout;
170  double m_pageWidth;
171  double m_pageHeight;
172  double m_distance;
173  QString m_unitSuffix;
174  QString m_selectedFile;
175  int m_unitIndex;
176  int m_tabSelected;
177  bool m_onStartup;
178  double m_bleedBottom;
179  double m_bleedTop;
180  double m_bleedLeft;
181  double m_bleedRight;
182 };
183 
184 #endif // NEWDOC_H
Widget for Margins setting. Used e.g. in "New Doc Dialog" or "Preferences".
Definition: marginwidget.h:28
Definition: nftwidget.h:26
Definition: newfile.h:53
The ScComboBox widget always uses a listbox instead of a popup, independent of any QStyle...
Definition: sccombobox.h:26
Definition: newfile.h:39
ScrSpinBox is a Qt4 replacement for our old ScrSpinBox using Qt3.
Definition: scrspinbox.h:21
Coord distance(Point const &a, Point const &b)
Definition: point.h:205
Manage Scribus preferences here, and here alone Start to move the preferences out of scribus...
Definition: prefsmanager.h:43