Back to index

scribus-ng  1.3.4.dfsg+svn20071115
scriptercore.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 #ifndef SCRIPTERCORE_H
00008 #define SCRIPTERCORE_H
00009 
00010 #include "cmdvar.h"
00011 
00012 #include "qmap.h"
00013 #include "qguardedptr.h"
00014 
00015 class ScrAction;
00016 class ScribusMainWindow;
00017 class MenuManager;
00018 class PythonConsole;
00019 
00020 class ScripterCore : public QObject
00021 {
00022        Q_OBJECT
00023 
00024 public:
00025        ScripterCore(QWidget* parent);
00026        ~ScripterCore();
00027        void addToMainWindowMenu(ScribusMainWindow *);
00028 
00030        QString returnString;
00032        QString inValue;
00033 
00034 public slots:
00035        void runScriptDialog();
00036        void StdScript(QString filebasename);
00037        void RecentScript(QString fn);
00038        void slotRunScriptFile(QString fileName, bool inMainInterpreter = false);
00039        void slotRunScript(const QString Script);
00040        void slotInteractiveScript(bool);
00041        void slotExecute();
00046        void aboutScript();
00048        bool setupMainInterpreter();
00050        void initExtensionScripts();
00052        void runStartupScript();
00053        void languageChange();
00054 
00055        const QString & startupScript() const;
00056        bool extensionsEnabled() const;
00057        void setStartupScript(const QString& newScript);
00058        void setExtensionsEnabled(bool enable);
00059 
00060 protected:
00061        // Private helper functions
00062        void FinishScriptRun();
00063        void ReadPlugPrefs();
00064        void SavePlugPrefs();
00065        void rebuildRecentScriptsMenu();
00066        void buildScribusScriptsMenu();
00067        void buildRecentScriptsMenu();
00068        void rebuildScribusScriptsMenu();
00069 
00070        //Internal members
00072        PythonConsole *pcon;
00073        QStringList SavedRecentScripts;
00074        QStringList RecentScripts;
00075        MenuManager *menuMgr;
00076        QMap<QString, QGuardedPtr<ScrAction> > scrScripterActions;
00077        QMap<QString, QGuardedPtr<ScrAction> > scrRecentScriptActions;
00078 
00079        // Preferences
00081        bool m_enableExtPython;
00083        bool m_importAllNames;
00085        QString m_startupScript;
00086 };
00087 
00088 #endif