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