Files
qt5-legatus-legacy/Lts/Plugins/ParticipantManagement/Gui/ParticipantTemplates/participant_templates_gui_plugin.h
T
2026-08-13 18:33:10 +02:00

75 lines
2.4 KiB
C++
Executable File

/**
* @RDE_HEADER@
* GUI Plugin for ParticipantManagement - ParticipantManagement
* $Id$
* $HeadURL$
* $Author$
* Created by Patric Karwat, SLSE, 2016-10-05
*/
#pragma once
#include <ParticipantManagement/logger.h>
#include <PluginInterfaces/gui_plugin_interface.h>
#include <Plugins/ParticipantManagement/ppm_templates_gui_plugin_interface.h>
#include <Plugins/ParticipantManagement/ppm_data_plugin_interface.h>
#include <Plugins/ParticipantManagement/ppm_gui_combobox_plugin_interface.h>
#include <Plugins/ParticipantManagement/ppm_org_chart_gui_plugin.h>
#include <QTreeView>
namespace ParticipantManagement
{
class ParticipantTemplateChooserModel;
class GuiPlugin final : public QObject, public GuiPluginBase::Plugin
{
Q_PLUGIN_METADATA(IID "gui:3:ppm.template")
Q_INTERFACES(GuiPluginBase::Plugin)
Q_OBJECT
public:
GuiPlugin() = default;
~GuiPlugin() = default;
QString pluginName() override { return QStringLiteral("ParticipantManagement.GuiPlugin.ParticipantTemplates"); }
std::shared_ptr<GuiPluginBase::Interface> createGuiInterface(LtsSession::LtsSession *session) override;
bool availableInPartition(IDL::PartitionType partition) const override
{
return (partition == IDL::PartitionType::Global ||
partition == IDL::PartitionType::Exercise);
}
};
class InterfaceImpl final : public QObject, public ForeignGuiTemplatesInterface, public GuiPluginBase::Interface
{
Q_OBJECT
public:
explicit InterfaceImpl(LtsSession::LtsSession *session);
QVector<LtsWidgets::PluginData> getActions() override;
bool fetchInterfaces() override;
void clearInterfaces() override;
QString menuGroup() const override;
bool availableInPartition(IDL::PartitionType partition) const override
{
return partition == IDL::PartitionType::Global ||
partition == IDL::PartitionType::Exercise;
}
bool getTemplateModel(QTreeView *treeView, bool asSupportService) override final;
private:
LtsWidgets::LtsDialog *onShowTemplateChooser(QWidget *parent, bool asSupportService = false);
private:
std::shared_ptr<ParticipantManagement::Interface::Dtc> m_dtc;
std::shared_ptr<ParticipantManagement::Interface::Ftc> m_ftc;
std::shared_ptr<ParticipantManagement::ForeignGuiComboboxInterface> m_ppmGuiCbxIfc;
std::shared_ptr<ParticipantManagement::ForeignGuiOrgChartInterface> m_ppmGuiOrgChartIfc;
};
} // namespace ParticipantManagement