Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
qdesktopunixservices_p.h
Go to the documentation of this file.
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// Qt-Security score:critical reason:execute-external-code
4
5#ifndef QDESKTOPUNIXSERVICES_H
6#define QDESKTOPUNIXSERVICES_H
7
8//
9// W A R N I N G
10// -------------
11//
12// This file is not part of the Qt API. It exists purely as an
13// implementation detail. This header file may change from version to
14// version without notice, or even be removed.
15//
16// We mean it.
17//
18
19#include <qpa/qplatformservices.h>
20
21#include <QtCore/qpointer.h>
22#include <QtCore/QString>
23#include <QtCore/private/qglobal_p.h>
24
25QT_BEGIN_NAMESPACE
26
27class QDBusPendingCallWatcher;
28class QWindow;
29class QDBusServiceWatcher;
30
31class Q_GUI_EXPORT QDesktopUnixServices : public QPlatformServices
32{
33public:
34 QDesktopUnixServices();
35 ~QDesktopUnixServices();
36
37 QByteArray desktopEnvironment() const override;
38
39 bool hasCapability(Capability capability) const override;
40 bool openUrl(const QUrl &url) override;
41 bool openDocument(const QUrl &url) override;
42 QPlatformServiceColorPicker *colorPicker(QWindow *parent = nullptr) override;
43
44 void setApplicationBadge(qint64 number);
45 virtual QString portalWindowIdentifier(QWindow *window);
46
47 virtual void registerDBusMenuForWindow(QWindow *window, const QString &service, const QString &path);
48 virtual void unregisterDBusMenuForWindow(QWindow *window);
49
50private:
51 QString m_webBrowser;
52 QString m_documentLauncher;
53#if QT_CONFIG(dbus)
54 QPointer<QDBusPendingCallWatcher> m_watcher = nullptr;
55 std::unique_ptr<QDBusServiceWatcher> m_portalWatcher;
56#endif
57 bool m_hasScreenshotPortalWithColorPicking = false;
58};
59
60QT_END_NAMESPACE
61
62#endif // QDESKTOPUNIXSERVICES_H