-
Notifications
You must be signed in to change notification settings - Fork 345
/
programGuide.h
135 lines (105 loc) · 4.74 KB
/
programGuide.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
//////////////////////////////////////////////////////////////////////////////
// Program Name: programGuide.h
// Created : Jan. 15, 2010
//
// Purpose :
//
// Copyright (c) 2010 David Blain <dblain@mythtv.org>
//
// Licensed under the GPL v2 or later, see COPYING for details
//
//////////////////////////////////////////////////////////////////////////////
#ifndef PROGRAMGUIDE_H_
#define PROGRAMGUIDE_H_
#include <QDateTime>
#include <QString>
#include "serviceexp.h"
#include "datacontracthelper.h"
#include "programAndChannel.h"
namespace DTC
{
/////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////
//
//
//
/////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////
class SERVICE_PUBLIC ProgramGuide : public QObject
{
Q_OBJECT
Q_CLASSINFO( "version", "1.0" );
// Q_CLASSINFO Used to augment Metadata for properties.
// See datacontracthelper.h for details
Q_CLASSINFO( "Channels", "type=DTC::ChannelInfo");
Q_CLASSINFO( "AsOf" , "transient=true" );
Q_PROPERTY( QDateTime StartTime READ StartTime WRITE setStartTime )
Q_PROPERTY( QDateTime EndTime READ EndTime WRITE setEndTime )
Q_PROPERTY( int StartChanId READ StartChanId WRITE setStartChanId )
Q_PROPERTY( int EndChanId READ EndChanId WRITE setEndChanId )
Q_PROPERTY( int NumOfChannels READ NumOfChannels WRITE setNumOfChannels )
Q_PROPERTY( bool Details READ Details WRITE setDetails )
Q_PROPERTY( int Count READ Count WRITE setCount )
Q_PROPERTY( QDateTime AsOf READ AsOf WRITE setAsOf )
Q_PROPERTY( QString Version READ Version WRITE setVersion )
Q_PROPERTY( QString ProtoVer READ ProtoVer WRITE setProtoVer )
Q_PROPERTY( QVariantList Channels READ Channels DESIGNABLE true )
PROPERTYIMP ( QDateTime , StartTime )
PROPERTYIMP ( QDateTime , EndTime )
PROPERTYIMP ( int , StartChanId )
PROPERTYIMP ( int , EndChanId )
PROPERTYIMP ( int , NumOfChannels )
PROPERTYIMP ( bool , Details )
PROPERTYIMP ( int , Count )
PROPERTYIMP ( QDateTime , AsOf )
PROPERTYIMP ( QString , Version )
PROPERTYIMP ( QString , ProtoVer )
PROPERTYIMP_RO_REF( QVariantList, Channels )
public:
static void InitializeCustomTypes()
{
qRegisterMetaType< ProgramGuide >();
qRegisterMetaType< ProgramGuide* >();
ChannelInfo::InitializeCustomTypes();
}
public:
ProgramGuide(QObject *parent = 0)
: QObject ( parent ),
m_StartChanId ( 0 ),
m_EndChanId ( 0 ),
m_NumOfChannels ( 0 ),
m_Details ( false ),
m_Count ( 0 )
{
}
ProgramGuide( const ProgramGuide &src )
{
Copy( src );
}
void Copy( const ProgramGuide &src )
{
m_StartTime = src.m_StartTime ;
m_EndTime = src.m_EndTime ;
m_StartChanId = src.m_StartChanId ;
m_EndChanId = src.m_EndChanId ;
m_NumOfChannels= src.m_NumOfChannels;
m_Details = src.m_Details ;
m_Count = src.m_Count ;
m_AsOf = src.m_AsOf ;
m_Version = src.m_Version ;
m_ProtoVer = src.m_ProtoVer ;
CopyListContents< ChannelInfo >( this, m_Channels, src.m_Channels );
}
ChannelInfo *AddNewChannel()
{
// We must make sure the object added to the QVariantList has
// a parent of 'this'
ChannelInfo *pObject = new ChannelInfo( this );
Channels().append( QVariant::fromValue<QObject *>( pObject ));
return pObject;
}
};
} // namespace DTC
Q_DECLARE_METATYPE( DTC::ProgramGuide )
Q_DECLARE_METATYPE( DTC::ProgramGuide* )
#endif