Scribus
Open source desktop publishing at your fingertips
appmodehelper.h
1 /***************************************************************************
2  * *
3  * This program is free software; you can redistribute it and/or modify *
4  * it under the terms of the GNU General Public License as published by *
5  * the Free Software Foundation; either version 2 of the License, or *
6  * (at your option) any later version. *
7  * *
8  ***************************************************************************/
9 
10 /*
11 For general Scribus (>=1.3.2) copyright and licensing information please refer
12 to the COPYING file provided with the program. Following this notice may exist
13 a copyright and/or license notice that predates the release of Scribus 1.3.2
14 for which a new license (GPL+exception) is in place.
15 */
16 
17 #ifndef APPMODEHELPER_H
18 #define APPMODEHELPER_H
19 
20 #include <QMap>
21 #include <QObject>
22 #include <QPointer>
23 #include <QString>
24 #include "actionmanager.h"
25 #include "appmodes.h"
26 #include "scraction.h"
27 
28 class PageItem;
29 
30 class AppModeHelper : public QObject
31 {
32  Q_OBJECT
33 
34  friend class ActionManager;
35  friend class ScribusMainWindow;
36 
37  public:
38  explicit AppModeHelper(QObject *parent = 0);
39  void setup(ActionManager* am, QMap<QString, QPointer<ScrAction> > *, QMap<QString, QPointer<ScrAction> > *, QMap<QString, QPointer<ScrAction> > *, QMap<QString, QPointer<ScrAction> > *, QMap<QString, QPointer<ScrAction> > *, QMap<QString, QPointer<ScrAction> > *);
40  void resetApplicationMode(ScribusMainWindow* scmw, int newMode);
41  void setApplicationMode(ScribusMainWindow* scmw, ScribusDoc* doc, int newMode);
42  void enableActionsForSelection(ScribusMainWindow* scmw, ScribusDoc *doc);
43  void setModeActionsPerMode(int newMode);
44  void setActionGroupEnabled(QMap<QString, QPointer<ScrAction> > *, bool enabled);
45  void setTextEditMode(bool b);
46  void setSpecialEditMode(bool b);
47  void setFrameEditMode(bool b);
48  void setSymbolEditMode(bool b, ScribusDoc* doc);
49  void setInlineEditMode(bool b, ScribusDoc* doc);
50  void setMasterPageEditMode(bool b, ScribusDoc *doc);
52  void changeLayer(ScribusDoc *doc, bool clipScrapHaveData);
53  void mainWindowHasNewDoc(ScribusDoc *doc, bool clipScrapHaveData);
54  void mainWindowSwitchWin(ScribusDoc *doc);
55  void mainWindowCloseLastDoc();
56  void setPreviewMode(bool b);
58  void enableTextActions(bool enabled, const QString& fontName=QString::null);
59  void setStartupActionsEnabled(bool enabled);
60 
61 
62  signals:
63  void AppModeChanged(int oldMode, int newMode);
64  void UpdateRequest(int updateFlags);
65 
66  public slots:
67 
68  protected:
69  QMap<QString, QPointer<ScrAction> > *a_scrActions;
70  QMap<QString, QPointer<ScrAction> > *a_scrRecentFileActions;
71  QMap<QString, QPointer<ScrAction> > *a_scrWindowsActions;
72  QMap<QString, QPointer<ScrAction> > *a_scrScrapActions;
73  QMap<QString, QPointer<ScrAction> > *a_scrLayersActions;
74  QMap<QString, QPointer<ScrAction> > *a_scrRecentPasteActions;
75  ActionManager* a_actMgr;
76 };
77 
78 #endif // APPMODEHELPER_H
This Class is the base class for your application. It sets up the main window and providing a menubar...
Definition: scribus.h:123
ScribusDoc * doc
doc represents your actual document and is created only once. It keeps information such as filename a...
Definition: scribus.h:205
the Document Class
Definition: scribusdoc.h:90
void enableTextActions(bool enabled, const QString &fontName=QString::null)
enable or disable the unicode actions and their menus
Definition: appmodehelper.cpp:1689
Definition: appmodehelper.h:30
void updateTableMenuActions()
Definition: scribus.cpp:9258
Definition: pageitem.h:92
Definition: actionmanager.h:50