/** * @RDE_HEADER@ * A small helper class to provide icon rendering capabilities for NGLTreeModels * $Id$ * $HeadURL$ * $Author$ * Created by Christian Ehrlicher, SLSE, 2017-10-26 */ #pragma once #include #include #include #include #include namespace LtsSession { class LtsSessionDataDds; } namespace AdvancedSymbology { class ForeignDataInterface; class SymbolResult; enum class Role; } namespace NGL { class INGLLogger; } namespace ParticipantManagement { class PPMCOMMON_EXPORT ParticipantIconModelBase : public NGLTreeModel { Q_OBJECT protected: ParticipantIconModelBase(const std::shared_ptr &ppmDtc, const std::shared_ptr &asbIfc, const QStringList &hdr, NGLTreeItem *rootItem, QObject *parent, NGL::INGLLogger &logger); // type handling ParticipantManagement::TypeClass typeClassIdFromTypeId(int typeId) const; QString typeClassStringFromTypeId(int typeId) const; bool isUnitType(int typeId) const; // symbol handling void tryRenderSymbol(const QString &symbol, NGLTreeItem *item); void symbolRendered(AdvancedSymbology::SymbolResult *symbolResult); bool updateIcon(const QModelIndex ¤tIndex, NGLTreeItem *itemToUpdate, const QIcon &icon); protected: void onTypeChanged(const ParticipantManagement::Type &data, DataModification modType); protected: // misc std::shared_ptr m_dtc; // type handling QHash m_types; // symbol handling std::shared_ptr m_asb; struct SymbolResultData { QSharedPointer result; QVector treeItems; }; QHash m_symbolResultMapping; AdvancedSymbology::Role m_partyRole; QColor m_partyColor; NGL::INGLLogger &m_logger; }; } // namespace ParticipantManagement