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

0001 /* This file is part of the KDE project
0002  * SPDX-FileCopyrightText: 2004 Boudewijn Rempt <boud@valdyas.org>
0003  * SPDX-FileCopyrightText: 2006 Thomas Zander <zander@kde.org>
0004  *
0005  * SPDX-License-Identifier: LGPL-2.0-or-later
0006  */
0007 
0008 #ifndef KO_TOOL_REGISTRY_H_
0009 #define KO_TOOL_REGISTRY_H_
0010 
0011 #include "KoGenericRegistry.h"
0012 #include "kritaflake_export.h"
0013 
0014 class KoToolFactoryBase;
0015 
0016 /**
0017  * This singleton class keeps a register of all available flake tools,
0018  * or rather, of the factories that the KoToolBox (and KoToolManager) will use
0019  * to create flake tools.
0020  */
0021 class KRITAFLAKE_EXPORT KoToolRegistry : public KoGenericRegistry<KoToolFactoryBase*>
0022 {
0023 public:
0024     KoToolRegistry();
0025     ~KoToolRegistry() override;
0026 
0027     /**
0028      * Return an instance of the KoToolRegistry
0029      * Create a new instance on first call and return the singleton.
0030      */
0031     static KoToolRegistry *instance();
0032 
0033 private:
0034     KoToolRegistry(const KoToolRegistry&);
0035     KoToolRegistry operator=(const KoToolRegistry&);
0036     void init();
0037 
0038     class Private;
0039     Private * const d;
0040 };
0041 
0042 #endif