#ifndef IMETADATAPLUGIN_H #define IMETADATAPLUGIN_H #include #include "core_global.h" #include "iplugin.h" class MetaData { public: MetaData(const QString& mName, const QString& mId, const QString& mDescription, int mSchemaVersion, const QStringList& mSchemas, const QStringList& mDependsOn); [[nodiscard]] const QString& getName() const; [[nodiscard]] const QString& getId() const; [[nodiscard]] const QString& getDescription() const; [[nodiscard]] int getSchemaVersion() const; [[nodiscard]] const QStringList& getSchemas() const; [[nodiscard]] const QStringList& getDependsOn() const; private: QString m_name; QString m_id; QString m_description; int m_schemaVersion; QStringList m_schemas; QStringList m_dependsOn; }; using MetaDataPtr = QSharedPointer; class CORESHARED_EXPORT IMetaDataPlugin : public IPlugin { public: IMetaDataPlugin(); ~IMetaDataPlugin() override; // IPlugin interface public: QString pluginName() override; QString pluginId() override; QString pluginDescription() override; int schemaVersion() override; QStringList schemas() override; QStringList dependsOn() override; ReportList reports() override; void init(const QJsonObject &metaData) override; static MetaDataPtr loadBaseMetaData(const QJsonObject &metaData); protected: virtual void initServiceUi() = 0; virtual void parseMetaData(const QJsonObject &metaData); private: QString m_name; QString m_id; QString m_description; int m_schemaVersion; QStringList m_schemas; QStringList m_dependsOn; ReportList m_reports; static QString parseLocaleText(const QJsonObject &object); void addCustomReports(); void addReportsFromJson(const QJsonValue &repArray); }; #endif // IMETADATAPLUGIN_H