5 #ifndef FABCOIN_QT_FABCOINUNITS_H 6 #define FABCOIN_QT_FABCOINUNITS_H 10 #include <QAbstractListModel> 12 #include <boost/multiprecision/cpp_int.hpp> 16 #define REAL_THIN_SP_CP 0x2009 17 #define REAL_THIN_SP_UTF8 "\xE2\x80\x89" 18 #define REAL_THIN_SP_HTML " " 21 #define HAIR_SP_CP 0x200A 22 #define HAIR_SP_UTF8 "\xE2\x80\x8A" 23 #define HAIR_SP_HTML " " 26 #define SIXPEREM_SP_CP 0x2006 27 #define SIXPEREM_SP_UTF8 "\xE2\x80\x86" 28 #define SIXPEREM_SP_HTML " " 31 #define FIGURE_SP_CP 0x2007 32 #define FIGURE_SP_UTF8 "\xE2\x80\x87" 33 #define FIGURE_SP_HTML " " 39 #define HTML_HACK_SP "<span style='white-space: nowrap; font-size: 6pt'> </span>" 42 #define THIN_SP_CP REAL_THIN_SP_CP 43 #define THIN_SP_UTF8 REAL_THIN_SP_UTF8 44 #define THIN_SP_HTML HTML_HACK_SP 78 static QList<Unit> availableUnits();
80 static bool valid(
int unit);
82 static QString
name(
int unit);
84 static QString description(
int unit);
86 static qint64 factor(
int unit);
88 static int256_t tokenFactor(
int unit);
90 static int decimals(
int unit);
94 static QString formatWithUnit(
int unit,
const CAmount& amount,
bool plussign=
false,
SeparatorStyle separators=separatorStandard);
96 static QString formatHtmlWithUnit(
int unit,
const CAmount& amount,
bool plussign=
false,
SeparatorStyle separators=separatorStandard);
98 static bool parse(
int unit,
const QString &value,
CAmount *val_out);
100 static QString getAmountColumnTitle(
int unit);
102 static bool parseToken(
int decimal_units,
const QString &value, int256_t *val_out);
104 static QString formatToken(
int decimal_units,
const int256_t& amount,
bool plussign=
false,
SeparatorStyle separators=separatorStandard);
105 static QString formatTokenWithUnit(
const QString unit,
int decimals,
const int256_t& amount,
bool plussign=
false,
SeparatorStyle separators=separatorStandard);
114 UnitRole = Qt::UserRole
116 int rowCount(
const QModelIndex &parent)
const;
117 QVariant
data(
const QModelIndex &index,
int role)
const;
124 #if (THIN_SP_CP != REAL_THIN_SP_CP) 138 #endif // FABCOIN_QT_FABCOINUNITS_H
FabcoinUnits::Unit FabcoinUnit
int64_t CAmount
Amount in lius (Can be negative)
QList< FabcoinUnits::Unit > unitlist
static QString removeSpaces(QString text)
Fabcoin unit definitions.