1// Copyright (C) 2020 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3
4#ifndef QDESKTOPUNIXSERVICES_H
5#define QDESKTOPUNIXSERVICES_H
6
7//
8// W A R N I N G
9// -------------
10//
11// This file is not part of the Qt API. It exists purely as an
12// implementation detail. This header file may change from version to
13// version without notice, or even be removed.
14//
15// We mean it.
16//
17
18#include <qpa/qplatformservices.h>
19
20#include <QtCore/qpointer.h>
21#include <QtCore/QString>
22#include <QtCore/private/qglobal_p.h>
23
24QT_BEGIN_NAMESPACE
25
26class QDBusPendingCallWatcher;
27class QWindow;
28
29class Q_GUI_EXPORT QDesktopUnixServices : public QPlatformServices
30{
31public:
32 QDesktopUnixServices();
33 ~QDesktopUnixServices();
34
35 QByteArray desktopEnvironment() const override;
36
37 bool hasCapability(Capability capability) const override;
38 bool openUrl(const QUrl &url) override;
39 bool openDocument(const QUrl &url) override;
40 QPlatformServiceColorPicker *colorPicker(QWindow *parent = nullptr) override;
41
42 void setApplicationBadge(qint64 number);
43 virtual QString portalWindowIdentifier(QWindow *window);
44
45 virtual void registerDBusMenuForWindow(QWindow *window, const QString &service, const QString &path);
46 virtual void unregisterDBusMenuForWindow(QWindow *window);
47
48private:
49 QString m_webBrowser;
50 QString m_documentLauncher;
51#if QT_CONFIG(dbus)
52 QPointer<QDBusPendingCallWatcher> m_watcher = nullptr;
53#endif
54 bool m_hasScreenshotPortalWithColorPicking = false;
55};
56
57QT_END_NAMESPACE
58
59#endif // QDESKTOPUNIXSERVICES_H
60

source code of qtbase/src/gui/platform/unix/qdesktopunixservices_p.h