MagicSmoke
$VERSION$
|
Encapsulates tickets for a specific event in a specific price category as they are stored in the cart. One instance of CartTicket can contain several tickets. This class is used by the client to tell the server about new orders and by the Web UI to actually store its cart. More...
#include <srcMOCartTicket.h>
Public Types | |
enum | TicketValidationState { Ok =0, EventOver =1, TooLate =2, Exhausted =3, Invalid =4 } |
Used when checking orders: tells us whether a ticket can be sold or not. More... | |
Public Member Functions | |
MOCartTicket () | |
default constructor: constructs an invalid instance of MOCartTicket More... | |
MOCartTicket (const MOCartTicket &) | |
copy constructor: creates a (deep) copy of the object More... | |
MOCartTicket (const QDomElement &) | |
special constructor: create from the XML representation, deserializing the object More... | |
virtual | ~MOCartTicket () |
destructor: deletes this copy of the object More... | |
virtual Nullable< qint64 > | amount () const |
virtual Nullable< QString > | cartid () const |
The cartID as used by the web user interface, this property must not be interpreted while the server attempts to create an order from this cart, the server must preserve it unchanged. More... | |
virtual Nullable< qint64 > | cartlineid () const |
optional property that can be used by the calling process to distinguish lines in the cart, the server must preserve it unchanged More... | |
virtual Nullable< MOEvent > | event () const |
Used in the Web UI only to provide access to event properties. More... | |
virtual Nullable< qint64 > | eventid () const |
virtual Nullable< MOEventPrice > | eventprice () const |
Used in the Web UI only to provide access to price properties. More... | |
virtual Nullable< qint64 > | maxamount () const |
MOCartTicket & | operator= (const MOCartTicket &) |
copy assignment: creates a (deep) copy of the object More... | |
virtual Nullable< MOEventPrice > | origeventprice () const |
Used in the Web UI only to provide access to price properties. More... | |
virtual Nullable< qint64 > | origpricecategoryid () const |
Price category originally assigned before the coupon changed it. More... | |
virtual Nullable< qint64 > | price () const |
virtual Nullable< qint64 > | pricecategoryid () const |
Price category to be used for this ticket. More... | |
Q_ENUMS (TicketValidationState) | |
virtual void | setamount (Nullable< qint64 > s) |
virtual void | setcartid (Nullable< QString > s) |
The cartID as used by the web user interface, this property must not be interpreted while the server attempts to create an order from this cart, the server must preserve it unchanged. More... | |
virtual void | setcartlineid (Nullable< qint64 > s) |
optional property that can be used by the calling process to distinguish lines in the cart, the server must preserve it unchanged More... | |
virtual void | setevent (Nullable< MOEvent > s) |
Used in the Web UI only to provide access to event properties. More... | |
virtual void | seteventid (Nullable< qint64 > s) |
virtual void | seteventprice (Nullable< MOEventPrice > s) |
Used in the Web UI only to provide access to price properties. More... | |
virtual void | setmaxamount (Nullable< qint64 > s) |
virtual void | setorigeventprice (Nullable< MOEventPrice > s) |
Used in the Web UI only to provide access to price properties. More... | |
virtual void | setorigpricecategoryid (Nullable< qint64 > s) |
Price category originally assigned before the coupon changed it. More... | |
virtual void | setprice (Nullable< qint64 > s) |
virtual void | setpricecategoryid (Nullable< qint64 > s) |
Price category to be used for this ticket. More... | |
virtual void | setstatus (Nullable< TicketValidationState > s) |
virtual void | setstatustext (Nullable< QString > s) |
virtual Nullable < TicketValidationState > | status () const |
virtual Nullable< QString > | statustext () const |
QString | toString () |
Serializes the object to XML and returns the string representation of that XML. More... | |
QDomElement | toXml (QDomDocument &doc, QString name="CartTicket") |
Transforms the object into its XML representation, the element node returned is not appended to the document - you have to do that yourself. More... | |
void | toXml (QDomDocument &, QDomElement &) |
Serializes the object into the given element. More... | |
Static Public Member Functions | |
static MOCartTicket | fromString (const QString &) |
create MOCartTicket from XML formatted string (inverse of toString) More... | |
static MOCartTicket | fromXml (const QDomElement &) |
create MOCartTicket from XML (inverse of toXml) More... | |
static TicketValidationState | locstr2TicketValidationState (QString, bool *ok=0) |
Converts a localized string into the corresponding enum TicketValidationState value. More... | |
static TicketValidationState | str2TicketValidationState (QString, bool *ok=0) |
Converts string into the corresponding enum TicketValidationState value. More... | |
static QString | TicketValidationState2locstr (TicketValidationState) |
Converts enum TicketValidationState value into the corresponding localized string. More... | |
static QString | TicketValidationState2str (TicketValidationState) |
Converts enum TicketValidationState value into the corresponding string. More... | |
Protected Attributes | |
Nullable< qint64 > | mp_amount |
Nullable< QString > | mp_cartid |
Nullable< qint64 > | mp_cartlineid |
Nullable< MOEvent > | mp_event |
Nullable< qint64 > | mp_eventid |
Nullable< MOEventPrice > | mp_eventprice |
Nullable< qint64 > | mp_maxamount |
Nullable< MOEventPrice > | mp_origeventprice |
Nullable< qint64 > | mp_origpricecategoryid |
Nullable< qint64 > | mp_price |
Nullable< qint64 > | mp_pricecategoryid |
Nullable< TicketValidationState > | mp_status |
Nullable< QString > | mp_statustext |
Properties | |
Nullable< qint64 > | amount |
Nullable< QString > | cartid |
The cartID as used by the web user interface, this property must not be interpreted while the server attempts to create an order from this cart, the server must preserve it unchanged. More... | |
Nullable< qint64 > | cartlineid |
optional property that can be used by the calling process to distinguish lines in the cart, the server must preserve it unchanged More... | |
Nullable< MOEvent > | event |
Used in the Web UI only to provide access to event properties. More... | |
Nullable< qint64 > | eventid |
Nullable< MOEventPrice > | eventprice |
Used in the Web UI only to provide access to price properties. More... | |
Nullable< qint64 > | maxamount |
Nullable< MOEventPrice > | origeventprice |
Used in the Web UI only to provide access to price properties. More... | |
Nullable< qint64 > | origpricecategoryid |
Price category originally assigned before the coupon changed it. More... | |
Nullable< qint64 > | price |
Nullable< qint64 > | pricecategoryid |
Price category to be used for this ticket. More... | |
Nullable< TicketValidationState > | status |
Nullable< QString > | statustext |
Encapsulates tickets for a specific event in a specific price category as they are stored in the cart. One instance of CartTicket can contain several tickets. This class is used by the client to tell the server about new orders and by the Web UI to actually store its cart.
Used when checking orders: tells us whether a ticket can be sold or not.
|
inline |
default constructor: constructs an invalid instance of MOCartTicket
Referenced by fromString(), and fromXml().
MOCartTicket::MOCartTicket | ( | const MOCartTicket & | o | ) |
copy constructor: creates a (deep) copy of the object
References mp_amount, mp_cartid, mp_cartlineid, mp_event, mp_eventid, mp_eventprice, mp_maxamount, mp_origeventprice, mp_origpricecategoryid, mp_price, mp_pricecategoryid, mp_status, and mp_statustext.
|
explicit |
special constructor: create from the XML representation, deserializing the object
References setamount(), setcartid(), setcartlineid(), setevent(), seteventid(), seteventprice(), setmaxamount(), setorigeventprice(), setorigpricecategoryid(), setprice(), setpricecategoryid(), setstatus(), setstatustext(), and str2TicketValidationState().
|
inlinevirtual |
destructor: deletes this copy of the object
|
inlinevirtual |
|
inlinevirtual |
The cartID as used by the web user interface, this property must not be interpreted while the server attempts to create an order from this cart, the server must preserve it unchanged.
|
inlinevirtual |
optional property that can be used by the calling process to distinguish lines in the cart, the server must preserve it unchanged
|
inlinevirtual |
Used in the Web UI only to provide access to event properties.
|
inlinevirtual |
|
inlinevirtual |
Used in the Web UI only to provide access to price properties.
|
static |
create MOCartTicket from XML formatted string (inverse of toString)
References MOCartTicket().
|
static |
create MOCartTicket from XML (inverse of toXml)
References MOCartTicket().
|
static |
|
inlinevirtual |
MOCartTicket & MOCartTicket::operator= | ( | const MOCartTicket & | o | ) |
copy assignment: creates a (deep) copy of the object
References mp_amount, mp_cartid, mp_cartlineid, mp_event, mp_eventid, mp_eventprice, mp_maxamount, mp_origeventprice, mp_origpricecategoryid, mp_price, mp_pricecategoryid, mp_status, and mp_statustext.
|
inlinevirtual |
Used in the Web UI only to provide access to price properties.
|
inlinevirtual |
Price category originally assigned before the coupon changed it.
|
inlinevirtual |
|
inlinevirtual |
Price category to be used for this ticket.
MOCartTicket::Q_ENUMS | ( | TicketValidationState | ) |
|
inlinevirtual |
Referenced by MOCartTicket().
|
inlinevirtual |
The cartID as used by the web user interface, this property must not be interpreted while the server attempts to create an order from this cart, the server must preserve it unchanged.
Referenced by MOCartTicket().
|
inlinevirtual |
optional property that can be used by the calling process to distinguish lines in the cart, the server must preserve it unchanged
Referenced by MOCartTicket().
|
inlinevirtual |
Used in the Web UI only to provide access to event properties.
Referenced by MOCartTicket().
|
inlinevirtual |
Referenced by MOCartTicket().
|
inlinevirtual |
Used in the Web UI only to provide access to price properties.
Referenced by MOCartTicket().
|
inlinevirtual |
Referenced by MOCartTicket().
|
inlinevirtual |
Used in the Web UI only to provide access to price properties.
Referenced by MOCartTicket().
|
inlinevirtual |
Price category originally assigned before the coupon changed it.
Referenced by MOCartTicket().
|
inlinevirtual |
Referenced by MOCartTicket().
|
inlinevirtual |
Price category to be used for this ticket.
Referenced by MOCartTicket().
|
inlinevirtual |
Referenced by MOCartTicket().
|
inlinevirtual |
Referenced by MOCartTicket().
|
inlinevirtual |
|
inlinevirtual |
|
static |
|
static |
|
static |
QString MOCartTicket::toString | ( | ) |
Serializes the object to XML and returns the string representation of that XML.
References toXml().
QDomElement MOCartTicket::toXml | ( | QDomDocument & | doc, |
QString | name = "CartTicket" |
||
) |
Transforms the object into its XML representation, the element node returned is not appended to the document - you have to do that yourself.
doc | the DOM document node for which to generate the element |
name | the name to give the generated element, per default "MOCartTicket" is used |
Referenced by toString().
void MOCartTicket::toXml | ( | QDomDocument & | doc, |
QDomElement & | r | ||
) |
Serializes the object into the given element.
References mp_amount, mp_cartid, mp_cartlineid, mp_event, mp_eventid, mp_eventprice, mp_maxamount, mp_origeventprice, mp_origpricecategoryid, mp_price, mp_pricecategoryid, mp_status, and mp_statustext.
|
protected |
Referenced by MOCartTicket(), operator=(), and toXml().
|
protected |
Referenced by MOCartTicket(), operator=(), and toXml().
|
protected |
Referenced by MOCartTicket(), operator=(), and toXml().
|
protected |
Referenced by MOCartTicket(), operator=(), and toXml().
|
protected |
Referenced by MOCartTicket(), operator=(), and toXml().
|
protected |
Referenced by MOCartTicket(), operator=(), and toXml().
|
protected |
Referenced by MOCartTicket(), operator=(), and toXml().
|
protected |
Referenced by MOCartTicket(), operator=(), and toXml().
|
protected |
Referenced by MOCartTicket(), operator=(), and toXml().
|
protected |
Referenced by MOCartTicket(), operator=(), and toXml().
|
protected |
Referenced by MOCartTicket(), operator=(), and toXml().
|
protected |
Referenced by MOCartTicket(), operator=(), and toXml().
|
protected |
Referenced by MOCartTicket(), operator=(), and toXml().
|
readwrite |
|
readwrite |
The cartID as used by the web user interface, this property must not be interpreted while the server attempts to create an order from this cart, the server must preserve it unchanged.
|
readwrite |
optional property that can be used by the calling process to distinguish lines in the cart, the server must preserve it unchanged
|
readwrite |
Used in the Web UI only to provide access to event properties.
|
readwrite |
|
readwrite |
Used in the Web UI only to provide access to price properties.
|
readwrite |
|
readwrite |
Used in the Web UI only to provide access to price properties.
|
readwrite |
Price category originally assigned before the coupon changed it.
|
readwrite |
|
readwrite |
Price category to be used for this ticket.
|
readwrite |
|
readwrite |