File indexing completed on 2024-02-25 17:30:59

0001 /*
0002  * SPDX-FileCopyrightText: 2016-2018 Red Hat Inc
0003  *
0004  * SPDX-License-Identifier: LGPL-2.0-or-later
0005  *
0006  * SPDX-FileCopyrightText: 2016-2018 Jan Grulich <jgrulich@redhat.com>
0007  * SPDX-FileCopyrightText: 2022 Harald Sitter <sitter@kde.org>
0008  */
0009 
0010 #ifndef XDG_DESKTOP_PORTAL_KDE_APPCHOOSER_H
0011 #define XDG_DESKTOP_PORTAL_KDE_APPCHOOSER_H
0012 
0013 #include <QDBusAbstractAdaptor>
0014 #include <QDBusObjectPath>
0015 
0016 class QDBusMessage;
0017 class AppChooserDialog;
0018 
0019 class AppChooserPortal : public QDBusAbstractAdaptor
0020 {
0021     Q_OBJECT
0022     Q_CLASSINFO("D-Bus Interface", "org.freedesktop.impl.portal.AppChooser")
0023 public:
0024     explicit AppChooserPortal(QObject *parent);
0025     ~AppChooserPortal() override;
0026 
0027 public Q_SLOTS:
0028     uint ChooseApplication(const QDBusObjectPath &handle,
0029                            const QString &app_id,
0030                            const QString &parent_window,
0031                            const QStringList &choices,
0032                            const QVariantMap &options,
0033                            QVariantMap &results);
0034 
0035     uint
0036     ChooseApplicationPrivate(const QString &parent_window, const QStringList &urls, const QVariantMap &options, const QDBusMessage &msg, QVariantMap &results);
0037     void UpdateChoices(const QDBusObjectPath &handle, const QStringList &choices);
0038 
0039 private:
0040     QMap<QString, AppChooserDialog *> m_appChooserDialogs;
0041 };
0042 
0043 #endif // XDG_DESKTOP_PORTAL_KDE_APPCHOOSER_H