Fabcoin Core  0.16.2
P2P Digital Currency
Public Types | Public Slots | Public Member Functions | Private Member Functions | Private Attributes | Friends | List of all members
ContractTableModel Class Reference

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

#include <contracttablemodel.h>

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

Public Types

enum  ColumnIndex { Label = 0, Address = 1, ABI = 2 }
 
enum  EditStatus { OK = 0, NO_CHANGES, DUPLICATE_ADDRESS }
 Return status of edit/insert operation. More...
 

Public Slots

void updateEntry (const QString &address, const QString &label, const QString &abi, int status)
 

Public Member Functions

 ContractTableModel (CWallet *wallet, WalletModel *parent=0)
 
 ~ContractTableModel ()
 
QString addRow (const QString &label, const QString &address, const QString &abi)
 
QString labelForAddress (const QString &address) const
 
QString abiForAddress (const QString &address) const
 
int lookupAddress (const QString &address) const
 
EditStatus getEditStatus () const
 
void resetEditStatus ()
 
Methods overridden from QAbstractTableModel
int rowCount (const QModelIndex &parent) const
 
int columnCount (const QModelIndex &parent) const
 
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())
 

Private Member Functions

void emitDataChanged (int index)
 Notify listeners that data changed. More...
 
void updateEditStatus (EditStatus status)
 

Private Attributes

WalletModelwalletModel
 
CWalletwallet
 
ContractTablePrivpriv
 
QStringList columns
 
EditStatus editStatus
 

Friends

class ContractTablePriv
 

Detailed Description

Qt model of the contract book in the core.

This allows views to access and modify the contract book.

Definition at line 15 of file contracttablemodel.h.

Member Enumeration Documentation

Enumerator
Label 

User specified label.

Address 

Contract address.

ABI 

Contract abi.

Definition at line 23 of file contracttablemodel.h.

Return status of edit/insert operation.

Enumerator
OK 

Everything ok.

NO_CHANGES 

No changes were made during edit operation.

DUPLICATE_ADDRESS 

Address already in contract book.

Definition at line 30 of file contracttablemodel.h.

Constructor & Destructor Documentation

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

Definition at line 134 of file contracttablemodel.cpp.

Here is the call graph for this function:

ContractTableModel::~ContractTableModel ( )

Definition at line 142 of file contracttablemodel.cpp.

Member Function Documentation

QString ContractTableModel::abiForAddress ( const QString &  address) const

Definition at line 345 of file contracttablemodel.cpp.

Here is the caller graph for this function:

QString ContractTableModel::addRow ( const QString &  label,
const QString &  address,
const QString &  abi 
)

Definition at line 290 of file contracttablemodel.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

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

Definition at line 153 of file contracttablemodel.cpp.

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

Definition at line 159 of file contracttablemodel.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void ContractTableModel::emitDataChanged ( int  index)
private

Notify listeners that data changed.

Definition at line 378 of file contracttablemodel.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

EditStatus ContractTableModel::getEditStatus ( ) const
inline

Definition at line 65 of file contracttablemodel.h.

Here is the call graph for this function:

Here is the caller graph for this function:

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

Definition at line 257 of file contracttablemodel.cpp.

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

Definition at line 269 of file contracttablemodel.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

QString ContractTableModel::labelForAddress ( const QString &  address) const

Definition at line 329 of file contracttablemodel.cpp.

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

Definition at line 359 of file contracttablemodel.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

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

Definition at line 311 of file contracttablemodel.cpp.

Here is the call graph for this function:

void ContractTableModel::resetEditStatus ( )

Definition at line 373 of file contracttablemodel.cpp.

Here is the caller graph for this function:

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

Definition at line 147 of file contracttablemodel.cpp.

Here is the call graph for this function:

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

Definition at line 198 of file contracttablemodel.cpp.

Here is the call graph for this function:

void ContractTableModel::updateEditStatus ( ContractTableModel::EditStatus  status)
private

Definition at line 383 of file contracttablemodel.cpp.

Here is the caller graph for this function:

void ContractTableModel::updateEntry ( const QString &  address,
const QString &  label,
const QString &  abi,
int  status 
)
slot

Definition at line 283 of file contracttablemodel.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

Friends And Related Function Documentation

friend class ContractTablePriv
friend

Definition at line 86 of file contracttablemodel.h.

Member Data Documentation

QStringList ContractTableModel::columns
private

Definition at line 73 of file contracttablemodel.h.

EditStatus ContractTableModel::editStatus
private

Definition at line 74 of file contracttablemodel.h.

ContractTablePriv* ContractTableModel::priv
private

Definition at line 72 of file contracttablemodel.h.

CWallet* ContractTableModel::wallet
private

Definition at line 71 of file contracttablemodel.h.

WalletModel* ContractTableModel::walletModel
private

Definition at line 70 of file contracttablemodel.h.


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