update core to d0d80170a2ca73004e08fb85007fe055cbf4e411 (CWallet class)
[novacoin.git] / src / qt / addresstablemodel.h
index 8799414..d846585 100644 (file)
@@ -5,17 +5,19 @@
 #include <QStringList>
 
 class AddressTablePriv;
+class CWallet;
 
 class AddressTableModel : public QAbstractTableModel
 {
     Q_OBJECT
 public:
-    explicit AddressTableModel(QObject *parent = 0);
+    explicit AddressTableModel(CWallet *wallet, QObject *parent = 0);
     ~AddressTableModel();
 
     enum ColumnIndex {
         Label = 0,   /* User specified label */
-        Address = 1  /* Bitcoin address */
+        Address = 1,  /* Bitcoin address */
+        IsDefaultAddress = 2 /* Is default address? */
     };
 
     enum {
@@ -37,18 +39,26 @@ public:
     /* Add an address to the model.
        Returns the added address on success, and an empty string otherwise.
      */
-    QString addRow(const QString &type, const QString &label, const QString &address);
+    QString addRow(const QString &type, const QString &label, const QString &address, bool setAsDefault);
+
+    /* Set and get default address */
+    QString getDefaultAddress() const;
+    void setDefaultAddress(const QString &defaultAddress);
 
     /* Update address list from core. Invalidates any indices.
      */
     void updateList();
+
 private:
+    CWallet *wallet;
     AddressTablePriv *priv;
     QStringList columns;
+
 signals:
+    void defaultAddressChanged(const QString &address);
 
 public slots:
-
+    void update();
 };
 
 #endif // ADDRESSTABLEMODEL_H