MagicSmoke  $VERSION$
MOVoucherAbstract Class Reference

#include <srcMOVoucherAbstract.h>

Inheritance diagram for MOVoucherAbstract:
MOVoucher MOVoucherAudit

Public Types

enum  VoucherState { Ok =0, InvalidValue =1, InvalidPrice =2, InvalidTime =3 }
 

Public Member Functions

 MOVoucherAbstract ()
 default constructor: constructs an invalid instance of MOVoucherAbstract More...
 
 MOVoucherAbstract (const MOVoucherAbstract &)
 copy constructor: creates a (deep) copy of the object More...
 
 MOVoucherAbstract (const QDomElement &)
 special constructor: create from the XML representation, deserializing the object More...
 
virtual ~MOVoucherAbstract ()
 destructor: deletes this copy of the object More...
 
virtual Nullable< bool > isused () const
 The voucher has been used. There may still be value on it. More...
 
MOVoucherAbstractoperator= (const MOVoucherAbstract &)
 copy assignment: creates a (deep) copy of the object More...
 
virtual Nullable< qint64 > orderid () const
 
virtual Nullable< qint64 > price () const
 What the voucher costs in cents. More...
 
 Q_ENUMS (VoucherState)
 
virtual void setisused (Nullable< bool > s)
 The voucher has been used. There may still be value on it. More...
 
virtual void setorderid (Nullable< qint64 > s)
 
virtual void setprice (Nullable< qint64 > s)
 What the voucher costs in cents. More...
 
virtual void setstatus (Nullable< VoucherState > s)
 
virtual void settags (Nullable< QString > s)
 
virtual void setvalidtime (Nullable< qint64 > s)
 
virtual void setvalue (Nullable< qint64 > s)
 What the voucher is worth in cents. More...
 
virtual void setvoucherid (Nullable< QString > s)
 
virtual Nullable< VoucherStatestatus () const
 
virtual Nullable< QString > tags () const
 
QString toString ()
 Serializes the object to XML and returns the string representation of that XML. More...
 
QDomElement toXml (QDomDocument &doc, QString name="Voucher")
 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...
 
virtual Nullable< qint64 > validtime () const
 
virtual Nullable< qint64 > value () const
 What the voucher is worth in cents. More...
 
virtual Nullable< QString > voucherid () const
 

Static Public Member Functions

static MOVoucherAbstract fromString (const QString &)
 create MOVoucherAbstract from XML formatted string (inverse of toString) More...
 
static MOVoucherAbstract fromXml (const QDomElement &)
 create MOVoucherAbstract from XML (inverse of toXml) More...
 
static VoucherState locstr2VoucherState (QString, bool *ok=0)
 Converts a localized string into the corresponding enum VoucherState value. More...
 
static VoucherState str2VoucherState (QString, bool *ok=0)
 Converts string into the corresponding enum VoucherState value. More...
 
static QString VoucherState2locstr (VoucherState)
 Converts enum VoucherState value into the corresponding localized string. More...
 
static QString VoucherState2str (VoucherState)
 Converts enum VoucherState value into the corresponding string. More...
 

Protected Attributes

Nullable< bool > mp_isused
 
Nullable< qint64 > mp_orderid
 
Nullable< qint64 > mp_price
 
Nullable< VoucherStatemp_status
 
Nullable< QString > mp_tags
 
Nullable< qint64 > mp_validtime
 
Nullable< qint64 > mp_value
 
Nullable< QString > mp_voucherid
 

Properties

Nullable< bool > isused
 The voucher has been used. There may still be value on it. More...
 
Nullable< qint64 > orderid
 
Nullable< qint64 > price
 What the voucher costs in cents. More...
 
Nullable< VoucherStatestatus
 
Nullable< QString > tags
 
Nullable< qint64 > validtime
 
Nullable< qint64 > value
 What the voucher is worth in cents. More...
 
Nullable< QString > voucherid
 

Member Enumeration Documentation

Enumerator
Ok 

The voucher is valid.

InvalidValue 

The requested value (what it is worth) is invalid.

InvalidPrice 

The requested price (what needs to be paid) is invalid.

InvalidTime 

The voucher is past its validity time.

Constructor & Destructor Documentation

MOVoucherAbstract::MOVoucherAbstract ( )
inline

default constructor: constructs an invalid instance of MOVoucherAbstract

Referenced by fromString(), and fromXml().

MOVoucherAbstract::MOVoucherAbstract ( const MOVoucherAbstract o)

copy constructor: creates a (deep) copy of the object

References mp_isused, mp_orderid, mp_price, mp_status, mp_tags, mp_validtime, mp_value, and mp_voucherid.

MOVoucherAbstract::MOVoucherAbstract ( const QDomElement &  root)
explicit

special constructor: create from the XML representation, deserializing the object

References setisused(), setorderid(), setprice(), setstatus(), settags(), setvalidtime(), setvalue(), setvoucherid(), and str2VoucherState().

virtual MOVoucherAbstract::~MOVoucherAbstract ( )
inlinevirtual

destructor: deletes this copy of the object

Member Function Documentation

MOVoucherAbstract MOVoucherAbstract::fromString ( const QString &  txt)
static

create MOVoucherAbstract from XML formatted string (inverse of toString)

References MOVoucherAbstract().

MOVoucherAbstract MOVoucherAbstract::fromXml ( const QDomElement &  root)
static

create MOVoucherAbstract from XML (inverse of toXml)

References MOVoucherAbstract().

virtual Nullable<bool> MOVoucherAbstract::isused ( ) const
inlinevirtual

The voucher has been used. There may still be value on it.

MOVoucherAbstract::VoucherState MOVoucherAbstract::locstr2VoucherState ( QString  s,
bool *  ok = 0 
)
static

Converts a localized string into the corresponding enum VoucherState value.

References InvalidPrice, InvalidTime, InvalidValue, and Ok.

MOVoucherAbstract & MOVoucherAbstract::operator= ( const MOVoucherAbstract o)

copy assignment: creates a (deep) copy of the object

References mp_isused, mp_orderid, mp_price, mp_status, mp_tags, mp_validtime, mp_value, and mp_voucherid.

Referenced by MOVoucherAudit::operator=().

virtual Nullable<qint64> MOVoucherAbstract::orderid ( ) const
inlinevirtual
virtual Nullable<qint64> MOVoucherAbstract::price ( ) const
inlinevirtual

What the voucher costs in cents.

Referenced by MOVoucher::priceString().

MOVoucherAbstract::Q_ENUMS ( VoucherState  )
virtual void MOVoucherAbstract::setisused ( Nullable< bool >  s)
inlinevirtual

The voucher has been used. There may still be value on it.

Referenced by MOVoucherAbstract().

virtual void MOVoucherAbstract::setorderid ( Nullable< qint64 >  s)
inlinevirtual

Referenced by MOVoucherAbstract().

virtual void MOVoucherAbstract::setprice ( Nullable< qint64 >  s)
inlinevirtual

What the voucher costs in cents.

Referenced by MOVoucherAbstract().

virtual void MOVoucherAbstract::setstatus ( Nullable< VoucherState s)
inlinevirtual

Referenced by MOVoucherAbstract().

virtual void MOVoucherAbstract::settags ( Nullable< QString >  s)
inlinevirtual

Referenced by MOVoucherAbstract().

virtual void MOVoucherAbstract::setvalidtime ( Nullable< qint64 >  s)
inlinevirtual

Referenced by MOVoucherAbstract().

virtual void MOVoucherAbstract::setvalue ( Nullable< qint64 >  s)
inlinevirtual

What the voucher is worth in cents.

Referenced by MOVoucherAbstract().

virtual void MOVoucherAbstract::setvoucherid ( Nullable< QString >  s)
inlinevirtual

Referenced by MOVoucherAbstract().

virtual Nullable<VoucherState> MOVoucherAbstract::status ( ) const
inlinevirtual

Referenced by MOVoucher::statusString().

MOVoucherAbstract::VoucherState MOVoucherAbstract::str2VoucherState ( QString  s,
bool *  ok = 0 
)
static

Converts string into the corresponding enum VoucherState value.

References InvalidPrice, InvalidTime, InvalidValue, and Ok.

Referenced by MOVoucherAbstract().

virtual Nullable<QString> MOVoucherAbstract::tags ( ) const
inlinevirtual
QString MOVoucherAbstract::toString ( )

Serializes the object to XML and returns the string representation of that XML.

References toXml().

QDomElement MOVoucherAbstract::toXml ( QDomDocument &  doc,
QString  name = "Voucher" 
)

Transforms the object into its XML representation, the element node returned is not appended to the document - you have to do that yourself.

Parameters
docthe DOM document node for which to generate the element
namethe name to give the generated element, per default "MOVoucherAbstract" is used

Referenced by toString(), and MOVoucherAudit::toXml().

void MOVoucherAbstract::toXml ( QDomDocument &  doc,
QDomElement &  r 
)

Serializes the object into the given element.

References mp_isused, mp_orderid, mp_price, mp_status, mp_tags, mp_validtime, mp_value, and mp_voucherid.

virtual Nullable<qint64> MOVoucherAbstract::validtime ( ) const
inlinevirtual

Referenced by MOVoucher::validDate().

virtual Nullable<qint64> MOVoucherAbstract::value ( ) const
inlinevirtual

What the voucher is worth in cents.

Referenced by MOVoucher::valueString().

virtual Nullable<QString> MOVoucherAbstract::voucherid ( ) const
inlinevirtual

Referenced by MOVoucher::isValid().

QString MOVoucherAbstract::VoucherState2locstr ( VoucherState  e)
static

Converts enum VoucherState value into the corresponding localized string.

References InvalidPrice, InvalidTime, InvalidValue, and Ok.

Referenced by MOVoucher::statusString().

QString MOVoucherAbstract::VoucherState2str ( VoucherState  e)
static

Converts enum VoucherState value into the corresponding string.

References InvalidPrice, InvalidTime, InvalidValue, and Ok.

Member Data Documentation

Nullable<bool> MOVoucherAbstract::mp_isused
protected

Referenced by MOVoucherAbstract(), operator=(), and toXml().

Nullable<qint64> MOVoucherAbstract::mp_orderid
protected

Referenced by MOVoucherAbstract(), operator=(), and toXml().

Nullable<qint64> MOVoucherAbstract::mp_price
protected

Referenced by MOVoucherAbstract(), operator=(), and toXml().

Nullable<VoucherState> MOVoucherAbstract::mp_status
protected

Referenced by MOVoucherAbstract(), operator=(), and toXml().

Nullable<QString> MOVoucherAbstract::mp_tags
protected

Referenced by MOVoucherAbstract(), operator=(), and toXml().

Nullable<qint64> MOVoucherAbstract::mp_validtime
protected

Referenced by MOVoucherAbstract(), operator=(), and toXml().

Nullable<qint64> MOVoucherAbstract::mp_value
protected

Referenced by MOVoucherAbstract(), operator=(), and toXml().

Nullable<QString> MOVoucherAbstract::mp_voucherid
protected

Referenced by MOVoucherAbstract(), operator=(), and toXml().

Property Documentation

Nullable<bool> MOVoucherAbstract::isused
readwrite

The voucher has been used. There may still be value on it.

Nullable<qint64> MOVoucherAbstract::orderid
readwrite
Nullable<qint64> MOVoucherAbstract::price
readwrite

What the voucher costs in cents.

Nullable<VoucherState> MOVoucherAbstract::status
readwrite
Nullable<QString> MOVoucherAbstract::tags
readwrite
Nullable<qint64> MOVoucherAbstract::validtime
readwrite
Nullable<qint64> MOVoucherAbstract::value
readwrite

What the voucher is worth in cents.

Nullable<QString> MOVoucherAbstract::voucherid
readwrite

The documentation for this class was generated from the following files: