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                           scribus.h  -  description
9                              -------------------
10     begin                : Fre Apr  6 21:09:31 CEST 2001
11     copyright            : (C) 2001 by Franz Schmid
12     email                : Franz.Schmid@altmuehlnet.de
13  ***************************************************************************/
14 
15 /***************************************************************************
16  *                                                                         *
17  *   This program is free software; you can redistribute it and/or modify  *
18  *   it under the terms of the GNU General Public License as published by  *
19  *   the Free Software Foundation; either version 2 of the License, or     *
20  *   (at your option) any later version.                                   *
21  *                                                                         *
22  ***************************************************************************/
23 
24 #ifndef SCRIBUS_H
25 #define SCRIBUS_H
26 
27 #define VERS13x
28 
29 // include from stl
30 #include <vector>
31 
32 // include files for QT
33 
34 #include <QActionGroup>
35 #include <QClipboard>
36 #include <QImage>
37 #include <QKeyEvent>
38 #include <QMainWindow>
39 #include <QMap>
40 #include <QMultiHash>
41 #include <QPointer>
42 #include <QPushButton>
43 #include <QProcess>
44 #include <QString>
45 
46 class QCloseEvent;
47 class QDragEnterEvent;
48 class QDropEvent;
49 class QEvent;
50 class QKeyEvent;
51 class QLabel;
52 class QMdiArea;
53 class QMdiSubWindow;
54 class QQuickView;
55 
56 // application specific includes
57 #include "scribusapi.h"
58 #include "scribusdoc.h"
59 #include "styleoptions.h"
60 #include "ui/customfdialog.h"
61 #include "ui/scmessagebox.h"
62 
63 class ActionManager;
64 class AlignDistributePalette;
65 class AppModeHelper;
66 class Autoforms;
67 class Biblio;
68 class BookPalette;
69 class CharSelect;
70 class CheckDocument;
71 class ColorCombo;
72 class DownloadsPalette;
73 class EditToolBar;
74 class FileToolBar;
75 class FontCombo;
76 class FormatsManager;
77 class GuideManager;
78 class HelpBrowser;
79 class InlinePalette;
80 class LayerPalette;
81 class MarksManager;
82 class Measurements;
83 class ModeToolBar;
84 class NodePalette;
85 class NotesStylesEditor;
86 class OutlinePalette;
87 class PDFToolBar;
88 class PSLib;
89 class PageItem;
90 class PagePalette;
91 class PageSelector;
92 class PrefsContext;
93 class PrefsManager;
94 class ContentPalette;
95 class PropertiesPalette;
96 class ResourceManager;
97 class ScMWMenuManager;
98 class ScToolBar;
99 class ScrAction;
100 class ScrSpinBox;
101 class ScribusCore;
102 class ScribusDoc;
103 class ScribusMainWindow;
104 class ScribusQApp;
105 class ScribusWin;
106 class SimpleState;
107 class StoryEditor;
108 class StyleManager;
109 class SymbolPalette;
110 class TOCGenerator;
111 class UndoManager;
112 class UndoPalette;
113 class UndoState;
114 class ViewToolBar;
115 
116 extern SCRIBUS_API ScribusQApp* ScQApp;
117 
118 /**
119   * \brief This Class is the base class for your application. It sets up the main
120   * window and providing a menubar, toolbar
121   * and statusbar. For the main view, an instance of class ScribusView is
122   * created which creates your view.
123   */
124 class SCRIBUS_API ScribusMainWindow : public QMainWindow, public UndoObject
125 {
126 	Q_OBJECT
127 
128 public:
129 	/** \brief constructor */
130 	ScribusMainWindow();
131 	/** \brief destructor */
132 	~ScribusMainWindow();
133 	/*!
134 	* \retval 0 - ok, 1 - no fonts, ...
135 	*/
136 	int initScMW(bool primaryMainWindow);
137 	void setupMainWindow();
138 	int getScreenNumber() const;
139 	QScreen* getScreen() const;
140 	void getScreenPosition(int& xPos, int& yPos) const;
141 	void getScreenDPI(int& dpiX, int& dpiY) const;
142 	void addScToolBar(ScToolBar *tb, const QString& name);
143 	bool warningVersion(QWidget *parent);
144 	void SetShortCut();
145 	void startUpDialog();
146 	void setDefaultPrinter(const QString&, const QString&, const QString&);
147 	void getDefaultPrinter(QString& name, QString& file, QString& command);
148 
scriptIsRunning(void)149 	inline bool scriptIsRunning(void) const { return (m_ScriptRunning > 0); }
setScriptRunning(bool value)150 	inline void setScriptRunning(bool value) { m_ScriptRunning += (value ? 1 : -1); }
151 
152 	ScribusDoc *doFileNew(double width, double height, double topMargin, double leftMargin, double rightMargin, double bottomMargin, double columnDistance, double columnCount, bool autoTextFrames, int pageArrangement, int unitIndex, int firstPageLocation, int orientation, int firstPageNumber, const QString& defaultPageSize, bool requiresGUI, int pageCount=1, bool showView=true, int marginPreset=0);
153 	ScribusDoc *newDoc(double width, double height, double topMargin, double leftMargin, double rightMargin, double bottomMargin, double columnDistance, double columnCount, bool autoTextFrames, int pageArrangement, int unitIndex, int firstPageLocation, int orientation, int firstPageNumber, const QString& defaultPageSize, bool requiresGUI, int pageCount=1, bool showView=true, int marginPreset=0);
154 	bool DoFileSave(const QString& fileName, QString* savedFileName = nullptr);
155 
156 	void changeEvent(QEvent *e) override;
157 	void closeEvent(QCloseEvent *ce) override;
158 	void keyPressEvent(QKeyEvent *k) override;
159 	void keyReleaseEvent(QKeyEvent *k) override;
160 	void inputMethodEvent (QInputMethodEvent *event) override;
161 	QVariant inputMethodQuery ( Qt::InputMethodQuery query ) const override;
162 
163 	void requestUpdate(int);
164 	void setTBvals(PageItem *currItem);
165 	int ShowSubs();
166 	void applyNewMaster(const QString& name);
167 	void updateRecent(const QString& fn);
168 	void doPasteRecent(const QString& data);
169 	bool getPDFDriver(const QString & filename, const std::vector<int> & pageNumbers, const QMap<int, QImage> & thumbs, QString& error, bool* cancelled = nullptr);
170 	bool DoSaveAsEps(const QString& fn, QString& error);
171 	QString CFileDialog(const QString& workingDirectory = ".", const QString& dialogCaption = "", const QString& fileFilter = "", const QString& defNa = "",
172 						int optionFlags = fdExistingFiles, bool *useCompression = 0, bool *useFonts = 0, bool *useProfiles = 0);
173 	/*! \brief Recalculate the colors after changing CMS settings.
174 	Call the appropriate document function and then update the GUI elements.
175 	\param dia optional progress widget */
176 	void recalcColors();
177 	void SwitchWin();
178 	void RestoreBookMarks();
179 	QStringList  scrapbookNames();
180 	void updateLayerMenu();
181 	void emergencySave();
182 	QStringList findRecoverableFile();
183 	bool recoverFile(const QStringList& foundFiles);
184 
185 	/**
186 	 * @brief Returns true if an arrow key is pressed down.
187 	 * @return true if an arrow key is pressed down otherwise returns false
188 	 */
189 	//bool arrowKeyDown();
190 
191 	/**
192 	 * @brief Returns true if application is in object specific undo mode, other wise returns false.
193 	 * @return true if application is in object specific undo mode, other wise returns false
194 	 */
195 	bool isObjectSpecificUndo();
196 	void restore(UndoState* state, bool isUndo) override;
197 	void restoreGrouping(SimpleState *state, bool isUndo);
198 	void restoreUngrouping(SimpleState *state, bool isUndo);
199 	void restoreAddPage(SimpleState *state, bool isUndo);
200 	void restoreDeletePage(SimpleState *state, bool isUndo);
201 	void setPreviewToolbar();
202 	void updateFromDrop();
203 	struct CopyContentsBuffer contentsBuffer;
204 	bool internalCopy;
205 	QString internalCopyBuffer;
206 	int  HaveDoc;
207 	PrefsContext* dirs {nullptr};
208 	/** \brief view is the main widget which represents your working area. The View
209 	 * class should handle all events of the view widget.  It is kept empty so
210 	 * you can create your view according to your application's needs by
211 	 * changing the view class.
212 	 */
213 	ScribusView *view {nullptr};
214 	/** \brief doc represents your actual document and is created only once. It keeps
215 	 * information such as filename and does the serialization of your files.
216 	 */
217 	ScribusDoc *doc {nullptr};
218 	/** \brief private doc for managing default patterns. */
219 	ScribusDoc* m_doc {nullptr};
220 
221 
222 	QProgressBar* mainWindowProgressBar {nullptr};
223 	ScrSpinBox* zoomSpinBox; //zoom spinbox at bottom of view
224 	PageSelector* pageSelector; //Page selector at bottom of view
225 	QPushButton *zoomDefaultToolbarButton {nullptr};
226 	QPushButton *zoomOutToolbarButton {nullptr};
227 	QPushButton *zoomInToolbarButton {nullptr};
228 	QComboBox *layerMenu {nullptr}; //Menu for layers at bottom of view
229 	QComboBox *unitSwitcher {nullptr}; //Menu for units at bottom of view
230 	EditToolBar *editToolBar {nullptr};
231 	FileToolBar *fileToolBar {nullptr};
232 	ModeToolBar* modeToolBar {nullptr};
233 	PDFToolBar* pdfToolBar {nullptr};
234 	ViewToolBar* viewToolBar {nullptr};
235 	QLabel* mainWindowXPosLabel {nullptr};
236 	QLabel* mainWindowXPosDataLabel {nullptr};
237 	QLabel* mainWindowYPosLabel {nullptr};
238 	QLabel* mainWindowYPosDataLabel {nullptr};
239 	GuideManager *guidePalette {nullptr};
240 	CharSelect *charPalette {nullptr};
241 	PropertiesPalette *propertiesPalette {nullptr};
242 	ContentPalette *contentPalette {nullptr};
243 	MarksManager *marksManager {nullptr};
244 	NotesStylesEditor *nsEditor {nullptr};
245 	NodePalette *nodePalette {nullptr};
246 	OutlinePalette *outlinePalette {nullptr};
247 	Biblio *scrapbookPalette {nullptr};
248 	LayerPalette* layerPalette {nullptr};
249 	PagePalette *pagePalette {nullptr};
250 	BookPalette *bookmarkPalette {nullptr};
251 	DownloadsPalette *downloadsPalette {nullptr};
252 	SymbolPalette *symbolPalette {nullptr};
253 	InlinePalette *inlinePalette {nullptr};
254 	Measurements* measurementPalette {nullptr};
255 	CheckDocument * docCheckerPalette {nullptr};
256 	UndoPalette* undoPalette {nullptr};
257 	AlignDistributePalette *alignDistributePalette {nullptr};
258 	ResourceManager *resourceManager {nullptr};
259 	StoryEditor* storyEditor {nullptr};
260 	StoryEditor* CurrStED {nullptr};
261 	QMdiArea *mdiArea {nullptr};
262 	ScribusWin* ActWin {nullptr};
263 	QClipboard *ClipB {nullptr};
264 	QString LoadEnc;
265 	AppModeHelper *appModeHelper {nullptr};
266 
267 	QMap<QString, QPointer<ScrAction> > scrActions;
268 	QMap<QString, QPointer<ScrAction> > scrRecentFileActions;
269 	QMap<QString, QPointer<ScrAction> > scrWindowsActions;
270 	QMap<QString, QPointer<ScrAction> > scrScrapActions;
271 	QMap<QString, QPointer<ScrAction> > scrLayersActions;
272 	QMap<QString, QPointer<ScrAction> > scrRecentPasteActions;
273 	QMap<QString, QPointer<ScToolBar> > scrToolBars;
274 	QMultiHash<QString, QActionGroup*> scrActionGroups;
275 	ScMWMenuManager* scrMenuMgr {nullptr};
276 	ActionManager* actionManager {nullptr};
277 	QStringList m_recentDocsList;
278 	QStringList patternsDependingOnThis;
279 
280 public slots:
281 	void iconSetChange();
282 	void languageChange();
283 	void localeChange();
284 	void statusBarLanguageChange();
285 	void specialActionKeyEvent(int unicodevalue);
286 	void newView();
287 	void ToggleStickyTools();
288 	void ToggleAllGuides();
289 	void ToggleAllPalettes();
290 	void slotStoryEditor(bool fromTable);
291 	void slotCharSelect();
292 	void ImageEffects();
293 	QString fileCollect(const bool compress = false, const bool withFonts = false, const bool withProfiles = false, const QString& newDirectory=QString());
294 	void AddBookMark(PageItem *ite);
295 	void DelBookMark(PageItem *ite);
296 	void BookMarkTxT(PageItem *ite);
297 	void StoreBookmarks();
298 	void setStatusBarMousePosition(double xp, double yp);
299 	void setStatusBarTextPosition(double base, double xp);
300 	void setStatusBarTextSelectedItemInfo();
301 	void setTempStatusBarText(const QString &text);
302 	void setStatusBarInfoText(const QString& newText);
303 	bool DoFileClose();
304 	void windowsMenuAboutToShow();
305 	//! \brief Handle the Extras menu for its items availability.
306 	void extrasMenuAboutToShow();
307 	void newActWin(QMdiSubWindow *w);
308 	void closeActiveWindowMasterPageEditor();
309 	void updateActiveWindowCaption(const QString &newCaption);
310 	void windowsMenuActivated(int id);
311 	void PutScrap(int scID);
312 	void PutToInline(const QString& buffer);
313 	void PutToInline();
314 	void PutToPatterns();
315 	void ConvertToSymbol();
316 	void changeLayer(int);
317 	void setLayerMenuText(const QString &);
318 	void showLayer();
319 	void slotSetCurrentPage(int pageIndex);
320 	void setCurrentPage(int p);
321 	void ManageJava();
322 	void editSelectedSymbolStart();
323 	void editSymbolStart(const QString& temp);
324 	void editSymbolEnd();
325 	void editInlineStart(int id);
326 	void editInlineEnd();
327 	void editMasterPagesStart(const QString& temp = "");
328 	void editMasterPagesEnd();
329 	/** \brief generate a new document in the current view */
330 	bool slotFileNew();
331 	void newFileFromTemplate();
332 	bool slotPageImport();
333 	bool loadPage(const QString& fileName, int Nr, bool Mpa, const QString& renamedPageName=QString());
334 	void gotoLayer(int l);
335 	void slotGetContent();
336 	void slotGetContent2(); // kk2006
337 	void slotGetClipboardImage();
338 	void toogleInlineState();
339 	/*!
340 	\author Franz Schmid
341 	\brief Appends a Textfile to the Text in the selected Textframe at the Cursorposition
342 	*/
343 	void slotFileAppend();
344 
345 	void removeRecent(const QString& fn, bool fromFileWatcher = false);
346 	void removeRecentFromWatcher(const QString& filename);
347 	void loadRecent(const QString& filename);
348 	void rebuildRecentFileMenu();
349 	void rebuildRecentPasteMenu();
350 	void rebuildScrapbookMenu();
351 	void pasteRecent(const QString& fn);
352 	void pasteFromScrapbook(const QString& fn);
353 	void importVectorFile();
354 	void rebuildLayersList();
355 	bool slotFileOpen();
356 	bool loadDoc(const QString& );
357 	/**
358 	 * @brief Do post loading functions
359 	 */
360 	bool postLoadDoc();
361 	/** \brief save a document */
362 	bool slotFileSave();
363 	/** \brief save a document under a different filename*/
364 	bool slotFileSaveAs();
365 	void slotFileRevert();
366 	/** \brief Sichert den Text eines Elements */
367 	void SaveText();
368 	/** \brief close the actual file */
369 	bool slotFileClose();
370 	/** \brief print the actual file */
371 	void slotFilePrint();
372 	void slotReallyPrint();
373 	void slotEndSpecialEdit();
374 	/*!
375 	\author Franz Schmid
376 	\brief Generate and print PostScript from a doc
377 	\param options PrintOptions struct to control all settings
378 	\param error   Error Message in case of failure
379 	\sa ScribusMainWindow::slotFilePrint()
380 	\retval bool True for success */
381 	bool doPrint(PrintOptions &options, QString& error);
382 	/** \brief exits the application */
383 	void slotFileQuit();
384 	/** \brief put the marked text/object into the clipboard and remove
385 	 * it from the document */
386 	void slotEditCut();
387 	/** \brief put the marked text/object into the clipboard*/
388 	void slotEditCopy();
389 	/** \brief paste the clipboard into the document*/
390 	void slotEditPaste();
391 	void slotEditCopyContents();
392 	void slotEditPasteContents(int absolute=0);
393 	void SelectAll(bool docWideSelect=false);
394 	void SelectAllOnLayer();
395 	void deselectAll();
396 	void ClipChange();
397 	void setCopyCutEnabled(bool b);
398 	/** \brief shows an about dialog*/
399 	void slotHelpAbout();
400 	void slotHelpAboutPlugins();
401     void slotHelpAboutQt();
402 	void slotHelpActionSearch();
403 	void slotHelpCheckUpdates();
404 	void slotRaiseOnlineHelp();
405 	void slotOnlineHelp(const QString & jumpToSection=QString(), const QString & jumpToFile=QString());
406 	void slotOnlineHelpClosed();
407 	void slotResourceManager();
408 	void ToggleTips();
409 	void ToggleMouseTips();
410 	/** \brief Erzeugt eine neue Seite */
411 	void slotNewPageP(int wo, const QString& templ);
412 	void slotNewPageM();
413 	void slotNewMasterPage(int w, const QString &);
414 	void slotNewPage(int w, const QString& masterPageName=QString(), bool mov = true);
415 	void duplicateToMasterPage();
416 	/** \brief Loescht die aktuelle Seite */
417 	void deletePage();
418 	/**
419 	 * \brief Delete pages
420 	 * @param from First page to delete
421 	 * @param to Last page to delete
422 	 */
423 	void deletePage(int from, int to);
424 	void deletePage2(int pg);
425 	/** \brief Verschiebt Seiten */
426 	void movePage();
427 	void copyPage();
428 	void changePageProperties();
429 	/*!
430 	\author Craig Bradney
431 	\date Sun 30 Jan 2005
432 	\brief Zoom the view.
433 	Take the main window zoom actions and pass the view a %. Actions have whole number values like 20.0, 100.0, etc. Zoom to Fit uses -100 as a marker.
434 	\param zoomFactor Value stored in the ScrAction.
435 	 */
436 	void slotZoom(double zoomFactor); // 20, 50, 100, or -100 for Fit
437 	/** \brief Schaltet Raender ein/aus */
438 	void toggleMarks();
439 	void toggleBleeds();
440 	void toggleFrames();
441 	void toggleLayerMarkers();
442 	void toggleTextLinks();
443 	void toggleTextControls();
444 	void toggleColumnBorders();
445 	void toggleRulers();
446 	void toggleRulerMode();
447 	void togglePagePalette();
448 	void toggleUndoPalette();
449 	void setUndoPalette(bool visible);
450 	void toggleCheckPal();
451 	/** \brief Schaltet M_ViewShowImages ein/aus */
452 	void toggleImageVisibility();
453 	/** \brief Schaltet Raster ein/aus */
454 	void toggleGrid();
455 	/** \brief Schaltet Rasterbenutzung ein/aus */
456 	void toggleSnapGrid();
457 	/** \brief Schaltet Rahmenbearbeitung ein/aus */
458 	void toggleNodeEdit();
459 	void slotSelect();
460 	/** \brief Switch appMode
461 	\param mode TODO learn modes*/
462 	void setAppModeByToggle(bool isOn, int newMode);
463 	/** \brief Neues Dokument erzeugt */
464 	void HaveNewDoc();
465 	void HaveNewSel();
466 	/** Dokument ist geaendert worden */
467 	void slotDocCh(bool reb = true);
468 	/** Setzt die Abstufung */
469 	//void setItemShade(int id);
470 	/** Setz die Zeichensatzgroesse */
471 	void setItemFontSize(int fontSize);
472 	void setItemLanguage(const QString& language);
473 	/** Color Replacement */
474 	void slotReplaceColors();
475 	/** Style Manager */
476 
477 	/** Erzeugt einen Rahmen */
478 	void MakeFrame(int f, int c, double *vals);
479 	/** Duplicate current item */
480 	void duplicateItem();
481 	/** Multiple duplicate current item*/
482 	void duplicateItemMulti();
483 
484 	void objectAttributes();
485 	void getImageInfo();
486 	void generateTableOfContents();
487 	void updateDocument();
488 
489 	void setNewAlignment(int i);
490 	void setNewDirection(int i);
491 	void setNewParStyle(const QString& name);
492 	void setNewCharStyle(const QString& name);
493 	void setAlignmentValue(int i);
494 	void setDirectionValue(int i);
495 	void editItemsFromOutlines(PageItem *ite);
496 	//0= center, 1 = top left.
497 	void selectItemsFromOutlines(PageItem *ite, bool single = false, int position = 0);
498 	void selectItemFromOutlines(PageItem *ite, bool single, int cPos);
499 	void selectPagesFromOutlines(int ScPage);
500 	void doPrintPreview();
501 	void printPreview();
502 	void doOutputPreviewPDF();
503 	void outputPreviewPDF();
504 	void doOutputPreviewPS();
505 	void outputPreviewPS();
506 	void SaveAsEps();
507 	void reallySaveAsEps();
508 	void SaveAsPDF();
509 	void doSaveAsPDF();
510 	void setMainWindowActive();
511 	void setItemEffects(int h);
512 	void setStyleEffects(int s);
513 	void setItemTypeStyle(int id);
514 	void slotElemRead(const QString& Name, double x, double y, bool art, bool loca, ScribusDoc* docc, ScribusView* vie);
515 	void slotChangeUnit(int art, bool draw = true);
516 	/*!
517 	 * @brief Apply master pages from the Apply Master Page dialog
518 	 * @todo Make this work with real page numbers, negative numbers and document sections when they are implemented
519 	*/
520 	void ApplyMasterPage();
521 	void Apply_MasterPage(const QString& pageName, int pageNumber, bool reb = true);
522 	void GroupObj(bool showLockDia = true);
523 	void UnGroupObj();
524 	void AdjustGroupObj();
525 	void StatusPic();
526 	void ModifyAnnot();
527 	void toggleGuides();
528 	void toggleBase();
529 	void toggleSnapGuides();
530 	void toggleSnapElements();
531 	void SetSnapElements(bool b);
532 	void EditTabs();
533 	void SearchText();
534 	/*! \brief call gimp and wait upon completion */
535 	void callImageEditor();
536 	void docCheckToggle(bool visible);
537 	//! \brief Scan a document for errors, return true on errors found
538 	bool scanDocument();
539 	void setUndoMode(bool isObjectSpecific);
540 	//! \brief Apply a Lorem Ipsum to the each item in a selection
541 	void insertSampleText();
542 	void updateItemLayerList();
543 	void updateColorLists();
544 	/*! \brief Change Preferences dialog.
545 	See prefsOrg for more info. It's very similar to docSetup/slotDocSetup. */
546 	void slotPrefsOrg();
547 	/** \brief Refromat the document when user click "OK" in ReformDoc dialog.
548 	See docSetup() for more info. */
549 	void slotDocSetup();
550 	//! \brief Insert a frame friendly dialog
551 	void slotInsertFrame();
552 	//! \brief Transform an item
553 	void slotItemTransform();
554 	//! \brief manages paints
555 	void manageColorsAndFills();
556 	//! \brief allow SE to get the SM for edit stlyes
styleMgr()557 	StyleManager *styleMgr() const {return m_styleManager;};
558 	//! \brief drawnew, call palettes to update for new page layout
559 	void updateGUIAfterPagesChanged();
560 	/**
561 	 * Enables/disables the actions in the "Table" menu.
562 	 *
563 	 * This has a functions of its own, since it needs to be called from the table edit
564 	 * canvas modes/gestures.
565 	 */
566 	void updateTableMenuActions();
emitUpdateRequest(int updateFlags)567 	void emitUpdateRequest(int updateFlags) { emit UpdateRequest(updateFlags); }
568 
569 	//inserting marks
slotInsertMark2Mark()570 	void slotInsertMark2Mark() { insertMark(MARK2MarkType); }
slotInsertMarkAnchor()571 	void slotInsertMarkAnchor() { insertMark(MARKAnchorType); }
slotInsertMarkVariableText()572 	void slotInsertMarkVariableText() { insertMark(MARKVariableTextType); }
slotInsertMarkItem()573 	void slotInsertMarkItem() { insertMark(MARK2ItemType); }
574 	void slotInsertMarkNote();
slotInsertMarkIndex()575 	void slotInsertMarkIndex() { insertMark(MARKIndexType); }
576 	void slotEditMark();
577 	//connected to signal emitted by actions when "Update Marks" menu item is triggered
578 	void slotUpdateMarks();
579 	bool editMarkDlg(Mark *mrk, PageItem_TextFrame* currItem = nullptr);
580 //	void testQT_slot1(QString);
581 //	void testQT_slot2(double);
582 //	void testQT_slot3(int);
583 //	void testQT_slot4();
584 	void changePreviewQuality(int index);
585 	void enablePalettes(bool b);
586 	void ToggleFrameEdit();
587 	void NoFrameEdit();
588 
589 signals:
590 	void TextStyle(const ParagraphStyle&);
591 //deprecated: (av)
592 	void TextEffects(int);
593 	void UpdateRequest(int updateFlags);
594 	void changeLayers(int);
595 
596 protected:
597 	/*!
598 	\brief Receive key events from palettes such as palette hiding events. Possibly easier way but this is cleaner than before. No need to modify all those palettes and each new one in future.
599 	 */
600 	bool eventFilter( QObject *o, QEvent *e ) override;
601 	void dragEnterEvent( QDragEnterEvent* e) override;
602 	void dropEvent( QDropEvent* e) override;
603 
604 private:
605     /** init methods */
606 	void initSplash(bool showSplash);
607 	void initMdiArea();
608 	void initMenuBar(); // initMenuBar creates the menu_bar and inserts the menuitems
609 	void createMenuBar();
610 	void addDefaultWindowMenuItems(); // addDefaultWindowMenuItems adds the basic Windows menu items, excluding the actual list of windows
611 	void initStatusBar(); // setup the statusbar
612 	void initToolBars(); // setup the toolbars
613 	void setStyleSheet(); //set stylesheet for app
614 	//Returns false when there are no fonts
615 	void initHyphenator();
616 	void initDefaultValues();
617 	void initKeyboardShortcuts();
618 	void initPalettes();
619 	void initScrapbook();
620 	void updateColorMenu(QProgressBar* progressBar=nullptr);
621 
622 	int m_ScriptRunning {0};
623 
624 	QLabel* m_mainWindowStatusLabel {nullptr};
625 	QString m_statusLabelText;
626 	//QPixmap noIcon;
627 
628 	int m_toolbarMenuTools;
629 	int m_toolbarMenuPDFTools;
630 	int m_viewToolbars;
631 	int m_viewPropertiesPalette;
632 	int m_viewPropertiesPaletteText;
633 	int m_viewOutlinePalette;
634 	int m_viewNodePalette;
635 	int m_viewBpal;
636 	int m_viewLayerPalette;
637 	int m_viewPagePalette;
638 	int m_viewBopal;
639 	int m_viewUndoPalette;
640 
641 	bool m_palettesStatus[13];
642 	bool m_guidesStatus[13];
643 
644 	//bool m_keyrep;
645 	/** @brief Tells if an arrow key is pressed down */
646 	//bool m_arrowKeyDown;
647 	/** @brief tells the undo mode */
648 	bool m_objectSpecificUndo;
649 
650 	//CB: #8212: add overrideMasterPageSizing, however default to true for compatibility with other calls.. for now
651 	void addNewPages(int wo, int where, int numPages, double height, double width, int orient, const QString& siz, bool mov, QStringList* basedOn = 0, bool overrideMasterPageSizing=true);
652 
653 	int m_DocNr;
654 	bool m_PrinterUsed;
655 	struct PDe {
656 					QString Pname;
657 					QString Dname;
658 					QString Command;
659 				} PDef ;
660 	TOCGenerator *m_tocGenerator {nullptr};
661 
662 	StyleManager *m_styleManager {nullptr};
663 	UndoManager *m_undoManager {nullptr};
664 	PrefsManager& m_prefsManager;
665 	FormatsManager *m_formatsManager {nullptr};
666 
667 	QPointer<HelpBrowser> m_helpBrowser;
668 	QString m_osgFilterString;
669 
670 	void insertMark(MarkType);
671 	bool insertMarkDialog(PageItem_TextFrame* item, MarkType mT, ScItemsState* &is);
672 	int m_marksCount; //remember marks count from last call
673 	bool m_WasAutoSave;
674 	bool m_pagePalVisible;
675 };
676 
677 #endif
678