|
ORE Studio 0.0.4
|
Model for displaying accounts fetched from the server via client. More...
#include <ClientAccountModel.hpp>


Public Types | |
| enum | Column { Username , AccountType , Email , Parties , Status , Locked , Version , ModifiedBy , RecordedAt , ColumnCount } |
| Enumeration of table columns for type-safe column access. More... | |
Public Member Functions | |
| ClientAccountModel (ClientManager *clientManager, 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 account data from server asynchronously. | |
| void | load_page (std::uint32_t offset, std::uint32_t limit) |
| Load a specific page of account data. | |
| const AccountWithLoginInfo * | getAccountWithLoginInfo (int row) const |
| Get account with login info at the specified row. | |
| const iam::domain::account * | getAccount (int row) const |
| Get account at the specified row (for backward compatibility). | |
| std::vector< AccountWithLoginInfo > | getAccountsWithLoginInfo () const |
| Get all accounts with their login info. | |
| std::uint32_t | page_size () const |
| Get the page size used for pagination. | |
| void | set_page_size (std::uint32_t size) |
| Set the page size for pagination. | |
| std::uint32_t | total_available_count () const |
| Get the total number of records available on the server. | |
Additional Inherited Members | |
Signals inherited from AbstractClientModel | |
| void | dataLoaded () |
| void | loadError (const QString &error_message, const QString &details={}) |
Model for displaying accounts fetched from the server via client.
This model extends QAbstractTableModel and fetches account data asynchronously using the ores.comms client instead of direct database access.
| enum Column |
Enumeration of table columns for type-safe column access.
Using an enum instead of magic numbers makes the code self-documenting and easier to refactor when columns are added, removed, or reordered. This enum is public so that delegates and other consumers can reference columns without hardcoding indices. Note: IsAdmin removed - admin privileges are now managed via RBAC.
| void refresh | ( | bool | replace = true | ) |
Refresh account data from server asynchronously.
This method initiates an async request to fetch accounts. The model will emit dataChanged() when the fetch completes. When replace is true, existing data is cleared before loading. When false, new data is appended (for pagination).
| replace | If true, replace existing data; if false, append. |
| void load_page | ( | std::uint32_t | offset, |
| std::uint32_t | limit | ||
| ) |
Load a specific page of account data.
Used for pagination navigation. Replaces current data with the requested page.
| offset | Number of records to skip |
| limit | Number of records to fetch |
| const AccountWithLoginInfo * getAccountWithLoginInfo | ( | int | row | ) | const |
Get account with login info at the specified row.
| row | The row index. |
| const iam::domain::account * getAccount | ( | int | row | ) | const |
Get account at the specified row (for backward compatibility).
| row | The row index. |
| std::vector< AccountWithLoginInfo > getAccountsWithLoginInfo | ( | ) | const |
Get all accounts with their login info.
| std::uint32_t page_size | ( | ) | const |
Get the page size used for pagination.
| void set_page_size | ( | std::uint32_t | size | ) |
Set the page size for pagination.
| size | The number of records to fetch per page (1-1000). |
| std::uint32_t total_available_count | ( | ) | const |
Get the total number of records available on the server.