ORE Studio 0.0.4
Loading...
Searching...
No Matches
Public Member Functions | List of all members
TradingPlugin Class Reference

Trading plugin: portfolios, books, trades, and the portfolio/org explorers. More...

#include <TradingPlugin.hpp>

Inheritance diagram for TradingPlugin:
Inheritance graph
Collaboration diagram for TradingPlugin:
Collaboration graph

Public Member Functions

 TradingPlugin (QObject *parent=nullptr)
 
QString name () const override
 Returns a short, unique plugin name (e.g. "ores.qt.legacy").
 
int load_order () const override
 Load order hint — lower values are initialised first (default 100).
 
void on_login (const plugin_context &ctx) override
 Create controllers and subscribe to server events.
 
void setup_menus (const shared_menus_context &ctx) override
 Contribute items to host-owned shared menus.
 
QList< QMenu * > create_menus () override
 Build and return standalone domain menus for this plugin.
 
QList< QAction * > toolbar_actions () override
 Return actions to be added to the main toolbar.
 
void on_logout () override
 Destroy controllers and unsubscribe from server events.
 
- Public Member Functions inherited from PluginBase
 PluginBase (QObject *parent=nullptr)
 

Additional Inherited Members

- Signals inherited from PluginBase
void statusMessage (const QString &msg)
 Status or error message to display in the host status bar.
 
void windowCreated (DetachableMdiSubWindow *window)
 A detachable MDI sub-window was created by a controller.
 
void windowDestroyed (DetachableMdiSubWindow *window)
 A detachable MDI sub-window owned by a controller was destroyed.
 
- Protected Member Functions inherited from PluginBase
void connectControllerSignals (EntityController *ctrl)
 Wire the four standard EntityController signals to PluginBase signals.
 

Detailed Description

Trading plugin: portfolios, books, trades, and the portfolio/org explorers.

Extracted from LegacyPlugin in Step 8 of the Qt plugin refactor. Owns the Data (portfolios/books) and Trading menus.

Trading plugin: portfolios, books, trades, and the portfolio/org explorers.

Loaded as a shared library by QPluginLoader at application startup. Owns the Data (portfolios/books) and Trading menus.

Member Function Documentation

◆ name()

QString name ( ) const
overridevirtual

Returns a short, unique plugin name (e.g. "ores.qt.legacy").

Implements IPlugin.

◆ load_order()

int load_order ( ) const
overridevirtual

Load order hint — lower values are initialised first (default 100).

Reimplemented from IPlugin.

◆ on_login()

void on_login ( const plugin_context ctx)
overridevirtual

Create controllers and subscribe to server events.

Called immediately after successful login. ctx provides the shared application resources (client, caches, MDI area, etc.).

Implements IPlugin.

◆ setup_menus()

void setup_menus ( const shared_menus_context ctx)
overridevirtual

Contribute items to host-owned shared menus.

Called once at startup, before create_menus(). The host passes a struct containing pre-created menus that plugins may freely add sub-menus or actions to.

Plugins that only need to add sub-menus to these shared containers should do all their work here and return {} from create_menus().

The default implementation does nothing.

Reimplemented from IPlugin.

◆ create_menus()

QList< QMenu * > create_menus ( )
overridevirtual

Build and return standalone domain menus for this plugin.

Called once at startup, after setup_menus(). The host inserts the returned menus into the menu bar before the &System menu, in plugin load_order. Menus are initially disabled and are enabled on login.

Plugins that contribute exclusively to shared menus via setup_menus() should return an empty list here.

Implements IPlugin.

◆ toolbar_actions()

QList< QAction * > toolbar_actions ( )
overridevirtual

Return actions to be added to the main toolbar.

Called once at startup (after create_menus()). The returned QAction objects must be the same instances that appear in the plugin's menus so that enable/disable state is shared automatically. The host inserts a separator between each plugin's toolbar group.

The default implementation returns an empty list (no toolbar contribution).

Reimplemented from IPlugin.

◆ on_logout()

void on_logout ( )
overridevirtual

Destroy controllers and unsubscribe from server events.

Called when the client disconnects, before the returned menus are removed.

Implements IPlugin.