SciDAVis  1.D4
ScriptingEnv.h
Go to the documentation of this file.
1 /***************************************************************************
2  File : ScriptingEnv.h
3  Project : SciDAVis
4  --------------------------------------------------------------------
5  Copyright : (C) 2006 by Ion Vasilief,
6  Tilman Benkert,
7  Knut Franke
8  Email (use @ for *) : ion_vasilief*yahoo.fr, thzs*gmx.net
9  Description : Scripting abstraction layer
10 
11  ***************************************************************************/
12 
13 /***************************************************************************
14  * *
15  * This program is free software; you can redistribute it and/or modify *
16  * it under the terms of the GNU General Public License as published by *
17  * the Free Software Foundation; either version 2 of the License, or *
18  * (at your option) any later version. *
19  * *
20  * This program is distributed in the hope that it will be useful, *
21  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
22  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
23  * GNU General Public License for more details. *
24  * *
25  * You should have received a copy of the GNU General Public License *
26  * along with this program; if not, write to the Free Software *
27  * Foundation, Inc., 51 Franklin Street, Fifth Floor, *
28  * Boston, MA 02110-1301 USA *
29  * *
30  ***************************************************************************/
31 #ifndef SCRIPTINGENV_H
32 #define SCRIPTINGENV_H
33 
34 #include <QVariant>
35 #include <QString>
36 #include <QStringList>
37 #include <QObject>
38 #include <QStringList>
39 #include <QEvent>
40 
41 #include "customevents.h"
42 
43 class ApplicationWindow;
44 class Script;
45 
47 
52 class ScriptingEnv : public QObject
53 {
54  Q_OBJECT
55 
56  public:
57  ScriptingEnv(ApplicationWindow *parent, const char *langName);
59  virtual bool initialize() { return true; };
61  bool initialized() const { return d_initialized; }
63  virtual bool isRunning() const { return false; }
64 
66  virtual Script *newScript(const QString&, QObject*, const QString&) { return 0; }
67 
69  virtual QString stackTraceString() { return QString::null; }
70 
72  virtual const QStringList mathFunctions() const { return QStringList(); }
74  virtual const QString mathFunctionDoc(const QString&) const { return QString::null; }
76  virtual const QStringList fileExtensions() const { return QStringList(); };
78  const QString fileFilter() const;
79 
80 // virtual QSyntaxHighlighter syntaxHighlighter(QTextEdit *textEdit) const;
81 
82  public slots:
83  // global variables
84  virtual bool setQObject(QObject*, const char*) { return false; }
85  virtual bool setInt(int, const char*) { return false; }
86  virtual bool setDouble(double, const char*) { return false; }
87 
89  virtual void clear() {}
91  virtual void stopExecution() {}
93  virtual void startExecution() {}
94 
96  void incref();
98  void decref();
99 
100  signals:
102  void error(const QString & message, const QString & scriptName, int lineNumber);
104  void print(const QString & output);
105 
106  protected:
111 
112  private:
115 };
116 
117 #endif