/** * @RDE_HEADER@ * PresentationManangement - Script Overview Dialog Model * $Id$ * $HeadURL$ * $Author$ * * Created by Mike Wille, SLSE, 2017-03-15 */ #pragma once #include #include #include #include #include #include namespace PresentationManagement { class PREGUICOMMON_EXPORT PresentationManagementDialogModel : public LtsWidgets::LtsAbstractTableModel { Q_OBJECT public: enum Columns { Id = 0, Name, Description, Operator, LastModified, Status }; explicit PresentationManagementDialogModel(QObject *parent = nullptr); ~PresentationManagementDialogModel(); bool initModel(const std::shared_ptr &dtc, const std::shared_ptr &opmDtc, const std::function &predicate); QVariant headerData(int section, Qt::Orientation orientation, int role) const override; QVariant data(const QModelIndex &, int) const override; protected: bool isFiltered(const Presentation &data, DataModification modType) const override { if (!m_predicate(data)) return true; return LtsWidgets::LtsAbstractTableModel::isFiltered(data, modType); } private: std::shared_ptr m_opmDtc; std::function m_predicate; friend class PresentationManagementDialogProxyModel; QMap m_users; QVector m_scriptUsers; LOGGER_T m_logger; }; class PREGUICOMMON_EXPORT PresentationManagementDialogProxyModel final : public LtsWidgets::LtsColumnFilterProxyModel { Q_OBJECT public: using LtsWidgets::LtsColumnFilterProxyModel::LtsColumnFilterProxyModel; void setSourceModel(QAbstractItemModel *sourceModel) override; protected: bool lessThan(const QModelIndex &source_left, const QModelIndex &source_right) const override; private: PresentationManagementDialogModel *m_sourceModel = nullptr; }; }