Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Toggle main menu visibility
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
25
QT_BEGIN_NAMESPACE
26
27
class
QDBusPendingCallWatcher;
28
class
QWindow;
29
class
QDBusServiceWatcher;
30
31
class
Q_GUI_EXPORT
QDesktopUnixServices
:
public
QPlatformServices
32
{
33
public
:
34
enum
class
LaunchType { Browser, Document };
35
36
QDesktopUnixServices();
37
~QDesktopUnixServices();
38
39
QByteArray desktopEnvironment()
const
override;
40
41
bool
hasCapability(Capability capability)
const
override;
42
bool
openUrl(
const
QUrl &url) override;
43
bool
openDocument(
const
QUrl &url) override;
44
QPlatformServiceColorPicker *colorPicker(QWindow *parent =
nullptr
) override;
45
46
void
setApplicationBadge(qint64 number);
47
virtual
QString portalWindowIdentifier(QWindow *window);
48
49
virtual
void
registerDBusMenuForWindow(QWindow *window,
const
QString &service,
const
QString &path);
50
virtual
void
unregisterDBusMenuForWindow(QWindow *window);
51
52
private
:
53
QString m_webBrowser;
54
QString m_documentLauncher;
55
#
if
QT_CONFIG
(
dbus
)
56
QPointer<QDBusPendingCallWatcher> m_watcher =
nullptr
;
57
std::unique_ptr<QDBusServiceWatcher> m_portalWatcher;
58
bool
m_hasNoPortal =
false
;
59
#
else
60
static
constexpr
bool
m_hasNoPortal =
true
;
// even if we did, we can't talk to it
61
#
endif
62
bool
m_hasScreenshotPortalWithColorPicking =
false
;
63
64
inline
bool
launchProcess(LaunchType type,
const
QUrl &url,
const
QString &xdgActivationToken);
65
inline
QString portalFocusWindowIdentifier();
66
67
inline
bool
openDocumentWithoutPortal(
const
QUrl &url,
const
QString &xdgActivationToken);
68
inline
bool
openDocumentWithPortal(
const
QUrl &url,
const
QString &xdgActivationToken);
69
inline
bool
openUrlWithoutPortal(
const
QUrl &url,
const
QString &xdgActivationToken);
70
inline
bool
openUrlWithPortal(
const
QUrl &url,
const
QString &xdgActivationToken);
71
template
<
typename
F>
72
inline
bool
runWithXdgActivationToken(F callback,
const
QUrl &url);
73
};
74
75
QT_END_NAMESPACE
76
77
#
endif
// QDESKTOPUNIXSERVICES_H
QDesktopUnixServices
Definition
qdesktopunixservices_p.h:32
qtbase
src
gui
platform
unix
qdesktopunixservices_p.h
Generated on
for Qt by
1.18.0