MythTV  master
videoMultiplexList.h
Go to the documentation of this file.
1 #ifndef VIDEOMULTIPLEXLIST_H_
2 #define VIDEOMULTIPLEXLIST_H_
3 
4 #include <QVariantList>
5 #include <QDateTime>
6 
9 
10 #include "videoMultiplex.h"
11 
12 namespace DTC
13 {
14 
15 class SERVICE_PUBLIC VideoMultiplexList : public QObject
16 {
17  Q_OBJECT
18  Q_CLASSINFO( "version", "1.0" );
19 
20  // Q_CLASSINFO Used to augment Metadata for properties.
21  // See datacontracthelper.h for details
22 
23  Q_CLASSINFO( "VideoMultiplexes", "type=DTC::VideoMultiplex");
24  Q_CLASSINFO( "AsOf" , "transient=true" );
25 
26  Q_PROPERTY( int StartIndex READ StartIndex WRITE setStartIndex )
27  Q_PROPERTY( int Count READ Count WRITE setCount )
28  Q_PROPERTY( int CurrentPage READ CurrentPage WRITE setCurrentPage )
29  Q_PROPERTY( int TotalPages READ TotalPages WRITE setTotalPages )
30  Q_PROPERTY( int TotalAvailable READ TotalAvailable WRITE setTotalAvailable )
31  Q_PROPERTY( QDateTime AsOf READ AsOf WRITE setAsOf )
32  Q_PROPERTY( QString Version READ Version WRITE setVersion )
33  Q_PROPERTY( QString ProtoVer READ ProtoVer WRITE setProtoVer )
34 
35  Q_PROPERTY( QVariantList VideoMultiplexes READ VideoMultiplexes )
36 
37  PROPERTYIMP ( int , StartIndex )
38  PROPERTYIMP ( int , Count )
39  PROPERTYIMP ( int , CurrentPage )
40  PROPERTYIMP ( int , TotalPages )
41  PROPERTYIMP ( int , TotalAvailable )
42  PROPERTYIMP_REF ( QDateTime , AsOf )
43  PROPERTYIMP_REF ( QString , Version )
44  PROPERTYIMP_REF ( QString , ProtoVer )
45 
46  PROPERTYIMP_RO_REF( QVariantList, VideoMultiplexes );
47 
48  public:
49 
50  static inline void InitializeCustomTypes();
51 
52  Q_INVOKABLE VideoMultiplexList(QObject *parent = nullptr)
53  : QObject( parent ),
54  m_StartIndex ( 0 ),
55  m_Count ( 0 ),
56  m_CurrentPage ( 0 ),
57  m_TotalPages ( 0 ),
58  m_TotalAvailable ( 0 )
59  {
60  }
61 
62  void Copy( const VideoMultiplexList *src )
63  {
64  m_AsOf = src->m_AsOf ;
65  m_Version = src->m_Version ;
66  m_ProtoVer = src->m_ProtoVer ;
67 
68  CopyListContents< VideoMultiplex >( this, m_VideoMultiplexes, src->m_VideoMultiplexes );
69  }
70 
72  {
73  // We must make sure the object added to the QVariantList has
74  // a parent of 'this'
75 
76  auto *pObject = new VideoMultiplex( this );
77  m_VideoMultiplexes.append( QVariant::fromValue<QObject *>( pObject ));
78 
79  return pObject;
80  }
81 
82  private:
83  Q_DISABLE_COPY(VideoMultiplexList);
84 };
85 
87 {
88  qRegisterMetaType< VideoMultiplexList* >();
89 
91 }
92 
93 } // namespace DTC
94 
95 #endif
DTC::VideoMultiplexList::AddNewVideoMultiplex
VideoMultiplex * AddNewVideoMultiplex()
Definition: videoMultiplexList.h:71
videoMultiplex.h
DTC::VideoMultiplex
Definition: videoMultiplex.h:15
DTC::VideoMultiplexList::InitializeCustomTypes
static void InitializeCustomTypes()
Definition: videoMultiplexList.h:86
SERVICE_PUBLIC
#define SERVICE_PUBLIC
Definition: serviceexp.h:9
PROPERTYIMP_RO_REF
#define PROPERTYIMP_RO_REF(type, name)
Definition: datacontracthelper.h:114
datacontracthelper.h
serviceexp.h
DTC::VideoMultiplexList::Copy
void Copy(const VideoMultiplexList *src)
Definition: videoMultiplexList.h:62
PROPERTYIMP
#define PROPERTYIMP(type, name)
Definition: datacontracthelper.h:56
DTC
Definition: datacontracthelper.h:123
PROPERTYIMP_REF
#define PROPERTYIMP_REF(type, name)
Definition: datacontracthelper.h:70
DTC::VideoMultiplexList
Definition: videoMultiplexList.h:15
DTC::VideoMultiplex::InitializeCustomTypes
static void InitializeCustomTypes()
Definition: videoMultiplex.h:119