Subversion Repositories Scribus

Rev

Rev 2226 | Rev 2622 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
1718 craig 1
#ifndef SCRIPTERCORE_H
2
#define SCRIPTERCORE_H
1467 cbradney 3
 
4
#include "cmdvar.h"
5
 
1718 craig 6
#include "qmap.h"
7
#include "qguardedptr.h"
1467 cbradney 8
 
1718 craig 9
#include "menumanager.h"
10
#include "pconsole.h"
11
 
12
class ScrAction;
13
class MenuManager;
14
 
2503 subik 15
 
1467 cbradney 16
class ScripterCore : public QObject
17
{
1718 craig 18
        Q_OBJECT
1467 cbradney 19
 
20
public:
1718 craig 21
        ScripterCore(QWidget* parent);
22
        ~ScripterCore();
23
 
1467 cbradney 24
public slots:
1718 craig 25
        void slotTest();
26
        void StdScript(QString filebasename);
27
        void RecentScript(QString fn);
1752 craig 28
        void slotRunScriptFile(QString fileName, bool inMainInterpreter = false);
1718 craig 29
        QString slotRunScript(QString Script);
30
        void slotInteractiveScript(bool);
31
        void slotExecute();
32
        void aboutScript();
2503 subik 33
        /** Sets up the plugin for extension scripts, if enabled */
1752 craig 34
        void initExtensionScripts();
2503 subik 35
        /** Runs the startup script, if enabled */
1752 craig 36
        void runStartupScript();
2226 cbradney 37
        void languageChange();
1718 craig 38
 
39
protected:
40
        // Private helper functions
41
        void FinishScriptRun();
42
        void ReadPlugPrefs();
43
        void SavePlugPrefs();
44
        void rebuildRecentScriptsMenu();
45
        void buildScribusScriptsMenu();
46
        void buildRecentScriptsMenu();
47
        void rebuildScribusScriptsMenu();
48
 
2503 subik 49
        //Internal members
50
        //! Reference to the "IDE" widget
51
        PythonConsole *pcon;
1718 craig 52
        int cons;
53
        int about;
54
        QStringList SavedRecentScripts;
55
        QStringList RecentScripts;
56
        MenuManager *menuMgr;
57
        QMap<QString, QGuardedPtr<ScrAction> > scrScripterActions;
58
        QMap<QString, QGuardedPtr<ScrAction> > scrRecentScriptActions;
1752 craig 59
 
60
        // Preferences
2503 subik 61
        /** pref: Enable access to main interpreter and 'extension scripts' */
1752 craig 62
        bool enableExtPython;
2503 subik 63
        /** pref: Run 'from scribus import *' at scripter startup */
1752 craig 64
        bool importAllNames;
2503 subik 65
        /** pref: Load this script on startup */
1752 craig 66
        QString startupScript;
1467 cbradney 67
};
68
 
69
#endif