MagicSmoke  $VERSION$
MOVoucher Class Reference

#include <voucher.h>

Inheritance diagram for MOVoucher:
MOVoucherAbstract MOVoucherAudit

Public Member Functions

bool isValid () const
 returns whether this is a valid voucher object (ie. More...
 
QString priceString () const
 returns the price as string More...
 
QString statusString () const
 returns the status of the voucher as string More...
 
QString validDate () const
 returns the validity date More...
 
QString valueString () const
 returns the current value as string More...
 
- Public Member Functions inherited from MOVoucherAbstract
 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
 

Additional Inherited Members

- Public Types inherited from MOVoucherAbstract
enum  VoucherState { Ok =0, InvalidValue =1, InvalidPrice =2, InvalidTime =3 }
 
- Static Public Member Functions inherited from MOVoucherAbstract
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 inherited from MOVoucherAbstract
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 inherited from MOVoucherAbstract
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 Function Documentation

bool MOVoucher::isValid ( ) const
inline

returns whether this is a valid voucher object (ie.

it has a voucher ID)

References MOVoucherAbstract::voucherid().

QString MOVoucher::priceString ( ) const
inline

returns the price as string

References cent2str(), and MOVoucherAbstract::price().

QString MOVoucher::statusString ( ) const
inline

returns the status of the voucher as string

References MOVoucherAbstract::status(), and MOVoucherAbstract::VoucherState2locstr().

QString MOVoucher::validDate ( ) const
inline

returns the validity date

References unix2date(), and MOVoucherAbstract::validtime().

Referenced by MVoucherLabel::getVariable().

QString MOVoucher::valueString ( ) const
inline

returns the current value as string

References cent2str(), and MOVoucherAbstract::value().


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