Plasma-workspace

screencastingrequest.h
1/*
2 SPDX-FileCopyrightText: 2020 Aleix Pol Gonzalez <aleixpol@kde.org>
3
4 SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
5*/
6
7#pragma once
8
9#include "screencasting.h"
10#include <QObject>
11#include <qqmlregistration.h>
12
13/**
14 * Allows us to request a stream for a window identified by its universally
15 * unique identifier.
16 *
17 * We will get a PipeWire node id that can be fed to any pipewire player, be it
18 * the PipeWireSourceItem, GStreamer's pipewiresink or any other.
19 */
21{
23 QML_ELEMENT
24 /**
25 * The unique identifier of the window we want to cast.
26 *
27 * @see PlasmaWindow::uuid
28 * @see PlasmaWindow::stackingOrderUuids
29 * @see PlasmaWindowModel::Uuid
30 * @see TasksModel::WinIdList
31 */
32 Q_PROPERTY(QString uuid READ uuid WRITE setUuid RESET resetUuid NOTIFY uuidChanged)
33
34 /**
35 * The output name as define in Screen.name
36 */
37 Q_PROPERTY(QString outputName READ outputName WRITE setOutputName RESET resetOutputName NOTIFY outputNameChanged)
38
39 /** The offered nodeId to give to a source */
40 Q_PROPERTY(quint32 nodeId READ nodeId NOTIFY nodeIdChanged)
41public:
44
45 void resetUuid();
46 void setUuid(const QString &uuid);
47 QString uuid() const;
48
49 void resetOutputName();
50 void setOutputName(const QString &outputName);
51 QString outputName() const;
52
53 quint32 nodeId() const;
54
56 void nodeIdChanged(quint32 nodeId);
57 void uuidChanged(const QString &uuid);
58 void outputNameChanged(const QString &outputNames);
59
60private:
61 void setNodeid(uint nodeId);
62 void setStream(std::unique_ptr<ScreencastingStream> stream);
63
64 std::unique_ptr<Screencasting> m_screenCasting;
65 std::unique_ptr<ScreencastingStream> m_stream;
66 QString m_uuid;
67 QString m_outputName;
68 quint32 m_nodeId = 0;
69};
Allows us to request a stream for a window identified by its universally unique identifier.
QML_ELEMENTQString uuid
The unique identifier of the window we want to cast.
quint32 nodeId
The offered nodeId to give to a source.
QString outputName
The output name as define in Screen.name.
Q_OBJECTQ_OBJECT
Q_PROPERTY(...)
Q_SIGNALSQ_SIGNALS
QObject * parent() const const
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Oct 11 2024 12:19:55 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.