Scribus Developer Documentation - API
logo-pen

Scribus Developer Documentation - API

actionmanager.h

Go to the documentation of this file.
00001 /*
00002 For general Scribus (>=1.3.2) copyright and licensing information please refer
00003 to the COPYING file provided with the program. Following this notice may exist
00004 a copyright and/or license notice that predates the release of Scribus 1.3.2
00005 for which a new license (GPL+exception) is in place.
00006 */
00007 /***************************************************************************
00008     begin                : Jan 2005
00009     copyright            : (C) 2005 by Craig Bradney
00010     email                : cbradney@zip.com.au
00011  ***************************************************************************/
00012 
00013 /***************************************************************************
00014  *                                                                         *
00015  *   This program is free software; you can redistribute it and/or modify  *
00016  *   it under the terms of the GNU General Public License as published by  *
00017  *   the Free Software Foundation; either version 2 of the License, or     *
00018  *   (at your option) any later version.                                   *
00019  *                                                                         *
00020  ***************************************************************************/
00021 #ifndef ACTIONMANAGER_H
00022 #define ACTIONMANAGER_H
00023 
00024 #include <QKeySequence>
00025 #include <QObject>
00026 #include <QString>
00027 #include <QStringList>
00028 #include <QMap>
00029 #include <QPair>
00030 #include <QVector>
00031 #include <QPointer>
00032 #include <QMultiHash>
00033 #include <QPixmap>
00034 #include <QActionGroup>
00035 
00036 class QEvent;
00037 
00038 #include "scribusapi.h"
00039 #include "scraction.h"
00040 
00041 class ScribusDoc;
00042 class ScribusMainWindow;
00043 class ScribusQApp;
00044 class ScribusView;
00045 class UndoManager;
00049 class SCRIBUS_API ActionManager : public QObject
00050 {
00051     Q_OBJECT
00052 
00053     friend class StoryEditor;
00054     public:
00055         ActionManager ( QObject * parent );
00056         ~ActionManager();
00057         
00058         virtual void changeEvent(QEvent *e);
00059         
00060         void init(ScribusMainWindow *);
00061         static void createDefaultShortcuts();
00062         static QMap<QString, QKeySequence>* defaultShortcuts() {return &defKeys;};
00063         static void createDefaultMenus();
00064         static void createDefaultNonMenuActions();
00065         static QVector< QPair<QString, QStringList> >* defaultMenus() {return &defMenus;};
00066         static QVector< QPair<QString, QStringList> >* defaultNonMenuActions() {return &defNonMenuActions;};
00067         void createActions();
00068         void disconnectModeActions();
00069         void connectModeActions();
00070         void disconnectNewViewActions();
00071         void connectNewViewActions(ScribusView *);
00072         void disconnectNewDocActions();
00073         void connectNewDocActions(ScribusDoc *);
00074         void disconnectNewSelectionActions();
00075         void connectNewSelectionActions(ScribusView *,ScribusDoc *);
00076         void saveActionShortcutsPreEditMode();
00077         void restoreActionShortcutsPostEditMode();
00078         void enableActionStringList(QMap<QString, QPointer<ScrAction> > *actionMap, QStringList *list, bool enabled, bool checkingUnicode=false, const QString& fontName=QString::null);
00079         void enableUnicodeActions(QMap<QString, QPointer<ScrAction> > *actionMap, bool enabled, const QString& fontName=QString::null);
00080         void setPDFActions(ScribusView *);
00081         
00082     public slots:
00083         void languageChange();
00084         void handleMultipleSelections(bool isMultiple);
00085         
00086     protected:
00087         void initFileMenuActions();
00088         void initEditMenuActions();
00089         void initStyleMenuActions();
00090         void initItemMenuActions();
00091         void initInsertMenuActions();
00092         void initPageMenuActions();
00093         void initViewMenuActions();
00094         void initToolsMenuActions();
00095         void initExtrasMenuActions();
00096         void initWindowsMenuActions();
00097         void initScriptMenuActions();
00098         void initHelpMenuActions();
00099         static void initUnicodeActions(QMap<QString, QPointer<ScrAction> > *actionMap, QWidget *actionParent, QStringList *actionNamesList);
00100         void initSpecialActions();
00101         static void languageChangeUnicodeActions(QMap<QString, QPointer<ScrAction> > *actionMap);
00102         void languageChangeActions();
00103     
00104         QPixmap noIcon;
00105         ScribusMainWindow *mainWindow;
00106         ScribusQApp *ScQApp;
00107         UndoManager *undoManager;
00108         QMap<QString, QPointer<ScrAction> > *scrActions;
00109         QMultiHash<QString, QActionGroup*> *scrActionGroups;
00110         QStringList *modeActionNames;
00111         QStringList *nonEditActionNames;
00112         QStringList *unicodeCharActionNames;
00113         static QMap<QString, QKeySequence> defKeys;
00114         static QVector< QPair<QString, QStringList> > defMenus;
00115         static QVector< QPair<QString, QStringList> > defNonMenuActions;
00116 };
00117 
00118 #endif
Created with personalized Doxygen. This is documentation for GPL software Scribus - Open Source Desktop Publishing.