20#ifndef ORES_QT_EQUITY_INSTRUMENT_FORM_HPP
21#define ORES_QT_EQUITY_INSTRUMENT_FORM_HPP
23#include "ores.qt/IInstrumentForm.hpp"
24#include "ores.logging/make_logger.hpp"
25#include "ores.trading.api/domain/equity_option_instrument.hpp"
28class EquityInstrumentForm;
45 inline static std::string_view logger_name =
46 "ores.qt.equity_instrument_form";
48 [[nodiscard]]
static auto& lg() {
50 static auto instance = make_logger(logger_name);
59 void setUsername(
const std::string& username)
override;
63 const trading::domain::trade_instrument& instrument)
override;
64 void clear()
override;
67 bool has_options,
bool has_extension)
override;
74 const std::string& code,
const std::string& commentary)
override;
78 std::function<
void(
const std::string&
id)> on_success,
79 std::function<
void(
const QString& error)> on_failure)
override;
82 void setupConnections();
83 void populateCurrencies();
84 void populateFromInstrument();
85 void emitProvenance();
86 void onFieldChanged();
88 Ui::EquityInstrumentForm* ui_;
91 std::string username_;
Implements logging infrastructure for ORE Studio.
Definition boost_severity.hpp:28
Qt-based graphical user interface for ORE Studio.
Definition AccountController.hpp:32
Manages the lifecycle of the NATS client and login state.
Definition ClientManager.hpp:123
Cache for dynamically loaded images (flags, icons) from the server.
Definition ImageCache.hpp:54
IInstrumentForm subclass owning the equity instrument editor.
Definition EquityInstrumentForm.hpp:41
void saveInstrument(std::function< void(const std::string &id)> on_success, std::function< void(const QString &error)> on_failure) override
Save the in-flight instrument via the family's NATS request.
Definition EquityInstrumentForm.cpp:337
bool isLoaded() const override
True after the asynchronous load has populated the form.
Definition EquityInstrumentForm.cpp:203
void setInstrument(const trading::domain::trade_instrument &instrument) override
Populate the form with the already-resolved instrument.
Definition EquityInstrumentForm.cpp:231
void writeUiToInstrument() override
Pull the current UI values into the in-flight domain object.
Definition EquityInstrumentForm.cpp:211
void setImageCache(ImageCache *cache) override
Inject the image cache for flag icons on currency combo boxes.
Definition EquityInstrumentForm.cpp:121
void setUsername(const std::string &username) override
Inject the username stamped on every saved instrument.
Definition EquityInstrumentForm.cpp:155
void setTradeType(const QString &code, bool has_options, bool has_extension) override
Inform the form which trade type is currently selected.
Definition EquityInstrumentForm.cpp:166
void setChangeReason(const std::string &code, const std::string &commentary) override
Stamp the change reason on the in-flight instrument before the dialog calls saveInstrument.
Definition EquityInstrumentForm.cpp:205
void setReadOnly(bool readOnly) override
Toggle read-only on every editable widget.
Definition EquityInstrumentForm.cpp:176
void setClientManager(ClientManager *cm) override
Inject the NATS client used for load and save round-trips.
Definition EquityInstrumentForm.cpp:116
bool isDirty() const override
Has the user edited any field since the last load or save?
Definition EquityInstrumentForm.cpp:202
void clear() override
Reset the form to a blank state ready for create mode.
Definition EquityInstrumentForm.cpp:159
Pure-virtual interface implemented by every per-family instrument form widget hosted in TradeDetailDi...
Definition IInstrumentForm.hpp:73
Equity Option instrument.
Definition equity_option_instrument.hpp:36