-
Notifications
You must be signed in to change notification settings - Fork 0
/
shutdownpara.h
92 lines (63 loc) · 1.73 KB
/
shutdownpara.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
#ifndef SHUTDOWNPARA_H
#define SHUTDOWNPARA_H
#include <QString>
#include <QHostInfo>
#include <windows.h>
#include <QObject>
#include <QJsonDocument>
#include <QJsonObject>
#include <QJsonArray>
enum SHUTDOWN_TYPE : unsigned int {NONE, SHUTDOWN, RESTART, SLEEP, HIBERNATE,
LOCK, LOGOUT, SHUTDOWN_P, CANCEL};
enum REASON_TYPE {PLANNED, UNPLANNED, CUSTOM, NOREASON};
class ShutdownPara : public QObject
{
Q_OBJECT
private:
public:
//模式
SHUTDOWN_TYPE shutdownType;
//计算机
// bool bMultiMachine;
QList<QString> computer;
//参数:
bool bForce;
bool bTimeout;
int iTimeout;
bool bToFirmware;
bool bFastBoot;
bool bToAdvancedOpt;
bool bAutoLogin;
bool bComment;
QString sComment;
bool bReason;
REASON_TYPE reasonType;
std::uint8_t majorReason;
std::uint16_t minorReason;
QString condition;
ShutdownPara();
ShutdownPara(const ShutdownPara& p);
TCHAR* getMachineName(int i);
TCHAR* getMesssage();
DWORD getTimeout();
DWORD getFlags();
DWORD getReason();
DWORD getComputerListlength();
void addMachine(QString n);
void removeMachine(QString n);
void set(const ShutdownPara *x);
QJsonObject toJsonObject(QString name) const;
QString fromJsonObject(const QJsonObject& obj);
signals:
void machineListChanged(QList<QString>);
public slots:
void updateMachineList(QList<QString> x){
//QList深拷贝
this->computer.clear();
for(int i=0;i<x.length();i++)
{
this->computer.append(x[i]);
}
}
};
#endif // SHUTDOWNPARA_H