ORE Studio 0.0.4
Loading...
Searching...
No Matches
RefdataPlugin.hpp
1/* -*- mode: c++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
2 *
3 * Copyright (C) 2026 Marco Craveiro <marco.craveiro@gmail.com>
4 *
5 * This program is free software; you can redistribute it and/or modify it under
6 * the terms of the GNU General Public License as published by the Free Software
7 * Foundation; either version 3 of the License, or (at your option) any later
8 * version.
9 *
10 * This program is distributed in the hope that it will be useful, but WITHOUT
11 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
12 * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License along with
15 * this program; if not, write to the Free Software Foundation, Inc., 51 Franklin
16 * Street, Fifth Floor, Boston, MA 02110-1301, USA.
17 *
18 */
19#ifndef ORES_QT_REFDATA_PLUGIN_HPP
20#define ORES_QT_REFDATA_PLUGIN_HPP
21
22#include <memory>
23#include <QList>
24#include "ores.qt/PluginBase.hpp"
25
26class QAction;
27
28namespace ores::qt {
29
30class DataLibrarianWindow;
31class DetachableMdiSubWindow;
32class CurrencyController;
33class CountryController;
34class ChangeReasonCategoryController;
35class ChangeReasonController;
36class CodingSchemeAuthorityTypeController;
37class CodeDomainController;
38class CodingSchemeController;
39class DatasetController;
40class DayCountFractionTypeController;
41class BusinessDayConventionTypeController;
42class FloatingIndexTypeController;
43class PaymentFrequencyTypeController;
44class LegTypeController;
45class MonetaryNatureController;
46class RoundingTypeController;
47class PurposeTypeController;
48class ZeroConventionController;
49class DepositConventionController;
50class SwapConventionController;
51class OisConventionController;
52class FraConventionController;
53class IborIndexConventionController;
54class OvernightIndexConventionController;
55class FxConventionController;
56class CdsConventionController;
57
72class RefdataPlugin : public PluginBase {
73 Q_OBJECT
74 Q_PLUGIN_METADATA(IID "ores.qt.IPlugin/1.0")
75 Q_INTERFACES(ores::qt::IPlugin)
76
77public:
78 explicit RefdataPlugin(QObject* parent = nullptr);
79 ~RefdataPlugin() override;
80
81 QString name() const override { return QStringLiteral("ores.qt.refdata"); }
82 int load_order() const override { return 100; } // setup_menus only; no standalone menus
83
84 void on_login(const plugin_context& ctx) override;
85 void setup_menus(const shared_menus_context& ctx) override;
86 QList<QMenu*> create_menus() override;
87 QList<QAction*> toolbar_actions() override;
88 void on_logout() override;
89
90private:
91
92 plugin_context ctx_;
93
94 QAction* act_currencies_{nullptr};
95 QAction* act_countries_{nullptr};
96 QAction* act_data_librarian_{nullptr};
97
98 // Singleton MDI sub-window for Data Librarian (nullptr when not open)
99 DetachableMdiSubWindow* data_librarian_window_{nullptr};
100
101 std::unique_ptr<CurrencyController> currencyController_;
102 std::unique_ptr<CountryController> countryController_;
103 std::unique_ptr<ChangeReasonCategoryController> changeReasonCategoryController_;
104 std::unique_ptr<ChangeReasonController> changeReasonController_;
105 std::unique_ptr<CodingSchemeAuthorityTypeController> codingSchemeAuthorityTypeController_;
106 std::unique_ptr<CodeDomainController> codeDomainController_;
107 std::unique_ptr<CodingSchemeController> codingSchemeController_;
108 std::unique_ptr<DatasetController> datasetController_;
109 std::unique_ptr<DayCountFractionTypeController> dayCountFractionTypeController_;
110 std::unique_ptr<BusinessDayConventionTypeController> businessDayConventionTypeController_;
111 std::unique_ptr<FloatingIndexTypeController> floatingIndexTypeController_;
112 std::unique_ptr<PaymentFrequencyTypeController> paymentFrequencyTypeController_;
113 std::unique_ptr<LegTypeController> legTypeController_;
114 std::unique_ptr<MonetaryNatureController> monetaryNatureController_;
115 std::unique_ptr<RoundingTypeController> roundingTypeController_;
116 std::unique_ptr<PurposeTypeController> purposeTypeController_;
117 std::unique_ptr<ZeroConventionController> zeroConventionController_;
118 std::unique_ptr<DepositConventionController> depositConventionController_;
119 std::unique_ptr<SwapConventionController> swapConventionController_;
120 std::unique_ptr<OisConventionController> oisConventionController_;
121 std::unique_ptr<FraConventionController> fraConventionController_;
122 std::unique_ptr<IborIndexConventionController> iborIndexConventionController_;
123 std::unique_ptr<OvernightIndexConventionController> overnightIndexConventionController_;
124 std::unique_ptr<FxConventionController> fxConventionController_;
125 std::unique_ptr<CdsConventionController> cdsConventionController_;
126};
127
128}
129
130#endif
Qt-based graphical user interface for ORE Studio.
Definition AccountController.hpp:32
Context passed to setup_menus() containing all host-owned shared menus.
Definition IPlugin.hpp:39
Abstract interface that every domain plugin must implement.
Definition IPlugin.hpp:70
Context passed to each plugin at login time.
Definition plugin_context.hpp:47
Concrete base class for all domain plugins.
Definition PluginBase.hpp:46
Reference data plugin: currencies, countries, dimensions, coding schemes, datasets,...
Definition RefdataPlugin.hpp:72
void on_logout() override
Destroy controllers and unsubscribe from server events.
Definition RefdataPlugin.cpp:434
QList< QAction * > toolbar_actions() override
Return actions to be added to the main toolbar.
Definition RefdataPlugin.cpp:425
QList< QMenu * > create_menus() override
Build and return standalone domain menus for this plugin.
Definition RefdataPlugin.cpp:420
void setup_menus(const shared_menus_context &ctx) override
Contribute items to host-owned shared menus.
Definition RefdataPlugin.cpp:218
QString name() const override
Returns a short, unique plugin name (e.g. "ores.qt.legacy").
Definition RefdataPlugin.hpp:81
int load_order() const override
Load order hint — lower values are initialised first (default 100).
Definition RefdataPlugin.hpp:82
void on_login(const plugin_context &ctx) override
Create controllers and subscribe to server events.
Definition RefdataPlugin.cpp:79