File indexing completed on 2024-02-25 17:31:00

0001 // SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
0002 // SPDX-FileCopyrightText: 2022 Harald Sitter <sitter@kde.org>
0003 
0004 #pragma once
0005 
0006 #include <QDBusAbstractAdaptor>
0007 #include <QDBusObjectPath>
0008 
0009 class DynamicLauncherPortal : public QDBusAbstractAdaptor
0010 {
0011     Q_OBJECT
0012     Q_CLASSINFO("D-Bus Interface", "org.freedesktop.impl.portal.DynamicLauncher")
0013 
0014     Q_PROPERTY(uint version MEMBER m_version CONSTANT)
0015     const uint m_version = 1;
0016 
0017     Q_PROPERTY(uint SupportedLauncherTypes MEMBER m_supportedTypes CONSTANT)
0018     const uint m_supportedTypes = uint(Type::Application) | uint(Type::Webapp);
0019 
0020 public:
0021     enum class Type { Application = 1, Webapp = 2 };
0022 
0023     explicit DynamicLauncherPortal(QObject *parent = nullptr);
0024 
0025 public Q_SLOTS:
0026     uint PrepareInstall(const QDBusObjectPath &handle,
0027                         const QString &app_id,
0028                         const QString &parent_window,
0029                         const QString &name,
0030                         const QDBusVariant &icon_v,
0031                         const QVariantMap &options,
0032                         QVariantMap &results);
0033     uint RequestInstallToken(const QString &app_id, const QVariantMap &options);
0034 };