20#ifndef ORES_QT_BOND_INSTRUMENT_FORM_HPP
21#define ORES_QT_BOND_INSTRUMENT_FORM_HPP
23#include "ores.qt/IInstrumentForm.hpp"
24#include "ores.logging/make_logger.hpp"
25#include "ores.trading.api/domain/bond_instrument.hpp"
28class BondInstrumentForm;
45 inline static std::string_view logger_name =
"ores.qt.bond_instrument_form";
47 [[nodiscard]]
static auto& lg() {
49 static auto instance = make_logger(logger_name);
58 void setUsername(
const std::string& username)
override;
62 const trading::domain::trade_instrument& instrument)
override;
63 void clear()
override;
66 bool has_options,
bool has_extension)
override;
73 const std::string& code,
const std::string& commentary)
override;
77 std::function<
void(
const std::string&
id)> on_success,
78 std::function<
void(
const QString& error)> on_failure)
override;
81 void setupConnections();
82 void populateCurrencies();
83 void populateFromInstrument();
84 void emitProvenance();
85 void onFieldChanged();
87 Ui::BondInstrumentForm* ui_;
90 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 bond instrument editor.
Definition BondInstrumentForm.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 BondInstrumentForm.cpp:321
bool isLoaded() const override
True after the asynchronous load has populated the form.
Definition BondInstrumentForm.cpp:180
void setInstrument(const trading::domain::trade_instrument &instrument) override
Populate the form with the already-resolved instrument.
Definition BondInstrumentForm.cpp:225
void writeUiToInstrument() override
Pull the current UI values into the in-flight domain object.
Definition BondInstrumentForm.cpp:188
void setImageCache(ImageCache *cache) override
Inject the image cache for flag icons on currency combo boxes.
Definition BondInstrumentForm.cpp:104
void setUsername(const std::string &username) override
Inject the username stamped on every saved instrument.
Definition BondInstrumentForm.cpp:138
void setTradeType(const QString &code, bool has_options, bool has_extension) override
Inform the form which trade type is currently selected.
Definition BondInstrumentForm.cpp:149
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 BondInstrumentForm.cpp:182
void setReadOnly(bool readOnly) override
Toggle read-only on every editable widget.
Definition BondInstrumentForm.cpp:157
void setClientManager(ClientManager *cm) override
Inject the NATS client used for load and save round-trips.
Definition BondInstrumentForm.cpp:99
bool isDirty() const override
Has the user edited any field since the last load or save?
Definition BondInstrumentForm.cpp:179
void clear() override
Reset the form to a blank state ready for create mode.
Definition BondInstrumentForm.cpp:142
Pure-virtual interface implemented by every per-family instrument form widget hosted in TradeDetailDi...
Definition IInstrumentForm.hpp:73
Bond instrument economics for Bond, ForwardBond, CallableBond, ConvertibleBond, and BondRepo trades.
Definition bond_instrument.hpp:38