-
Notifications
You must be signed in to change notification settings - Fork 345
/
frontend.h
50 lines (36 loc) · 1.22 KB
/
frontend.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
#ifndef FRONTEND_H
#define FRONTEND_H
#include <QScriptEngine>
#include "services/frontendServices.h"
class Frontend : public FrontendServices
{
friend class MythFEXML;
Q_OBJECT
public:
Q_INVOKABLE Frontend(QObject *parent = 0) : FrontendServices(parent) { }
public:
DTC::FrontendStatus* GetStatus(void);
bool SendMessage(const QString &Message);
bool SendAction(const QString &Action,
const QString &Value,
uint Width, uint Height);
QStringList GetContextList(void);
DTC::FrontendActionList* GetActionList(const QString &Context);
static bool IsValidAction(const QString &action);
static void InitialiseActions(void);
protected:
static QStringList gActionList;
static QHash<QString,QStringList> gActionDescriptions;
};
class ScriptableFrontend : public QObject
{
Q_OBJECT
private:
Frontend m_obj;
public:
Q_INVOKABLE ScriptableFrontend(QObject *parent = 0) : QObject(parent) { }
public slots:
QObject* GetStatus(void) { return m_obj.GetStatus(); }
};
Q_SCRIPT_DECLARE_QMETAOBJECT(ScriptableFrontend, QObject*);
#endif // FRONTEND_H