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

0001 /* This file is part of the KDE project
0002  * SPDX-FileCopyrightText: 2009 Jan Hambrecht <jaham@gmx.net>
0003  *
0004  * SPDX-License-Identifier: LGPL-2.1-or-later
0005  */
0006 
0007 #ifndef KOFILTEREFFECTREGISTRY_H
0008 #define KOFILTEREFFECTREGISTRY_H
0009 
0010 #include <KoGenericRegistry.h>
0011 #include <KoFilterEffectFactoryBase.h>
0012 
0013 #include "kritaflake_export.h"
0014 
0015 #include <QDomDocument>
0016 class KoFilterEffectLoadingContext;
0017 class KoFilterEffect;
0018 
0019 class KRITAFLAKE_EXPORT KoFilterEffectRegistry : public KoGenericRegistry<KoFilterEffectFactoryBase*>
0020 {
0021 public:
0022     KoFilterEffectRegistry();
0023     ~KoFilterEffectRegistry() override;
0024 
0025     /**
0026     * Return the only instance of KoFilterEffectRegistry.
0027     * Creates an instance on the first call.
0028     */
0029     static KoFilterEffectRegistry *instance();
0030 
0031     /**
0032      * Creates filter effect from given xml element.
0033      * @param element the xml element to load from
0034      * @param context the loading context
0035      * @return the created filter effect if successful, otherwise returns 0
0036      */
0037     KoFilterEffect *createFilterEffectFromXml(const QDomElement &element, const KoFilterEffectLoadingContext &context);
0038 
0039 private:
0040 
0041     KoFilterEffectRegistry(const KoFilterEffectRegistry&);
0042     KoFilterEffectRegistry operator=(const KoFilterEffectRegistry&);
0043     void init();
0044 
0045     class Private;
0046     Private * const d;
0047 };
0048 
0049 #endif // KOFILTEREFFECTREGISTRY_H