/** * @RDE_HEADER@ * GUI Plugin for ParticipantManagement - Participant Combat Power Dialog * $Id$ * $HeadURL$ * $Author$ * Created by Patric Karwat, SLSE, 2017-04-07 */ #pragma once #include "participant_org_chart.h" #include "org_chart_main_helper.h" #include #include #include #include #include #include #include #include #include #include #include #include namespace Ui { class OrgChartMain; } namespace ParticipantManagement { //---------------------------------------------------------------------------- class OrgChartMain : public LtsWidgets::LtsDialog , protected ParticipantManagement::Interface::Ftc::ModifyParticipantDataReplyHandler , protected ParticipantManagement::Interface::Ftc::ModifyTemplateDataReplyHandler { Q_OBJECT public: explicit OrgChartMain(LtsSession::LtsSession *session , QWidget *parent = nullptr); ~OrgChartMain(); bool init(const std::shared_ptr &dtc , const std::shared_ptr &ftc , const std::shared_ptr &asbIfc , const std::shared_ptr &ppmGuiCbxIfc , const std::shared_ptr &ppmGuiInfoIfc , bool useSymData = true , bool asSupportService = false , int templateId = -1); void initTopicLockHandler(); void onModifyParticipantDataReply(const Core::FunctionReplyObject &replyObject) override final { m_requestHelper->requestReply(replyObject); } void onModifyTemplateDataReply(const Core::FunctionReplyObject &replyObject) override final { m_requestHelper->requestReply(replyObject); } bool loadTemplate(int templateRootId, bool isSupport = false); private: void retranslate() override; bool initButtons(); QByteArray getMimeData(const Type &type, const QImage &image); QVector getDataOf(const QJsonObject &obj, int superiorModId, int hierarchyNr); QVector getTemplateDataOf(const QJsonObject &obj, int superiorModId, int hierarchyNr); bool apply() override; ParticipantData convertFromJson(const QJsonObject &obj); TemplateData fromParticipantData(const ParticipantData &data); void fillComboBoxes(); void updateButtonMimeData(); QColor currentPartyColor(); AdvancedSymbology::Role currentPartyRole(); private slots: void onPartyChanged(); void onOpenInfo(int id); void onEdit(const QString &data); void onDelete(const QString &data); void onUpdateItem(const QModelIndex &parent, const ParticipantData &editData); void onNewHierarchy(const QString &data); void onReload(); void onUpdateParticipant(const Participant &data, DataModification modType); void onLockDataChanged(); private: ParticipantManagement::LtsParticipantsOrgChart *m_orgChart; std::shared_ptr m_dtc; std::shared_ptr m_ftc; std::shared_ptr m_asbIfc; std::shared_ptr m_ppmGuiCbxIfc; std::shared_ptr m_ppmGuiInfoIfc; LtsUtils::RequestHelper *m_requestHelper; LtsSession::LtsSession *m_session; QVector m_participantsToDelete; QVector m_templateParticipantsToDelete; QMap> m_buttonMap; QMap, QPointer> m_templateMimeDataHelpers; // global TopicLockHandler does not exists, create our own: LtsSession::TopicLockHanderData m_topicLockHanderData; bool m_useSymData; bool m_asSupportService; bool m_isTemplate; int m_rootTemplateId; int m_party; Ui::OrgChartMain *m_ui; NGL::INGLLogger &m_logger; }; } //ParticipantManagement