Subversion Repositories Scribus

Rev

Rev 19344 | Rev 19386 | Go to most recent revision | 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>
10185 cbradney 36
#include <QKeyEvent>
37
#include <QMainWindow>
38
#include <QMap>
9911 cbradney 39
#include <QMultiHash>
10185 cbradney 40
#include <QPixmap>
41
#include <QPointer>
19093 craig 42
#include <QPushButton>
10185 cbradney 43
#include <QProcess>
44
#include <QString>
19093 craig 45
#include <QToolButton>
3 paul 46
 
16546 jghali 47
class QCloseEvent;
48
class QDragEnterEvent;
49
class QDropEvent;
50
class QEvent;
51
class QKeyEvent;
52
class QLabel;
53
class QMdiArea;
54
class QMdiSubWindow;
19344 jghali 55
class QQuickView;
10185 cbradney 56
 
3 paul 57
// application specific includes
2969 craig 58
#include "scribusapi.h"
3 paul 59
#include "scribusdoc.h"
19093 craig 60
#include "styleoptions.h"
13552 cbradney 61
#include "ui/customfdialog.h"
18888 craig 62
#include "appmodehelper.h"
1208 cbradney 63
 
3699 cbradney 64
class ActionManager;
65
class AlignDistributePalette;
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;
10976 cbradney 72
class EditToolBar;
73
class FileToolBar;
10185 cbradney 74
class FontCombo;
10181 cbradney 75
class FormatsManager;
5087 subik 76
class GuideManager;
10108 cbradney 77
class HelpBrowser;
17405 fschmid 78
class InlinePalette;
3699 cbradney 79
class LayerPalette;
17826 craig 80
class MarksManager;
284 Franz 81
class Measurements;
14509 cbradney 82
class ScMWMenuManager;
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;
10976 cbradney 94
class PropertiesPalette;
10185 cbradney 95
class ScToolBar;
3699 cbradney 96
class ScrAction;
13805 jghali 97
class ScribusDoc;
5243 cbradney 98
class ScribusCore;
4026 craig 99
class ScribusMainWindow;
3627 cbradney 100
class ScribusQApp;
3699 cbradney 101
class ScribusWin;
19093 craig 102
class ScrSpinBox;
3699 cbradney 103
class SimpleState;
104
class StoryEditor;
4829 tsoots 105
class StyleManager;
15060 fschmid 106
class SymbolPalette;
3699 cbradney 107
class TOCGenerator;
108
class UndoManager;
109
class UndoPalette;
110
class UndoState;
19009 craig 111
class ViewToolBar;
3205 craig 112
 
10976 cbradney 113
 
4194 fschmid 114
extern SCRIBUS_API ScribusQApp* ScQApp;
3205 craig 115
 
3 paul 116
/**
4650 subik 117
  * \brief This Class is the base class for your application. It sets up the main
3 paul 118
  * window and providing a menubar, toolbar
119
  * and statusbar. For the main view, an instance of class ScribusView is
120
  * created which creates your view.
121
  */
10184 cbradney 122
class SCRIBUS_API ScribusMainWindow : public QMainWindow, public UndoObject
3 paul 123
{
162 Franz 124
        Q_OBJECT
1429 subik 125
 
168 Franz 126
public:
4650 subik 127
        /** \brief constructor */
4026 craig 128
        ScribusMainWindow();
4650 subik 129
        /** \brief destructor */
4208 craig 130
        ~ScribusMainWindow();
4650 subik 131
        /*!
132
        * \retval 0 - ok, 1 - no fonts, ...
133
        */
5243 cbradney 134
        int initScMW(bool primaryMainwWindow);
11040 fschmid 135
        void addScToolBar(ScToolBar *tb, QString name);
1525 cbradney 136
        bool warningVersion(QWidget *parent);
162 Franz 137
        void SetShortCut();
2833 fschmid 138
        void startUpDialog();
2859 cbradney 139
        void setDefaultPrinter(const QString&, const QString&, const QString&);
11031 jghali 140
        void getDefaultPrinter(QString& name, QString& file, QString& command);
3873 subik 141
 
14754 jghali 142
        inline bool scriptIsRunning(void) const { return (ScriptRunning > 0); }
143
        inline void setScriptRunning(bool value) { ScriptRunning += (value ? 1 : -1); }
144
 
12334 fschmid 145
        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);
146
        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);
11212 jghali 147
        bool DoFileSave(const QString& fileName, QString* savedFileName = NULL);
10859 cbradney 148
        void changeEvent(QEvent *e);
5800 fschmid 149
        void closeEvent(QCloseEvent *ce);
150
        void keyPressEvent(QKeyEvent *k);
151
        void keyReleaseEvent(QKeyEvent *k);
16546 jghali 152
        void inputMethodEvent ( QInputMethodEvent * event );
153
        QVariant inputMethodQuery ( Qt::InputMethodQuery query ) const ;
154
        void requestUpdate(int);
5800 fschmid 155
        void setTBvals(PageItem *currItem);
16180 craig 156
        int ShowSubs();
5800 fschmid 157
        void applyNewMaster(QString name);
158
        void updateRecent(QString fn);
11554 fschmid 159
        void doPasteRecent(QString data);
5800 fschmid 160
        bool getPDFDriver(const QString & fn, const QString & nam,
161
                                          int Components, const std::vector<int> & pageNs,
11441 jghali 162
                                          const QMap<int,QPixmap> & thumbs, QString& error,
163
                                          bool* cancelled = NULL);
11060 jghali 164
        bool DoSaveAsEps(QString fn, QString& error);
5800 fschmid 165
        QString CFileDialog(QString wDir = ".", QString caption = "", QString filter = "", QString defNa = "",
5846 jghali 166
                                                int optionFlags = fdExistingFiles, bool *docom = 0, bool *doFont = 0, bool *doProfiles = 0);
5800 fschmid 167
        /*! \brief Recalculate the colors after changing CMS settings.
168
        Call the appropriate document function and then update the GUI elements.
169
        \param dia optional progress widget */
9953 cbradney 170
        void recalcColors(QProgressBar *dia = 0);
5800 fschmid 171
        void SwitchWin();
172
        void RestoreBookMarks();
18466 craig 173
        QStringList  scrapbookNames();
18972 craig 174
        void updateLayerMenu();
5800 fschmid 175
        void emergencySave();
176
 
177
        /**
178
         * @brief Returns true if an arrow key is pressed down.
179
         * @return true if an arrow key is pressed down otherwise returns false
180
         */
181
        bool arrowKeyDown();
182
        /**
183
         * @brief Returns true if application is in object specific undo mode, other wise returns false.
184
         * @return true if application is in object specific undo mode, other wise returns false
185
         */
186
        bool isObjectSpecificUndo();
187
        void restore(UndoState* state, bool isUndo);
6578 cbradney 188
        void restoreGrouping(SimpleState *state, bool isUndo);
189
        void restoreUngrouping(SimpleState *state, bool isUndo);
5800 fschmid 190
        void restoreAddPage(SimpleState *state, bool isUndo);
191
        void restoreDeletePage(SimpleState *state, bool isUndo);
17909 fschmid 192
        void setPreviewToolbar();
5800 fschmid 193
        struct CopyContentsBuffer contentsBuffer;
9721 fschmid 194
        bool internalCopy;
17016 fschmid 195
        QString internalCopyBuffer;
12841 jghali 196
        int  HaveDoc;
5800 fschmid 197
        PrefsContext* dirs;
198
        /** \brief view is the main widget which represents your working area. The View
199
         * class should handle all events of the view widget.  It is kept empty so
200
         * you can create your view according to your application's needs by
201
         * changing the view class.
202
         */
203
        ScribusView *view;
204
        /** \brief doc represents your actual document and is created only once. It keeps
205
         * information such as filename and does the serialization of your files.
206
         */
207
        ScribusDoc *doc;
16016 fschmid 208
        /** \brief private doc for managing default patterns. */
209
        ScribusDoc* m_doc;
5800 fschmid 210
 
211
 
9953 cbradney 212
        QProgressBar* mainWindowProgressBar;
18972 craig 213
        ScrSpinBox* zoomSpinBox; //zoom spinbox at bottom of view
214
        PageSelector* pageSelector; //Page selector at bottom of view
215
#if OPTION_USE_QTOOLBUTTON
216
        QToolButton *zoomDefaultToolbarButton;
217
        QToolButton *zoomOutToolbarButton;
218
        QToolButton *zoomInToolbarButton;
219
#else
220
        QPushButton *zoomDefaultToolbarButton;
221
        QPushButton *zoomOutToolbarButton;
222
        QPushButton *zoomInToolbarButton;
223
#endif
224
        QComboBox *layerMenu; //Menu for layers at bottom of view
225
        QComboBox *unitSwitcher; //Menu for units at bottom of view
19009 craig 226
        EditToolBar *editToolBar;
227
        FileToolBar *fileToolBar;
228
        ModeToolBar* modeToolBar;
229
        PDFToolBar* pdfToolBar;
230
        ViewToolBar* viewToolBar;
5800 fschmid 231
        QLabel* mainWindowXPosLabel;
232
        QLabel* mainWindowXPosDataLabel;
233
        QLabel* mainWindowYPosLabel;
234
        QLabel* mainWindowYPosDataLabel;
235
        GuideManager *guidePalette;
7087 subik 236
        CharSelect *charPalette;
10862 cbradney 237
        PropertiesPalette *propertiesPalette;
17826 craig 238
        MarksManager *marksManager;
239
        NotesStylesEditor *nsEditor;
5800 fschmid 240
        NodePalette *nodePalette;
10862 cbradney 241
        OutlinePalette *outlinePalette;
5800 fschmid 242
        Biblio *scrapbookPalette;
243
        LayerPalette* layerPalette;
244
        PagePalette *pagePalette;
245
        BookPalette *bookmarkPalette;
15060 fschmid 246
        SymbolPalette *symbolPalette;
17405 fschmid 247
        InlinePalette *inlinePalette;
5800 fschmid 248
        Measurements* measurementPalette;
249
        CheckDocument * docCheckerPalette;
250
        UndoPalette* undoPalette;
251
        AlignDistributePalette *alignDistributePalette;
252
        StoryEditor* storyEditor;
253
        StoryEditor* CurrStED;
13959 jghali 254
        QMdiArea *mdiArea;
5800 fschmid 255
        ScribusWin* ActWin;
256
        QClipboard *ClipB;
257
        QString LoadEnc;
18888 craig 258
        AppModeHelper appModeHelper;
7087 subik 259
 
10006 cbradney 260
        QProcess *ExternalApp;
7087 subik 261
 
8501 cbradney 262
        QMap<QString, QPointer<ScrAction> > scrActions;
18551 fschmid 263
        QMap<QString, QPointer<ScrAction> > scrRecentFileActions;
264
        QMap<QString, QPointer<ScrAction> > scrWindowsActions;
265
        QMap<QString, QPointer<ScrAction> > scrScrapActions;
266
        QMap<QString, QPointer<ScrAction> > scrLayersActions;
267
        QMap<QString, QPointer<ScrAction> > scrRecentPasteActions;
268
        QMap<QString, QPointer<ScToolBar> > scrToolBars;
9911 cbradney 269
        QMultiHash<QString, QActionGroup*> scrActionGroups;
14509 cbradney 270
        ScMWMenuManager* scrMenuMgr;
5800 fschmid 271
        ActionManager* actionManager;
272
        QStringList RecentDocs;
16052 fschmid 273
        QStringList patternsDependingOnThis;
5800 fschmid 274
 
275
public slots:
276
        void languageChange();
18972 craig 277
        void statusBarLanguageChange();
19100 craig 278
        void specialActionKeyEvent(int unicodevalue);
5800 fschmid 279
        void newView();
7350 fschmid 280
        void ToggleStickyTools();
5800 fschmid 281
        void ToggleAllGuides();
282
        void ToggleAllPalettes();
17358 fschmid 283
        void slotStoryEditor(bool fromTable);
5800 fschmid 284
        void slotCharSelect();
285
        void ImageEffects();
15207 cbradney 286
        QString fileCollect(const bool compress = false, const bool withFonts = false, const bool withProfiles = false, const QString& newDirectory=QString::null);
5800 fschmid 287
        void AddBookMark(PageItem *ite);
288
        void DelBookMark(PageItem *ite);
289
        void BookMarkTxT(PageItem *ite);
290
        void StoreBookmarks();
291
        void setStatusBarMousePosition(double xp, double yp);
15465 avox 292
        void setStatusBarTextPosition(double base, double xp);
15675 fschmid 293
        void setTempStatusBarText(const QString &text);
5800 fschmid 294
        void setStatusBarInfoText(QString newText);
295
        bool DoFileClose();
296
        void windowsMenuAboutToShow();
11129 subik 297
        //! \brief Handle the Extras menu for its items availability.
298
        void extrasMenuAboutToShow();
13950 fschmid 299
        void newActWin(QMdiSubWindow *w);
5800 fschmid 300
        void closeActiveWindowMasterPageEditor();
301
        void updateActiveWindowCaption(const QString &newCaption);
302
        void windowsMenuActivated(int id);
15516 fschmid 303
        void PutScrap(int scID);
17804 fschmid 304
        void PutToInline(QString buffer);
18068 fschmid 305
        void PutToInline();
6410 fschmid 306
        void PutToPatterns();
18068 fschmid 307
        void ConvertToSymbol();
5800 fschmid 308
        void changeLayer(int);
18972 craig 309
        void setLayerMenuText(const QString &);
5800 fschmid 310
        void showLayer();
18976 craig 311
        void slotSetCurrentPage(int Seite);
18972 craig 312
        void setCurrentPage(int p);
5800 fschmid 313
        void ManageJava();
16029 fschmid 314
        void editSelectedSymbolStart();
315
        void editSymbolStart(QString temp);
316
        void editSymbolEnd();
17410 fschmid 317
        void editInlineStart(int id);
318
        void editInlineEnd();
18888 craig 319
        void editMasterPagesStart(QString temp = "");
320
        void editMasterPagesEnd();
5800 fschmid 321
        /** \brief generate a new document in the current view */
322
        bool slotFileNew();
13188 fschmid 323
        void newFileFromTemplate();
5800 fschmid 324
        bool slotPageImport();
325
        bool loadPage(QString fileName, int Nr, bool Mpa, const QString& renamedPageName=QString::null);
18972 craig 326
        void GotoLa(int l);
5800 fschmid 327
        void slotGetContent();
328
        void slotGetContent2(); // kk2006
12860 fschmid 329
        void slotGetClipboardImage();
14796 fschmid 330
        void toogleInlineState();
5800 fschmid 331
        /*!
332
        \author Franz Schmid
333
        \brief Appends a Textfile to the Text in the selected Textframe at the Cursorposition
334
        */
335
        void slotFileAppend();
336
 
15946 jghali 337
        void removeRecent(QString fn, bool fromFileWatcher = false);
338
        void removeRecentFromWatcher(QString fn);
5800 fschmid 339
        void loadRecent(QString fn);
340
        void rebuildRecentFileMenu();
341
        void rebuildRecentPasteMenu();
18870 craig 342
        void rebuildScrapbookMenu();
5800 fschmid 343
        void pasteRecent(QString fn);
11554 fschmid 344
        void pasteFromScrapbook(QString fn);
12110 fschmid 345
        void importVectorFile();
5800 fschmid 346
        void rebuildLayersList();
19080 craig 347
        bool slotFileOpen();
5800 fschmid 348
        bool loadDoc(QString);
349
        /**
350
         * @brief Do post loading functions
351
         */
352
        bool postLoadDoc();
353
        void slotAutoSaved();
354
        /** \brief save a document */
355
        bool slotFileSave();
356
        /** \brief save a document under a different filename*/
357
        bool slotFileSaveAs();
358
        void slotFileRevert();
359
        /** \brief Sichert den Text eines Elements */
360
        void SaveText();
361
        /** \brief close the actual file */
362
        bool slotFileClose();
363
        /** \brief print the actual file */
364
        void slotFilePrint();
365
        void slotReallyPrint();
19367 craig 366
        void slotEndSpecialEdit();
5800 fschmid 367
        /*!
368
        \author Franz Schmid
369
        \brief Generate and print PostScript from a doc
370
        \param options PrintOptions struct to control all settings
11060 jghali 371
        \param error   Error Message in case of failure
5800 fschmid 372
        \sa ScribusMainWindow::slotFilePrint()
373
        \retval bool True for success */
11060 jghali 374
        bool doPrint(PrintOptions &options, QString& error);
5800 fschmid 375
        /** \brief exits the application */
376
        void slotFileQuit();
377
        /** \brief put the marked text/object into the clipboard and remove
378
         * it from the document */
379
        void slotEditCut();
380
        /** \brief put the marked text/object into the clipboard*/
381
        void slotEditCopy();
382
        /** \brief paste the clipboard into the document*/
383
        void slotEditPaste();
384
        void slotEditCopyContents();
385
        void slotEditPasteContents(int absolute=0);
386
        void EnableTxEdit();
387
        void DisableTxEdit();
11893 cbradney 388
        void SelectAll(bool docWideSelect=false);
389
        void SelectAllOnLayer();
5800 fschmid 390
        void deselectAll();
391
        void ClipChange();
392
        /** \brief shows an about dialog*/
393
        void slotHelpAbout();
394
        void slotHelpAboutPlugins();
395
    void slotHelpAboutQt();
10913 jghali 396
        void slotHelpCheckUpdates();
16180 craig 397
        void slotRaiseOnlineHelp();
398
        void slotOnlineHelp(const QString & jumpToSection=QString::null, const QString & jumpToFile=QString::null);
10108 cbradney 399
        void slotOnlineHelpClosed();
5800 fschmid 400
        void ToggleTips();
12754 fschmid 401
        void ToggleMouseTips();
5800 fschmid 402
        /** \brief Erzeugt eine neue Seite */
403
        void slotNewPageP(int wo, QString templ);
404
        void slotNewPageM();
405
        void slotNewMasterPage(int w, const QString &);
406
        void slotNewPage(int w, const QString& masterPageName=QString::null, bool mov = true);
407
        void duplicateToMasterPage();
408
        /** \brief Loescht die aktuelle Seite */
17213 craig 409
        void deletePage();
5800 fschmid 410
        /**
411
         * \brief Delete pages
412
         * @param from First page to delete
413
         * @param to Last page to delete
414
         */
17213 craig 415
        void deletePage(int from, int to);
416
        void deletePage2(int pg);
5800 fschmid 417
        /** \brief Verschiebt Seiten */
17213 craig 418
        void movePage();
419
        void copyPage();
5800 fschmid 420
        void changePageMargins();
421
        /*!
422
        \author Craig Bradney
423
        \date Sun 30 Jan 2005
424
        \brief Zoom the view.
425
        Take the ScMW 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.
426
        \param zoomFactor Value stored in the ScrAction.
427
         */
428
        void slotZoom(double zoomFactor); // 20, 50, 100, or -100 for Fit
429
        /** \brief Schaltet Raender ein/aus */
430
        void ToggleMarks();
7051 fschmid 431
        void ToggleBleeds();
5800 fschmid 432
        void ToggleFrames();
433
        void ToggleLayerMarkers();
434
        void ToggleTextLinks();
435
        void ToggleTextControls();
436
        void ToggleColumnBorders();
437
        void ToggleRulers();
438
        void ToggleRulerMode();
439
        void togglePagePalette();
440
        void toggleUndoPalette();
441
        void setUndoPalette(bool visible);
442
        void toggleCheckPal();
443
        /** \brief Schaltet M_ViewShowImages ein/aus */
444
        void TogglePics();
445
        /** \brief Schaltet Raster ein/aus */
18027 jghali 446
        void ToggleGrid();
5800 fschmid 447
        /** \brief Schaltet Rasterbenutzung ein/aus */
18027 jghali 448
        void ToggleUGrid();
5800 fschmid 449
        /** \brief Schaltet Rahmenbearbeitung ein/aus */
10532 avox 450
        void toggleNodeEdit();
5800 fschmid 451
        void slotSelect();
452
        /** \brief Switch appMode
453
        \param mode TODO learn modes*/
454
        void setAppMode(int mode);
455
        void setAppModeByToggle(bool isOn, int newMode);
456
        /** \brief Neues Dokument erzeugt */
457
        void HaveNewDoc();
19288 jghali 458
        void HaveNewSel();
5800 fschmid 459
        /** Dokument ist geaendert worden */
460
        void slotDocCh(bool reb = true);
461
        /** Setzt die Abstufung */
462
        void setItemShade(int id);
463
        /** Setzt den Font */
464
        /** Korrigiert das FontMenu */
465
        void SetNewFont(const QString& nf);
466
        /** Setz die Zeichensatzgroesse */
467
        void setItemFSize(int id);
11895 fschmid 468
        /** Color Replacement */
469
        void slotReplaceColors();
5800 fschmid 470
        /** Style Manager */
17000 fschmid 471
 
5800 fschmid 472
        /** Erzeugt einen Rahmen */
473
        void MakeFrame(int f, int c, double *vals);
10953 subik 474
        /** Duplicate current item */
475
        void duplicateItem();
476
        /** Multiple duplicate current item*/
477
        void duplicateItemMulti();
14871 cbradney 478
 
5800 fschmid 479
        void objectAttributes();
480
        void getImageInfo();
481
        void generateTableOfContents();
18047 craig 482
        void updateDocument();
14871 cbradney 483
 
9822 fschmid 484
//      void saveStyles(StilFormate *dia); //still required for style save from SE
5800 fschmid 485
        void setNewAlignment(int a);
9067 avox 486
        void setNewParStyle(const QString& name);
487
        void setNewCharStyle(const QString& name);
16546 jghali 488
        void setAlignmentValue(int a);
16999 fschmid 489
        void editItemsFromOutlines(PageItem *ite);
16122 fschmid 490
        void selectItemsFromOutlines(PageItem *ite, bool single = false);
17013 fschmid 491
        void selectItemFromOutlines(PageItem *ite, bool single, int cPos);
16729 fschmid 492
        void selectPagesFromOutlines(int ScPage);
5800 fschmid 493
        void doPrintPreview();
494
        void printPreview();
495
        void SaveAsEps();
496
        void reallySaveAsEps();
497
        void SaveAsPDF();
498
        void doSaveAsPDF();
499
        void setMainWindowActive();
16546 jghali 500
        void setItemEffects(int h);
501
        void setStyleEffects(int s);
5800 fschmid 502
        void setItemTypeStyle(int id);
503
        void slotElemRead(QString Name, double x, double y, bool art, bool loca, ScribusDoc* docc, ScribusView* vie);
504
        void slotChangeUnit(int art, bool draw = true);
505
        /*!
506
         * @brief Apply master pages from the Apply Master Page dialog
507
         * @todo Make this work with real page numbers, negative numbers and document sections when they are implemented
508
        */
509
        void ApplyMasterPage();
6578 cbradney 510
        void Apply_MasterPage(QString pageName, int pageNumber, bool reb = true);
9918 jghali 511
        void GroupObj(bool showLockDia = true);
512
        void UnGroupObj();
17905 fschmid 513
        void AdjustGroupObj();
5800 fschmid 514
        void StatusPic();
515
        void ModifyAnnot();
516
        void ToggleGuides();
517
        void ToggleBase();
518
        void ToggleUGuides();
17744 craig 519
        void ToggleUElements();
17747 craig 520
        void SetSnapElements(bool b);
5800 fschmid 521
        void EditTabs();
522
        void SearchText();
10006 cbradney 523
        void imageEditorExited(int, QProcess::ExitStatus);
5800 fschmid 524
        /*! \brief call gimp and wait upon completion */
525
        void callImageEditor();
526
        void docCheckToggle(bool visible);
6715 cbradney 527
        //! \brief Scan a document for errors, return true on errors found
528
        bool scanDocument();
5800 fschmid 529
        void setUndoMode(bool isObjectSpecific);
530
        //! \brief Apply a Lorem Ipsum to the each item in a selection
531
        void insertSampleText();
532
        void updateItemLayerList();
15326 cbradney 533
        void updateColorLists();
14871 cbradney 534
        /*! \brief Change Preferences dialog.
535
        See prefsOrg for more info. It's very similar to docSetup/slotDocSetup. */
17000 fschmid 536
        void slotPrefsOrg();
14871 cbradney 537
        /** \brief Refromat the document when user click "OK" in ReformDoc dialog.
538
        See docSetup() for more info. */
17000 fschmid 539
        void slotDocSetup();
6083 cbradney 540
        //! \brief Insert a frame friendly dialog
541
        void slotInsertFrame();
15309 cbradney 542
        //! \brief Transform an item
543
        void slotItemTransform();
15599 fschmid 544
        //! \brief manages paints
545
        void managePaints();
8428 cbradney 546
        //! \brief allow SE to get the SM for edit stlyes
547
        StyleManager *styleMgr() const {return styleManager;};
17213 craig 548
        //! \brief drawnew, call palettes to update for new page layout
549
        void updateGUIAfterPagesChanged();
16856 craig 550
        /**
551
         * Enables/disables the actions in the "Table" menu.
552
         *
553
         * This has a functions of its own, since it needs to be called from the table edit
554
         * canvas modes/gestures.
555
         */
556
        void updateTableMenuActions();
17826 craig 557
        void emitUpdateRequest(int updateFlags) { emit UpdateRequest(updateFlags); }
16856 craig 558
 
17826 craig 559
        //inserting marks
560
        void slotInsertMark2Mark() { insertMark(MARK2MarkType); }
561
        void slotInsertMarkAnchor() { insertMark(MARKAnchorType); }
562
        void slotInsertMarkVariableText() { insertMark(MARKVariableTextType); }
563
        void slotInsertMarkItem() { insertMark(MARK2ItemType); }
564
        void slotInsertMarkNote();
565
        void slotInsertMarkIndex() { insertMark(MARKIndexType); }
566
        void slotEditMark();
567
        //connected to signal emited by actions when "Update Marks" menu item is triggered
568
        void slotUpdateMarks();
569
        bool editMarkDlg(Mark *mrk, PageItem_TextFrame* currItem = NULL);
18485 craig 570
        void testQTQuick2_1();
19004 craig 571
        void testQT_slot1(QString);
572
        void testQT_slot2(double);
573
        void testQT_slot3(int);
574
        void testQT_slot4();
19009 craig 575
        //void adjustCMS();
18972 craig 576
        void changePreviewQuality(int index);
17826 craig 577
 
5800 fschmid 578
signals:
17094 jghali 579
        void AppModeChanged(int oldMode, int newMode);
9067 avox 580
        void TextStyle(const ParagraphStyle&);
581
//deprecated: (av)
16546 jghali 582
        void TextEffects(int);
583
        void UpdateRequest(int updateFlags);
18972 craig 584
        void changeLayers(int);
5800 fschmid 585
 
586
protected:
587
        /*!
588
        \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.
589
         */
590
        bool eventFilter( QObject *o, QEvent *e );
591
        virtual void dragEnterEvent( QDragEnterEvent* e);
592
        virtual void dropEvent( QDropEvent* e);
593
 
594
private:
595
    /** init methods */
596
        void initSplash(bool showSplash);
597
        void initMenuBar(); // initMenuBar creates the menu_bar and inserts the menuitems
18548 craig 598
        void createMenuBar();
5800 fschmid 599
        void addDefaultWindowMenuItems(); // addDefaultWindowMenuItems adds the basic Windows menu items, excluding the actual list of windows
600
        void initStatusBar(); // setup the statusbar
601
        void initToolBars(); // setup the toolbars
602
        //Returns false when there are no fonts
603
        void initHyphenator();
604
        void initDefaultValues();
605
        void initKeyboardShortcuts();
606
        void initPalettes();
607
        void initScrapbook();
7087 subik 608
 
9953 cbradney 609
        void updateColorMenu(QProgressBar* progressBar=NULL);
10532 avox 610
        void ToggleFrameEdit();
611
        void NoFrameEdit();
5800 fschmid 612
 
14754 jghali 613
        int ScriptRunning;
614
 
5800 fschmid 615
        QLabel* mainWindowStatusLabel;
15675 fschmid 616
        QString statusLabelText;
5800 fschmid 617
        QPixmap noIcon;
19009 craig 618
 
5800 fschmid 619
        int toolbarMenuTools;
620
        int toolbarMenuPDFTools;
621
        int viewToolbars;
622
        int viewPropertiesPalette;
623
        int viewOutlinePalette;
624
        int viewNodePalette;
625
        int viewBpal;
626
        int viewLayerPalette;
627
        int viewPagePalette;
628
        int viewBopal;
629
        int viewUndoPalette;
630
 
631
        bool palettesStatus[10];
7051 fschmid 632
        bool guidesStatus[13];
5800 fschmid 633
 
634
        bool keyrep;
635
        /** @brief Tells if an arrow key is pressed down */
636
        bool _arrowKeyDown;
637
        /** @brief tells the undo mode */
638
        bool objectSpecificUndo;
639
 
13752 cbradney 640
        //CB: #8212: add overrideMasterPageSizing, however default to true for compatibility with other calls.. for now
641
        void addNewPages(int wo, int where, int numPages, double height, double width, int orient, QString siz, bool mov, QStringList* basedOn = 0, bool overrideMasterPageSizing=true);
7087 subik 642
 
5800 fschmid 643
        int DocNr;
644
        bool PrinterUsed;
645
        struct PDe {
646
                                        QString Pname;
647
                                        QString Dname;
648
                                        QString Command;
649
                                } PDef ;
650
        TOCGenerator *tocGenerator;
651
        int storedPageNum;
652
        int storedViewXCoor;
653
        int storedViewYCoor;
654
        double storedViewScale;
655
        StyleManager *styleManager;
656
        UndoManager *undoManager;
7087 subik 657
        PrefsManager *prefsManager;
10181 cbradney 658
        FormatsManager *formatsManager;
10093 cbradney 659
 
16180 craig 660
        QPointer<HelpBrowser> helpBrowser;
17781 fschmid 661
        QString osgFilterString;
17826 craig 662
 
663
        void insertMark(MarkType);
17830 craig 664
        bool insertMarkDialog(PageItem_TextFrame* item, MarkType mT, ScItemsState* &is);
17826 craig 665
        int m_marksCount; //remember marks count from last call
17971 fschmid 666
        bool m_WasAutoSave;
18071 fschmid 667
        bool m_pagePalVisible;
19004 craig 668
 
669
        QQuickView *qqview;
5800 fschmid 670
};
671
 
672
#endif