Warning, file /office/calligra/libs/flake/KoShapeBasedDocumentBase.h was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).
0001 /* This file is part of the KDE project 0002 0003 Copyright (C) 2006 Jan Hambrecht <jaham@gmx.net> 0004 Copyright (C) 2006, 2010 Thomas Zander <zander@kde.org> 0005 Copyright (C) 2008 C. Boemann <cbo@boemann.dk> 0006 0007 This library is free software; you can redistribute it and/or 0008 modify it under the terms of the GNU Library General Public 0009 License as published by the Free Software Foundation; either 0010 version 2 of the License, or (at your option) any later version. 0011 0012 This library is distributed in the hope that it will be useful, 0013 but WITHOUT ANY WARRANTY; without even the implied warranty of 0014 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 0015 Library General Public License for more details. 0016 0017 You should have received a copy of the GNU Library General Public License 0018 along with this library; see the file COPYING.LIB. If not, write to 0019 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 0020 * Boston, MA 02110-1301, USA. 0021 */ 0022 0023 #ifndef KOSHAPEBASEDDOCUMENTBASE_H 0024 #define KOSHAPEBASEDDOCUMENTBASE_H 0025 0026 #include "flake_export.h" 0027 0028 #include <QList> 0029 0030 class KoShape; 0031 class KoShapeBasedDocumentBasePrivate; 0032 class KoDocumentResourceManager; 0033 class KUndo2Command; 0034 0035 /** 0036 * The KoShapeBasedDocumentBase is an abstract interface that the application's class 0037 * that owns the shapes should implement. This tends to be the document. 0038 * @see KoShapeDeleteCommand, KoShapeCreateCommand 0039 */ 0040 class FLAKE_EXPORT KoShapeBasedDocumentBase 0041 { 0042 public: 0043 KoShapeBasedDocumentBase(); 0044 virtual ~KoShapeBasedDocumentBase(); 0045 0046 /** 0047 * Add a shape to the shape controller, allowing it to be seen and saved. 0048 * The controller should add the shape to the ShapeManager instance(s) manually 0049 * if the shape is one that should be currently shown on screen. 0050 * @param shape the new shape 0051 */ 0052 virtual void addShape(KoShape *shape) = 0; 0053 0054 /** 0055 * Remove a shape from the shape controllers control, allowing it to be deleted shortly after 0056 * The controller should remove the shape from all the ShapeManager instance(s) manually 0057 * @param shape the shape to remove 0058 */ 0059 virtual void removeShape(KoShape *shape) = 0; 0060 0061 /** 0062 * This method gets called after the KoShapeDeleteCommand is executed 0063 * 0064 * This passes the KoShapeDeleteCommand as the command parameter. This makes it possible 0065 * for applications that need to do something after the KoShapeDeleteCommand is done, e.g. 0066 * adding one commands that need to be executed when a shape was deleted. 0067 * The default implementation is empty. 0068 * @param shapes The list of shapes that got removed. 0069 * @param command The command that was used to remove the shapes from the document. 0070 */ 0071 virtual void shapesRemoved(const QList<KoShape*> &shapes, KUndo2Command *command); 0072 0073 /** 0074 * Return a pointer to the resource manager associated with the 0075 * shape-set (typically a document). The resource manager contains 0076 * document wide resources * such as variable managers, the image 0077 * collection and others. 0078 */ 0079 virtual KoDocumentResourceManager *resourceManager() const; 0080 0081 private: 0082 KoShapeBasedDocumentBasePrivate * const d; 0083 }; 0084 0085 #endif