Use standard C99 (and Qt) types for 64-bit integers
[novacoin.git] / src / qt / optionsmodel.h
1 #ifndef OPTIONSMODEL_H
2 #define OPTIONSMODEL_H
3
4 #include <QtGlobal>
5 #include <QAbstractListModel>
6
7 class CWallet;
8
9 /** Interface from QT to configuration data structure for bitcoin client.
10    To QT, the options are presented as a list with the different options
11    laid out vertically.
12    This can be changed to a tree once the settings become sufficiently
13    complex.
14  */
15 class OptionsModel : public QAbstractListModel
16 {
17     Q_OBJECT
18 public:
19     explicit OptionsModel(CWallet *wallet, QObject *parent = 0);
20
21     enum OptionID {
22         StartAtStartup, // bool
23         MinimizeToTray, // bool
24         MapPortUPnP, // bool
25         MinimizeOnClose, // bool
26         ConnectSOCKS4, // bool
27         ProxyIP, // QString
28         ProxyPort, // QString
29         Fee, // qint64
30         DisplayUnit, // BitcoinUnits::Unit
31         DisplayAddresses, // bool
32         OptionIDRowCount
33     };
34
35     int rowCount(const QModelIndex & parent = QModelIndex()) const;
36     QVariant data(const QModelIndex & index, int role = Qt::DisplayRole) const;
37     bool setData(const QModelIndex & index, const QVariant & value, int role = Qt::EditRole);
38
39     /* Explicit getters */
40     qint64 getTransactionFee();
41     bool getMinimizeToTray();
42     bool getMinimizeOnClose();
43     int getDisplayUnit();
44     bool getDisplayAddresses();
45 private:
46     // Wallet stores persistent options
47     CWallet *wallet;
48     int nDisplayUnit;
49     bool bDisplayAddresses;
50 signals:
51     void displayUnitChanged(int unit);
52
53 public slots:
54
55 };
56
57 #endif // OPTIONSMODEL_H