/** * @RDE_HEADER@ * GUI Plugin for ParticipantManagement - Participant Organisaton * $Id$ * $HeadURL$ * $Author$ * Created by Patric Karwat, SLSE, 2016-10-17 */ #pragma once #include #include "participant_pool_model.h" #include "participant_orga_model.h" #include #include #include #include #include #include #include #include #include class QSortFilterProxyModel; namespace Ui { class ParticipantOrganisation; } namespace ParticipantManagement { class DeleteDelegate : public QItemDelegate { Q_OBJECT public: explicit DeleteDelegate(QObject *parent = nullptr); void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const override; bool editorEvent(QEvent *event, QAbstractItemModel *model, const QStyleOptionViewItem &option, const QModelIndex &index) override; Q_SIGNALS: void removePoolParty(); }; //---------------------------------------------------------------------------- class ParticipantOrganisationDialog : public LtsWidgets::LtsDialog, protected ParticipantManagement::Interface::Ftc::ModifyParticipantDataReplyHandler { Q_OBJECT public: ParticipantOrganisationDialog(LtsSession::LtsSession *session, bool asSupportService, QWidget *parent = nullptr); ~ParticipantOrganisationDialog(); bool init(const std::shared_ptr &dtc, const std::shared_ptr &ftc, const std::shared_ptr &ppmGuiTemplateIfc, const std::shared_ptr &ppmGuiCbxIfc, const std::shared_ptr &asbIfc); void onModifyParticipantDataReply(const Core::FunctionReplyObject &replyObject) override final; void retranslate() override; void lock() override; void unlock() override; private: QModelIndex selectedIndexView() const; bool saveParticipantData(const ModifyParticipantDataRequest &request); protected Q_SLOTS: void onPoolParticipantsChanged(const QVector &participants, const QString &originatorMimeType); void onPartyParticipantsChanged(int addedParticipantId); void onAttachedParticipantsChanged(int addedParticipantId); void onDetachedParticipantsChanged(int addedParticipantId); void onCooperateParticipantsChanged(int addedParticipantId); void onStartTemplateUnitNamer(int templateId); void onPartyChanged(); void onRemovePoolParty(); void showContextMenu(const QPoint &position); private: bool m_asSupportService; ParticipantPoolModel *m_poolModel; QSortFilterProxyModel *m_proxyModel; ParticipantOrgaModel *m_partyModel; ParticipantOrgaModel *m_attachedModel; ParticipantOrgaModel *m_detachedModel; ParticipantOrgaModel *m_cooperateModel; DeleteDelegate *m_delegate; std::shared_ptr m_dtc; std::shared_ptr m_ftc; std::shared_ptr m_ppmGuiTemplateIfc; std::shared_ptr m_ppmGuiCbxIfc; LtsSession::LtsSession *m_session; LtsUtils::RequestHelper *m_requestHelper; static int s_preselectedParty; Ui::ParticipantOrganisation *m_ui; NGL::INGLLogger &m_logger; }; } //ParticipantManagement