File indexing completed on 2024-05-12 15:56:09

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