mirror of
https://github.com/AskDavis/Casinotest.git
synced 2026-01-04 04:29:46 -08:00
Coin Information API integrated
This commit is contained in:
46
src/qt/currencies.h
Normal file
46
src/qt/currencies.h
Normal file
@@ -0,0 +1,46 @@
|
||||
#ifndef CURRENCIES_H
|
||||
#define CURRENCIES_H
|
||||
|
||||
#include <QAbstractListModel>
|
||||
|
||||
class Currencies : public QAbstractListModel
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit Currencies(QObject *parent);
|
||||
|
||||
enum FiatCurrencyID {
|
||||
USD,
|
||||
EUR,
|
||||
CNY,
|
||||
JPY,
|
||||
RUB,
|
||||
};
|
||||
|
||||
//! Get list of currencies, for drop-down box
|
||||
static QList<FiatCurrencyID> availableCurrencies();
|
||||
//! Is currency ID valid?
|
||||
static bool valid(int currency);
|
||||
//! Short name
|
||||
static QString name(int currency);
|
||||
//! Longer description
|
||||
static QString description(int unit);
|
||||
|
||||
//! @name AbstractListModel implementation
|
||||
//! List model for currency drop-down selection box.
|
||||
///@{
|
||||
enum RoleIndex {
|
||||
/** Currency identifier */
|
||||
CurrencyRole = Qt::UserRole
|
||||
};
|
||||
int rowCount(const QModelIndex &parent) const;
|
||||
QVariant data(const QModelIndex &index, int role) const;
|
||||
///@}
|
||||
|
||||
private:
|
||||
QList<Currencies::FiatCurrencyID> currencylist;
|
||||
};
|
||||
typedef Currencies::FiatCurrencyID Currency;
|
||||
|
||||
#endif // CURRENCIES_H
|
||||
Reference in New Issue
Block a user