File indexing completed on 2024-04-28 05:36:53

0001 /*
0002  * SPDX-FileCopyrightText: 2018 Red Hat Inc
0003  *
0004  * SPDX-License-Identifier: LGPL-2.0-or-later
0005  *
0006  * SPDX-FileCopyrightText: 2018 Jan Grulich <jgrulich@redhat.com>
0007  */
0008 
0009 #ifndef XDG_DESKTOP_PORTAL_KDE_SCREENCHOOSER_DIALOG_H
0010 #define XDG_DESKTOP_PORTAL_KDE_SCREENCHOOSER_DIALOG_H
0011 
0012 #include "outputsmodel.h"
0013 #include "quickdialog.h"
0014 #include "screencast.h"
0015 #include <QEventLoop>
0016 #include <QRect>
0017 
0018 class ScreenChooserDialog : public QuickDialog
0019 {
0020     Q_OBJECT
0021 public:
0022     ScreenChooserDialog(const QString &appName, bool multiple, ScreenCastPortal::SourceTypes types);
0023     ~ScreenChooserDialog() override;
0024 
0025     QList<Output> selectedOutputs() const;
0026     QList<QMap<int, QVariant>> selectedWindows() const;
0027     bool allowRestore() const;
0028     QRect selectedRegion() const;
0029 
0030 public Q_SLOTS:
0031     void accept() override;
0032 
0033 Q_SIGNALS:
0034     void clearSelection();
0035 
0036 private:
0037     void setRegion(const QRect region);
0038 
0039     QRect m_region;
0040 };
0041 
0042 #endif // XDG_DESKTOP_PORTAL_KDE_SCREENCHOOSER_DIALOG_H