20#ifndef ORES_QT_I_INSTRUMENT_FORM_HPP
21#define ORES_QT_I_INSTRUMENT_FORM_HPP
28#include "ores.trading.api/domain/trade_instrument.hpp"
41 std::string modified_by;
42 std::string performed_by;
43 std::chrono::system_clock::time_point recorded_at;
44 std::string change_reason_code;
45 std::string change_commentary;
76 using QWidget::QWidget;
99 const trading::domain::trade_instrument& instrument) = 0;
115 bool has_options,
bool has_extension) = 0;
135 const std::string& code,
const std::string& commentary) = 0;
151 std::function<
void(
const std::string&
id)> on_success,
152 std::function<
void(
const QString& error)> on_failure) = 0;
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
Audit metadata snapshot reported by an IInstrumentForm so the outer dialog can refresh its (shared) i...
Definition IInstrumentForm.hpp:39
Pure-virtual interface implemented by every per-family instrument form widget hosted in TradeDetailDi...
Definition IInstrumentForm.hpp:73
virtual bool isLoaded() const =0
True after the asynchronous load has populated the form.
virtual bool isDirty() const =0
Has the user edited any field since the last load or save?
virtual void setUsername(const std::string &username)=0
Inject the username stamped on every saved instrument.
virtual void setClientManager(ClientManager *cm)=0
Inject the NATS client used for load and save round-trips.
virtual void setChangeReason(const std::string &code, const std::string &commentary)=0
Stamp the change reason on the in-flight instrument before the dialog calls saveInstrument.
void changed()
Emitted when any field changes (after the initial load).
virtual void clear()=0
Reset the form to a blank state ready for create mode.
virtual void setReadOnly(bool readOnly)=0
Toggle read-only on every editable widget.
void loadFailed(const QString &error)
Emitted on a load failure with the server's error message.
virtual void setInstrument(const trading::domain::trade_instrument &instrument)=0
Populate the form with the already-resolved instrument.
virtual void setImageCache(ImageCache *)
Inject the image cache for flag icons on currency combo boxes.
Definition IInstrumentForm.hpp:86
void provenanceChanged(const InstrumentProvenance &provenance)
Emitted with the latest audit metadata after load and save.
virtual void writeUiToInstrument()=0
Pull the current UI values into the in-flight domain object.
virtual void setTradeType(const QString &code, bool has_options, bool has_extension)=0
Inform the form which trade type is currently selected.
void instrumentLoaded()
Emitted once the asynchronous load has populated the form.
virtual void saveInstrument(std::function< void(const std::string &id)> on_success, std::function< void(const QString &error)> on_failure)=0
Save the in-flight instrument via the family's NATS request.