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_P_H
5#define QCAPTURABLEWINDOW_P_H
6
7#include <QtGui/qwindowdefs.h>
8#include <QtCore/QSharedData>
9#include <QtMultimedia/qcapturablewindow.h>
10
11#include <memory>
12
13//
14// W A R N I N G
15// -------------
16//
17// This file is not part of the Qt API. It exists purely as an
18// implementation detail. This header file may change from version to
19// version without notice, or even be removed.
20//
21// We mean it.
22//
23
24QT_BEGIN_NAMESPACE
25
26class QCapturableWindowPrivate : public QSharedData {
27public:
28 using Id = size_t;
29
30 QString description;
31 Id id = 0;
32
33 QCapturableWindowPrivate(Id id, QString &&description)
34 : QSharedData()
35 , description{ std::move(description) }
36 , id{ id }
37 {}
38
39 static const QCapturableWindowPrivate *handle(const QCapturableWindow &window)
40 {
41 return window.d.get();
42 }
43
44 [[nodiscard]] static QCapturableWindow create(Id id, QString &&description)
45 {
46 return { new QCapturableWindowPrivate(id, std::move(description)) };
47 }
48};
49
50QT_END_NAMESPACE
51
52#endif // QCAPTURABLEWINDOW_P_H
53

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