MythTV master
mythfrontendservice.h
Go to the documentation of this file.
1#ifndef MYTHFRONTENDSERVICE_H
2#define MYTHFRONTENDSERVICE_H
3
4// MythTV
6
7#define FRONTEND_SERVICE QString("/Frontend/")
8#define FRONTEND_HANDLE QString("Frontend")
9
10class FrontendStatus : public QObject
11{
12 Q_OBJECT
13 Q_CLASSINFO("Version", "1.1")
14 Q_CLASSINFO("State", "type=QString")
15 Q_CLASSINFO("ChapterTimes", "type=QString;name=Chapter")
16 Q_CLASSINFO("SubtitleTracks", "type=QString;name=Track")
17 Q_CLASSINFO("AudioTracks", "type=QString;name=Track")
18 SERVICE_PROPERTY2(QString, Name)
19 SERVICE_PROPERTY2(QString, Version)
20 SERVICE_PROPERTY2(QVariantMap, State)
21 SERVICE_PROPERTY2(QVariantList, ChapterTimes)
22 SERVICE_PROPERTY2(QVariantMap, SubtitleTracks)
23 SERVICE_PROPERTY2(QVariantMap, AudioTracks)
24
25 public:
26 Q_INVOKABLE FrontendStatus(QObject *parent = nullptr)
27 : QObject ( parent ) {};
28 FrontendStatus(QString Name, QString Version, QVariantMap State);
29};
30
32
33class FrontendActionList : public QObject
34{
35 Q_OBJECT
36 Q_CLASSINFO("Version", "1.0")
37 Q_CLASSINFO("ActionList", "type=QString;name=Action")
38 SERVICE_PROPERTY2(QVariantMap, ActionList)
39
40 public:
41 Q_INVOKABLE FrontendActionList(QObject *parent = nullptr)
42 : QObject ( parent ) {};
43 FrontendActionList(QVariantMap List);
44};
45
47
49{
50 Q_OBJECT
51 Q_CLASSINFO("Version", "2.1")
52 Q_CLASSINFO("SendAction", "methods=POST")
53 Q_CLASSINFO("SendKey", "methods=POST")
54 Q_CLASSINFO("PlayVideo", "methods=POST")
55 Q_CLASSINFO("PlayRecording", "methods=POST")
56 Q_CLASSINFO("SendMessage", "methods=POST")
57 Q_CLASSINFO("SendNotification", "methods=POST")
58 Q_CLASSINFO("GetContextList", "name=StringList") // Consistency with old code
59
60 public slots:
61 static bool SendAction (const QString& Action, const QString& Value, uint Width, uint Height);
62 static bool SendKey (const QString& Key);
63 static FrontendActionList* GetActionList(const QString& Context);
64 static QStringList GetContextList ();
65 static FrontendStatus* GetStatus ();
66 static bool PlayVideo (const QString& Id, bool UseBookmark);
67 static bool PlayRecording (int RecordedId, int ChanId, const QDateTime& StartTime);
68 static bool SendMessage (const QString& Message, uint Timeout);
69 static bool SendNotification(bool Error, const QString& Type,
70 const QString& Message, const QString& Origin,
71 const QString& Description, const QString& Image,
72 const QString& Extra, const QString& ProgressText,
73 float Progress, std::chrono::seconds Timeout,
74 bool Fullscreen, uint Visibility,
76
77 public:
79 ~MythFrontendService() override = default;
80 static void RegisterCustomTypes();
81
82 protected:
83 static bool IsValidAction(const QString& Action);
84
85 private:
86 Q_DISABLE_COPY(MythFrontendService)
87};
88
89#endif
QList< ActionID > ActionList
Definition: action.h:115
An action (for this plugin) consists of a description, and a set of key sequences.
Definition: action.h:41
Q_INVOKABLE FrontendActionList(QObject *parent=nullptr)
Q_INVOKABLE FrontendStatus(QObject *parent=nullptr)
static void RegisterCustomTypes()
~MythFrontendService() override=default
unsigned int uint
Definition: freesurround.h:24
static int SendMessage(const MythUtilCommandLineParser &cmdline)
Q_DECLARE_METATYPE(std::chrono::seconds)
#define SERVICE_PROPERTY2(Type, Name)
void PlayVideo(const QString &filename, const VideoMetadataListManager &video_list, bool useAltPlayer=false)
Definition: videodlg.cpp:269
State
Definition: zmserver.h:69