MagicSmoke  $VERSION$
seatplanobj.h
Go to the documentation of this file.
1 //
2 // C++ Interface: unabstract
3 //
4 // Description: removes abstract flag from classes that only need to be abstract in PHP
5 //
6 //
7 // Author: Konrad Rosenbaum <konrad@silmor.de>, (C) 2009-2017
8 //
9 // Copyright: See README/COPYING.GPL files that come with this distribution
10 //
11 //
12 
13 #ifndef MAGICSMOKE_MOSEATPLANOBJ_H
14 #define MAGICSMOKE_MOSEATPLANOBJ_H
15 
16 #include "MOSeatPlanDefPriceAbstract"
17 #include "MOSeatPlanGroupAbstract"
18 #include "MOSeatPlanVGroupAbstract"
19 #include "misc.h"
20 
21 #include <QRect>
22 
23 #ifndef MSIFACE_EXPORT
24 #define MSIFACE_EXPORT Q_DECL_IMPORT
25 #endif
26 
27 class MOEventSaleInfo;
28 
31 {
32  Q_GADGET
33  WOBJECT(MOSeatPlanDefPrice)
34  Q_PROPERTY(bool isValid READ isValid)
35  public:
37  bool isValid()const{return !capacity().isNull() && !price().isNull() && !cost().isNull();}
38 };
39 
43 
44 
47 {
48  Q_GADGET
49  WOBJECT(MOSeatPlanGroup)
50  Q_PROPERTY(bool isValid READ isValid)
51  Q_PROPERTY(int capacityNum READ capacityNum)
52  Q_PROPERTY(QRect geometry READ geometry)
53  Q_PROPERTY(QList<int> categoryIds READ categoryIds)
54  Q_PROPERTY(QStringList categoryAbbreviations READ categoryAbbreviations)
55  Q_PROPERTY(int numReservedTickets READ numReservedTickets)
56  Q_PROPERTY(int numOrderedTickets READ numOrderedTickets)
57  Q_PROPERTY(int numUsedTickets READ numUsedTickets)
58  Q_PROPERTY(int numCancelledTickets READ numCancelledTickets)
59  Q_PROPERTY(int numBlockedSeats READ numBlockedSeats)
60  public:
62  bool isValid()const{return !capacity().isNull() && !price().isNull() && !id().isNull();}
63 
65  int capacityNum()const{return mcapacity;}
66 
68  QRect geometry()const;
69 
71  QList<int> categoryIds()const{return mcategoryids;}
72 
74  QStringList categoryAbbreviations()const{return mcategoryabbr;}
75 
77  int numReservedTickets()const{return mreserve;}
78 
80  int numOrderedTickets()const{return mordered;}
81 
83  int numUsedTickets()const{return mused;}
84 
86  int numCancelledTickets()const{return mcancelled;}
87 
89  int numBlockedSeats()const{return mblocked;}
90 
91  private:
92  friend class MOEventSaleInfo;
93  void adjust(const MOEventSaleInfo&);
94 
95  QList<int> mcategoryids;
96  QStringList mcategoryabbr;
97  int mreserve=0,mordered=0,mused=0,mcancelled=0,mblocked=0,mcapacity=0;
98 };
99 
103 
104 
105 
108 {
109  Q_GADGET
110  WOBJECT(MOSeatPlanVGroup)
111  Q_PROPERTY(bool isValid READ isValid)
112  Q_PROPERTY(int capacityNum READ capacityNum)
113  Q_PROPERTY(QList<int> categoryIds READ categoryIds)
114  Q_PROPERTY(QStringList categoryAbbreviations READ categoryAbbreviations)
115  Q_PROPERTY(int numReservedTickets READ numReservedTickets)
116  Q_PROPERTY(int numOrderedTickets READ numOrderedTickets)
117  Q_PROPERTY(int numUsedTickets READ numUsedTickets)
118  Q_PROPERTY(int numCancelledTickets READ numCancelledTickets)
119  Q_PROPERTY(int numBlockedSeats READ numBlockedSeats);
120  public:
122  bool isValid()const{return !capacity().isNull() && !price().isNull();}
123 
125  int capacityNum()const{return mcapacity;}
126 
128  QList<int> categoryIds()const{return mcategoryids;}
129 
131  QStringList categoryAbbreviations()const{return mcategoryabbr;}
132 
134  int numReservedTickets()const{return mreserve;}
135 
137  int numOrderedTickets()const{return mordered;}
138 
140  int numUsedTickets()const{return mused;}
141 
143  int numCancelledTickets()const{return mcancelled;}
144 
146  int numBlockedSeats()const{return mblocked;}
147 
148  private:
149  friend class MOEventSaleInfo;
150  void adjust(const MOEventSaleInfo&);
151 
152  QList<int> mcategoryids;
153  QStringList mcategoryabbr;
154  int mreserve=0,mordered=0,mused=0,mcancelled=0,mblocked=0,mcapacity=0;
155 };
156 
160 
161 
162 #endif
int numBlockedSeats() const
number of blocked seats (reserved, ordered, used tickets)
Definition: seatplanobj.h:146
int numBlockedSeats() const
number of blocked seats (reserved, ordered, used tickets)
Definition: seatplanobj.h:89
virtual QList< MOEventPrice > price() const
Definition: srcMOEventSaleInfoAbstract.h:59
Default price categories for a seat plan.
Definition: srcMOSeatPlanDefPriceAbstract.h:15
virtual Nullable< QString > capacity() const
amount of seats in this (part of the) group
Definition: srcMOSeatPlanDefPriceAbstract.h:30
bool isValid() const
returns whether the object is valid (it comes from the DB and it has been understood by the parser) ...
Definition: seatplanobj.h:62
bool isValid() const
returns whether the object is valid (it comes from the DB and it has been understood by the parser) ...
Definition: seatplanobj.h:122
int numReservedTickets() const
number of reserved tickets
Definition: seatplanobj.h:77
int numCancelledTickets() const
number of cancelled tickets
Definition: seatplanobj.h:86
int numCancelledTickets() const
number of cancelled tickets
Definition: seatplanobj.h:143
int numReservedTickets() const
number of reserved tickets
Definition: seatplanobj.h:134
int numUsedTickets() const
number of used tickets
Definition: seatplanobj.h:140
#define MSIFACE_EXPORT
Definition: seatplanobj.h:24
QList< int > categoryIds() const
IDs of categories in this group.
Definition: seatplanobj.h:128
this class represents a seat group
Definition: eventsaleinfo.h:27
virtual Nullable< QString > cost() const
default cost definition
Definition: srcMOSeatPlanDefPriceAbstract.h:34
this class represents a seat group
Definition: seatplanobj.h:107
int numUsedTickets() const
number of used tickets
Definition: seatplanobj.h:83
this class represents a seat group
Definition: seatplanobj.h:46
QList< int > categoryIds() const
IDs of categories in this group.
Definition: seatplanobj.h:71
int numOrderedTickets() const
number of ordered (not yet used) tickets
Definition: seatplanobj.h:80
int capacityNum() const
numeric capacity
Definition: seatplanobj.h:65
bool isValid() const
returns whether the object is valid (it comes from the DB and it has been understood by the parser) ...
Definition: seatplanobj.h:37
QStringList categoryAbbreviations() const
Abbreviations of categories in this group.
Definition: seatplanobj.h:131
bool isValid() const
returns whether the object is valid (it comes from the DB and it has been understood by the parser) ...
Definition: eventsaleinfo.h:35
virtual Nullable< QString > price() const
definition of categories in this group
Definition: srcMOSeatPlanDefPriceAbstract.h:32
Q_DECLARE_METATYPE(QDomNode)
int numOrderedTickets() const
number of ordered (not yet used) tickets
Definition: seatplanobj.h:137
int capacityNum() const
numeric capacity
Definition: seatplanobj.h:125
QStringList categoryAbbreviations() const
Abbreviations of categories in this group.
Definition: seatplanobj.h:74
This is a helper for parsing seat plans: it defines a group of rows of seats.
Definition: srcMOSeatPlanGroupAbstract.h:16
this class represents a default price category definition
Definition: seatplanobj.h:30
This is a helper for parsing seat plans: it defines a virtual group of categories.
Definition: srcMOSeatPlanVGroupAbstract.h:15
virtual Nullable< qint64 > capacity() const
Definition: srcMOEventSaleInfoAbstract.h:55