00001 /* This file is part of the KDE project 00002 * 00003 * Copyright (C) 2006 Thomas Zander <zander@kde.org> 00004 * 00005 * This library is free software; you can redistribute it and/or 00006 * modify it under the terms of the GNU Library General Public 00007 * License as published by the Free Software Foundation; either 00008 * version 2 of the License, or (at your option) any later version. 00009 * 00010 * This library is distributed in the hope that it will be useful, 00011 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00012 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00013 * Library General Public License for more details. 00014 * 00015 * You should have received a copy of the GNU Library General Public License 00016 * along with this library; see the file COPYING.LIB. If not, write to 00017 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 00018 * Boston, MA 02110-1301, USA. 00019 */ 00020 00021 #ifndef KOSHAPECONTROLLER_H 00022 #define KOSHAPECONTROLLER_H 00023 00024 #include <koffice_export.h> 00025 00026 #include <kcommand.h> 00027 00028 #include <QString> 00029 00030 class KoCanvasBase; 00031 class KoShape; 00032 class KoShapeControllerBase; 00033 class KoProperties; 00034 00044 class FLAKE_EXPORT KoShapeController { 00045 public: 00050 KoShapeController(KoCanvasBase *canvas); 00052 ~KoShapeController() {}; 00053 00063 void setShapeController(KoShapeControllerBase *sc) { m_shapeController = sc; } 00064 00071 void setShapeId(const QString &id) { m_shapeId = id; } 00076 const QString &shapeId() const { return m_shapeId; } 00077 00083 void setShapeProperties(KoProperties *properties) { m_newShapeProperties = properties; } 00088 KoProperties const * shapeProperties() { return m_newShapeProperties; } 00089 00091 KCommand* deleteShape( KoShape *shape); 00092 00094 KCommand* createShape( KoShape *shape ); 00095 00096 protected: 00097 friend class KoCreateShapeStrategy; 00102 KoShapeControllerBase* controller() const { return m_shapeController; } 00103 00104 private: 00105 KoShapeControllerBase *m_shapeController; 00106 QString m_shapeId; 00107 KoProperties *m_newShapeProperties; 00108 KoCanvasBase *m_canvas; 00109 }; 00110 00111 #endif