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
qxdgnotificationproxy_p.h
Go to the documentation of this file.
1
// Copyright (C) 2021 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:significant reason:default
4
5
/*
6
This file was originally created by qdbusxml2cpp version 0.8
7
Command line was:
8
qdbusxml2cpp -p qxdgnotificationproxy ../../3rdparty/dbus-ifaces/org.freedesktop.Notifications.xml
9
10
However it is maintained manually.
11
12
It is also not part of the public API. This header file may change from
13
version to version without notice, or even be removed.
14
*/
15
16
#
ifndef
QXDGNOTIFICATIONPROXY_P_H
17
#
define
QXDGNOTIFICATIONPROXY_P_H
18
19
//
20
// W A R N I N G
21
// -------------
22
//
23
// This file is not part of the Qt API. It exists for the convenience
24
// of other Qt classes. This header file may change from version to
25
// version without notice, or even be removed.
26
//
27
// We mean it.
28
//
29
30
#
include
<
QObject
>
31
#
include
<
QByteArray
>
32
#
include
<
QList
>
33
#
include
<
QLoggingCategory
>
34
#
include
<
QMap
>
35
#
include
<
QString
>
36
#
include
<
QStringList
>
37
#
include
<
QVariant
>
38
#
include
<
QDBusAbstractInterface
>
39
#
include
<
QDBusPendingReply
>
40
#
include
<
QDBusReply
>
41
#
include
<
private
/
qglobal_p
.
h
>
42
43
QT_BEGIN_NAMESPACE
44
45
Q_DECLARE_LOGGING_CATEGORY
(
qLcTray
)
46
47
/*
48
* Proxy class for interface org.freedesktop.Notifications
49
*/
50
class
QXdgNotificationInterface
:
public
QDBusAbstractInterface
51
{
52
Q_OBJECT
53
public
:
54
static
inline
const
char
*
staticInterfaceName
()
55
{
return
"org.freedesktop.Notifications"
; }
56
57
public
:
58
QXdgNotificationInterface
(
const
QString
&
service
,
const
QString
&
path
,
59
const
QDBusConnection
&
connection
,
QObject
*
parent
=
nullptr
);
60
61
~
QXdgNotificationInterface
();
62
63
public
Q_SLOTS
:
// METHODS
64
inline
QDBusPendingReply
<>
closeNotification
(
uint
id
)
65
{
66
return
asyncCall
(
QStringLiteral
(
"CloseNotification"
),
id
);
67
}
68
69
inline
QDBusPendingReply
<
QStringList
>
getCapabilities
()
70
{
71
return
asyncCall
(
QStringLiteral
(
"GetCapabilities"
));
72
}
73
74
inline
QDBusPendingReply
<
QString
,
QString
,
QString
,
QString
>
getServerInformation
()
75
{
76
return
asyncCall
(
QStringLiteral
(
"GetServerInformation"
));
77
}
78
inline
QDBusReply
<
QString
>
getServerInformation
(
QString
&
vendor
,
QString
&
version
,
QString
&
specVersion
)
79
{
80
QDBusMessage
reply
=
call
(
QDBus
::
Block
,
QStringLiteral
(
"GetServerInformation"
));
81
if
(
reply
.
type
() ==
QDBusMessage
::
ReplyMessage
&&
reply
.
arguments
().
size
() == 4) {
82
vendor
=
qdbus_cast
<
QString
>(
reply
.
arguments
().
at
(1));
83
version
=
qdbus_cast
<
QString
>(
reply
.
arguments
().
at
(2));
84
specVersion
=
qdbus_cast
<
QString
>(
reply
.
arguments
().
at
(3));
85
}
86
return
reply
;
87
}
88
89
// see https://developer.gnome.org/notification-spec/#basic-design
90
inline
QDBusPendingReply
<
uint
>
notify
(
const
QString
&
appName
,
uint
replacesId
,
const
QString
&
appIcon
,
91
const
QString
&
summary
,
const
QString
&
body
,
const
QStringList
&
actions
,
92
const
QVariantMap
&
hints
,
int
timeout
)
93
{
94
qCDebug
(
qLcTray
) <<
appName
<<
replacesId
<<
appIcon
<<
summary
<<
body
<<
actions
<<
hints
<<
timeout
;
95
return
asyncCall
(
QStringLiteral
(
"Notify"
),
appName
,
replacesId
,
appIcon
,
summary
,
body
,
actions
,
hints
,
timeout
);
96
}
97
98
Q_SIGNALS
:
99
void
ActionInvoked
(
uint
id
,
const
QString
&
action_key
);
100
void
NotificationClosed
(uint id, uint reason);
101
};
102
103
QT_END_NAMESPACE
104
105
namespace
org
{
106
namespace
freedesktop
{
107
using
Notifications
=
QT_PREPEND_NAMESPACE
(
QXdgNotificationInterface
);
108
}
109
}
110
111
#
endif
QXdgNotificationInterface
Definition
qxdgnotificationproxy_p.h:51
QXdgNotificationInterface::NotificationClosed
void NotificationClosed(uint id, uint reason)
QXdgNotificationInterface::closeNotification
QDBusPendingReply closeNotification(uint id)
Definition
qxdgnotificationproxy_p.h:64
QXdgNotificationInterface::~QXdgNotificationInterface
~QXdgNotificationInterface()
Definition
qxdgnotificationproxy.cpp:14
org::freedesktop
Definition
qxdgnotificationproxy_p.h:106
org
Definition
qxdgnotificationproxy_p.h:105
Q_DECLARE_LOGGING_CATEGORY
QT_BEGIN_NAMESPACE Q_DECLARE_LOGGING_CATEGORY(lcEventDispatcher)
qtbase
src
gui
platform
unix
dbustray
qxdgnotificationproxy_p.h
Generated on
for Qt by
1.14.0