/
_extensionname_.h
57 lines (46 loc) · 1.97 KB
/
_extensionname_.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
//_extensionname_
//Copyright (C) 2015 _authorname_
//
//This file is part of BrainStim.
//BrainStim is free software: you can redistribute it and/or modify
//it under the terms of the GNU General Public License as published by
//the Free Software Foundation, either version 3 of the License, or
//(at your option) any later version.
//
//This program is distributed in the hope that it will be useful,
//but WITHOUT ANY WARRANTY; without even the implied warranty of
//MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
//GNU General Public License for more details.
//
//You should have received a copy of the GNU General Public License
//along with this program. If not, see <http://www.gnu.org/licenses/>.
//
//This file defines the script binding interface, all below function are scriptable except for the destructor
#ifndef _extensionname__H
#define _extensionname__H
#include <QObject>
#include <QString>
#include <QtScript>
#include <QScriptable>
#include "mainappinfo.h"
class _extensionname_ : public QObject, protected QScriptable
{
Q_OBJECT
//Q_CLASSINFO("ScriptAPIClassName", "_extensionname_");//Can't use defines here!, moc doesn't handle defines, not needed here
Q_PROPERTY( short ExampleProperty WRITE setExampleProperty READ getExampleProperty )
signals:
void ExampleSignalTriggered(short);
public:
_extensionname_(QObject *parent = 0);
~_extensionname_();
_extensionname_(const _extensionname_& other ){Q_UNUSED(other);}//TODO fill in copy constructor, should be used for the Q_DECLARE_METATYPE macro
static QScriptValue ctor__extensionname_(QScriptContext* context, QScriptEngine* engine);
public slots:
bool makeThisAvailableInScript(QString strObjectScriptName = "", QObject *engine = NULL);//To make the objects (e.g. defined in a *.exml file) available in the script
void setExampleProperty( short sExampleProperty );
short getExampleProperty() const;
private:
QScriptEngine* currentScriptEngine;
short m_ExampleProperty;
};
#endif // _extensionname__H