DtkSystemSettings
dtk library for systemsettings.
载入中...
搜索中...
未找到
dlogintypes.h
浏览该文件的文档.
1// SPDX-FileCopyrightText: 2022 UnionTech Software Technology Co., Ltd.
2//
3// SPDX-License-Identifier: LGPL-3.0-or-later
4
5#pragma once
6
7#include "dtklogin_global.h"
8
9#include <qdatetime.h>
10#include <qobject.h>
11#include <qvariant.h>
12
13DLOGIN_BEGIN_NAMESPACE
14// Do not use any unknown enum
16
22
24 Shutdown = 1 << 0,
25 Sleep = 1 << 1,
26 Idle = 1 << 2,
27 HandlePowerKey = 1 << 3,
28 HandleSuspendKey = 1 << 4,
29 HandleHibernateKey = 1 << 5,
30 HandleLidSwitch = 1 << 6
31};
32
33enum class PowerAction {
35 Reboot,
36 Halt,
37 KExec,
38 Suspend,
42 Lock,
44 Ignore,
45 Unknown
46};
47
48enum class ExecuteStatus { Yes, No, Challenge, Na, Unknown };
49enum class SessionRole { Leader, All, Unknown };
50enum class InhibitMode { Block, Delay, Unknown };
51enum class SessionState { Online, Active, Closing, Unknown };
52enum class SessionType { TTY, X11, Mir, Wayland, Unspecified };
53enum class SessionClass { User, Greeter, LockScreen, Unknown };
54enum class UserState { Offline, Lingering, Online, Active, Closing, Unknown };
55
57{
58 int what;
59 QString who;
60 QString why;
62 quint32 UID;
63 quint32 PID;
64 friend QDebug operator<<(QDebug debug, const Inhibitor &inhibitor);
65 friend bool operator==(const Inhibitor &lhs, const Inhibitor &rhs){
66 return lhs.what == rhs.what && lhs.who == rhs.who && lhs.why == rhs.why && lhs.mode == rhs.mode && lhs.UID == rhs.UID && lhs.PID == rhs.PID;
67 }
68};
69
70enum DLoginErrorCode {
71 NoError = 0,
72 Other = 1,
73 Failed,
74 NoMemory,
75 ServiceUnknown,
76 NoReply,
77 BadAddress,
78 NotSupported,
79 LimitsExceeded,
80 AccessDenied,
81 NoServer,
82 Timeout,
83 NoNetwork,
84 AddressInUse,
85 Disconnected,
86 InvalidArgs,
87 UnknownMethod,
88 TimedOut,
89 InvalidSignature,
90 UnknownInterface,
91 UnknownObject,
92 UnknownProperty,
93 PropertyReadOnly,
94 InternalError,
95 InvalidService,
96 InvalidObjectPath,
97 InvalidInterface,
98 InvalidMember
99};
100
101QDebug operator<<(QDebug debug, const ShutdownType &type);
102QDebug operator<<(QDebug debug, const ScheduledShutdownValue &scheduledShutdown);
103QDebug operator<<(QDebug debug, const PowerAction &action);
104QDebug operator<<(QDebug debug, const ExecuteStatus &status);
105QDebug operator<<(QDebug debug, const SessionRole &role);
106QDebug operator<<(QDebug debug, const InhibitMode &mode);
107QDebug operator<<(QDebug debug, const SessionState &state);
108QDebug operator<<(QDebug debug, const SessionType &type);
109QDebug operator<<(QDebug debug, const SessionClass &sessionClass);
110QDebug operator<<(QDebug debug, const UserState &userState);
111
112DLOGIN_END_NAMESPACE
113
114Q_DECLARE_METATYPE(DTK_LOGIN_NAMESPACE::ShutdownType)
115Q_DECLARE_METATYPE(DTK_LOGIN_NAMESPACE::ScheduledShutdownValue)
116Q_DECLARE_METATYPE(DTK_LOGIN_NAMESPACE::PowerAction)
117Q_DECLARE_METATYPE(DTK_LOGIN_NAMESPACE::ExecuteStatus)
118Q_DECLARE_METATYPE(DTK_LOGIN_NAMESPACE::SessionRole)
119Q_DECLARE_METATYPE(DTK_LOGIN_NAMESPACE::InhibitMode)
120Q_DECLARE_METATYPE(DTK_LOGIN_NAMESPACE::SessionState)
121Q_DECLARE_METATYPE(DTK_LOGIN_NAMESPACE::SessionType)
122Q_DECLARE_METATYPE(DTK_LOGIN_NAMESPACE::SessionClass)
123Q_DECLARE_METATYPE(DTK_LOGIN_NAMESPACE::UserState)
124Q_DECLARE_METATYPE(DTK_LOGIN_NAMESPACE::Inhibitor)
ExecuteStatus
是否可以执行当前动作
Definition dlogintypes.h:48
PowerAction
定义关机键的动作
Definition dlogintypes.h:33
ShutdownType
定义关机类型
Definition dlogintypes.h:15
SessionClass
会话类别
Definition dlogintypes.h:53
InhibitMode
抑制锁的类型
Definition dlogintypes.h:50
InhibitBehavior
定义抑制锁行为
Definition dlogintypes.h:23
UserState
用户状态
Definition dlogintypes.h:54
SessionType
会话类型
Definition dlogintypes.h:52
SessionRole
指定进程对象
Definition dlogintypes.h:49
SessionState
会话状态
Definition dlogintypes.h:51
一个结构数组
Definition dlogintypes.h:57
QString who
Definition dlogintypes.h:59
InhibitMode mode
Definition dlogintypes.h:61
int what
Definition dlogintypes.h:58
quint32 UID
Definition dlogintypes.h:62
quint32 PID
Definition dlogintypes.h:63
QString why
Definition dlogintypes.h:60
定义定时关机所用数据结构
Definition dlogintypes.h:18
QDateTime time
Definition dlogintypes.h:20
ShutdownType type
Definition dlogintypes.h:19