File indexing completed on 2024-05-05 17:04:28

0001 /*
0002     Copyright (C) 2012  Dan Leinir Turthra Jensen <admin@leinir.dk>
0003 
0004     This program is free software; you can redistribute it and/or modify
0005     it under the terms of the GNU General Public License as published by
0006     the Free Software Foundation; either version 2 of the License, or
0007     (at your option) any later version.
0008 
0009     This program is distributed in the hope that it will be useful,
0010     but WITHOUT ANY WARRANTY; without even the implied warranty of
0011     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
0012     GNU General Public License for more details.
0013 
0014     You should have received a copy of the GNU General Public License along
0015     with this program; if not, write to the Free Software Foundation, Inc.,
0016     51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
0017 */
0018 
0019 
0020 #ifndef TOOLMANAGER_H
0021 #define TOOLMANAGER_H
0022 
0023 #include <QQuickItem>
0024 
0025 class KoCanvasController;
0026 
0027 class ToolManager : public QQuickItem
0028 {
0029     Q_OBJECT
0030     Q_PROPERTY(QObject* currentTool READ currentTool NOTIFY currentToolChanged);
0031 public:
0032     explicit ToolManager(QQuickItem* parent = 0);
0033     ~ToolManager() override;
0034 
0035     QObject* currentTool() const;
0036 
0037     Q_INVOKABLE void requestToolChange(QString toolID);
0038 
0039 public Q_SLOTS:
0040     void slotToolChanged(KoCanvasController* canvas, int toolId);
0041 
0042 Q_SIGNALS:
0043     void currentToolChanged();
0044 
0045 private:
0046     class Private;
0047     Private* d;
0048 };
0049 
0050 #endif // TOOLMANAGER_H