Krita Source Code Documentation
Loading...
Searching...
No Matches
KoShapeStroke.h
Go to the documentation of this file.
1/* This file is part of the KDE project
2 *
3 * SPDX-FileCopyrightText: 2006-2007 Thomas Zander <zander@kde.org>
4 * SPDX-FileCopyrightText: 2006-2008 Jan Hambrecht <jaham@gmx.net>
5 * SPDX-FileCopyrightText: 2007, 2009 Thorsten Zachmann <zachmann@kde.org>
6 * SPDX-FileCopyrightText: 2012 Inge Wallin <inge@lysator.liu.se>
7 *
8 * SPDX-License-Identifier: LGPL-2.0-or-later
9 */
10
11#ifndef KOSHAPESTROKE_H
12#define KOSHAPESTROKE_H
13
14#include "KoFlakeTypes.h"
15#include "KoShapeStrokeModel.h"
16
17#include "kritaflake_export.h"
18
19#include <QMetaType>
20#include <QColor>
21
22
23class KoShape;
24class QPainter;
25class QBrush;
26class QPen;
27struct KoInsets;
28
32class KRITAFLAKE_EXPORT KoShapeStroke : public KoShapeStrokeModel
33{
34public:
37
39 KoShapeStroke(const KoShapeStroke &other);
40
46 explicit KoShapeStroke(qreal lineWidth, const QColor &color = Qt::black);
47 ~KoShapeStroke() override;
48
50 KoShapeStroke& operator = (const KoShapeStroke &rhs);
51
53 void setCapStyle(Qt::PenCapStyle style);
55 Qt::PenCapStyle capStyle() const;
57 void setJoinStyle(Qt::PenJoinStyle style);
59 Qt::PenJoinStyle joinStyle() const;
61 void setLineWidth(qreal lineWidth);
63 qreal lineWidth() const;
65 void setMiterLimit(qreal miterLimit);
67 qreal miterLimit() const;
69 void setLineStyle(Qt::PenStyle style, const QVector<qreal> &dashes);
71 Qt::PenStyle lineStyle() const;
73 QVector<qreal> lineDashes() const;
75 void setDashOffset(qreal dashOffset);
77 qreal dashOffset() const;
78
80 QColor color() const;
82 void setColor(const QColor &color);
83
85 void setLineBrush(const QBrush & brush);
87 QBrush lineBrush() const;
88
89 // pure virtuals from KoShapeStrokeModel implemented here.
90 void strokeInsets(const KoShape *shape, KoInsets &insets) const override;
91 qreal strokeMaxMarkersInset(const KoShape *shape) const override;
92 bool hasTransparency() const override;
93 void paint(const KoShape *shape, QPainter &painter) const override;
94 void paintMarkers(const KoShape *shape, QPainter &painter) const override;
95
96 QPen resultLinePen() const;
97
98 bool compareFillTo(const KoShapeStrokeModel *other) override;
99 bool compareStyleTo(const KoShapeStrokeModel *other) override;
100 bool isVisible() const override;
101
102private:
103 class Private;
104 Private * const d;
105};
106
108
109#endif // KOSHAPESTROKE_H
virtual bool compareFillTo(const KoShapeStrokeModel *other)=0
virtual void strokeInsets(const KoShape *shape, KoInsets &insets) const =0
virtual bool isVisible() const =0
virtual void paint(const KoShape *shape, QPainter &painter) const =0
virtual bool compareStyleTo(const KoShapeStrokeModel *other)=0
virtual void paintMarkers(const KoShape *shape, QPainter &painter) const =0
paintMarkers Paints the markers if possible.
virtual qreal strokeMaxMarkersInset(const KoShape *shape) const =0
virtual bool hasTransparency() const =0
Private *const d
QColor color() const
Returns the color.
Q_DECLARE_METATYPE(KisPaintopLodLimitations)