20#ifndef ORES_QT_FX_VARIANCE_SWAP_INSTRUMENT_FORM_HPP
21#define ORES_QT_FX_VARIANCE_SWAP_INSTRUMENT_FORM_HPP
23#include "ores.qt/IInstrumentForm.hpp"
24#include "ores.logging/make_logger.hpp"
25#include "ores.trading.api/domain/fx_variance_swap_instrument.hpp"
28class FxVarianceSwapInstrumentForm;
42 inline static std::string_view logger_name =
43 "ores.qt.fx_variance_swap_instrument_form";
45 [[nodiscard]]
static auto& lg() {
47 static auto instance = make_logger(logger_name);
56 void setUsername(
const std::string& username)
override;
60 const trading::domain::trade_instrument& instrument)
override;
61 void clear()
override;
64 bool has_options,
bool has_extension)
override;
71 const std::string& code,
const std::string& commentary)
override;
75 std::function<
void(
const std::string&
id)> on_success,
76 std::function<
void(
const QString& error)> on_failure)
override;
79 void setupConnections();
80 void populateCurrencies();
81 void populateFromInstrument();
82 void emitProvenance();
83 void onFieldChanged();
85 Ui::FxVarianceSwapInstrumentForm* ui_;
88 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 for FX Variance Swap trades.
Definition FxVarianceSwapInstrumentForm.hpp:38
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 FxVarianceSwapInstrumentForm.cpp:246
bool isLoaded() const override
True after the asynchronous load has populated the form.
Definition FxVarianceSwapInstrumentForm.cpp:142
void setInstrument(const trading::domain::trade_instrument &instrument) override
Populate the form with the already-resolved instrument.
Definition FxVarianceSwapInstrumentForm.cpp:169
void writeUiToInstrument() override
Pull the current UI values into the in-flight domain object.
Definition FxVarianceSwapInstrumentForm.cpp:150
void setImageCache(ImageCache *cache) override
Inject the image cache for flag icons on currency combo boxes.
Definition FxVarianceSwapInstrumentForm.cpp:76
void setUsername(const std::string &username) override
Inject the username stamped on every saved instrument.
Definition FxVarianceSwapInstrumentForm.cpp:110
void setTradeType(const QString &code, bool has_options, bool has_extension) override
Inform the form which trade type is currently selected.
Definition FxVarianceSwapInstrumentForm.cpp:123
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 FxVarianceSwapInstrumentForm.cpp:144
void setReadOnly(bool readOnly) override
Toggle read-only on every editable widget.
Definition FxVarianceSwapInstrumentForm.cpp:129
void setClientManager(ClientManager *cm) override
Inject the NATS client used for load and save round-trips.
Definition FxVarianceSwapInstrumentForm.cpp:71
bool isDirty() const override
Has the user edited any field since the last load or save?
Definition FxVarianceSwapInstrumentForm.cpp:141
void clear() override
Reset the form to a blank state ready for create mode.
Definition FxVarianceSwapInstrumentForm.cpp:114
Pure-virtual interface implemented by every per-family instrument form widget hosted in TradeDetailDi...
Definition IInstrumentForm.hpp:73
FX Variance Swap instrument.
Definition fx_variance_swap_instrument.hpp:37