File indexing completed on 2024-05-12 15:56:47

0001 /* This file is part of the KDE project
0002  * SPDX-FileCopyrightText: 2009 Thomas Zander <zander@kde.org>
0003  * SPDX-FileCopyrightText: 2010 Boudewijn Rempt <boud@valdyas.org>
0004  *
0005  * SPDX-License-Identifier: LGPL-2.0-or-later
0006 */
0007 #ifndef KOSHAPEPRIVATE_H
0008 #define KOSHAPEPRIVATE_H
0009 
0010 #include "KoShape.h"
0011 
0012 #include <QPoint>
0013 #include <QPaintDevice>
0014 #include <QTransform>
0015 #include <QScopedPointer>
0016 #include <QSharedData>
0017 
0018 #include <KoClipMask.h>
0019 
0020 class KoShapeManager;
0021 
0022 
0023 class KoShape::SharedData : public QSharedData
0024 {
0025 public:
0026     explicit SharedData();
0027     virtual ~SharedData();
0028 
0029     explicit SharedData(const SharedData &rhs);
0030 
0031 
0032 public:
0033     // Members
0034 
0035     mutable QSizeF size; // size in pt
0036     QString shapeId;
0037     QString name; ///< the shapes names
0038 
0039     QTransform localMatrix; ///< the shapes local transformation matrix
0040 
0041     QScopedPointer<KoShapeUserData> userData;
0042     QSharedPointer<KoShapeStrokeModel> stroke; ///< points to a stroke, or 0 if there is no stroke
0043     QSharedPointer<KoShapeBackground> fill; ///< Stands for the background color / fill etc.
0044     bool inheritBackground = false;
0045     bool inheritStroke = false;
0046     KoShapeShadow * shadow; ///< the current shape shadow
0047     // XXX: change this to instance instead of pointer
0048     QScopedPointer<KoClipPath> clipPath; ///< the current clip path
0049     QScopedPointer<KoClipMask> clipMask; ///< the current clip mask
0050     QMap<QString, QString> additionalAttributes;
0051     QMap<QByteArray, QString> additionalStyleAttributes;
0052     KoFilterEffectStack *filterEffectStack; ///< stack of filter effects applied to the shape
0053     qreal transparency; ///< the shapes transparency
0054     QString hyperLink; //hyperlink for this shape
0055 
0056     int zIndex : 16; // keep maxZIndex in sync!
0057     int runThrough : 16;
0058     int visible : 1;
0059     int printable : 1;
0060     int geometryProtected : 1;
0061     int keepAspect : 1;
0062     int selectable : 1;
0063     int protectContent : 1;
0064 
0065     KoShape::TextRunAroundSide textRunAroundSide;
0066     qreal textRunAroundDistanceLeft;
0067     qreal textRunAroundDistanceTop;
0068     qreal textRunAroundDistanceRight;
0069     qreal textRunAroundDistanceBottom;
0070     qreal textRunAroundThreshold;
0071     KoShape::TextRunAroundContour textRunAroundContour;
0072 };
0073 
0074 class KoShape::Private
0075 {
0076 public:
0077     KoShapeContainer *parent;
0078     QSet<KoShapeManager *> shapeManagers;
0079     QSet<KoShape *> toolDelegates;
0080     QList<KoShape*> dependees; ///< list of shape dependent on this shape
0081     QList<KoShape::ShapeChangeListener*> listeners;
0082 };
0083 
0084 #endif