X-Git-Url: https://git.novaco.in/?a=blobdiff_plain;f=src%2Fqt%2Faddresstablemodel.h;h=d48e7866216da7fa40a73349442c8fdb1423074b;hb=51d7cc07f10209ac12bd5286391e3c8b095abd34;hp=87994143343c1c3a2a9937930f2ff1cf20e82e83;hpb=ba4081c1fcaddf361abd61b2721994eff5475bb3;p=novacoin.git diff --git a/src/qt/addresstablemodel.h b/src/qt/addresstablemodel.h index 8799414..d48e786 100644 --- a/src/qt/addresstablemodel.h +++ b/src/qt/addresstablemodel.h @@ -5,12 +5,13 @@ #include class AddressTablePriv; +class CWallet; class AddressTableModel : public QAbstractTableModel { Q_OBJECT public: - explicit AddressTableModel(QObject *parent = 0); + explicit AddressTableModel(CWallet *wallet, QObject *parent = 0); ~AddressTableModel(); enum ColumnIndex { @@ -33,6 +34,7 @@ public: QVariant headerData(int section, Qt::Orientation orientation, int role) const; QModelIndex index(int row, int column, const QModelIndex & parent) const; bool removeRows(int row, int count, const QModelIndex & parent = QModelIndex()); + Qt::ItemFlags flags(const QModelIndex & index) const; /* Add an address to the model. Returns the added address on success, and an empty string otherwise. @@ -42,13 +44,30 @@ public: /* Update address list from core. Invalidates any indices. */ void updateList(); + + /* Check address for validity + */ + bool validateAddress(const QString &address); + + /* Look up label for address in address book, if not found return empty string. + */ + QString labelForAddress(const QString &address) const; + + /* Look up row index of an address in the model. + Return -1 if not found. + */ + int lookupAddress(const QString &address) const; + private: + CWallet *wallet; AddressTablePriv *priv; QStringList columns; + signals: + void defaultAddressChanged(const QString &address); public slots: - + void update(); }; #endif // ADDRESSTABLEMODEL_H