Scribus
Open source desktop publishing at your fingertips
checkDocument.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 CHECKDOCUMENT_H
8 #define CHECKDOCUMENT_H
9 
10 #include <QMap>
11 #include <QPair>
12 #include <QPointer>
13 #include <QString>
14 
15 class QEvent;
16 class QHBoxLayout;
17 class QLabel;
18 class QPushButton;
19 class QTreeWidget;
20 class QTreeWidgetItem;
21 class QVBoxLayout;
22 
23 #include "scribusapi.h"
24 
25 #include "pageitem.h"
26 #include "scribusstructs.h"
27 #include "ui/scrpalettebase.h"
28 
29 class ScribusDoc;
30 class ScComboBox;
31 class ScPage;
32 
37 class SCRIBUS_API CheckDocument : public ScrPaletteBase
38 {
39  Q_OBJECT
40 
41 public:
42  CheckDocument( QWidget* parent, bool modal );
43  ~CheckDocument() {};
44 
45  virtual void changeEvent(QEvent *e);
46  void setDoc(ScribusDoc *doc);
47 
49  enum CheckMode { checkNULL, checkPDF, checkEPS, checkPrint, checkPrintPreview };
50 
52  void clearErrorList();
63  void buildErrorList(ScribusDoc *doc);
66  void setIgnoreEnabled(bool state);
69  bool isIgnoreEnabled();
70 
73 
74 public slots:
77  void slotSelect(QTreeWidgetItem* ite);
79  void doReScan();
82  void newScan(const QString& name);
83 
84 signals:
85  //void rescan();
87  void selectElement(PageItem *, bool, int);
88  void selectElementByItem(PageItem *, bool);
90  void selectPage(int);
92  void selectMasterPage(QString);
94  void selectMasterPageElement(QString, int);
95  //void selectNormal();
97  void ignoreAllErrors();
98 
99 
100 
101 protected slots:
102  virtual void languageChange();
103 
104 protected:
105  QVBoxLayout* checkDocumentLayout;
106  QHBoxLayout* layout1;
107  QHBoxLayout* layout2;
109  QMap<QTreeWidgetItem*, QPointer<PageItem> > itemMap;
111  QMap<QTreeWidgetItem*, ScPage*> pageMap;
113  QMap<QTreeWidgetItem*, ScPage*> masterPageMap;
115  QMap<QTreeWidgetItem*, QPointer<PageItem> > masterPageItemMap;
117  QMap<QTreeWidgetItem*, int> posMap;
118 
122  QPixmap graveError;
124  QPixmap onlyWarning;
126  QPixmap noErrors;
127 
129  enum {
130  PV_ANNOTATION,
131  PV_APPLIED_MASTER_DIFF_SIDE,
132  PV_EMPTY_IMAGE_FRAME,
133  PV_EMPTY_TEXT_FRAME,
134  PV_FONT_NOT_EMBEDDED,
135  PV_HIGH_DPI,
136  PV_IMAGE_FRAME_PART_FILLED,
137  PV_IS_GIF,
138  PV_LOW_DPI,
139  PV_MISSING_GLYPH,
140  PV_MISSING_IMAGE,
141  PV_NON_ON_PAGE,
142  PV_NOT_CMYK_SPOT,
143  PV_RASTER_PDF,
144  PV_TEXT_OVERFLOW,
145  PV_TRANSPARENCY,
146  PV_WRONG_FONT,
147  PV_LAYER_TRANSPARENCY,
148  PV_LAYER_BLENDMODE,
149  PV_LAYER_PRINTVIS_MISMATCH
150  };
152  QMap<int, QPair<QString, QString> > warnMap;
153 
155  bool noButton;
156  ScComboBox* curCheckProfile;
157  QLabel* textLabel1;
158  QTreeWidget* reportDisplay;
159  QPushButton* ignoreErrors;
160  QPushButton* reScan;
161 
162 // bool globalGraveError;
163  bool pageGraveError;
164  bool itemError;
165  bool showPagesWithoutErrors;
166  bool showNonPrintingLayerErrors;
167 
168  int minResDPI;
169  int maxResDPI;
170 
182  void buildItem(QTreeWidgetItem * item,
183  PreflightError errorType,
184  PageItem * pageItem);
185 };
186 
187 #endif // CHECKDOCUMENT_H
QMap< int, QPair< QString, QString > > warnMap
Strings for common texts in GUI dialog tree.
Definition: checkDocument.h:152
QMap< QTreeWidgetItem *, QPointer< PageItem > > itemMap
Mappping Page Item - item nr.
Definition: checkDocument.h:109
QPixmap noErrors
Icon for OK.
Definition: checkDocument.h:126
Definition: scpage.h:46
QMap< QTreeWidgetItem *, int > posMap
Mappping Page Item - cursor position in item.
Definition: checkDocument.h:117
QPixmap onlyWarning
Icon for warning.
Definition: checkDocument.h:124
bool noButton
Flag if is ignore button shown. true = hidden, false = shown.
Definition: checkDocument.h:155
The ScComboBox widget always uses a listbox instead of a popup, independent of any QStyle...
Definition: sccombobox.h:26
the Document Class
Definition: scribusdoc.h:90
QMap< QTreeWidgetItem *, ScPage * > pageMap
Mappping Page - page nr.
Definition: checkDocument.h:111
QPixmap graveError
Icon for fatal error.
Definition: checkDocument.h:122
Preflight Verifier GUI (P.V.) A tool to check document for errors (in P.V. profiles) which can be set...
Definition: checkDocument.h:37
QMap< QTreeWidgetItem *, ScPage * > masterPageMap
Mappping Master Page - MP nr.
Definition: checkDocument.h:113
CheckMode
State of the P.V.
Definition: checkDocument.h:49
CheckMode checkMode
Current state of P.V.
Definition: checkDocument.h:72
Definition: pageitem.h:92
Definition: scrpalettebase.h:38
QMap< QTreeWidgetItem *, QPointer< PageItem > > masterPageItemMap
Mappping MP Item - MP item nr.
Definition: checkDocument.h:115
ScribusDoc * m_Doc
a reference to the current document
Definition: checkDocument.h:120