MagicSmoke  $VERSION$
event.h
Go to the documentation of this file.
1 //
2 // C++ Interface: event
3 //
4 // Description:
5 //
6 //
7 // Author: Konrad Rosenbaum <konrad@silmor.de>, (C) 2007-2011
8 //
9 // Copyright: See README/COPYING.GPL files that come with this distribution
10 //
11 //
12 
13 #ifndef EVENT_H
14 #define EVENT_H
15 
16 #include <QString>
17 #include <MOEventAbstract>
18 
19 #ifndef MSIFACE_EXPORT
20 #define MSIFACE_EXPORT Q_DECL_IMPORT
21 #endif
22 
23 
26 {
27  Q_GADGET
28  WOBJECT(MOEvent)
29  Q_PROPERTY(Nullable<qint64> eventid READ eventid)
30  Q_PROPERTY(QString startTimeString READ startTimeString)
31  Q_PROPERTY(QString startDateString READ startDateString)
32  Q_PROPERTY(QString endTimeString READ endTimeString)
33  Q_PROPERTY(QString priceString READ priceString)
34  Q_PROPERTY(QRegExp priceRegExp READ priceRegExp)
35  Q_PROPERTY(bool isValid READ isValid)
36  Q_PROPERTY(QList<MOEventPrice> priceFiltered READ priceFiltered)
37  public:
39  MOEvent(qint64);
40 
42  inline Nullable<qint64> eventid()const{return id();}
43 
45  QString startTimeString()const;
47  QString startDateString()const;
49  QString endTimeString()const;
50 
52  QString priceString()const;
54  QRegExp priceRegExp()const;
55 
57  bool isValid()const{return !eventid().isNull() && eventid().value()>0;}
58 
60  QList<MOEventPrice> priceFiltered()const;
61 };
62 
65 Q_DECLARE_METATYPE(Nullable<MOEvent>)
66 
67 #endif
encapsulation of an event, this class wraps the auto-generated event class to provide some convenienc...
Definition: event.h:25
QRegExp priceRegExp(bool localize)
return a (localized) regular expression that validates prices
Definition: misc.cpp:87
virtual Nullable< qint64 > id() const
Definition: srcMOEventAbstract.h:89
#define MSIFACE_EXPORT
Definition: event.h:20
Nullable< qint64 > eventid() const
alias for id()
Definition: event.h:42
bool isValid() const
returns whether the event is valid.
Definition: event.h:57
Q_DECLARE_METATYPE(QDomNode)
Definition: srcMOEventAbstract.h:17