00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00025
00026 #ifndef MYTH_H
00027 #define MYTH_H
00028
00029 #include <QScriptEngine>
00030
00031 #include "services/mythServices.h"
00032
00033 class Myth : public MythServices
00034 {
00035 Q_OBJECT
00036
00037 public:
00038
00039 Q_INVOKABLE Myth( QObject *parent = 0 ) : MythServices( parent ) {}
00040
00041 public:
00042
00043 DTC::ConnectionInfo* GetConnectionInfo ( const QString &Pin );
00044
00045 QString GetHostName ( );
00046 QStringList GetHosts ( );
00047 QStringList GetKeys ( );
00048
00049 DTC::StorageGroupDirList* GetStorageGroupDirs ( const QString &GroupName,
00050 const QString &HostName );
00051
00052 bool AddStorageGroupDir ( const QString &GroupName,
00053 const QString &DirName,
00054 const QString &HostName );
00055
00056 bool RemoveStorageGroupDir( const QString &GroupName,
00057 const QString &DirName,
00058 const QString &HostName );
00059
00060 DTC::TimeZoneInfo* GetTimeZone ( );
00061
00062 DTC::LogMessageList* GetLogs ( const QString &HostName,
00063 const QString &Application,
00064 int PID,
00065 int TID,
00066 const QString &Thread,
00067 const QString &Filename,
00068 int Line,
00069 const QString &Function,
00070 const QDateTime &FromTime,
00071 const QDateTime &ToTime,
00072 const QString &Level,
00073 const QString &MsgContains
00074 );
00075
00076 DTC::SettingList* GetSetting ( const QString &HostName,
00077 const QString &Key,
00078 const QString &Default );
00079
00080 bool PutSetting ( const QString &HostName,
00081 const QString &Key,
00082 const QString &Value );
00083
00084 bool ChangePassword ( const QString &UserName,
00085 const QString &OldPassword,
00086 const QString &NewPassword );
00087
00088 bool TestDBSettings ( const QString &HostName,
00089 const QString &UserName,
00090 const QString &Password,
00091 const QString &DBName,
00092 int dbPort);
00093
00094 bool SendMessage ( const QString &Message,
00095 const QString &Address,
00096 int udpPort,
00097 int Timeout);
00098
00099 bool BackupDatabase ( void );
00100
00101 bool CheckDatabase ( bool Repair );
00102
00103 bool ProfileSubmit ( void );
00104
00105 bool ProfileDelete ( void );
00106
00107 QString ProfileURL ( void );
00108
00109 QString ProfileUpdated ( void );
00110
00111 QString ProfileText ( void );
00112 };
00113
00114
00115
00116
00117
00118
00119
00120
00121
00122
00123
00124
00125
00126
00127
00128
00129 class ScriptableMyth : public QObject
00130 {
00131 Q_OBJECT
00132
00133 private:
00134
00135 Myth m_obj;
00136
00137 public:
00138
00139 Q_INVOKABLE ScriptableMyth( QObject *parent = 0 ) : QObject( parent ) {}
00140
00141 public slots:
00142
00143 QObject* GetConnectionInfo ( const QString &Pin )
00144 {
00145 return m_obj.GetConnectionInfo( Pin );
00146 }
00147
00148 QString GetHostName() { return m_obj.GetHostName(); }
00149 QStringList GetHosts () { return m_obj.GetHosts(); }
00150 QStringList GetKeys () { return m_obj.GetKeys (); }
00151
00152 QObject* GetStorageGroupDirs ( const QString &GroupName,
00153 const QString &HostName )
00154 {
00155 return m_obj.GetStorageGroupDirs( GroupName, HostName );
00156 }
00157
00158 bool AddStorageGroupDir ( const QString &GroupName,
00159 const QString &DirName,
00160 const QString &HostName )
00161 {
00162 return m_obj.AddStorageGroupDir( GroupName, DirName, HostName );
00163 }
00164
00165 bool RemoveStorageGroupDir ( const QString &GroupName,
00166 const QString &DirName,
00167 const QString &HostName )
00168 {
00169 return m_obj.RemoveStorageGroupDir( GroupName, DirName, HostName );
00170 }
00171
00172 QObject* GetTimeZone() { return m_obj.GetTimeZone( ); }
00173
00174 QObject* GetLogs( const QString &HostName,
00175 const QString &Application,
00176 int PID,
00177 int TID,
00178 const QString &Thread,
00179 const QString &Filename,
00180 int Line,
00181 const QString &Function,
00182 const QDateTime &FromTime,
00183 const QDateTime &ToTime,
00184 const QString &Level,
00185 const QString &MsgContains )
00186 {
00187 return m_obj.GetLogs( HostName, Application, PID, TID, Thread,
00188 Filename, Line, Function, FromTime, ToTime,
00189 Level, MsgContains );
00190 }
00191
00192 QObject* GetSetting ( const QString &HostName,
00193 const QString &Key,
00194 const QString &Default )
00195 {
00196 return m_obj.GetSetting( HostName, Key, Default );
00197 }
00198
00199 bool PutSetting( const QString &HostName,
00200 const QString &Key,
00201 const QString &Value )
00202 {
00203 return m_obj.PutSetting( HostName, Key, Value );
00204 }
00205
00206 bool TestDBSettings( const QString &HostName,
00207 const QString &UserName,
00208 const QString &Password,
00209 const QString &DBName,
00210 int dbPort)
00211 {
00212 return m_obj.TestDBSettings( HostName, UserName, Password,
00213 DBName, dbPort );
00214 }
00215
00216 bool SendMessage( const QString &Message,
00217 const QString &Address,
00218 int udpPort,
00219 int Timeout)
00220 {
00221 return m_obj.SendMessage( Message, Address, udpPort, Timeout );
00222 }
00223
00224 bool BackupDatabase( void )
00225 {
00226 return m_obj.BackupDatabase();
00227 }
00228
00229 bool CheckDatabase( bool Repair )
00230 {
00231 return m_obj.CheckDatabase( Repair );
00232 }
00233
00234 bool ProfileSubmit( void )
00235 {
00236 return m_obj.ProfileSubmit();
00237 }
00238
00239 bool ProfileDelete( void )
00240 {
00241 return m_obj.ProfileDelete();
00242 }
00243
00244 QString ProfileURL( void )
00245 {
00246 return m_obj.ProfileURL();
00247 }
00248
00249 QString ProfileUpdated( void )
00250 {
00251 return m_obj.ProfileUpdated();
00252 }
00253
00254 QString ProfileText( void )
00255 {
00256 return m_obj.ProfileText();
00257 }
00258 };
00259
00260
00261 Q_SCRIPT_DECLARE_QMETAOBJECT( ScriptableMyth, QObject*);
00262
00263
00264
00265 #endif