ORE Studio 0.0.4
Loading...
Searching...
No Matches
Public Types | Public Member Functions | List of all members
ClientCounterpartyModel Class Referencefinal

Model for displaying counterparties fetched from the server. More...

#include <ClientCounterpartyModel.hpp>

Inheritance diagram for ClientCounterpartyModel:
Inheritance graph
Collaboration diagram for ClientCounterpartyModel:
Collaboration graph

Public Types

enum  Column {
  BusinessCenterCode , ShortCode , FullName , TransliteratedName ,
  PartyType , Status , Version , ModifiedBy ,
  RecordedAt , ColumnCount
}
 Enumeration of table columns for type-safe column access.
 

Public Member Functions

 ClientCounterpartyModel (ClientManager *clientManager, ImageCache *imageCache, QObject *parent=nullptr)
 
int rowCount (const QModelIndex &parent=QModelIndex()) const override
 
int columnCount (const QModelIndex &parent=QModelIndex()) const override
 
QVariant data (const QModelIndex &index, int role=Qt::DisplayRole) const override
 
QVariant headerData (int section, Qt::Orientation orientation, int role=Qt::DisplayRole) const override
 
void refresh (bool replace=true)
 Refresh counterparty data from server asynchronously.
 
void load_page (std::uint32_t offset, std::uint32_t limit)
 Load a specific page of counterparty data.
 
const refdata::domain::counterpartygetCounterparty (int row) const
 Get counterparty at the specified row.
 
std::uint32_t page_size () const
 
void set_page_size (std::uint32_t size)
 
std::uint32_t total_available_count () const
 

Additional Inherited Members

- Signals inherited from AbstractClientModel
void dataLoaded ()
 
void loadError (const QString &error_message, const QString &details={})
 

Detailed Description

Model for displaying counterparties fetched from the server.

This model extends QAbstractTableModel and fetches counterparty data asynchronously using the ores.comms client.

Member Function Documentation

◆ refresh()

void refresh ( bool  replace = true)

Refresh counterparty data from server asynchronously.

When replace is true, existing data is cleared before loading. When false, new data is appended (for pagination).

Parameters
replaceIf true, replace existing data; if false, append.

◆ load_page()

void load_page ( std::uint32_t  offset,
std::uint32_t  limit 
)

Load a specific page of counterparty data.

Parameters
offsetNumber of records to skip
limitNumber of records to fetch

◆ getCounterparty()

const refdata::domain::counterparty * getCounterparty ( int  row) const

Get counterparty at the specified row.

Parameters
rowThe row index.
Returns
The counterparty, or nullptr if row is invalid.