1 | // Copyright (C) 2023 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 | |
4 | #ifndef QCAPTURABLEWINDOW_H |
5 | #define QCAPTURABLEWINDOW_H |
6 | |
7 | #include <QtMultimedia/qtmultimediaglobal.h> |
8 | #include <QtCore/qmetatype.h> |
9 | #include <QtCore/qshareddata.h> |
10 | |
11 | QT_BEGIN_NAMESPACE |
12 | |
13 | class QCapturableWindowPrivate; |
14 | QT_DECLARE_QESDP_SPECIALIZATION_DTOR_WITH_EXPORT(QCapturableWindowPrivate, Q_MULTIMEDIA_EXPORT) |
15 | |
16 | class QMediaCaptureSession; |
17 | class QWindowCapturePrivate; |
18 | |
19 | class QCapturableWindow |
20 | { |
21 | Q_GADGET_EXPORT(Q_MULTIMEDIA_EXPORT) |
22 | Q_PROPERTY(QString description READ description CONSTANT) |
23 | Q_PROPERTY(bool isValid READ isValid CONSTANT) |
24 | public: |
25 | Q_MULTIMEDIA_EXPORT QCapturableWindow(); |
26 | |
27 | Q_MULTIMEDIA_EXPORT ~QCapturableWindow(); |
28 | |
29 | Q_MULTIMEDIA_EXPORT QCapturableWindow(const QCapturableWindow &other); |
30 | |
31 | QCapturableWindow(QCapturableWindow &&other) noexcept = default; |
32 | |
33 | Q_MULTIMEDIA_EXPORT QCapturableWindow& operator=(const QCapturableWindow &other); |
34 | |
35 | QT_MOVE_ASSIGNMENT_OPERATOR_IMPL_VIA_PURE_SWAP(QCapturableWindow); |
36 | |
37 | void swap(QCapturableWindow &other) noexcept |
38 | { d.swap(other&: other.d); } |
39 | |
40 | Q_MULTIMEDIA_EXPORT friend bool operator==(const QCapturableWindow &lhs, const QCapturableWindow &rhs) noexcept; |
41 | |
42 | friend bool operator!=(const QCapturableWindow &lhs, const QCapturableWindow &rhs) noexcept |
43 | { return !(lhs == rhs); } |
44 | |
45 | Q_MULTIMEDIA_EXPORT bool isValid() const; |
46 | |
47 | Q_MULTIMEDIA_EXPORT QString description() const; |
48 | |
49 | #ifndef QT_NO_DEBUG_STREAM |
50 | Q_MULTIMEDIA_EXPORT friend QDebug operator<<(QDebug, const QCapturableWindow &); |
51 | #endif |
52 | |
53 | private: |
54 | Q_MULTIMEDIA_EXPORT QCapturableWindow(QCapturableWindowPrivate *capturablePrivate); |
55 | friend class QCapturableWindowPrivate; |
56 | |
57 | QExplicitlySharedDataPointer<QCapturableWindowPrivate> d; |
58 | }; |
59 | |
60 | Q_DECLARE_SHARED(QCapturableWindow) |
61 | |
62 | QT_END_NAMESPACE |
63 | |
64 | Q_DECLARE_METATYPE(QCapturableWindow) |
65 | |
66 | #endif // QCAPTURABLEWINDOW_H |
67 |