MagicSmoke
$VERSION$
|
Deducts an amount from a voucher - this can be used for items that are not in the MagicSmoke shop repository. More...
#include <srcMTDeductVoucher.h>
Public Member Functions | |
MTDeductVoucher () | |
default constructor: generates an invalid transaction More... | |
MTDeductVoucher (const MTDeductVoucher &) | |
copy constructor: the two copies share their state More... | |
virtual | ~MTDeductVoucher () |
deletes this instance More... | |
Q_SLOT Nullable< qint64 > | getamount () const |
The amount actually transferred. Can only be zero (not enough left on the voucher) or the same as above. More... | |
Q_SLOT Nullable< MOVoucher > | getvoucher () const |
The full voucher object after the transaction. More... | |
MTDeductVoucher & | operator= (const MTDeductVoucher &) |
copy assignment: the copy shares the state of the original object More... | |
Static Public Member Functions | |
static MTDeductVoucher | asyncQuery (const QString &avoucherid, const qint64 &aamount, const QString &acomment, QString iface="MagicSmoke") |
emits the query over the network and returns the transaction object, use isFinished() to check for the transaction's state More... | |
static MTDeductVoucher | query (const QString &avoucherid, const qint64 &aamount, const QString &acomment, QString iface="MagicSmoke") |
emits the query over the network and returns the finished transaction object More... | |
Static Public Member Functions inherited from MTransaction | |
static void | setStartStopActions (const MTStartStop &start, const MTStartStop &stop) |
set actions to be executed at start/stop More... | |
Protected Member Functions | |
MTDeductVoucher (const QString &avoucherid, const qint64 &aamount, const QString &acomment, QString iface) | |
generates an instance from its properties More... | |
virtual void | endQuery () |
Protected Member Functions inherited from MTransaction | |
MTransaction (QString iface=QString()) | |
internal: construct the transaction More... | |
MTransaction (const WTransaction &) | |
internal: copy the transaction More... | |
MTransaction (const MTransaction &) | |
internal: copy the transaction More... | |
QByteArray | executeQuery (QString, QByteArray) |
internal: extend executeQuery to show a wait cursor More... | |
Friends | |
class | MTDeductVoucher_Private |
Deducts an amount from a voucher - this can be used for items that are not in the MagicSmoke shop repository.
Fails if the voucher is not paid for yet. Will not transfer anything if the voucher does not contain enough money. Fails if the voucher is not valid anymore.
|
explicitprotected |
generates an instance from its properties
avoucherid | ID of the voucher to be used |
aamount | Amount to be deducted. Must be positive. |
acomment | A comment noting why it was deducted. |
iface | ID of the interface that the transaction will be sent on |
References MTDeductVoucher_Private::in_amount, MTDeductVoucher_Private::in_comment, MTDeductVoucher_Private::in_voucherid, and MTDeductVoucher_Private.
MTDeductVoucher::MTDeductVoucher | ( | ) |
default constructor: generates an invalid transaction
References MTDeductVoucher_Private.
MTDeductVoucher::MTDeductVoucher | ( | const MTDeductVoucher & | t | ) |
copy constructor: the two copies share their state
References MTDeductVoucher_Private::attach().
|
virtual |
deletes this instance
References MTDeductVoucher_Private::detach().
|
static |
emits the query over the network and returns the transaction object, use isFinished() to check for the transaction's state
avoucherid | ID of the voucher to be used |
aamount | Amount to be deducted. Must be positive. |
acomment | A comment noting why it was deducted. |
iface | ID of the interface that the transaction will be sent on |
|
protectedvirtual |
Nullable< qint64 > MTDeductVoucher::getamount | ( | ) | const |
The amount actually transferred. Can only be zero (not enough left on the voucher) or the same as above.
References MTDeductVoucher_Private::out_amount.
Referenced by MOverview::deductVoucher().
Nullable< MOVoucher > MTDeductVoucher::getvoucher | ( | ) | const |
The full voucher object after the transaction.
References MTDeductVoucher_Private::out_voucher.
Referenced by MOverview::deductVoucher().
MTDeductVoucher & MTDeductVoucher::operator= | ( | const MTDeductVoucher & | t | ) |
copy assignment: the copy shares the state of the original object
References MTDeductVoucher_Private::attach(), and MTDeductVoucher_Private::detach().
|
static |
emits the query over the network and returns the finished transaction object
avoucherid | ID of the voucher to be used |
aamount | Amount to be deducted. Must be positive. |
acomment | A comment noting why it was deducted. |
iface | ID of the interface that the transaction will be sent on |
Referenced by MInterface::queryDeductVoucher().
|
friend |
Referenced by MTDeductVoucher().