/src/qtbase/src/gui/image/qpicture.h
Line | Count | Source |
1 | | // Copyright (C) 2016 The Qt Company Ltd. |
2 | | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only |
3 | | // Qt-Security score:significant reason:default |
4 | | |
5 | | #ifndef QPICTURE_H |
6 | | #define QPICTURE_H |
7 | | |
8 | | #include <QtGui/qtguiglobal.h> |
9 | | #include <QtCore/qiodevice.h> |
10 | | #include <QtCore/qshareddata.h> |
11 | | #include <QtCore/qstringlist.h> |
12 | | #include <QtGui/qpaintdevice.h> |
13 | | |
14 | | QT_BEGIN_NAMESPACE |
15 | | |
16 | | #ifndef QT_NO_PICTURE |
17 | | |
18 | | class QPicturePrivate; |
19 | | class Q_GUI_EXPORT QPicture : public QPaintDevice |
20 | | { |
21 | 0 | Q_DECLARE_PRIVATE(QPicture) Unexecuted instantiation: QPicture::d_func() Unexecuted instantiation: QPicture::d_func() const |
22 | 0 | public: |
23 | 0 | explicit QPicture(int formatVersion = -1); |
24 | 0 | QPicture(const QPicture &); |
25 | 0 | ~QPicture(); |
26 | 0 |
|
27 | 0 | bool isNull() const; |
28 | 0 |
|
29 | 0 | int devType() const override; |
30 | 0 | uint size() const; |
31 | 0 | const char* data() const; |
32 | 0 | virtual void setData(const char* data, uint size); |
33 | 0 |
|
34 | 0 | bool play(QPainter *p); |
35 | 0 |
|
36 | 0 | bool load(QIODevice *dev); |
37 | 0 | bool load(const QString &fileName); |
38 | 0 | bool save(QIODevice *dev); |
39 | 0 | bool save(const QString &fileName); |
40 | 0 |
|
41 | 0 | QRect boundingRect() const; |
42 | 0 | void setBoundingRect(const QRect &r); |
43 | 0 |
|
44 | 0 | QPicture& operator=(const QPicture &p); |
45 | 0 | QT_MOVE_ASSIGNMENT_OPERATOR_IMPL_VIA_PURE_SWAP(QPicture) |
46 | 0 | inline void swap(QPicture &other) noexcept |
47 | 0 | { d_ptr.swap(other.d_ptr); } |
48 | | void detach(); |
49 | | bool isDetached() const; |
50 | | |
51 | | friend Q_GUI_EXPORT QDataStream &operator<<(QDataStream &in, const QPicture &p); |
52 | | friend Q_GUI_EXPORT QDataStream &operator>>(QDataStream &in, QPicture &p); |
53 | | |
54 | | QPaintEngine *paintEngine() const override; |
55 | | |
56 | | protected: |
57 | | QPicture(QPicturePrivate &data); |
58 | | |
59 | | int metric(PaintDeviceMetric m) const override; |
60 | | |
61 | | private: |
62 | | bool exec(QPainter *p, QDataStream &ds, int i); |
63 | | |
64 | | QExplicitlySharedDataPointer<QPicturePrivate> d_ptr; |
65 | | friend class QPicturePaintEngine; |
66 | | friend class QAlphaPaintEngine; |
67 | | friend class QPreviewPaintEngine; |
68 | | |
69 | | public: |
70 | | typedef QExplicitlySharedDataPointer<QPicturePrivate> DataPtr; |
71 | 0 | inline DataPtr &data_ptr() { return d_ptr; } |
72 | | }; |
73 | | |
74 | | Q_DECLARE_SHARED(QPicture) |
75 | | |
76 | | /***************************************************************************** |
77 | | QPicture stream functions |
78 | | *****************************************************************************/ |
79 | | |
80 | | #ifndef QT_NO_DATASTREAM |
81 | | Q_GUI_EXPORT QDataStream &operator<<(QDataStream &, const QPicture &); |
82 | | Q_GUI_EXPORT QDataStream &operator>>(QDataStream &, QPicture &); |
83 | | #endif |
84 | | |
85 | | #endif // QT_NO_PICTURE |
86 | | |
87 | | QT_END_NAMESPACE |
88 | | |
89 | | #endif // QPICTURE_H |