You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
55 lines
1.5 KiB
55 lines
1.5 KiB
14 years ago
|
#ifndef ADDRESSTABLEMODEL_H
|
||
|
#define ADDRESSTABLEMODEL_H
|
||
|
|
||
|
#include <QAbstractTableModel>
|
||
14 years ago
|
#include <QStringList>
|
||
|
|
||
|
class AddressTablePriv;
|
||
14 years ago
|
|
||
|
class AddressTableModel : public QAbstractTableModel
|
||
|
{
|
||
|
Q_OBJECT
|
||
|
public:
|
||
|
explicit AddressTableModel(QObject *parent = 0);
|
||
14 years ago
|
~AddressTableModel();
|
||
14 years ago
|
|
||
14 years ago
|
enum ColumnIndex {
|
||
14 years ago
|
Label = 0, /* User specified label */
|
||
|
Address = 1 /* Bitcoin address */
|
||
14 years ago
|
};
|
||
14 years ago
|
|
||
14 years ago
|
enum {
|
||
|
TypeRole = Qt::UserRole
|
||
|
} RoleIndex;
|
||
|
|
||
14 years ago
|
static const QString Send; /* Send addres */
|
||
|
static const QString Receive; /* Receive address */
|
||
|
|
||
14 years ago
|
/* Overridden methods from QAbstractTableModel */
|
||
14 years ago
|
int rowCount(const QModelIndex &parent) const;
|
||
|
int columnCount(const QModelIndex &parent) const;
|
||
|
QVariant data(const QModelIndex &index, int role) const;
|
||
14 years ago
|
bool setData(const QModelIndex & index, const QVariant & value, int role);
|
||
14 years ago
|
QVariant headerData(int section, Qt::Orientation orientation, int role) const;
|
||
14 years ago
|
QModelIndex index(int row, int column, const QModelIndex & parent) const;
|
||
14 years ago
|
bool removeRows(int row, int count, const QModelIndex & parent = QModelIndex());
|
||
|
|
||
|
/* Add an address to the model.
|
||
14 years ago
|
Returns the added address on success, and an empty string otherwise.
|
||
14 years ago
|
*/
|
||
14 years ago
|
QString addRow(const QString &type, const QString &label, const QString &address);
|
||
14 years ago
|
|
||
14 years ago
|
/* Update address list from core. Invalidates any indices.
|
||
|
*/
|
||
14 years ago
|
void updateList();
|
||
14 years ago
|
private:
|
||
|
AddressTablePriv *priv;
|
||
|
QStringList columns;
|
||
14 years ago
|
signals:
|
||
|
|
||
|
public slots:
|
||
|
|
||
|
};
|
||
|
|
||
|
#endif // ADDRESSTABLEMODEL_H
|