6 #ifndef RAVEN_QT_RAVENUNITS_H 7 #define RAVEN_QT_RAVENUNITS_H 11 #include <QAbstractListModel> 15 #define MAX_ASSET_UNITS 8 16 #define MIN_ASSET_UNITS 0 20 #define REAL_THIN_SP_CP 0x2009 21 #define REAL_THIN_SP_UTF8 "\xE2\x80\x89" 22 #define REAL_THIN_SP_HTML " " 25 #define HAIR_SP_CP 0x200A 26 #define HAIR_SP_UTF8 "\xE2\x80\x8A" 27 #define HAIR_SP_HTML " " 30 #define SIXPEREM_SP_CP 0x2006 31 #define SIXPEREM_SP_UTF8 "\xE2\x80\x86" 32 #define SIXPEREM_SP_HTML " " 35 #define FIGURE_SP_CP 0x2007 36 #define FIGURE_SP_UTF8 "\xE2\x80\x87" 37 #define FIGURE_SP_HTML " " 43 #define HTML_HACK_SP "<span style='white-space: nowrap; font-size: 6pt'> </span>" 46 #define THIN_SP_CP REAL_THIN_SP_CP 47 #define THIN_SP_UTF8 REAL_THIN_SP_UTF8 48 #define THIN_SP_HTML HTML_HACK_SP 84 static bool valid(
int unit);
86 static QString
name(
int unit);
90 static qint64
factor(
int unit);
104 static bool parse(
int unit,
const QString &value,
CAmount *val_out);
117 int rowCount(
const QModelIndex &parent)
const;
118 QVariant
data(
const QModelIndex &index,
int role)
const;
125 #if (THIN_SP_CP != REAL_THIN_SP_CP) 139 #endif // RAVEN_QT_RAVENUNITS_H static QString format(int unit, const CAmount &amount, bool plussign=false, SeparatorStyle separators=separatorStandard, const int nAssetUnit=MIN_ASSET_UNITS - 1)
Format as string.
static bool assetParse(int assetUnit, const QString &value, CAmount *val_out)
static bool valid(int unit)
Is unit ID valid?
static QString getAmountColumnTitle(int unit)
Gets title for amount column including current display unit if optionsModel reference available */...
QList< RavenUnits::Unit > unitlist
static bool parse(int unit, const QString &value, CAmount *val_out)
Parse string to coin amount.
int64_t CAmount
Amount in corbies (Can be negative)
static QString formatWithUnit(int unit, const CAmount &amount, bool plussign=false, SeparatorStyle separators=separatorStandard)
Format as string (with unit)
int rowCount(const QModelIndex &parent) const
static QString removeSpaces(QString text)
QVariant data(const QModelIndex &index, int role) const
RavenUnits(QObject *parent)
static qint64 factorAsset(int unit)
Number of Satoshis (1e-8) per unit for assets.
static QString formatHtmlWithUnit(int unit, const CAmount &amount, bool plussign=false, SeparatorStyle separators=separatorStandard)
Format as HTML string (with unit)
static QList< Unit > availableUnits()
Get list of units, for drop-down box.
static QString name(int unit)
Short name.
static QString formatWithCustomName(QString customName, const CAmount &amount, int unit=MAX_ASSET_UNITS, bool plussign=false, SeparatorStyle separators=separatorStandard)
Format as string (with custom name)
static int decimals(int unit)
Number of decimals left.
RavenUnits::Unit RavenUnit
static qint64 factor(int unit)
Number of Satoshis (1e-8) per unit.
static CAmount maxMoney()
Return maximum number of base units (Satoshis)
static QString description(int unit)
Longer description.