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 
7 #include "serviceexp.h"
8 #include "datacontracthelper.h"
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 DESIGNABLE true )
36 
37  PROPERTYIMP ( int , StartIndex )
38  PROPERTYIMP ( int , Count )
39  PROPERTYIMP ( int , CurrentPage )
40  PROPERTYIMP ( int , TotalPages )
41  PROPERTYIMP ( int , TotalAvailable )
42  PROPERTYIMP ( QDateTime , AsOf )
43  PROPERTYIMP ( QString , Version )
44  PROPERTYIMP ( 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  VideoMultiplex *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
VERBOSE_PREAMBLE Most true
Definition: verbosedefs.h:91
static void InitializeCustomTypes()
#define PROPERTYIMP(type, name)
#define SERVICE_PUBLIC
Definition: serviceexp.h:9
#define PROPERTYIMP_RO_REF(type, name)
VideoMultiplex * AddNewVideoMultiplex()
static void InitializeCustomTypes()
void Copy(const VideoMultiplexList *src)