Plasma-workspace

loginddbustypes.h
1#pragma once
2
3#include <QDBusArgument>
4#include <QDBusObjectPath>
5
6struct SessionInfo {
7 QString sessionId;
8 uint userId;
9 QString userName;
10 QString seatId;
11 QDBusObjectPath sessionPath;
12};
13
15
16inline QDBusArgument &operator<<(QDBusArgument &argument, const SessionInfo &sessionInfo)
17{
18 argument.beginStructure();
19 argument << sessionInfo.sessionId;
20 argument << sessionInfo.userId;
21 argument << sessionInfo.userName;
22 argument << sessionInfo.seatId;
23 argument << sessionInfo.sessionPath;
24 argument.endStructure();
25
26 return argument;
27}
28
29inline const QDBusArgument &operator>>(const QDBusArgument &argument, SessionInfo &sessionInfo)
30{
31 argument.beginStructure();
32 argument >> sessionInfo.sessionId;
33 argument >> sessionInfo.userId;
34 argument >> sessionInfo.userName;
35 argument >> sessionInfo.seatId;
36 argument >> sessionInfo.sessionPath;
37 argument.endStructure();
38
39 return argument;
40}
41
42struct UserInfo {
43 uint userId;
44 QString name;
45 QDBusObjectPath path;
46};
47
49
50inline QDBusArgument &operator<<(QDBusArgument &argument, const UserInfo &userInfo)
51{
52 argument.beginStructure();
53 argument << userInfo.userId;
54 argument << userInfo.name;
55 argument << userInfo.path;
56 argument.endStructure();
57
58 return argument;
59}
60
61inline const QDBusArgument &operator>>(const QDBusArgument &argument, UserInfo &userInfo)
62{
63 argument.beginStructure();
64 argument >> userInfo.userId;
65 argument >> userInfo.name;
66 argument >> userInfo.path;
67 argument.endStructure();
68
69 return argument;
70}
71
72struct NamedSeatPath {
73 QString name;
74 QDBusObjectPath path;
75};
76
77inline QDBusArgument &operator<<(QDBusArgument &argument, const NamedSeatPath &namedSeat)
78{
79 argument.beginStructure();
80 argument << namedSeat.name;
81 argument << namedSeat.path;
82 argument.endStructure();
83 return argument;
84}
85
86inline const QDBusArgument &operator>>(const QDBusArgument &argument, NamedSeatPath &namedSeat)
87{
88 argument.beginStructure();
89 argument >> namedSeat.name;
90 argument >> namedSeat.path;
91 argument.endStructure();
92 return argument;
93}
94
96
97typedef NamedSeatPath NamedSessionPath;
99
100struct NamedUserPath {
101 uint userId;
102 QDBusObjectPath path;
103};
104
105inline QDBusArgument &operator<<(QDBusArgument &argument, const NamedUserPath &namedUser)
106{
107 argument.beginStructure();
108 argument << namedUser.userId;
109 argument << namedUser.path;
110 argument.endStructure();
111 return argument;
112}
113
114inline const QDBusArgument &operator>>(const QDBusArgument &argument, NamedUserPath &namedUser)
115{
116 argument.beginStructure();
117 argument >> namedUser.userId;
118 argument >> namedUser.path;
119 argument.endStructure();
120 return argument;
121}
122
123struct Inhibitor {
124 QString what;
125 QString who;
126 QString why;
127 QString mode;
128 uint userId;
129 uint processId;
130};
131
133
134inline QDBusArgument &operator<<(QDBusArgument &argument, const Inhibitor &inhibitor)
135{
136 argument.beginStructure();
137 argument << inhibitor.what;
138 argument << inhibitor.who;
139 argument << inhibitor.why;
140 argument << inhibitor.mode;
141 argument << inhibitor.userId;
142 argument << inhibitor.processId;
143 argument.endStructure();
144 return argument;
145}
146
147inline const QDBusArgument &operator>>(const QDBusArgument &argument, Inhibitor &inhibitor)
148{
149 argument.beginStructure();
150 argument >> inhibitor.what;
151 argument >> inhibitor.who;
152 argument >> inhibitor.why;
153 argument >> inhibitor.mode;
154 argument >> inhibitor.userId;
155 argument >> inhibitor.processId;
156 argument.endStructure();
157 return argument;
158}
KCALENDARCORE_EXPORT QDataStream & operator>>(QDataStream &in, const KCalendarCore::Alarm::Ptr &)
KTEXTEDITOR_EXPORT QDebug operator<<(QDebug s, const MovingCursor &cursor)
void beginStructure()
void endStructure()
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Dec 20 2024 12:00:00 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.