Subversion Repositories Scribus

Rev

Rev 2223 | Rev 2503 | 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();
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
 
49
        // Internal members
50
        PConsole pcon;
51
        int cons;
52
        int about;
53
        QStringList SavedRecentScripts;
54
        QStringList RecentScripts;
55
        MenuManager *menuMgr;
56
        QMap<QString, QGuardedPtr<ScrAction> > scrScripterActions;
57
        QMap<QString, QGuardedPtr<ScrAction> > scrRecentScriptActions;
1752 craig 58
 
59
        // Preferences
60
        /*** pref: Enable access to main interpreter and 'extension scripts' */
61
        bool enableExtPython;
62
        /*** pref: Run 'from scribus import *' at scripter startup */
63
        bool importAllNames;
64
        /*** pref: Load this script on startup */
65
        QString startupScript;
1467 cbradney 66
};
67
 
68
#endif