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

source code of qtmultimedia/src/multimedia/recording/qcapturablewindow.h