Remove UPNP support & do some cleanup.
[novacoin.git] / src / qt / optionsmodel.h
1 #ifndef OPTIONSMODEL_H
2 #define OPTIONSMODEL_H
3
4 #include <QAbstractListModel>
5
6 /** Interface from Qt to configuration data structure for Bitcoin client.
7    To Qt, the options are presented as a list with the different options
8    laid out vertically.
9    This can be changed to a tree once the settings become sufficiently
10    complex.
11  */
12 class OptionsModel : public QAbstractListModel
13 {
14     Q_OBJECT
15
16 public:
17     explicit OptionsModel(QObject *parent = 0);
18
19     enum OptionID {
20         StartAtStartup,    // bool
21         MinimizeToTray,    // bool
22         MinimizeOnClose,   // bool
23         ProxyUse,          // bool
24         ProxyIP,           // QString
25         ProxyPort,         // int
26         ProxySocksVersion, // int
27         TorUse,            // bool
28         TorIP,             // QString
29         TorPort,           // int
30         TorOnly,           // bool
31         TorName,           // QString
32         Fee,               // qint64
33         DisplayUnit,       // BitcoinUnits::Unit
34         DisplayAddresses,  // bool
35         ThirdPartyTxUrls,  // QString
36         DetachDatabases,   // bool
37         Language,          // QString
38         CoinControlFeatures, // bool
39         OptionIDRowCount,
40     };
41
42     void Init();
43
44     int rowCount(const QModelIndex & parent = QModelIndex()) const;
45     QVariant data(const QModelIndex & index, int role = Qt::DisplayRole) const;
46     bool setData(const QModelIndex & index, const QVariant & value, int role = Qt::EditRole);
47
48     /* Explicit getters */
49     qint64 getTransactionFee();
50     bool getMinimizeToTray();
51     bool getMinimizeOnClose();
52     int getDisplayUnit();
53     bool getDisplayAddresses();
54     bool getCoinControlFeatures();
55     QString getThirdPartyTxUrls() { return strThirdPartyTxUrls; }
56     QString getLanguage() { return language; }
57
58 private:
59     int nDisplayUnit;
60     bool bDisplayAddresses;
61     bool fMinimizeToTray;
62     bool fMinimizeOnClose;
63     bool fCoinControlFeatures;
64     QString language;
65     QString strThirdPartyTxUrls;
66
67 signals:
68     void displayUnitChanged(int unit);
69     void transactionFeeChanged(qint64);
70     void coinControlFeaturesChanged(bool);
71 };
72
73 #endif // OPTIONSMODEL_H