1 #ifndef ADDRESSTABLEMODEL_H
2 #define ADDRESSTABLEMODEL_H
4 #include <QAbstractTableModel>
7 class AddressTablePriv;
9 class AddressTableModel : public QAbstractTableModel
13 explicit AddressTableModel(QObject *parent = 0);
17 Label = 0, /* User specified label */
18 Address = 1 /* Bitcoin address */
22 TypeRole = Qt::UserRole
25 static const QString Send; /* Send addres */
26 static const QString Receive; /* Receive address */
28 /* Overridden methods from QAbstractTableModel */
29 int rowCount(const QModelIndex &parent) const;
30 int columnCount(const QModelIndex &parent) const;
31 QVariant data(const QModelIndex &index, int role) const;
32 bool setData(const QModelIndex & index, const QVariant & value, int role);
33 QVariant headerData(int section, Qt::Orientation orientation, int role) const;
34 QModelIndex index(int row, int column, const QModelIndex & parent) const;
35 bool removeRows(int row, int count, const QModelIndex & parent = QModelIndex());
37 /* Add an address to the model.
38 Returns the added address on success, and an empty string otherwise.
40 QString addRow(const QString &type, const QString &label, const QString &address);
42 /* Update address list from core. Invalidates any indices.
46 AddressTablePriv *priv;
54 #endif // ADDRESSTABLEMODEL_H