ORE Studio 0.0.4
Loading...
Searching...
No Matches
ComputePlugin.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_COMPUTE_PLUGIN_HPP
20#define ORES_QT_COMPUTE_PLUGIN_HPP
21
22#include <memory>
23#include <QList>
24#include "ores.qt/PluginBase.hpp"
25
26class QAction;
27
28namespace ores::qt {
29
30class AppController;
31class AppVersionController;
32class ComputeDashboardController;
33class ComputeConsoleController;
34class ServiceDashboardController;
35class QueueMonitorController;
36class ReportTypeController;
37class ConcurrencyPolicyController;
38class ReportDefinitionController;
39class ReportInstanceController;
40
48class ComputePlugin : public PluginBase {
49 Q_OBJECT
50 Q_PLUGIN_METADATA(IID "ores.qt.IPlugin/1.0")
51 Q_INTERFACES(ores::qt::IPlugin)
52
53public:
54 explicit ComputePlugin(QObject* parent = nullptr);
55 ~ComputePlugin() override;
56
57 QString name() const override { return QStringLiteral("ores.qt.compute"); }
58 int load_order() const override { return 400; }
59
60 void on_login(const plugin_context& ctx) override;
61 void setup_menus(const shared_menus_context& ctx) override;
62 QList<QMenu*> create_menus() override;
63 QList<QAction*> toolbar_actions() override;
64 void on_logout() override;
65
66private:
67
68 plugin_context ctx_;
69
70 QAction* act_report_definitions_{nullptr};
71 QAction* act_report_instances_{nullptr};
72
73 std::unique_ptr<AppController> appController_;
74 std::unique_ptr<AppVersionController> appVersionController_;
75 std::unique_ptr<ComputeDashboardController> computeDashboardController_;
76 std::unique_ptr<ComputeConsoleController> computeConsoleController_;
77 std::unique_ptr<ServiceDashboardController> serviceDashboardController_;
78 std::unique_ptr<QueueMonitorController> queueMonitorController_;
79 std::unique_ptr<ReportTypeController> reportTypeController_;
80 std::unique_ptr<ConcurrencyPolicyController> concurrencyPolicyController_;
81 std::unique_ptr<ReportDefinitionController> reportDefinitionController_;
82 std::unique_ptr<ReportInstanceController> reportInstanceController_;
83};
84
85}
86
87#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
Plugin owning all compute and reporting controllers.
Definition ComputePlugin.hpp:48
void on_logout() override
Destroy controllers and unsubscribe from server events.
Definition ComputePlugin.cpp:258
QList< QAction * > toolbar_actions() override
Return actions to be added to the main toolbar.
Definition ComputePlugin.cpp:252
QList< QMenu * > create_menus() override
Build and return standalone domain menus for this plugin.
Definition ComputePlugin.cpp:185
void setup_menus(const shared_menus_context &ctx) override
Contribute items to host-owned shared menus.
Definition ComputePlugin.cpp:148
QString name() const override
Returns a short, unique plugin name (e.g. "ores.qt.legacy").
Definition ComputePlugin.hpp:57
int load_order() const override
Load order hint — lower values are initialised first (default 100).
Definition ComputePlugin.hpp:58
void on_login(const plugin_context &ctx) override
Create controllers and subscribe to server events.
Definition ComputePlugin.cpp:66