20#ifndef ORES_QT_CLIENT_PARTY_ID_SCHEME_MODEL_HPP
21#define ORES_QT_CLIENT_PARTY_ID_SCHEME_MODEL_HPP
24#include <QFutureWatcher>
25#include <QAbstractTableModel>
26#include "ores.qt/AbstractClientModel.hpp"
27#include "ores.qt/ClientManager.hpp"
28#include "ores.qt/RecencyPulseManager.hpp"
29#include "ores.qt/RecencyTracker.hpp"
30#include "ores.logging/make_logger.hpp"
31#include "ores.refdata.api/domain/party_id_scheme.hpp"
45 inline static std::string_view logger_name =
46 "ores.qt.client_party_id_scheme_model";
48 [[nodiscard]]
static auto& lg() {
50 static auto instance = make_logger(logger_name);
71 QObject* parent =
nullptr);
75 int rowCount(
const QModelIndex& parent = QModelIndex())
const override;
76 int columnCount(
const QModelIndex& parent = QModelIndex())
const override;
77 QVariant data(
const QModelIndex& index,
int role = Qt::DisplayRole)
const override;
78 QVariant headerData(
int section, Qt::Orientation orientation,
79 int role = Qt::DisplayRole)
const override;
97 void load_page(std::uint32_t offset, std::uint32_t limit);
124 void onSchemesLoaded();
125 void onPulseStateChanged(
bool isOn);
126 void onPulsingComplete();
129 QVariant recency_foreground_color(
const std::string& code)
const;
133 std::vector<refdata::domain::party_id_scheme> schemes;
134 std::uint32_t total_available_count;
135 QString error_message;
136 QString error_details;
139 void fetch_schemes(std::uint32_t offset, std::uint32_t limit);
141 ClientManager* clientManager_;
142 std::vector<refdata::domain::party_id_scheme> schemes_;
143 QFutureWatcher<FetchResult>* watcher_;
144 std::uint32_t page_size_{100};
145 std::uint32_t total_available_count_{0};
146 bool is_fetching_{
false};
149 RecencyTracker<refdata::domain::party_id_scheme, PartyIdSchemeKeyExtractor> recencyTracker_;
150 RecencyPulseManager* pulseManager_;
Implements logging infrastructure for ORE Studio.
Definition boost_severity.hpp:28
Qt-based graphical user interface for ORE Studio.
Definition AboutDialog.hpp:29
Base class for all client-side entity models.
Definition AbstractClientModel.hpp:36
Manages the lifecycle of the NATS client and login state.
Definition ClientManager.hpp:109
Model for displaying party ID schemes fetched from the server.
Definition ClientPartyIdSchemeModel.hpp:41
void set_page_size(std::uint32_t size)
Set the page size for pagination.
Definition ClientPartyIdSchemeModel.cpp:267
void refresh()
Refresh party ID scheme data from server asynchronously.
Definition ClientPartyIdSchemeModel.cpp:135
std::uint32_t total_available_count() const
Get the total number of records available on the server.
Definition ClientPartyIdSchemeModel.hpp:112
const refdata::domain::party_id_scheme * getScheme(int row) const
Get party ID scheme at the specified row.
Definition ClientPartyIdSchemeModel.cpp:279
void load_page(std::uint32_t offset, std::uint32_t limit)
Load a specific page of data.
Definition ClientPartyIdSchemeModel.cpp:161
std::uint32_t page_size() const
Get the page size used for pagination.
Definition ClientPartyIdSchemeModel.hpp:102
Column
Enumeration of table columns for type-safe column access.
Definition ClientPartyIdSchemeModel.hpp:58
Classification of external identifier types for parties.
Definition party_id_scheme.hpp:38