File indexing completed on 2024-04-28 15:51:43

0001 /*
0002     SPDX-FileCopyrightText: 2015 Laurent Montel <montel@kde.org>
0003     SPDX-FileCopyrightText: 2015 Albert Astals Cid <aacid@kde.org>
0004 
0005     SPDX-License-Identifier: GPL-2.0-or-later
0006 */
0007 
0008 #ifndef DRAWINGTOOLACTIONS_H
0009 #define DRAWINGTOOLACTIONS_H
0010 
0011 #include <QDomDocument>
0012 #include <QObject>
0013 
0014 class QAction;
0015 class KActionCollection;
0016 
0017 class DrawingToolActions : public QObject
0018 {
0019     Q_OBJECT
0020 public:
0021     explicit DrawingToolActions(KActionCollection *parent);
0022     ~DrawingToolActions() override;
0023 
0024     QList<QAction *> actions() const;
0025 
0026     void reparseConfig();
0027 
0028 Q_SIGNALS:
0029     void changeEngine(const QDomElement &doc);
0030     void actionsRecreated();
0031 
0032 private Q_SLOTS:
0033     void actionTriggered();
0034 
0035 private:
0036     void loadTools();
0037     void createToolAction(const QString &text, const QString &toolName, const QString &colorName, const QDomElement &root);
0038 
0039     QList<QAction *> m_actions;
0040 };
0041 
0042 Q_DECLARE_METATYPE(QDomElement)
0043 
0044 #endif // DRAWINGTOOLACTIONS_H