/** * @RDE_HEADER@ * Subscribe to file management service * $Id$ * $HeadURL$ * $Author$ * * Created by Norbert Thoden, NLE, 2019-04-15 */ #pragma once #include #include #include #include #include #include #include namespace LtsUtils { class RequestHelper; } namespace AdvancedSymbology { class FlmSubscriber final : public QObject , public ForeignGuiFlmSymbolsProxyInterface , public FileManagement::Interface::Ftc::GetFileContentDataReplyHandler { Q_OBJECT public: explicit FlmSubscriber(const std::shared_ptr &flmDtc, const std::shared_ptr &flmFtc, const std::shared_ptr &opmDtc); ~FlmSubscriber(); bool createFlmSymbolProxy(int type_placeholder) override; // type_placeholder: GlobalSymbols, ExerciseSymbols... to be prepared bool connectFlmSymbolProxy(int type_placeholder, SymbologyType symbologyType) override; private: // methods bool setEtsSymbolToDict(SymbolDictionary &dict, qint32 fileContentId, const QString &name, const QImage &image, const QColor &colorToBeReplaced, const QStringList &usrTags); bool setXmlSymbolToDict(SymbolDictionary &dict, qint32 fileContentId, const QString &operatorName, qint64 lastModified, const QString &name, const QString &xmlContent, const QStringList &usrTags); protected slots: void onFileContentChanged(const FileManagement::FileContent &data, DataModification modType); void updateFileContentMap(const FileManagement::FileContent &data); void onLocalSymbolProxyEtsSymbolAdded(qint32 fileContentId, const QString &name, const QImage &image, const QColor &colorToBeReplaced, const QStringList &usrTags); void onLocalSymbolProxyEtsSymbolRemoved(qint32 fileContentId, const QString &name); void onLocalSymbolProxyXmlSymbolAdded(qint32 fileContentId, const QString &operatorName, qint64 lastModified, const QString &name, const QString &xmlContent, const QStringList &usrTags); void onLocalSymbolProxyXmlSymbolRemoved(qint32 fileContentId); protected: /** * @brief onGetFileContentDataReply * @param reply contains the FileContentData to be processed (Symbol as SVG/ByteArray) */ void onGetFileContentDataReply(const FileManagement::GetFileContentDataReply &reply) override; bool svgToImage(const QByteArray &svgByteArray, QImage &imageOut); QString operatorName(int operatorId); void checkForReFetching(); private: // attributes LOGGER_T m_logger; ///< Interface of the Logging-Facility struct Private; /** * The private d->pointer to not break BC when changing internals of this class */ Private *d = nullptr; }; } // namespace AdvancedSymbology