1 /****************************************************************************
2 **
3 ** DQt - D bindings for the Qt Toolkit
4 **
5 ** GNU Lesser General Public License Usage
6 ** This file may be used under the terms of the GNU Lesser
7 ** General Public License version 3 as published by the Free Software
8 ** Foundation and appearing in the file LICENSE.LGPL3 included in the
9 ** packaging of this file. Please review the following information to
10 ** ensure the GNU Lesser General Public License version 3 requirements
11 ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
12 **
13 ****************************************************************************/
14 module qt.gui.pen;
15 extern(C++):
16 
17 import qt.config;
18 import qt.core.global;
19 import qt.core.metatype;
20 import qt.core.namespace;
21 import qt.core.typeinfo;
22 import qt.core.variant;
23 import qt.core.vector;
24 import qt.gui.brush;
25 import qt.gui.color;
26 import qt.helpers;
27 
28 /+ class QVariant; +/
29 extern(C++, class) struct QPenPrivate;
30 /+ class QBrush;
31 class QPen;
32 
33 #ifndef QT_NO_DATASTREAM
34 Q_GUI_EXPORT QDataStream &operator<<(QDataStream &, const QPen &);
35 Q_GUI_EXPORT QDataStream &operator>>(QDataStream &, QPen &);
36 #endif +/
37 
38 @(QMetaType.Type.QPen) @Q_MOVABLE_TYPE extern(C++, class) struct /+ Q_GUI_EXPORT +/ QPen
39 {
40 public:
41     @disable this();
42     pragma(mangle, defaultConstructorMangling(__traits(identifier, typeof(this))))
43     ref typeof(this) rawConstructor();
44     static typeof(this) create()
45     {
46         typeof(this) r = typeof(this).init;
47         r.rawConstructor();
48         return r;
49     }
50 
51     this(/+ Qt:: +/qt.core.namespace.PenStyle);
52     this(ref const(QColor) color);
53     this(ref const(QBrush) brush, qreal width, /+ Qt:: +/qt.core.namespace.PenStyle s = /+ Qt:: +/qt.core.namespace.PenStyle.SolidLine,
54              /+ Qt:: +/qt.core.namespace.PenCapStyle c = /+ Qt:: +/qt.core.namespace.PenCapStyle.SquareCap, /+ Qt:: +/qt.core.namespace.PenJoinStyle j = /+ Qt:: +/qt.core.namespace.PenJoinStyle.BevelJoin);
55     @disable this(this);
56     this(ref const(QPen) pen)/+ noexcept+/;
57 
58     ~this();
59 
60     /+ref QPen operator =(ref const(QPen) pen)/+ noexcept+/;+/
61     /+ QPen(QPen &&other) noexcept
62         : d(other.d) { other.d = nullptr; } +/
63     /+ QPen &operator=(QPen &&other) noexcept
64     { qSwap(d, other.d); return *this; } +/
65     /+ void swap(QPen &other) noexcept { qSwap(d, other.d); } +/
66 
67     /+ Qt:: +/qt.core.namespace.PenStyle style() const;
68     void setStyle(/+ Qt:: +/qt.core.namespace.PenStyle);
69 
70     QVector!(qreal) dashPattern() const;
71     void setDashPattern(ref const(QVector!(qreal)) pattern);
72 
73     qreal dashOffset() const;
74     void setDashOffset(qreal doffset);
75 
76     qreal miterLimit() const;
77     void setMiterLimit(qreal limit);
78 
79     qreal widthF() const;
80     void setWidthF(qreal width);
81 
82     int width() const;
83     void setWidth(int width);
84 
85     QColor color() const;
86     void setColor(ref const(QColor) color);
87 
88     QBrush brush() const;
89     void setBrush(ref const(QBrush) brush);
90 
91     bool isSolid() const;
92 
93     /+ Qt:: +/qt.core.namespace.PenCapStyle capStyle() const;
94     void setCapStyle(/+ Qt:: +/qt.core.namespace.PenCapStyle pcs);
95 
96     /+ Qt:: +/qt.core.namespace.PenJoinStyle joinStyle() const;
97     void setJoinStyle(/+ Qt:: +/qt.core.namespace.PenJoinStyle pcs);
98 
99     bool isCosmetic() const;
100     void setCosmetic(bool cosmetic);
101 
102     /+bool operator ==(ref const(QPen) p) const;+/
103     /+pragma(inline, true) bool operator !=(ref const(QPen) p) const { return !(operator==(p)); }+/
104     /+auto opCast(T : QVariant)() const;+/
105 
106     bool isDetached();
107 private:
108     /+ friend Q_GUI_EXPORT QDataStream &operator>>(QDataStream &, QPen &); +/
109     /+ friend Q_GUI_EXPORT QDataStream &operator<<(QDataStream &, const QPen &); +/
110 
111     void detach();
112     QPenPrivate* d;
113 
114 public:
115     alias DataPtr = QPenPrivate*;
116     pragma(inline, true) ref DataPtr data_ptr() return { return d; }
117 }
118 
119 /+ Q_DECLARE_SHARED(QPen)
120 
121 #ifndef QT_NO_DEBUG_STREAM
122 Q_GUI_EXPORT QDebug operator<<(QDebug, const QPen &);
123 #endif +/
124