Subversion Repositories Scribus

Rev

Rev 1718 | Rev 2223 | 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
#include "conswin.h"
12
 
13
class ScrAction;
14
class MenuManager;
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();
1752 craig 33
        /*** Sets up the plugin for extension scripts, if enabled */
34
        void initExtensionScripts();
35
        /*** Runs the startup script, if enabled */
36
        void runStartupScript();
1718 craig 37
 
38
protected:
39
        // Private helper functions
40
        void FinishScriptRun();
41
        void ReadPlugPrefs();
42
        void SavePlugPrefs();
43
        void rebuildRecentScriptsMenu();
44
        void buildScribusScriptsMenu();
45
        void buildRecentScriptsMenu();
46
        void rebuildScribusScriptsMenu();
47
 
48
        // Internal members
49
        PConsole pcon;
50
        int cons;
51
        int about;
52
        QStringList SavedRecentScripts;
53
        QStringList RecentScripts;
54
        MenuManager *menuMgr;
55
        QMap<QString, QGuardedPtr<ScrAction> > scrScripterActions;
56
        QMap<QString, QGuardedPtr<ScrAction> > scrRecentScriptActions;
1752 craig 57
 
58
        // Preferences
59
        /*** pref: Enable access to main interpreter and 'extension scripts' */
60
        bool enableExtPython;
61
        /*** pref: Run 'from scribus import *' at scripter startup */
62
        bool importAllNames;
63
        /*** pref: Load this script on startup */
64
        QString startupScript;
1467 cbradney 65
};
66
 
67
#endif