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