Warning, file /office/calligra/libs/flake/KoShapeManagerPaintingStrategy.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) 2007,2009 Thorsten Zachmann <zachmann@kde.org> 0004 0005 This library is free software; you can redistribute it and/or 0006 modify it under the terms of the GNU Library General Public 0007 License as published by the Free Software Foundation; either 0008 version 2 of the License, or (at your option) any later version. 0009 0010 This library is distributed in the hope that it will be useful, 0011 but WITHOUT ANY WARRANTY; without even the implied warranty of 0012 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 0013 Library General Public License for more details. 0014 0015 You should have received a copy of the GNU Library General Public License 0016 along with this library; see the file COPYING.LIB. If not, write to 0017 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 0018 * Boston, MA 02110-1301, USA. 0019 */ 0020 0021 #ifndef KOSHAPEMANAGERPAINTINGSTRATEGY_H 0022 #define KOSHAPEMANAGERPAINTINGSTRATEGY_H 0023 0024 #include "flake_export.h" 0025 0026 class KoShapeManager; 0027 class KoShape; 0028 class KoViewConverter; 0029 class KoShapePaintingContext; 0030 class QPainter; 0031 class QRectF; 0032 0033 /** 0034 * This implements the painting strategy for the KoShapeManager 0035 * 0036 * This is done to make it possible to have e.g. animations in Stage. 0037 * 0038 * This class implements the default strategy which is normally used. 0039 */ 0040 class FLAKE_EXPORT KoShapeManagerPaintingStrategy 0041 { 0042 public: 0043 explicit KoShapeManagerPaintingStrategy(KoShapeManager *shapeManager); 0044 virtual ~KoShapeManagerPaintingStrategy(); 0045 0046 /** 0047 * Paint the shape 0048 * 0049 * @param shape the shape to paint 0050 * @param painter the painter to paint to. 0051 * @param converter to convert between document and view coordinates. 0052 * @param forPrint if true, make sure only actual content is drawn and no decorations. 0053 */ 0054 virtual void paint(KoShape *shape, QPainter &painter, const KoViewConverter &converter, KoShapePaintingContext &paintContext); 0055 0056 /** 0057 * Adapt the rect the shape occupies 0058 * 0059 * @param rect rect which will be updated to give the rect the shape occupies. 0060 */ 0061 virtual void adapt(KoShape *shape, QRectF &rect); 0062 0063 /** 0064 * Set the shape manager 0065 * 0066 * This is needed in case you cannot set the shape manager when creating the painting strategy. 0067 * It needs to be set before you paint otherwise nothing will be painted. 0068 * 0069 * @param shapeManager The shape manager to use in the painting strategy 0070 */ 0071 void setShapeManager(KoShapeManager *shapeManager); 0072 0073 protected: 0074 KoShapeManager *shapeManager(); 0075 0076 private: 0077 class Private; 0078 Private * const d; 0079 }; 0080 0081 #endif /* KOSHAPEMANAGERPAINTINGSTRATEGY_H */