00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00021
00022 #ifndef GUIDE_H
00023 #define GUIDE_H
00024
00025 #include <QScriptEngine>
00026
00027 #include "serviceUtil.h"
00028
00029 #include "services/guideServices.h"
00030
00031 #include "datacontracts/programAndChannel.h"
00032 #include "programinfo.h"
00033
00034 class Guide : public GuideServices
00035 {
00036 Q_OBJECT
00037
00038 public:
00039
00040 Q_INVOKABLE Guide( QObject *parent = 0 ) {}
00041
00042 public:
00043
00044
00045 DTC::ProgramGuide* GetProgramGuide ( const QDateTime &StartTime ,
00046 const QDateTime &EndTime ,
00047 int StartChanId,
00048 int NumChannels,
00049 bool Details );
00050
00051 DTC::Program* GetProgramDetails ( int ChanId,
00052 const QDateTime &StartTime );
00053
00054 QFileInfo GetChannelIcon ( int ChanId,
00055 int Width ,
00056 int Height );
00057 };
00058
00059
00060
00061
00062
00063
00064
00065
00066
00067
00068
00069
00070
00071
00072
00073
00074 class ScriptableGuide : public QObject
00075 {
00076 Q_OBJECT
00077
00078 private:
00079
00080 Guide m_obj;
00081
00082 public:
00083
00084 Q_INVOKABLE ScriptableGuide( QObject *parent = 0 ) : QObject( parent ) {}
00085
00086 public slots:
00087
00088 QObject* GetProgramGuide( const QDateTime &StartTime ,
00089 const QDateTime &EndTime ,
00090 int StartChanId,
00091 int NumChannels,
00092 bool Details )
00093 {
00094 return m_obj.GetProgramGuide( StartTime, EndTime, StartChanId, NumChannels, Details );
00095 }
00096
00097 QObject* GetProgramDetails( int ChanId, const QDateTime &StartTime )
00098 {
00099 return m_obj.GetProgramDetails( ChanId, StartTime );
00100 }
00101
00102 QFileInfo GetChannelIcon( int ChanId, int Width, int Height )
00103 {
00104 return m_obj.GetChannelIcon( ChanId, Width, Height );
00105 }
00106 };
00107
00108 Q_SCRIPT_DECLARE_QMETAOBJECT( ScriptableGuide, QObject*);
00109
00110 #endif