20#ifndef ORES_QT_COMPOSITE_INSTRUMENT_DETAIL_DIALOG_HPP
21#define ORES_QT_COMPOSITE_INSTRUMENT_DETAIL_DIALOG_HPP
24#include "ores.qt/ClientManager.hpp"
25#include "ores.qt/DetailDialogBase.hpp"
26#include "ores.logging/make_logger.hpp"
27#include "ores.trading.api/domain/composite_instrument.hpp"
28#include "ores.trading.api/domain/composite_leg.hpp"
31class CompositeInstrumentDetailDialog;
43 inline static std::string_view logger_name =
44 "ores.qt.composite_instrument_detail_dialog";
46 [[nodiscard]]
static auto& lg() {
48 static auto instance = make_logger(logger_name);
57 void setUsername(
const std::string& username);
58 void setCompositeInstrument(
61 const std::vector<trading::domain::composite_leg>& legs);
62 void setCreateMode(
bool createMode);
63 void setReadOnly(
bool readOnly);
73 void compositeInstrumentSaved(
const QString&
id);
74 void compositeInstrumentDeleted(
const QString&
id);
78 void onDeleteClicked();
79 void onFieldChanged();
89 void setupConnections();
90 void updateUiFromCompositeInstrument();
91 void updateCompositeInstrumentFromUi();
92 void updateSaveButtonState();
95 Ui::CompositeInstrumentDetailDialog* ui_;
97 std::string username_;
99 bool createMode_{
true};
100 bool readOnly_{
false};
101 bool hasChanges_{
false};
Implements logging infrastructure for ORE Studio.
Definition boost_severity.hpp:28
Qt-based graphical user interface for ORE Studio.
Definition AboutDialog.hpp:29
Manages the lifecycle of the NATS client and login state.
Definition ClientManager.hpp:109
Detail dialog for viewing and editing composite instrument records.
Definition CompositeInstrumentDetailDialog.hpp:39
ProvenanceWidget * provenanceWidget() const override
Returns the promoted ProvenanceWidget (named "provenanceWidget" in .ui).
Definition CompositeInstrumentDetailDialog.cpp:59
void loadLegs()
Asynchronously fetch legs from the server and populate the widget.
Definition CompositeInstrumentDetailDialog.cpp:118
bool hasUnsavedChanges() const override
Definition CompositeInstrumentDetailDialog.hpp:85
QTabWidget * tabWidget() const override
Returns the dialog's QTabWidget (named "tabWidget" in .ui).
Definition CompositeInstrumentDetailDialog.cpp:51
QWidget * provenanceTab() const override
Returns the Provenance tab widget (named "provenanceTab" in .ui).
Definition CompositeInstrumentDetailDialog.cpp:55
Base class for all detail dialogs.
Definition DetailDialogBase.hpp:74
Widget displaying the 6 standard record provenance fields.
Definition ProvenanceWidget.hpp:39
Composite instrument economics for CompositeTrade and MultiLegOption ORE product types.
Definition composite_instrument.hpp:37