-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathluascriptqmladapter.h
More file actions
58 lines (47 loc) · 2.36 KB
/
Copy pathluascriptqmladapter.h
File metadata and controls
58 lines (47 loc) · 2.36 KB
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
58
#ifndef LUASCRIPTQMLADAPTER_H
#define LUASCRIPTQMLADAPTER_H
#include <QObject>
#include <QQmlComponent>
#include <QQuickItem>
#include <QMutex>
class LuaScriptQmlAdapter : public QObject
{
Q_OBJECT
public:
explicit LuaScriptQmlAdapter(QObject* parent = Q_NULLPTR);
Q_INVOKABLE void checkSyntax(const QString& filePathName, const QString& luaCode);
Q_INVOKABLE void changeTab(int newTabIndex);
Q_INVOKABLE void requestSetLuaApi(const QString& filePathName, bool parseSilent);
Q_INVOKABLE void relayKeyPress(int key);
public:
/**
* @brief instance is the getter used to receive the object of this singleton implementation.
* @returns singleton instance of this
*/
static LuaScriptQmlAdapter* instance();
/**
* @brief The singleton type provider is needed by the Qt(-meta)-system to register this singleton instace in qml world
* @param pEngine not used but needed by function base
* @param pSriptEngine not used but needed by function base
* @returns singleton instance of this
*/
static QObject* getSingletonTypeProvider(QQmlEngine* pEngine, QJSEngine* pScriptEngine);
Q_SIGNALS:
void signal_requestSyntaxCheck(const QString& filePathName, const QString& luaCode);
void signal_syntaxCheckResult(const QString& filePathName, bool valid, int line, int start, int end, const QString& message);
void signal_runtimeErrorResult(const QString& filePathName, bool valid, int line, int start, int end, const QString& message);
void signal_changeTab(int newTabIndex);
void signal_requestSetLuaApi(const QString& filePathName, bool parseSilent);
void signal_luaApiPreparationResult(bool parseSilent, bool success, const QString& message);
void signal_relayKeyPress(int key);
void signal_resultSearchMatchCount(int matchCount);
public Q_SLOTS:
void syntaxCheckResult(const QString& filePathName, bool valid, int line, int start, int end, const QString& message);
void runtimeErrorResult(const QString& filePathName, bool valid, int line, int start, int end, const QString& message);
void luaApiPreparationResult(bool parseSilent, bool success, const QString& message);
void resultSearchMatchCount(int matchCount);
private:
static LuaScriptQmlAdapter* ms_pInstance;
static QMutex ms_mutex;
};
#endif // LUASCRIPTQMLADAPTER_H