File indexing completed on 2024-05-12 15:56:10
0001 /* 0002 * SPDX-FileCopyrightText: 2008 Boudewijn Rempt <boud@valdyas.org> 0003 * 0004 * SPDX-License-Identifier: GPL-2.0-or-later 0005 */ 0006 #ifndef KIS_BRUSH_FACTORY 0007 #define KIS_BRUSH_FACTORY 0008 0009 #include "kis_brush.h" 0010 0011 class QDomElement; 0012 0013 /** 0014 * A brush factory can create a new brush instance based 0015 * on a properties object that contains a serialized representation 0016 * of the object. 0017 */ 0018 class BRUSH_EXPORT KisBrushFactory 0019 { 0020 0021 public: 0022 0023 KisBrushFactory() {} 0024 virtual ~KisBrushFactory() {} 0025 0026 0027 virtual QString id() const = 0; 0028 0029 virtual QString name() const { 0030 return QString(); 0031 } 0032 0033 /** 0034 * Create a new brush from the given data or return an existing KisBrush 0035 * object. If this call leads to the creation of a resource, it should be 0036 * added to the resource provider, too. 0037 */ 0038 virtual KoResourceLoadResult createBrush(const QDomElement& element, KisResourcesInterfaceSP resourcesInterface) = 0; 0039 0040 }; 0041 0042 #endif