00001 /* This file is part of the KDE project 00002 * Copyright (C) 2006 Thomas Zander <zander@kde.org> 00003 * 00004 * This library is free software; you can redistribute it and/or 00005 * modify it under the terms of the GNU Library General Public 00006 * License as published by the Free Software Foundation; either 00007 * version 2 of the License, or (at your option) any later version. 00008 * 00009 * This library is distributed in the hope that it will be useful, 00010 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00011 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00012 * Library General Public License for more details. 00013 * 00014 * You should have received a copy of the GNU Library General Public License 00015 * along with this library; see the file COPYING.LIB. If not, write to 00016 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 00017 * Boston, MA 02110-1301, USA. 00018 */ 00019 #ifndef KO_TOOL_MANAGER_P 00020 #define KO_TOOL_MANAGER_P 00021 00022 #include <QList> 00023 #include <QObject> 00024 #include <QString> 00025 00026 class KoToolFactory; 00027 class KoToolBox; 00028 class KoShapeManager; 00029 class KoCanvasBase; 00030 class KoTool; 00031 class KoShape; 00032 00033 class QAbstractButton; 00034 00036 class ToolHelper : public QObject { 00037 Q_OBJECT 00038 public: 00039 ToolHelper(KoToolFactory *tool); 00040 QAbstractButton *createButton(); 00042 const QString &id() const; 00044 const QString &name() const; 00046 const QString &toolType() const; 00048 const QString &activationShapeId() const; 00050 int priority() const; 00051 KoTool *createTool(KoCanvasBase *canvas) const; 00052 int uniqueId() const { return m_uniqueId; } 00053 00054 signals: 00056 void toolActivated(ToolHelper *tool); 00057 00058 private slots: 00059 void buttonPressed(); 00060 00061 private: 00062 KoToolFactory *m_toolFactory; 00063 int m_uniqueId; 00064 }; 00065 00068 class Connector : public QObject { 00069 Q_OBJECT 00070 public: 00071 Connector(KoShapeManager *parent); 00072 00073 public slots: 00074 void selectionChanged(); 00075 00076 signals: 00077 void selectionChanged(QList<KoShape*> shape); 00078 00079 private: 00080 KoShapeManager *m_shapeManager; 00081 }; 00082 00083 #endif