Subversion Repositories Scribus

Rev

Rev 24826 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
4430 cbradney 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
*/
3 paul 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
 
516 fschmid 27
#define VERS13x
3 paul 28
 
326 Franz 29
// include from stl
30
#include <vector>
31
 
3 paul 32
// include files for QT
16546 jghali 33
 
10185 cbradney 34
#include <QActionGroup>
10186 cbradney 35
#include <QClipboard>
22459 jghali 36
#include <QImage>
10185 cbradney 37
#include <QKeyEvent>
38
#include <QMainWindow>
39
#include <QMap>
9911 cbradney 40
#include <QMultiHash>
10185 cbradney 41
#include <QPointer>
19093 craig 42
#include <QPushButton>
10185 cbradney 43
#include <QProcess>
44
#include <QString>
3 paul 45
 
16546 jghali 46
class QCloseEvent;
47
class QDragEnterEvent;
48
class QDropEvent;
49
class QEvent;
50
class QKeyEvent;
51
class QLabel;
52
class QMdiArea;
53
class QMdiSubWindow;
19344 jghali 54
class QQuickView;
10185 cbradney 55
 
3 paul 56
// application specific includes
2969 craig 57
#include "scribusapi.h"
3 paul 58
#include "scribusdoc.h"
19093 craig 59
#include "styleoptions.h"
13552 cbradney 60
#include "ui/customfdialog.h"
19605 jghali 61
#include "ui/scmessagebox.h"
1208 cbradney 62
 
3699 cbradney 63
class ActionManager;
64
class AlignDistributePalette;
19495 craig 65
class AppModeHelper;
169 Franz 66
class Autoforms;
3699 cbradney 67
class Biblio;
68
class BookPalette;
10185 cbradney 69
class CharSelect;
3699 cbradney 70
class CheckDocument;
10185 cbradney 71
class ColorCombo;
19783 craig 72
class DownloadsPalette;
10976 cbradney 73
class EditToolBar;
74
class FileToolBar;
10185 cbradney 75
class FontCombo;
10181 cbradney 76
class FormatsManager;
5087 subik 77
class GuideManager;
10108 cbradney 78
class HelpBrowser;
17405 fschmid 79
class InlinePalette;
3699 cbradney 80
class LayerPalette;
17826 craig 81
class MarksManager;
284 Franz 82
class Measurements;
10185 cbradney 83
class ModeToolBar;
3699 cbradney 84
class NodePalette;
17826 craig 85
class NotesStylesEditor;
10976 cbradney 86
class OutlinePalette;
10185 cbradney 87
class PDFToolBar;
88
class PSLib;
3699 cbradney 89
class PageItem;
90
class PagePalette;
19093 craig 91
class PageSelector;
10185 cbradney 92
class PrefsContext;
2834 cbradney 93
class PrefsManager;
23282 craig 94
class ContentPalette;
10976 cbradney 95
class PropertiesPalette;
19821 craig 96
class ResourceManager;
97
class ScMWMenuManager;
10185 cbradney 98
class ScToolBar;
3699 cbradney 99
class ScrAction;
19821 craig 100
class ScrSpinBox;
101
class ScribusCore;
13805 jghali 102
class ScribusDoc;
4026 craig 103
class ScribusMainWindow;
3627 cbradney 104
class ScribusQApp;
3699 cbradney 105
class ScribusWin;
106
class SimpleState;
107
class StoryEditor;
4829 tsoots 108
class StyleManager;
15060 fschmid 109
class SymbolPalette;
3699 cbradney 110
class TOCGenerator;
111
class UndoManager;
112
class UndoPalette;
113
class UndoState;
19009 craig 114
class ViewToolBar;
3205 craig 115
 
4194 fschmid 116
extern SCRIBUS_API ScribusQApp* ScQApp;
3205 craig 117
 
3 paul 118
/**
4650 subik 119
  * \brief This Class is the base class for your application. It sets up the main
3 paul 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
  */
10184 cbradney 124
class SCRIBUS_API ScribusMainWindow : public QMainWindow, public UndoObject
3 paul 125
{
162 Franz 126
        Q_OBJECT
1429 subik 127
 
168 Franz 128
public:
4650 subik 129
        /** \brief constructor */
4026 craig 130
        ScribusMainWindow();
4650 subik 131
        /** \brief destructor */
4208 craig 132
        ~ScribusMainWindow();
4650 subik 133
        /*!
134
        * \retval 0 - ok, 1 - no fonts, ...
135
        */
23700 craig 136
        int initScMW(bool primaryMainWindow);
23568 craig 137
        void setupMainWindow();
23577 craig 138
        int getScreenNumber() const;
139
        QScreen* getScreen() const;
140
        void getScreenPosition(int& xPos, int& yPos) const;
141
        void getScreenDPI(int& dpiX, int& dpiY) const;
22635 craig 142
        void addScToolBar(ScToolBar *tb, const QString& name);
1525 cbradney 143
        bool warningVersion(QWidget *parent);
162 Franz 144
        void SetShortCut();
2833 fschmid 145
        void startUpDialog();
2859 cbradney 146
        void setDefaultPrinter(const QString&, const QString&, const QString&);
11031 jghali 147
        void getDefaultPrinter(QString& name, QString& file, QString& command);
3873 subik 148
 
20691 craig 149
        inline bool scriptIsRunning(void) const { return (m_ScriptRunning > 0); }
150
        inline void setScriptRunning(bool value) { m_ScriptRunning += (value ? 1 : -1); }
14754 jghali 151
 
12334 fschmid 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);
22505 craig 154
        bool DoFileSave(const QString& fileName, QString* savedFileName = nullptr);
24048 jghali 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
 
16546 jghali 163
        void requestUpdate(int);
5800 fschmid 164
        void setTBvals(PageItem *currItem);
16180 craig 165
        int ShowSubs();
22561 craig 166
        void applyNewMaster(const QString& name);
167
        void updateRecent(const QString& fn);
22607 craig 168
        void doPasteRecent(const QString& data);
23825 jghali 169
        bool getPDFDriver(const QString & filename, const std::vector<int> & pageNumbers, const QMap<int, QImage> & thumbs, QString& error, bool* cancelled = nullptr);
22635 craig 170
        bool DoSaveAsEps(const QString& fn, QString& error);
171
        QString CFileDialog(const QString& workingDirectory = ".", const QString& dialogCaption = "", const QString& fileFilter = "", const QString& defNa = "",
19976 craig 172
                                                int optionFlags = fdExistingFiles, bool *useCompression = 0, bool *useFonts = 0, bool *useProfiles = 0);
5800 fschmid 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 */
22561 craig 176
        void recalcColors();
5800 fschmid 177
        void SwitchWin();
178
        void RestoreBookMarks();
18466 craig 179
        QStringList  scrapbookNames();
18972 craig 180
        void updateLayerMenu();
5800 fschmid 181
        void emergencySave();
21098 fschmid 182
        QStringList findRecoverableFile();
22635 craig 183
        bool recoverFile(const QStringList& foundFiles);
5800 fschmid 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
         */
24003 jghali 189
        //bool arrowKeyDown();
190
 
5800 fschmid 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();
24055 craig 196
        void restore(UndoState* state, bool isUndo) override;
6578 cbradney 197
        void restoreGrouping(SimpleState *state, bool isUndo);
198
        void restoreUngrouping(SimpleState *state, bool isUndo);
5800 fschmid 199
        void restoreAddPage(SimpleState *state, bool isUndo);
200
        void restoreDeletePage(SimpleState *state, bool isUndo);
17909 fschmid 201
        void setPreviewToolbar();
21314 fschmid 202
        void updateFromDrop();
5800 fschmid 203
        struct CopyContentsBuffer contentsBuffer;
24715 jghali 204
        bool internalCopy { false };
17016 fschmid 205
        QString internalCopyBuffer;
24715 jghali 206
        int  HaveDoc { 0 };
23651 craig 207
        PrefsContext* dirs {nullptr};
5800 fschmid 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
         */
23651 craig 213
        ScribusView *view {nullptr};
5800 fschmid 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
         */
23651 craig 217
        ScribusDoc *doc {nullptr};
16016 fschmid 218
        /** \brief private doc for managing default patterns. */
23651 craig 219
        ScribusDoc* m_doc {nullptr};
5800 fschmid 220
 
221
 
23651 craig 222
        QProgressBar* mainWindowProgressBar {nullptr};
24715 jghali 223
        ScrSpinBox* zoomSpinBox {nullptr}; //zoom spinbox at bottom of view
224
        PageSelector* pageSelector {nullptr}; //Page selector at bottom of view
23651 craig 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};
5800 fschmid 264
        QString LoadEnc;
23651 craig 265
        AppModeHelper *appModeHelper {nullptr};
7087 subik 266
 
8501 cbradney 267
        QMap<QString, QPointer<ScrAction> > scrActions;
18551 fschmid 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;
9911 cbradney 274
        QMultiHash<QString, QActionGroup*> scrActionGroups;
23651 craig 275
        ScMWMenuManager* scrMenuMgr {nullptr};
276
        ActionManager* actionManager {nullptr};
22700 craig 277
        QStringList m_recentDocsList;
16052 fschmid 278
        QStringList patternsDependingOnThis;
5800 fschmid 279
 
280
public slots:
23474 jghali 281
        void iconSetChange();
5800 fschmid 282
        void languageChange();
23607 craig 283
        void localeChange();
18972 craig 284
        void statusBarLanguageChange();
19100 craig 285
        void specialActionKeyEvent(int unicodevalue);
5800 fschmid 286
        void newView();
7350 fschmid 287
        void ToggleStickyTools();
5800 fschmid 288
        void ToggleAllGuides();
289
        void ToggleAllPalettes();
17358 fschmid 290
        void slotStoryEditor(bool fromTable);
5800 fschmid 291
        void slotCharSelect();
292
        void ImageEffects();
23041 craig 293
        QString fileCollect(const bool compress = false, const bool withFonts = false, const bool withProfiles = false, const QString& newDirectory=QString());
5800 fschmid 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);
15465 avox 299
        void setStatusBarTextPosition(double base, double xp);
19386 craig 300
        void setStatusBarTextSelectedItemInfo();
15675 fschmid 301
        void setTempStatusBarText(const QString &text);
22635 craig 302
        void setStatusBarInfoText(const QString& newText);
5800 fschmid 303
        bool DoFileClose();
304
        void windowsMenuAboutToShow();
11129 subik 305
        //! \brief Handle the Extras menu for its items availability.
306
        void extrasMenuAboutToShow();
13950 fschmid 307
        void newActWin(QMdiSubWindow *w);
5800 fschmid 308
        void closeActiveWindowMasterPageEditor();
309
        void updateActiveWindowCaption(const QString &newCaption);
310
        void windowsMenuActivated(int id);
15516 fschmid 311
        void PutScrap(int scID);
22635 craig 312
        void PutToInline(const QString& buffer);
18068 fschmid 313
        void PutToInline();
6410 fschmid 314
        void PutToPatterns();
18068 fschmid 315
        void ConvertToSymbol();
5800 fschmid 316
        void changeLayer(int);
18972 craig 317
        void setLayerMenuText(const QString &);
5800 fschmid 318
        void showLayer();
23947 jghali 319
        void slotSetCurrentPage(int pageIndex);
18972 craig 320
        void setCurrentPage(int p);
5800 fschmid 321
        void ManageJava();
16029 fschmid 322
        void editSelectedSymbolStart();
22561 craig 323
        void editSymbolStart(const QString& temp);
16029 fschmid 324
        void editSymbolEnd();
17410 fschmid 325
        void editInlineStart(int id);
326
        void editInlineEnd();
22635 craig 327
        void editMasterPagesStart(const QString& temp = "");
18888 craig 328
        void editMasterPagesEnd();
5800 fschmid 329
        /** \brief generate a new document in the current view */
330
        bool slotFileNew();
13188 fschmid 331
        void newFileFromTemplate();
5800 fschmid 332
        bool slotPageImport();
23041 craig 333
        bool loadPage(const QString& fileName, int Nr, bool Mpa, const QString& renamedPageName=QString());
23949 jghali 334
        void gotoLayer(int l);
5800 fschmid 335
        void slotGetContent();
336
        void slotGetContent2(); // kk2006
12860 fschmid 337
        void slotGetClipboardImage();
14796 fschmid 338
        void toogleInlineState();
5800 fschmid 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
 
22561 craig 345
        void removeRecent(const QString& fn, bool fromFileWatcher = false);
346
        void removeRecentFromWatcher(const QString& filename);
347
        void loadRecent(const QString& filename);
5800 fschmid 348
        void rebuildRecentFileMenu();
349
        void rebuildRecentPasteMenu();
18870 craig 350
        void rebuildScrapbookMenu();
22561 craig 351
        void pasteRecent(const QString& fn);
352
        void pasteFromScrapbook(const QString& fn);
12110 fschmid 353
        void importVectorFile();
5800 fschmid 354
        void rebuildLayersList();
19080 craig 355
        bool slotFileOpen();
22561 craig 356
        bool loadDoc(const QString& );
5800 fschmid 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();
19367 craig 373
        void slotEndSpecialEdit();
5800 fschmid 374
        /*!
375
        \author Franz Schmid
376
        \brief Generate and print PostScript from a doc
377
        \param options PrintOptions struct to control all settings
11060 jghali 378
        \param error   Error Message in case of failure
5800 fschmid 379
        \sa ScribusMainWindow::slotFilePrint()
380
        \retval bool True for success */
11060 jghali 381
        bool doPrint(PrintOptions &options, QString& error);
5800 fschmid 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);
11893 cbradney 393
        void SelectAll(bool docWideSelect=false);
394
        void SelectAllOnLayer();
5800 fschmid 395
        void deselectAll();
396
        void ClipChange();
23386 craig 397
        void setCopyCutEnabled(bool b);
5800 fschmid 398
        /** \brief shows an about dialog*/
399
        void slotHelpAbout();
400
        void slotHelpAboutPlugins();
401
    void slotHelpAboutQt();
23088 jghali 402
        void slotHelpActionSearch();
10913 jghali 403
        void slotHelpCheckUpdates();
16180 craig 404
        void slotRaiseOnlineHelp();
23041 craig 405
        void slotOnlineHelp(const QString & jumpToSection=QString(), const QString & jumpToFile=QString());
10108 cbradney 406
        void slotOnlineHelpClosed();
19821 craig 407
        void slotResourceManager();
5800 fschmid 408
        void ToggleTips();
12754 fschmid 409
        void ToggleMouseTips();
5800 fschmid 410
        /** \brief Erzeugt eine neue Seite */
22561 craig 411
        void slotNewPageP(int wo, const QString& templ);
5800 fschmid 412
        void slotNewPageM();
413
        void slotNewMasterPage(int w, const QString &);
23041 craig 414
        void slotNewPage(int w, const QString& masterPageName=QString(), bool mov = true);
5800 fschmid 415
        void duplicateToMasterPage();
416
        /** \brief Loescht die aktuelle Seite */
17213 craig 417
        void deletePage();
5800 fschmid 418
        /**
419
         * \brief Delete pages
420
         * @param from First page to delete
421
         * @param to Last page to delete
422
         */
17213 craig 423
        void deletePage(int from, int to);
424
        void deletePage2(int pg);
5800 fschmid 425
        /** \brief Verschiebt Seiten */
17213 craig 426
        void movePage();
427
        void copyPage();
19907 craig 428
        void changePageProperties();
5800 fschmid 429
        /*!
430
        \author Craig Bradney
431
        \date Sun 30 Jan 2005
432
        \brief Zoom the view.
22884 jghali 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.
5800 fschmid 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 */
19853 craig 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();
5800 fschmid 447
        void togglePagePalette();
448
        void toggleUndoPalette();
449
        void setUndoPalette(bool visible);
450
        void toggleCheckPal();
451
        /** \brief Schaltet M_ViewShowImages ein/aus */
19834 craig 452
        void toggleImageVisibility();
5800 fschmid 453
        /** \brief Schaltet Raster ein/aus */
19853 craig 454
        void toggleGrid();
5800 fschmid 455
        /** \brief Schaltet Rasterbenutzung ein/aus */
19853 craig 456
        void toggleSnapGrid();
5800 fschmid 457
        /** \brief Schaltet Rahmenbearbeitung ein/aus */
10532 avox 458
        void toggleNodeEdit();
5800 fschmid 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();
19288 jghali 465
        void HaveNewSel();
5800 fschmid 466
        /** Dokument ist geaendert worden */
467
        void slotDocCh(bool reb = true);
468
        /** Setzt die Abstufung */
19912 craig 469
        //void setItemShade(int id);
5800 fschmid 470
        /** Setz die Zeichensatzgroesse */
19912 craig 471
        void setItemFontSize(int fontSize);
22561 craig 472
        void setItemLanguage(const QString& language);
11895 fschmid 473
        /** Color Replacement */
474
        void slotReplaceColors();
5800 fschmid 475
        /** Style Manager */
17000 fschmid 476
 
5800 fschmid 477
        /** Erzeugt einen Rahmen */
478
        void MakeFrame(int f, int c, double *vals);
10953 subik 479
        /** Duplicate current item */
480
        void duplicateItem();
481
        /** Multiple duplicate current item*/
482
        void duplicateItemMulti();
14871 cbradney 483
 
5800 fschmid 484
        void objectAttributes();
485
        void getImageInfo();
486
        void generateTableOfContents();
18047 craig 487
        void updateDocument();
14871 cbradney 488
 
22268 craig 489
        void setNewAlignment(int i);
490
        void setNewDirection(int i);
9067 avox 491
        void setNewParStyle(const QString& name);
492
        void setNewCharStyle(const QString& name);
22268 craig 493
        void setAlignmentValue(int i);
494
        void setDirectionValue(int i);
16999 fschmid 495
        void editItemsFromOutlines(PageItem *ite);
19817 craig 496
        //0= center, 1 = top left.
497
        void selectItemsFromOutlines(PageItem *ite, bool single = false, int position = 0);
17013 fschmid 498
        void selectItemFromOutlines(PageItem *ite, bool single, int cPos);
16729 fschmid 499
        void selectPagesFromOutlines(int ScPage);
5800 fschmid 500
        void doPrintPreview();
501
        void printPreview();
23829 jghali 502
        void doOutputPreviewPDF();
503
        void outputPreviewPDF();
23845 jghali 504
        void doOutputPreviewPS();
505
        void outputPreviewPS();
5800 fschmid 506
        void SaveAsEps();
507
        void reallySaveAsEps();
508
        void SaveAsPDF();
509
        void doSaveAsPDF();
510
        void setMainWindowActive();
16546 jghali 511
        void setItemEffects(int h);
512
        void setStyleEffects(int s);
5800 fschmid 513
        void setItemTypeStyle(int id);
22635 craig 514
        void slotElemRead(const QString& Name, double x, double y, bool art, bool loca, ScribusDoc* docc, ScribusView* vie);
5800 fschmid 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();
22561 craig 521
        void Apply_MasterPage(const QString& pageName, int pageNumber, bool reb = true);
9918 jghali 522
        void GroupObj(bool showLockDia = true);
523
        void UnGroupObj();
17905 fschmid 524
        void AdjustGroupObj();
5800 fschmid 525
        void StatusPic();
526
        void ModifyAnnot();
19853 craig 527
        void toggleGuides();
528
        void toggleBase();
529
        void toggleSnapGuides();
530
        void toggleSnapElements();
17747 craig 531
        void SetSnapElements(bool b);
5800 fschmid 532
        void EditTabs();
533
        void SearchText();
534
        /*! \brief call gimp and wait upon completion */
535
        void callImageEditor();
536
        void docCheckToggle(bool visible);
6715 cbradney 537
        //! \brief Scan a document for errors, return true on errors found
538
        bool scanDocument();
5800 fschmid 539
        void setUndoMode(bool isObjectSpecific);
540
        //! \brief Apply a Lorem Ipsum to the each item in a selection
541
        void insertSampleText();
542
        void updateItemLayerList();
15326 cbradney 543
        void updateColorLists();
14871 cbradney 544
        /*! \brief Change Preferences dialog.
545
        See prefsOrg for more info. It's very similar to docSetup/slotDocSetup. */
17000 fschmid 546
        void slotPrefsOrg();
14871 cbradney 547
        /** \brief Refromat the document when user click "OK" in ReformDoc dialog.
548
        See docSetup() for more info. */
17000 fschmid 549
        void slotDocSetup();
6083 cbradney 550
        //! \brief Insert a frame friendly dialog
551
        void slotInsertFrame();
15309 cbradney 552
        //! \brief Transform an item
553
        void slotItemTransform();
15599 fschmid 554
        //! \brief manages paints
21926 craig 555
        void manageColorsAndFills();
24665 jghali 556
        //! \brief allow SE to get the SM for edit styles
20691 craig 557
        StyleManager *styleMgr() const {return m_styleManager;};
17213 craig 558
        //! \brief drawnew, call palettes to update for new page layout
559
        void updateGUIAfterPagesChanged();
16856 craig 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();
17826 craig 567
        void emitUpdateRequest(int updateFlags) { emit UpdateRequest(updateFlags); }
16856 craig 568
 
17826 craig 569
        //inserting marks
570
        void slotInsertMark2Mark() { insertMark(MARK2MarkType); }
571
        void slotInsertMarkAnchor() { insertMark(MARKAnchorType); }
572
        void slotInsertMarkVariableText() { insertMark(MARKVariableTextType); }
573
        void slotInsertMarkItem() { insertMark(MARK2ItemType); }
574
        void slotInsertMarkNote();
575
        void slotInsertMarkIndex() { insertMark(MARKIndexType); }
576
        void slotEditMark();
21017 craig 577
        //connected to signal emitted by actions when "Update Marks" menu item is triggered
17826 craig 578
        void slotUpdateMarks();
22505 craig 579
        bool editMarkDlg(Mark *mrk, PageItem_TextFrame* currItem = nullptr);
21752 jghali 580
//      void testQT_slot1(QString);
581
//      void testQT_slot2(double);
582
//      void testQT_slot3(int);
583
//      void testQT_slot4();
18972 craig 584
        void changePreviewQuality(int index);
19603 craig 585
        void enablePalettes(bool b);
19495 craig 586
        void ToggleFrameEdit();
587
        void NoFrameEdit();
17826 craig 588
 
5800 fschmid 589
signals:
9067 avox 590
        void TextStyle(const ParagraphStyle&);
591
//deprecated: (av)
16546 jghali 592
        void TextEffects(int);
593
        void UpdateRequest(int updateFlags);
18972 craig 594
        void changeLayers(int);
5800 fschmid 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
         */
24048 jghali 600
        bool eventFilter( QObject *o, QEvent *e ) override;
601
        void dragEnterEvent( QDragEnterEvent* e) override;
602
        void dropEvent( QDropEvent* e) override;
5800 fschmid 603
 
604
private:
605
    /** init methods */
606
        void initSplash(bool showSplash);
22076 jghali 607
        void initMdiArea();
5800 fschmid 608
        void initMenuBar(); // initMenuBar creates the menu_bar and inserts the menuitems
18548 craig 609
        void createMenuBar();
5800 fschmid 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
20196 craig 613
        void setStyleSheet(); //set stylesheet for app
5800 fschmid 614
        //Returns false when there are no fonts
615
        void initHyphenator();
616
        void initDefaultValues();
617
        void initKeyboardShortcuts();
618
        void initPalettes();
619
        void initScrapbook();
22505 craig 620
        void updateColorMenu(QProgressBar* progressBar=nullptr);
5800 fschmid 621
 
23651 craig 622
        int m_ScriptRunning {0};
14754 jghali 623
 
23651 craig 624
        QLabel* m_mainWindowStatusLabel {nullptr};
20691 craig 625
        QString m_statusLabelText;
20193 craig 626
        //QPixmap noIcon;
19009 craig 627
 
25129 jghali 628
        bool m_palettesStatus[14] { false };
24715 jghali 629
        bool m_guidesStatus[13] { false };
5800 fschmid 630
 
24003 jghali 631
        //bool m_keyrep;
5800 fschmid 632
        /** @brief Tells if an arrow key is pressed down */
24003 jghali 633
        //bool m_arrowKeyDown;
5800 fschmid 634
        /** @brief tells the undo mode */
24715 jghali 635
        bool m_objectSpecificUndo { false };
5800 fschmid 636
 
13752 cbradney 637
        //CB: #8212: add overrideMasterPageSizing, however default to true for compatibility with other calls.. for now
22561 craig 638
        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);
7087 subik 639
 
24715 jghali 640
        int m_DocNr { 1 };
641
        bool m_PrinterUsed { false };
5800 fschmid 642
        struct PDe {
643
                                        QString Pname;
644
                                        QString Dname;
645
                                        QString Command;
646
                                } PDef ;
23651 craig 647
        TOCGenerator *m_tocGenerator {nullptr};
23917 jghali 648
 
23651 craig 649
        StyleManager *m_styleManager {nullptr};
650
        UndoManager *m_undoManager {nullptr};
23060 craig 651
        PrefsManager& m_prefsManager;
23651 craig 652
        FormatsManager *m_formatsManager {nullptr};
10093 cbradney 653
 
20691 craig 654
        QPointer<HelpBrowser> m_helpBrowser;
655
        QString m_osgFilterString;
17826 craig 656
 
657
        void insertMark(MarkType);
17830 craig 658
        bool insertMarkDialog(PageItem_TextFrame* item, MarkType mT, ScItemsState* &is);
24715 jghali 659
        int m_marksCount { 0 }; //remember marks count from last call
660
        bool m_WasAutoSave { false };
661
        bool m_pagePalVisible { false };
5800 fschmid 662
};
663
 
664
#endif