20#ifndef ORES_QT_CLIENT_CATALOG_MODEL_HPP
21#define ORES_QT_CLIENT_CATALOG_MODEL_HPP
24#include <QAbstractTableModel>
26#include "ores.dq.api/domain/catalog.hpp"
27#include "ores.qt/ClientManager.hpp"
28#include "ores.qt/ColumnMetadata.hpp"
29#include "ores.qt/RecencyPulseManager.hpp"
30#include "ores.qt/RecencyTracker.hpp"
31#include "ores.logging/make_logger.hpp"
46 inline static std::string_view logger_name =
"ores.qt.client_catalog_model";
48 [[nodiscard]]
static auto& lg() {
50 static auto instance = make_logger(logger_name);
70 static constexpr std::size_t
kColumnCount = std::size_t(ColumnCount);
71 static constexpr std::array<ColumnMetadata, kColumnCount> kColumns = {{
74 .header = std::string_view(
"Name"),
76 .hidden_by_default =
false,
80 .column = Description,
81 .header = std::string_view(
"Description"),
83 .hidden_by_default =
false,
88 .header = std::string_view(
"Owner"),
90 .hidden_by_default =
false,
95 .header = std::string_view(
"Version"),
97 .hidden_by_default =
false,
101 .column = ModifiedBy,
102 .header = std::string_view(
"Modified By"),
104 .hidden_by_default =
false,
108 .column = RecordedAt,
109 .header = std::string_view(
"Recorded At"),
111 .hidden_by_default =
false,
129 static std::vector<column_style>
const kStylesVector = []() {
130 std::vector<column_style> result;
133 result.push_back(kColumns[i].style);
136 return kStylesVector;
143 static QVector<int>
const result =
144 ::ores::qt::defaultHiddenColumns<kColumnCount>(kColumns);
149 QObject* parent =
nullptr);
151 int rowCount(
const QModelIndex& parent = QModelIndex())
const override;
152 int columnCount(
const QModelIndex& parent = QModelIndex())
const override;
153 QVariant data(
const QModelIndex& index,
154 int role = Qt::DisplayRole)
const override;
155 QVariant headerData(
int section, Qt::Orientation orientation,
156 int role = Qt::DisplayRole)
const override;
164 void errorOccurred(
const QString& message,
const QString& details = {});
167 void onPulseStateChanged(
bool isOn);
168 void onPulsingComplete();
171 QVariant foregroundColor(
const std::string& name)
const;
173 ClientManager* clientManager_;
174 std::vector<dq::domain::catalog> catalogs_;
178 RecencyTracker<dq::domain::catalog, CatalogKeyExtractor> recencyTracker_;
179 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
constexpr int kColumnWidthAuto
Sentinel value for column default width meaning "auto-size to contents".
Definition ColumnMetadata.hpp:37
@ mono_center
Monospace, centered.
@ text_left
Proportional font, left-aligned (default).
@ mono_left
Monospace, left-aligned.
Represents a logical grouping of related datasets.
Definition catalog.hpp:39
Table model for displaying catalogs in a QTableView.
Definition ClientCatalogModel.hpp:42
static constexpr std::string_view kSettingsGroup
Settings group name for persisting window and column state.
Definition ClientCatalogModel.hpp:124
static constexpr std::size_t kColumnCount
Column metadata: header text, style, visibility, and width.
Definition ClientCatalogModel.hpp:70
static const QSize kDefaultWindowSize
Default window size for the catalog list window.
Definition ClientCatalogModel.hpp:119
static std::vector< column_style > const & columnStyles()
Returns a static vector of column styles (built once per process).
Definition ClientCatalogModel.hpp:128
static QVector< int > defaultHiddenColumns()
Returns a static QVector of hidden column indices (built once per process).
Definition ClientCatalogModel.hpp:142
Manages the lifecycle of the NATS client and login state.
Definition ClientManager.hpp:109