MythTV  master
v2myth.h
Go to the documentation of this file.
1 #ifndef V2MYTH_H
2 #define V2MYTH_H
3 
5 #include "v2connectionInfo.h"
7 #include "v2timeZoneInfo.h"
8 #include "v2logMessageList.h"
9 #include "v2frontendList.h"
10 #include "v2settingList.h"
11 #include "v2backendInfo.h"
12 #include "v2buildInfo.h"
13 #include "v2envInfo.h"
14 #include "v2logInfo.h"
15 
16 #define MYTH_SERVICE QString("/Myth/")
17 #define MYTH_HANDLE QString("Myth")
18 
19 class V2Myth : public MythHTTPService
20 {
21  Q_OBJECT
22  Q_CLASSINFO( "Version" , "5.2" )
23  Q_CLASSINFO( "GetHostName", "methods=GET;name=String" )
24  Q_CLASSINFO( "GetHosts", "methods=GET;name=StringList" )
25  Q_CLASSINFO( "GetKeys", "methods=GET;name=StringList" )
26  Q_CLASSINFO( "AddStorageGroupDir", "methods=POST" )
27  Q_CLASSINFO( "RemoveStorageGroupDir", "methods=POST" )
28  Q_CLASSINFO( "GetFormatDate", "methods=GET;name=String" )
29  Q_CLASSINFO( "GetFormatDateTime", "methods=GET;name=String" )
30  Q_CLASSINFO( "GetFormatTime", "methods=GET;name=String" )
31  Q_CLASSINFO( "ParseISODateString", "methods=GET" )
32  Q_CLASSINFO( "GetSetting", "methods=GET;name=String" )
33  Q_CLASSINFO( "PutSetting", "methods=POST" )
34  Q_CLASSINFO( "DeleteSetting", "methods=POST" )
35  Q_CLASSINFO( "TestDBSettings", "methods=POST" )
36  Q_CLASSINFO( "SendMessage", "methods=POST" )
37  Q_CLASSINFO( "SendNotification", "methods=POST" )
38  Q_CLASSINFO( "BackupDatabase", "methods=POST" )
39  Q_CLASSINFO( "CheckDatabase", "methods=POST" )
40  Q_CLASSINFO( "DelayShutdown", "methods=POST" )
41  Q_CLASSINFO( "ProfileSubmit", "methods=POST" )
42  Q_CLASSINFO( "ProfileDelete", "methods=POST" )
43  Q_CLASSINFO( "ProfileURL", "methods=GET" )
44  Q_CLASSINFO( "ProfileUpdated", "methods=GET" )
45  Q_CLASSINFO( "ProfileText", "methods=GET" )
46  Q_CLASSINFO( "ManageDigestUser", "methods=POST" )
47  Q_CLASSINFO( "ManageUrlProtection", "methods=POST" )
48  Q_CLASSINFO( "SetConnectionInfo", "methods=POST" )
49  Q_CLASSINFO("ManageScheduler", "methods=POST")
50  Q_CLASSINFO("Shutdown", "methods=POST")
51  Q_CLASSINFO("Proxy", "methods=GET,POST")
52 
53  public:
54  V2Myth();
55  ~V2Myth() override = default;
56  static void RegisterCustomTypes();
57 
58  public slots:
59 
60  static V2ConnectionInfo* GetConnectionInfo ( const QString &Pin );
61 
62  static bool SetConnectionInfo ( const QString &Host,
63  const QString &UserName,
64  const QString &Password,
65  const QString &Name,
66  int Port,
67  bool DoTest);
68 
69  static QString GetHostName ( );
70 
71  static QStringList GetHosts ( );
72 
73  static QStringList GetKeys ( );
74 
75  static QStringList GetDirListing ( const QString &DirName,
76  bool Files );
77 
78  static V2StorageGroupDirList* GetStorageGroupDirs ( const QString &GroupName,
79  const QString &HostName );
80 
81  static bool AddStorageGroupDir ( const QString &GroupName,
82  const QString &DirName,
83  const QString &HostName );
84 
85  static bool RemoveStorageGroupDir( const QString &GroupName,
86  const QString &DirName,
87  const QString &HostName );
88 
89  static V2TimeZoneInfo* GetTimeZone ( );
90 
91  static QString GetFormatDate ( const QDateTime &Date,
92  bool ShortDate );
93 
94  static QString GetFormatDateTime ( const QDateTime &DateTime,
95  bool ShortDate );
96 
97  static QString GetFormatTime ( const QDateTime &Time );
98 
99  static QDateTime ParseISODateString ( const QString &DateTime );
100 
101  static V2LogMessageList* GetLogs ( const QString &HostName,
102  const QString &Application,
103  int PID,
104  int TID,
105  const QString &Thread,
106  const QString &Filename,
107  int Line,
108  const QString &Function,
109  const QDateTime &FromTime,
110  const QDateTime &ToTime,
111  const QString &Level,
112  const QString &MsgContains
113  );
114 
115 
116  static V2FrontendList* GetFrontends ( bool OnLine );
117  static QString GetSetting ( const QString &HostName,
118  const QString &Key,
119  const QString &Default );
120  static V2SettingList* GetSettingList ( const QString &HostName );
121 
122  static bool PutSetting ( const QString &HostName,
123  const QString &Key,
124  const QString &Value );
125 
126  static bool DeleteSetting ( const QString &HostName,
127  const QString &Key);
128 
129  static bool TestDBSettings ( const QString &HostName,
130  const QString &UserName,
131  const QString &Password,
132  const QString &DBName,
133  int dbPort);
134 
135  static bool SendMessage ( const QString &Message,
136  const QString &Address,
137  int udpPort,
138  int Timeout);
139 
140  static bool SendNotification ( bool Error,
141  const QString &Type,
142  const QString &Message,
143  const QString &Origin,
144  const QString &Description,
145  const QString &Image,
146  const QString &Extra,
147  const QString &ProgressText,
148  float Progress,
149  int Timeout,
150  bool Fullscreen,
151  uint Visibility,
152  uint Priority,
153  const QString &Address,
154  int udpPort );
155 
156  static bool BackupDatabase ( void );
157 
158  static bool CheckDatabase ( bool Repair );
159 
160  static bool DelayShutdown ( void );
161 
162  static bool ProfileSubmit ( void );
163 
164  static bool ProfileDelete ( void );
165 
166  static QString ProfileURL ( void );
167 
168  static QString ProfileUpdated ( void );
169 
170  static QString ProfileText ( void );
171 
172  static V2BackendInfo* GetBackendInfo ( void );
173 
174  static bool ManageDigestUser ( const QString &Action,
175  const QString &UserName,
176  const QString &Password,
177  const QString &NewPassword,
178  const QString &AdminPassword );
179 
180  static bool ManageUrlProtection ( const QString &Services,
181  const QString &AdminPassword );
182 
183  static bool ManageScheduler ( bool Enable,
184  bool Disable );
185 
186  static bool Shutdown ( int Retcode, bool Restart);
187 
188  static QString Proxy ( const QString &Url);
189 
190  private:
191  Q_DISABLE_COPY(V2Myth)
192 
193 };
194 
195 #endif // V2MYTH_H
Password
static StandardSetting * Password(bool enabled)
Setting for changing password.
Definition: galleryconfig.cpp:245
V2Myth::GetHostName
static QString GetHostName()
Definition: v2myth.cpp:187
v2storageGroupDirList.h
V2Myth::DeleteSetting
static bool DeleteSetting(const QString &HostName, const QString &Key)
Definition: v2myth.cpp:787
V2Myth::GetDirListing
static QStringList GetDirListing(const QString &DirName, bool Files)
Definition: v2myth.cpp:268
V2Myth::GetKeys
static QStringList GetKeys()
Definition: v2myth.cpp:234
V2Myth::ProfileUpdated
static QString ProfileUpdated(void)
Definition: v2myth.cpp:1071
V2Myth::GetFormatDate
static QString GetFormatDate(const QDateTime &Date, bool ShortDate)
Definition: v2myth.cpp:481
V2Myth::PutSetting
static bool PutSetting(const QString &HostName, const QString &Key, const QString &Value)
Definition: v2myth.cpp:766
V2ConnectionInfo
Definition: v2connectionInfo.h:9
V2Myth::ProfileText
static QString ProfileText(void)
Definition: v2myth.cpp:1089
V2LogMessageList
Definition: v2logMessageList.h:10
V2Myth::DelayShutdown
static bool DelayShutdown(void)
Definition: v2myth.cpp:1009
v2frontendList.h
V2TimeZoneInfo
Definition: v2timeZoneInfo.h:8
Image
Definition: image.h:33
V2BackendInfo
Definition: v2backendInfo.h:19
Action
An action (for this plugin) consists of a description, and a set of key sequences.
Definition: action.h:40
V2Myth::ManageScheduler
static bool ManageScheduler(bool Enable, bool Disable)
Definition: v2myth.cpp:1258
V2Myth::SetConnectionInfo
static bool SetConnectionInfo(const QString &Host, const QString &UserName, const QString &Password, const QString &Name, int Port, bool DoTest)
Definition: v2myth.cpp:149
v2buildInfo.h
V2Myth
Definition: v2myth.h:19
v2envInfo.h
v2logMessageList.h
V2Myth::GetLogs
static V2LogMessageList * GetLogs(const QString &HostName, const QString &Application, int PID, int TID, const QString &Thread, const QString &Filename, int Line, const QString &Function, const QDateTime &FromTime, const QDateTime &ToTime, const QString &Level, const QString &MsgContains)
Definition: v2myth.cpp:530
V2Myth::ManageUrlProtection
static bool ManageUrlProtection(const QString &Services, const QString &AdminPassword)
Definition: v2myth.cpp:1200
V2Myth::~V2Myth
~V2Myth() override=default
V2Myth::GetFormatTime
static QString GetFormatTime(const QDateTime &Time)
Definition: v2myth.cpp:507
v2logInfo.h
V2Myth::GetFormatDateTime
static QString GetFormatDateTime(const QDateTime &DateTime, bool ShortDate)
Definition: v2myth.cpp:494
V2StorageGroupDirList
Definition: v2storageGroupDirList.h:9
PID
Contains Packet Identifier numeric values.
Definition: mpegtables.h:206
V2Myth::Proxy
static QString Proxy(const QString &Url)
Definition: v2myth.cpp:1296
uint
unsigned int uint
Definition: compat.h:81
V2Myth::BackupDatabase
static bool BackupDatabase(void)
Definition: v2myth.cpp:966
MythHTTPService
Definition: mythhttpservice.h:19
V2Myth::GetFrontends
static V2FrontendList * GetFrontends(bool OnLine)
Definition: v2myth.cpp:663
V2Myth::GetSetting
static QString GetSetting(const QString &HostName, const QString &Key, const QString &Default)
Definition: v2myth.cpp:676
V2Myth::AddStorageGroupDir
static bool AddStorageGroupDir(const QString &GroupName, const QString &DirName, const QString &HostName)
Definition: v2myth.cpp:363
mythhttpservice.h
V2Myth::GetConnectionInfo
static V2ConnectionInfo * GetConnectionInfo(const QString &Pin)
Definition: v2myth.cpp:69
V2Myth::ParseISODateString
static QDateTime ParseISODateString(const QString &DateTime)
Definition: v2myth.cpp:516
V2Myth::GetStorageGroupDirs
static V2StorageGroupDirList * GetStorageGroupDirs(const QString &GroupName, const QString &HostName)
Definition: v2myth.cpp:283
v2backendInfo.h
V2Myth::GetHosts
static QStringList GetHosts()
Definition: v2myth.cpp:199
Name
Definition: channelsettings.cpp:71
V2Myth::CheckDatabase
static bool CheckDatabase(bool Repair)
Definition: v2myth.cpp:995
v2timeZoneInfo.h
V2Myth::Shutdown
static bool Shutdown(int Retcode, bool Restart)
Definition: v2myth.cpp:1281
V2SettingList
Definition: v2settingList.h:16
v2connectionInfo.h
V2Myth::ProfileSubmit
static bool ProfileSubmit(void)
Definition: v2myth.cpp:1023
V2Myth::GetBackendInfo
static V2BackendInfo * GetBackendInfo(void)
Definition: v2myth.cpp:1103
V2Myth::TestDBSettings
static bool TestDBSettings(const QString &HostName, const QString &UserName, const QString &Password, const QString &DBName, int dbPort)
Definition: v2myth.cpp:808
V2Myth::RegisterCustomTypes
static void RegisterCustomTypes()
V2FrontendList
Definition: v2frontendList.h:18
V2Myth::ProfileURL
static QString ProfileURL(void)
Definition: v2myth.cpp:1055
V2Myth::ManageDigestUser
static bool ManageDigestUser(const QString &Action, const QString &UserName, const QString &Password, const QString &NewPassword, const QString &AdminPassword)
Definition: v2myth.cpp:1168
v2settingList.h
V2Myth::SendMessage
static bool SendMessage(const QString &Message, const QString &Address, int udpPort, int Timeout)
Definition: v2myth.cpp:834
V2Myth::SendNotification
static bool SendNotification(bool Error, const QString &Type, const QString &Message, const QString &Origin, const QString &Description, const QString &Image, const QString &Extra, const QString &ProgressText, float Progress, int Timeout, bool Fullscreen, uint Visibility, uint Priority, const QString &Address, int udpPort)
Definition: v2myth.cpp:888
Priority
Definition: channelsettings.cpp:216
V2Myth::RemoveStorageGroupDir
static bool RemoveStorageGroupDir(const QString &GroupName, const QString &DirName, const QString &HostName)
Definition: v2myth.cpp:425
V2Myth::V2Myth
V2Myth()
Definition: v2myth.cpp:60
V2Myth::GetTimeZone
static V2TimeZoneInfo * GetTimeZone()
Definition: v2myth.cpp:466
V2Myth::ProfileDelete
static bool ProfileDelete(void)
Definition: v2myth.cpp:1039
V2Myth::GetSettingList
static V2SettingList * GetSettingList(const QString &HostName)
Definition: v2myth.cpp:714