25 lines
603 B
C
25 lines
603 B
C
|
|
//IShapeFactory.h
|
||
|
|
#pragma once
|
||
|
|
|
||
|
|
#include "iCanvasItem.h"
|
||
|
|
#include "iPlugin.h"
|
||
|
|
#include <QMap>
|
||
|
|
|
||
|
|
// 形状工厂接口(纯接口,不用于插件)
|
||
|
|
class IShapeFactory
|
||
|
|
{
|
||
|
|
public:
|
||
|
|
virtual ~IShapeFactory() = default;
|
||
|
|
|
||
|
|
// 创建形状
|
||
|
|
virtual ICanvasItem* create(const QString &shapeId) = 0;
|
||
|
|
|
||
|
|
// 查询
|
||
|
|
virtual QStringList availableShapes() const = 0;
|
||
|
|
virtual bool contains(const QString &shapeId) const = 0;
|
||
|
|
|
||
|
|
// 获取形状信息
|
||
|
|
virtual ShapeDescriptor shapeDescriptor(const QString &shapeId) const = 0;
|
||
|
|
virtual QIcon shapeIcon(const QString &shapeId) const = 0;
|
||
|
|
};
|