File indexing completed on 2024-05-12 05:38:09

0001 /*
0002     SPDX-FileCopyrightText: 2020 Aleix Pol Gonzalez <aleixpol@kde.org>
0003 
0004     SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
0005 */
0006 
0007 #pragma once
0008 
0009 #include <QObject>
0010 #include <memory>
0011 
0012 class ScreencastingPrivate;
0013 class ScreencastingStreamPrivate;
0014 class ScreencastingStream : public QObject
0015 {
0016     Q_OBJECT
0017 public:
0018     ScreencastingStream(QObject *parent);
0019     ~ScreencastingStream() override;
0020 
0021     quint32 nodeId() const;
0022 
0023 Q_SIGNALS:
0024     void created(quint32 nodeid);
0025     void failed(const QString &error);
0026     void closed();
0027 
0028 private:
0029     friend class Screencasting;
0030     std::unique_ptr<ScreencastingStreamPrivate> d;
0031 };
0032 
0033 class Screencasting : public QObject
0034 {
0035     Q_OBJECT
0036 public:
0037     explicit Screencasting(QObject *parent = nullptr);
0038     ~Screencasting() override;
0039 
0040     enum CursorMode {
0041         Hidden = 1,
0042         Embedded = 2,
0043         Metadata = 4,
0044     };
0045     Q_ENUM(CursorMode)
0046 
0047     ScreencastingStream *createOutputStream(const QString &outputName, CursorMode mode);
0048     ScreencastingStream *createWindowStream(const QString &uuid, CursorMode mode);
0049 
0050     void destroy();
0051 
0052 Q_SIGNALS:
0053     void initialized();
0054     void removed();
0055     void sourcesChanged();
0056 
0057 private:
0058     std::unique_ptr<ScreencastingPrivate> d;
0059 };