Changeset View
Changeset View
Standalone View
Standalone View
src/qt/addresstablemodel.h
Show First 20 Lines • Show All 75 Lines • ▼ Show 20 Lines | public: | ||||
/*@}*/ | /*@}*/ | ||||
/* Add an address to the model. | /* Add an address to the model. | ||||
Returns the added address on success, and an empty string otherwise. | Returns the added address on success, and an empty string otherwise. | ||||
*/ | */ | ||||
QString addRow(const QString &type, const QString &label, | QString addRow(const QString &type, const QString &label, | ||||
const QString &address); | const QString &address); | ||||
/* Look up label for address in address book, if not found return empty | /** | ||||
* Look up label for address in address book, if not found return empty | |||||
* string. | * string. | ||||
*/ | */ | ||||
QString labelForAddress(const QString &address) const; | QString labelForAddress(const QString &address) const; | ||||
/** | |||||
* Look up purpose for address in address book, if not found return empty | |||||
* string. | |||||
*/ | |||||
QString purposeForAddress(const QString &address) const; | |||||
/* Look up row index of an address in the model. | /* 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; | ||||
AddressTablePriv *priv; | AddressTablePriv *priv; | ||||
QStringList columns; | QStringList columns; | ||||
EditStatus editStatus; | EditStatus editStatus; | ||||
/** Look up address book data given an address string. */ | |||||
bool getAddressData(const QString &address, std::string *name, | |||||
std::string *purpose) const; | |||||
/** Notify listeners that data changed. */ | /** Notify listeners that data changed. */ | ||||
void emitDataChanged(int index); | void emitDataChanged(int index); | ||||
public Q_SLOTS: | public Q_SLOTS: | ||||
/* Update address list from core. | /* Update address list from core. | ||||
*/ | */ | ||||
void updateEntry(const QString &address, const QString &label, bool isMine, | void updateEntry(const QString &address, const QString &label, bool isMine, | ||||
const QString &purpose, int status); | const QString &purpose, int status); | ||||
friend class AddressTablePriv; | friend class AddressTablePriv; | ||||
}; | }; | ||||
#endif // BITCOIN_QT_ADDRESSTABLEMODEL_H | #endif // BITCOIN_QT_ADDRESSTABLEMODEL_H |