/** * @RDE_HEADER@ * AreaEffectSimulation - Contamination Overview Dialog * $Id$ * $HeadURL$ * $Author$ * Created by Patric Karwat, SLSE, 2016-07-07 */ #pragma once #include "aes_base_exports.h" #include #include #include #include #include namespace Ui { class AesItemList; } namespace LtsSession { class LtsSession; } class QAbstractItemModel; namespace LtsDataView { class AbstractDisplayWidget; } namespace AreaEffectSimulation { class AesItemSortFilterProxyModel; template class AesItemSortFilterProxyModelTmpl; class AESBASEGUI_EXPORT AesItemList : public LtsWidgets::LtsDialog , protected AreaEffectSimulation::Interface::Ftc::MineResetReplyHandler , protected AreaEffectSimulation::Interface::Ftc::ExplosionClusterReleaseReceivedReplyHandler , protected AreaEffectSimulation::Interface::Ftc::AcknowledgeExternalAesItemReplyHandler , protected AreaEffectSimulation::Interface::Ftc::SetAesItemEffectorStateReplyHandler { Q_OBJECT public: explicit AesItemList(const QString &menuGroup, QWidget *parent = nullptr); ~AesItemList(); virtual bool init(LtsSession::LtsSession *session); bool isShowExpired() const { return m_showExpired; } void onMineResetReply(const Core::FunctionReplyObject &replyObject) override final { m_requestHelper->requestReply(replyObject); } void onExplosionClusterReleaseReceivedReply (const Core::FunctionReplyObject &replyObject) override final { m_requestHelper->requestReply(replyObject); } void onSetAesItemEffectorStateReply (const Core::FunctionReplyObject &replyObject) override final { m_requestHelper->requestReply(replyObject); } void onAcknowledgeExternalAesItemReply(const Core::FunctionReplyObject &replyObject) override final { m_requestHelper->requestReply(replyObject); } public slots: void setShowExpired(bool show); protected slots: void enaDisa(); virtual void onPrint(); virtual void onAddAesItem() = 0; virtual void onEditAesItem() = 0; virtual void onRemoveAesItem() = 0; virtual void onHandleAdler(); void onAdlerBtn(); void onCenterAesItem(); void hideColumn(int col); void showColumn(int col); protected: virtual void createModel() = 0; virtual AesItemSortFilterProxyModel *model() = 0; virtual const AesItemSortFilterProxyModel *model() const = 0; int currentRow() const; // the currently selected row (not current index!) void setDataViewModel(QAbstractItemModel *model, const std::function &customDisplayWidgetCreator); void setDataViewModel(QAbstractItemModel *model); void setSortIndicator(int col); void translateBase(const QString &windowTitle); void tableColumnOrganiserSetting() override; std::shared_ptr m_ftc; std::shared_ptr m_dtc; QString m_menuGroup; LtsUtils::RequestHelper *m_requestHelper; bool m_showExpired; bool m_bHasAddEditOperatorRights; bool m_bHasAddAdlerOperatorRights; LtsSession::LtsSession *m_session; Ui::AesItemList *m_ui; QMetaObject::Connection m_doubleClickConnection; LOGGER_T m_logger; }; template class AesItemListTmpl : public AesItemList { public: using AesItemList::AesItemList; protected: AesItemSortFilterProxyModel *model() override { return m_model; } const AesItemSortFilterProxyModel *model() const override { return m_model; } AesItemSortFilterProxyModelTmpl *m_model = nullptr; }; }