00001 #ifndef FRONTEND_H 00002 #define FRONTEND_H 00003 00004 #include <QScriptEngine> 00005 #include "services/frontendServices.h" 00006 00007 class Frontend : public FrontendServices 00008 { 00009 friend class MythFEXML; 00010 00011 Q_OBJECT 00012 00013 public: 00014 Q_INVOKABLE Frontend(QObject *parent = 0) : FrontendServices(parent) { } 00015 00016 public: 00017 DTC::FrontendStatus* GetStatus(void); 00018 bool SendMessage(const QString &Message, 00019 uint Timeout); 00020 bool SendAction(const QString &Action, 00021 const QString &Value, 00022 uint Width, uint Height); 00023 virtual bool PlayRecording(int ChanId, 00024 const QDateTime &StartTime); 00025 bool PlayVideo(const QString &Id, bool UseBookmark); 00026 QStringList GetContextList(void); 00027 DTC::FrontendActionList* GetActionList(const QString &Context); 00028 00029 00030 static bool IsValidAction(const QString &action); 00031 static void InitialiseActions(void); 00032 00033 protected: 00034 static QStringList gActionList; 00035 static QHash<QString,QStringList> gActionDescriptions; 00036 }; 00037 00038 class ScriptableFrontend : public QObject 00039 { 00040 Q_OBJECT 00041 00042 private: 00043 Frontend m_obj; 00044 00045 public: 00046 Q_INVOKABLE ScriptableFrontend(QObject *parent = 0) : QObject(parent) { } 00047 00048 public slots: 00049 QObject* GetStatus(void) { return m_obj.GetStatus(); } 00050 }; 00051 00052 Q_SCRIPT_DECLARE_QMETAOBJECT(ScriptableFrontend, QObject*); 00053 00054 #endif // FRONTEND_H
1.6.3