33 lines
863 B
C
33 lines
863 B
C
|
|
// customTypePlugin.h
|
||
|
|
#pragma once
|
||
|
|
|
||
|
|
#include "pluginCommon/iPlugin.h"
|
||
|
|
#include "reactorItem.h"
|
||
|
|
#include "export.hpp"
|
||
|
|
#include <QObject>
|
||
|
|
|
||
|
|
class DIAGRAM_DESIGNER_PUBLIC CustomTypePlugin : public IPlugin
|
||
|
|
{
|
||
|
|
Q_OBJECT
|
||
|
|
Q_PLUGIN_METADATA(IID "com.diagramDesigner.plugin/1.0" FILE "customType.json")
|
||
|
|
Q_INTERFACES(IPlugin)
|
||
|
|
|
||
|
|
public:
|
||
|
|
explicit CustomTypePlugin(QObject *parent = nullptr);
|
||
|
|
virtual ~CustomTypePlugin();
|
||
|
|
|
||
|
|
// IPlugin接口实现
|
||
|
|
PluginDescriptor descriptor() const override;
|
||
|
|
QList<ShapeDescriptor> shapes() const override;
|
||
|
|
ICanvasItem* createShape(const QString &shapeId) override;
|
||
|
|
bool initialize() override;
|
||
|
|
void shutdown() override;
|
||
|
|
QIcon shapeIcon(const QString &shapeId) const override;
|
||
|
|
|
||
|
|
private:
|
||
|
|
QIcon m_reactorIcon;
|
||
|
|
|
||
|
|
QIcon loadIcon(const QString &path) const;
|
||
|
|
QIcon createDefaultIcon() const;
|
||
|
|
};
|