Changeset View
Changeset View
Standalone View
Standalone View
src/qt/addresstablemodel.h
// Copyright (c) 2011-2015 The Bitcoin Core developers | // Copyright (c) 2011-2015 The Bitcoin Core developers | ||||
// Distributed under the MIT software license, see the accompanying | // Distributed under the MIT software license, see the accompanying | ||||
// file COPYING or http://www.opensource.org/licenses/mit-license.php. | // file COPYING or http://www.opensource.org/licenses/mit-license.php. | ||||
#ifndef BITCOIN_QT_ADDRESSTABLEMODEL_H | #ifndef BITCOIN_QT_ADDRESSTABLEMODEL_H | ||||
#define BITCOIN_QT_ADDRESSTABLEMODEL_H | #define BITCOIN_QT_ADDRESSTABLEMODEL_H | ||||
#include <QAbstractTableModel> | #include <QAbstractTableModel> | ||||
#include <QStringList> | #include <QStringList> | ||||
class AddressTablePriv; | class AddressTablePriv; | ||||
class WalletModel; | class WalletModel; | ||||
class CWallet; | namespace interface { | ||||
class Wallet; | |||||
} | |||||
/** | /** | ||||
* Qt model of the address book in the core. This allows views to access and | * Qt model of the address book in the core. This allows views to access and | ||||
* modify the address book. | * modify the address book. | ||||
*/ | */ | ||||
class AddressTableModel : public QAbstractTableModel { | class AddressTableModel : public QAbstractTableModel { | ||||
Q_OBJECT | Q_OBJECT | ||||
public: | public: | ||||
explicit AddressTableModel(CWallet *wallet, WalletModel *parent = 0); | explicit AddressTableModel(WalletModel *parent = 0); | ||||
~AddressTableModel(); | ~AddressTableModel(); | ||||
enum ColumnIndex { | enum ColumnIndex { | ||||
/**< User specified label */ | /**< User specified label */ | ||||
Label = 0, | Label = 0, | ||||
/**< Bitcoin address */ | /**< Bitcoin address */ | ||||
Address = 1 | Address = 1 | ||||
}; | }; | ||||
▲ Show 20 Lines • Show All 55 Lines • ▼ Show 20 Lines | /* Look up row index of an address in the model. | ||||
Return -1 if not found. | Return -1 if not found. | ||||
*/ | */ | ||||
int lookupAddress(const QString &address) const; | int lookupAddress(const QString &address) const; | ||||
EditStatus getEditStatus() const { return editStatus; } | EditStatus getEditStatus() const { return editStatus; } | ||||
private: | private: | ||||
WalletModel *walletModel; | WalletModel *walletModel; | ||||
CWallet *wallet; | |||||
AddressTablePriv *priv; | AddressTablePriv *priv; | ||||
QStringList columns; | QStringList columns; | ||||
EditStatus editStatus; | EditStatus editStatus; | ||||
/** Notify listeners that data changed. */ | /** Notify listeners that data changed. */ | ||||
void emitDataChanged(int index); | void emitDataChanged(int index); | ||||
public Q_SLOTS: | public Q_SLOTS: | ||||
Show All 9 Lines |