PIVX Core  5.6.99
P2P Digital Currency
Public Types | Public Member Functions | Static Public Attributes | List of all members
AddressTableModel Class Reference

Qt model of the address book in the core. More...

#include <addresstablemodel.h>

Inheritance diagram for AddressTableModel:
[legend]
Collaboration diagram for AddressTableModel:
[legend]

Public Types

enum  ColumnIndex { Label = 0 , Address = 1 , Date = 2 , Type = 3 }
 
enum  RoleIndex { TypeRole = Qt::UserRole }
 
enum  EditStatus {
  OK , NO_CHANGES , INVALID_ADDRESS , DUPLICATE_ADDRESS ,
  WALLET_UNLOCK_FAILURE , KEY_GENERATION_FAILURE
}
 Return status of edit/insert operation. More...
 

Public Member Functions

 AddressTableModel (CWallet *wallet, WalletModel *parent=0)
 
 ~AddressTableModel ()
 

Static Public Attributes

static const QString Send = "S"
 Specifies send address. More...
 
static const QString Receive = "R"
 Specifies receive address. More...
 
static const QString Zerocoin = "X"
 Specifies stealth address. More...
 
static const QString Delegator = "D"
 Specifies cold staking addresses which delegated tokens to this wallet and ARE being staked. More...
 
static const QString Delegable = "E"
 Specifies cold staking addresses which delegated tokens to this wallet. More...
 
static const QString ColdStaking = "C"
 Specifies cold staking own addresses. More...
 
static const QString ColdStakingSend = "T"
 Specifies send cold staking addresses (simil 'contacts') More...
 
static const QString ShieldedReceive = "U"
 Specifies shielded send address. More...
 
static const QString ShieldedSend = "V"
 Specifies shielded receive address. More...
 

Methods overridden from QAbstractTableModel

WalletModelwalletModel {nullptr}
 
CWalletwallet {nullptr}
 
AddressTablePrivpriv {nullptr}
 
QStringList columns {}
 
EditStatus editStatus {OK}
 
class AddressTablePriv
 
int rowCount (const QModelIndex &parent) const
 
int columnCount (const QModelIndex &parent) const
 
int sizeSend () const
 
int sizeRecv () const
 
int sizeDell () const
 
int sizeColdSend () const
 
int sizeShieldedSend () const
 
int sizeSendAll () const
 
void notifyChange (const QModelIndex &index)
 
QVariant data (const QModelIndex &index, int role) const
 
bool setData (const QModelIndex &index, const QVariant &value, int role)
 
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
 
QString addRow (const QString &type, const QString &label, const QString &address)
 
QString labelForAddress (const QString &address) const
 
int lookupAddress (const QString &address) const
 
std::string purposeForAddress (const std::string &address) const
 
bool isWhitelisted (const std::string &address) const
 Checks if the address is whitelisted. More...
 
QString getAddressToShow (bool shielded=false) const
 Return last unused address. More...
 
EditStatus getEditStatus () const
 
void emitDataChanged (int index)
 Notify listeners that data changed. More...
 
void updateEntry (const QString &address, const QString &label, bool isMine, const QString &purpose, int status)
 
void updateEntry (const QString &pubCoin, const QString &isUsed, int status)
 

Detailed Description

Qt model of the address book in the core.

This allows views to access and modify the address book.

Definition at line 20 of file addresstablemodel.h.

Member Enumeration Documentation

◆ ColumnIndex

Enumerator
Label 

User specified label.

Address 

Bitcoin address.

Date 

Address creation date.

Type 

Address Type.

Definition at line 28 of file addresstablemodel.h.

◆ EditStatus

Return status of edit/insert operation.

Enumerator
OK 

Everything ok.

NO_CHANGES 

No changes were made during edit operation.

INVALID_ADDRESS 

Unparsable address.

DUPLICATE_ADDRESS 

Address already in address book.

WALLET_UNLOCK_FAILURE 

Wallet could not be unlocked to create new receiving address.

KEY_GENERATION_FAILURE 

Generating a new public key for a receiving address failed.

Definition at line 40 of file addresstablemodel.h.

◆ RoleIndex

Enumerator
TypeRole 

Type of address (Send, Receive, ColdStaking, ColdStakingSend, Delegator, Delegable)

Definition at line 35 of file addresstablemodel.h.

Constructor & Destructor Documentation

◆ AddressTableModel()

AddressTableModel::AddressTableModel ( CWallet wallet,
WalletModel parent = 0 
)
explicit

Definition at line 320 of file addresstablemodel.cpp.

Here is the call graph for this function:

◆ ~AddressTableModel()

AddressTableModel::~AddressTableModel ( )

Definition at line 327 of file addresstablemodel.cpp.

Member Function Documentation

◆ addRow()

QString AddressTableModel::addRow ( const QString &  type,
const QString &  label,
const QString &  address 
)

Definition at line 511 of file addresstablemodel.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ columnCount()

int AddressTableModel::columnCount ( const QModelIndex &  parent) const

Definition at line 338 of file addresstablemodel.cpp.

◆ data()

QVariant AddressTableModel::data ( const QModelIndex &  index,
int  role 
) const

Definition at line 351 of file addresstablemodel.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ emitDataChanged()

void AddressTableModel::emitDataChanged ( int  index)
private

Notify listeners that data changed.

Definition at line 645 of file addresstablemodel.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ flags()

Qt::ItemFlags AddressTableModel::flags ( const QModelIndex &  index) const

Definition at line 465 of file addresstablemodel.cpp.

Here is the call graph for this function:

◆ getAddressToShow()

QString AddressTableModel::getAddressToShow ( bool  isShielded = false) const

Return last unused address.

Return an unused address.

Returns

Definition at line 615 of file addresstablemodel.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getEditStatus()

EditStatus AddressTableModel::getEditStatus ( ) const
inline

Definition at line 107 of file addresstablemodel.h.

Here is the caller graph for this function:

◆ headerData()

QVariant AddressTableModel::headerData ( int  section,
Qt::Orientation  orientation,
int  role 
) const

Definition at line 455 of file addresstablemodel.cpp.

◆ index()

QModelIndex AddressTableModel::index ( int  row,
int  column,
const QModelIndex &  parent 
) const

Definition at line 481 of file addresstablemodel.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ isWhitelisted()

bool AddressTableModel::isWhitelisted ( const std::string &  address) const

Checks if the address is whitelisted.

Definition at line 606 of file addresstablemodel.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ labelForAddress()

QString AddressTableModel::labelForAddress ( const QString &  address) const
Todo:
: Check why do we have empty addresses..

Definition at line 578 of file addresstablemodel.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ lookupAddress()

int AddressTableModel::lookupAddress ( const QString &  address) const

Definition at line 595 of file addresstablemodel.cpp.

Here is the call graph for this function:

◆ notifyChange()

void AddressTableModel::notifyChange ( const QModelIndex &  index)

Definition at line 650 of file addresstablemodel.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ purposeForAddress()

std::string AddressTableModel::purposeForAddress ( const std::string &  address) const

Definition at line 590 of file addresstablemodel.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ removeRows()

bool AddressTableModel::removeRows ( int  row,
int  count,
const QModelIndex &  parent = QModelIndex() 
)

Definition at line 560 of file addresstablemodel.cpp.

Here is the caller graph for this function:

◆ rowCount()

int AddressTableModel::rowCount ( const QModelIndex &  parent) const

Definition at line 332 of file addresstablemodel.cpp.

Here is the call graph for this function:

◆ setData()

bool AddressTableModel::setData ( const QModelIndex &  index,
const QVariant &  value,
int  role 
)

Definition at line 404 of file addresstablemodel.cpp.

Here is the call graph for this function:

◆ sizeColdSend()

int AddressTableModel::sizeColdSend ( ) const

Definition at line 347 of file addresstablemodel.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ sizeDell()

int AddressTableModel::sizeDell ( ) const

Definition at line 346 of file addresstablemodel.cpp.

Here is the call graph for this function:

◆ sizeRecv()

int AddressTableModel::sizeRecv ( ) const

Definition at line 345 of file addresstablemodel.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ sizeSend()

int AddressTableModel::sizeSend ( ) const

Definition at line 344 of file addresstablemodel.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ sizeSendAll()

int AddressTableModel::sizeSendAll ( ) const

Definition at line 349 of file addresstablemodel.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ sizeShieldedSend()

int AddressTableModel::sizeShieldedSend ( ) const

Definition at line 348 of file addresstablemodel.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ updateEntry [1/2]

void AddressTableModel::updateEntry ( const QString &  address,
const QString &  label,
bool  isMine,
const QString &  purpose,
int  status 
)
slot

Definition at line 492 of file addresstablemodel.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ updateEntry [2/2]

void AddressTableModel::updateEntry ( const QString &  pubCoin,
const QString &  isUsed,
int  status 
)
slot

Definition at line 503 of file addresstablemodel.cpp.

Here is the call graph for this function:

Friends And Related Function Documentation

◆ AddressTablePriv

friend class AddressTablePriv
friend

Definition at line 124 of file addresstablemodel.h.

Member Data Documentation

◆ ColdStaking

const QString AddressTableModel::ColdStaking = "C"
static

Specifies cold staking own addresses.

Definition at line 54 of file addresstablemodel.h.

◆ ColdStakingSend

const QString AddressTableModel::ColdStakingSend = "T"
static

Specifies send cold staking addresses (simil 'contacts')

Definition at line 55 of file addresstablemodel.h.

◆ columns

QStringList AddressTableModel::columns {}
private

Definition at line 113 of file addresstablemodel.h.

◆ Delegable

const QString AddressTableModel::Delegable = "E"
static

Specifies cold staking addresses which delegated tokens to this wallet.

Definition at line 53 of file addresstablemodel.h.

◆ Delegator

const QString AddressTableModel::Delegator = "D"
static

Specifies cold staking addresses which delegated tokens to this wallet and ARE being staked.

Definition at line 52 of file addresstablemodel.h.

◆ editStatus

EditStatus AddressTableModel::editStatus {OK}
private

Definition at line 114 of file addresstablemodel.h.

◆ priv

AddressTablePriv* AddressTableModel::priv {nullptr}
private

Definition at line 112 of file addresstablemodel.h.

◆ Receive

const QString AddressTableModel::Receive = "R"
static

Specifies receive address.

Definition at line 50 of file addresstablemodel.h.

◆ Send

const QString AddressTableModel::Send = "S"
static

Specifies send address.

Definition at line 49 of file addresstablemodel.h.

◆ ShieldedReceive

const QString AddressTableModel::ShieldedReceive = "U"
static

Specifies shielded send address.

Definition at line 56 of file addresstablemodel.h.

◆ ShieldedSend

const QString AddressTableModel::ShieldedSend = "V"
static

Specifies shielded receive address.

Definition at line 57 of file addresstablemodel.h.

◆ wallet

CWallet* AddressTableModel::wallet {nullptr}
private

Definition at line 111 of file addresstablemodel.h.

◆ walletModel

WalletModel* AddressTableModel::walletModel {nullptr}
private

Definition at line 110 of file addresstablemodel.h.

◆ Zerocoin

const QString AddressTableModel::Zerocoin = "X"
static

Specifies stealth address.

Definition at line 51 of file addresstablemodel.h.


The documentation for this class was generated from the following files: