5#ifndef BITCOIN_QT_ADDRESSTABLEMODEL_H
6#define BITCOIN_QT_ADDRESSTABLEMODEL_H
8#include <QAbstractTableModel>
66 int rowCount(
const QModelIndex &parent)
const override;
67 int columnCount(
const QModelIndex &parent)
const override;
68 QVariant
data(
const QModelIndex &
index,
int role)
const override;
69 bool setData(
const QModelIndex &
index,
const QVariant &value,
71 QVariant
headerData(
int section, Qt::Orientation orientation,
72 int role)
const override;
73 QModelIndex
index(
int row,
int column,
74 const QModelIndex &parent)
const override;
76 const QModelIndex &parent = QModelIndex())
override;
77 Qt::ItemFlags
flags(
const QModelIndex &
index)
const override;
83 QString
addRow(
const QString &type,
const QString &label,
84 const QString &address,
const OutputType address_type);
115 std::string *purpose)
const;
123 void updateEntry(
const QString &address,
const QString &label,
bool isMine,
124 const QString &purpose,
int status);
Qt model of the address book in the core.
bool removeRows(int row, int count, const QModelIndex &parent=QModelIndex()) override
@ TypeRole
Type of address (Send or Receive)
int lookupAddress(const QString &address) const
OutputType GetDefaultAddressType() const
EditStatus getEditStatus() const
EditStatus
Return status of edit/insert operation.
@ WALLET_UNLOCK_FAILURE
Wallet could not be unlocked to create new receiving address.
@ NO_CHANGES
No changes were made during edit operation.
@ INVALID_ADDRESS
Unparseable address.
@ KEY_GENERATION_FAILURE
Generating a new public key for a receiving address failed.
@ DUPLICATE_ADDRESS
Address already in address book.
void emitDataChanged(int index)
Notify listeners that data changed.
@ Address
Bitcoin address.
@ Label
User specified label.
QVariant data(const QModelIndex &index, int role) const override
QModelIndex index(int row, int column, const QModelIndex &parent) const override
int columnCount(const QModelIndex &parent) const override
bool setData(const QModelIndex &index, const QVariant &value, int role) override
static const QString Send
Specifies send address.
QString addRow(const QString &type, const QString &label, const QString &address, const OutputType address_type)
void updateEntry(const QString &address, const QString &label, bool isMine, const QString &purpose, int status)
QVariant headerData(int section, Qt::Orientation orientation, int role) const override
Qt::ItemFlags flags(const QModelIndex &index) const override
static const QString Receive
Specifies receive address.
int rowCount(const QModelIndex &parent) const override
WalletModel *const walletModel
AddressTableModel(WalletModel *parent=nullptr)
QString purposeForAddress(const QString &address) const
Look up purpose for address in address book, if not found return empty string.
QString labelForAddress(const QString &address) const
Look up label for address in address book, if not found return empty string.
bool getAddressData(const QString &address, std::string *name, std::string *purpose) const
Look up address book data given an address string.
Interface to Bitcoin wallet from Qt view code.