|
ORE Studio 0.0.4
|
IInstrumentForm subclass owning the commodity instrument editor.
More...
#include <CommodityInstrumentForm.hpp>


Public Member Functions | |
| CommodityInstrumentForm (QWidget *parent=nullptr) | |
| void | setClientManager (ClientManager *cm) override |
| Inject the NATS client used for load and save round-trips. | |
| void | setUsername (const std::string &username) override |
| Inject the username stamped on every saved instrument. | |
| void | setImageCache (ImageCache *cache) override |
| Inject the image cache for flag icons on currency combo boxes. | |
| void | setInstrument (const trading::domain::trade_instrument &instrument) override |
| Populate the form with the already-resolved instrument. | |
| void | clear () override |
| Reset the form to a blank state ready for create mode. | |
| void | setTradeType (const QString &code, bool has_options, bool has_extension) override |
| Inform the form which trade type is currently selected. | |
| void | setReadOnly (bool readOnly) override |
| Toggle read-only on every editable widget. | |
| bool | isDirty () const override |
| Has the user edited any field since the last load or save? | |
| bool | isLoaded () const override |
| True after the asynchronous load has populated the form. | |
| 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. | |
| void | writeUiToInstrument () override |
| Pull the current UI values into the in-flight domain object. | |
| 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. | |
Additional Inherited Members | |
Signals inherited from IInstrumentForm | |
| void | changed () |
| Emitted when any field changes (after the initial load). | |
| void | instrumentLoaded () |
| Emitted once the asynchronous load has populated the form. | |
| void | loadFailed (const QString &error) |
| Emitted on a load failure with the server's error message. | |
| void | provenanceChanged (const InstrumentProvenance &provenance) |
| Emitted with the latest audit metadata after load and save. | |
IInstrumentForm subclass owning the commodity instrument editor.
Hosts an internal QTabWidget with two pages: core (always visible) and extensions (revealed when has_extension is true, e.g. CommodityOption, CommoditySpreadOption, CommoditySwaption, CommodityVarianceSwap, CommodityAccumulator).
|
overridevirtual |
Inject the NATS client used for load and save round-trips.
Implements IInstrumentForm.
|
overridevirtual |
Inject the username stamped on every saved instrument.
Implements IInstrumentForm.
|
overridevirtual |
Inject the image cache for flag icons on currency combo boxes.
Reimplemented from IInstrumentForm.
|
overridevirtual |
Populate the form with the already-resolved instrument.
The dialog holds the full trade bundle and pushes the instrument here. The form pattern-matches its family from the variant, stores the per-type domain object, and updates the UI synchronously. On success it emits instrumentLoaded and provenanceChanged. If the variant does not hold this family's alternative the form emits loadFailed with a descriptive message.
Implements IInstrumentForm.
|
overridevirtual |
Reset the form to a blank state ready for create mode.
Implements IInstrumentForm.
|
overridevirtual |
Inform the form which trade type is currently selected.
| code | The trade type code (e.g. "FxOption"). |
| has_options | Reveal the family's options sub-section. |
| has_extension | Reveal the family's extension sub-section. |
The form decides how to lay out its sub-sections based on these flags — typically by toggling the visibility of internal tabs.
Implements IInstrumentForm.
|
overridevirtual |
Toggle read-only on every editable widget.
Implements IInstrumentForm.
|
overridevirtual |
Has the user edited any field since the last load or save?
Implements IInstrumentForm.
|
overridevirtual |
True after the asynchronous load has populated the form.
Implements IInstrumentForm.
|
overridevirtual |
Stamp the change reason on the in-flight instrument before the dialog calls saveInstrument.
The dialog gathers a single change reason once per save and applies it identically to both the trade and the instrument so that the two audit trails stay aligned.
Implements IInstrumentForm.
|
overridevirtual |
Pull the current UI values into the in-flight domain object.
Implements IInstrumentForm.
|
overridevirtual |
Save the in-flight instrument via the family's NATS request.
| on_success | Invoked on the Qt thread with the saved instrument id (so the dialog can populate trade.instrument_id in create mode and continue to the trade save). |
| on_failure | Invoked on the Qt thread with a human-readable error message; the dialog should abort the trade save and surface the error to the user. |
Implements IInstrumentForm.