11 #include "InfoLoader.h" 12 #include "settings/ISubSettings.h" 13 #include "utils/Job.h" 18 #define KB (1024) // 1 KiloByte (1KB) 1024 Byte (2^10 Byte) 19 #define MB (1024*KB) // 1 MegaByte (1MB) 1024 KB (2^10 KB) 20 #define GB (1024*MB) // 1 GigaByte (1GB) 1024 MB (2^10 MB) 21 #define TB (1024*GB) // 1 TerraByte (1TB) 1024 GB (2^10 GB) 23 #define MAX_KNOWN_ATTRIBUTES 46 25 #define REG_CURRENT_VERSION L"Software\\Microsoft\\Windows NT\\CurrentVersion" 31 enum INTERNET_STATE { UNKNOWN, CONNECTED, DISCONNECTED };
39 internetState = UNKNOWN;
42 std::string systemUptime;
43 std::string systemTotalUptime;
44 INTERNET_STATE internetState;
45 std::string videoEncoder;
46 std::string cpuFrequency;
47 std::string osVersionInfo;
48 std::string macAddress;
49 std::string ipAddress;
51 std::string gatewayAddress;
52 std::string networkLinkState;
53 std::vector<std::string> dnsServers;
54 std::string batteryLevel;
62 bool DoWork()
override;
65 static CSysData::INTERNET_STATE GetInternetState();
67 static bool SystemUpTime(
int iInputMinutes,
int &iMinutes,
int &iHours,
int &iDays);
68 static std::string GetSystemUpTime(
bool bTotalUptime);
69 static std::string GetMACAddress();
70 static std::string GetIPAddress();
71 static std::string GetNetMask();
72 static std::string GetGatewayAddress();
73 static std::string GetNetworkLinkState();
74 static std::string GetVideoEncoder();
75 static std::string GetBatteryLevel();
76 static std::vector<std::string> GetDNSServers();
87 WindowsVersionUnknown = -1,
90 WindowsVersionWin10_1607,
91 WindowsVersionWin10_1703,
92 WindowsVersionWin10_1709,
93 WindowsVersionWin10_1803,
94 WindowsVersionWin10_1809,
95 WindowsVersionWin10_1903,
96 WindowsVersionWin10_1909,
97 WindowsVersionWin10_2004,
98 WindowsVersionWin10_20H2,
99 WindowsVersionWin10_21H1,
100 WindowsVersionWin10_21H2,
101 WindowsVersionWin10_22H2,
102 WindowsVersionWin10_Future,
103 WindowsVersionWin11_21H2,
104 WindowsVersionWin11_22H2,
105 WindowsVersionWin11_Future,
107 WindowsVersionFuture = 100
110 enum WindowsDeviceFamily
123 bool Load(
const TiXmlNode *
settings)
override;
124 bool Save(TiXmlNode *settings)
const override;
126 char MD5_Sign[32 + 1];
128 static const std::string& GetAppName(
void);
130 static std::string GetKernelName(
bool emptyIfUnknown =
false);
131 static std::string GetKernelVersionFull(
void);
132 static std::string GetKernelVersion(
void);
133 static std::string GetOsName(
bool emptyIfUnknown =
false);
134 static std::string GetOsVersion(
void);
135 static std::string GetOsPrettyNameWithVersion(
void);
136 static std::string GetUserAgent();
137 static std::string GetDeviceName();
138 static std::string GetVersion();
139 static std::string GetVersionShort();
140 static std::string GetVersionCode();
141 static std::string GetVersionGit();
142 static std::string GetBuildDate();
145 bool IsAeroDisabled();
146 static bool IsWindowsVersion(WindowsVersion ver);
147 static bool IsWindowsVersionAtLeast(WindowsVersion ver);
148 static WindowsVersion GetWindowsVersion();
149 static int GetKernelBitness(
void);
150 static int GetXbmcBitness(
void);
151 static const std::string& GetKernelCpuFamily(
void);
152 static std::string GetManufacturerName(
void);
153 static std::string GetModelName(
void);
154 bool GetDiskSpace(std::string drive,
int& iTotal,
int& iTotalFree,
int& iTotalUsed,
int& iPercentFree,
int& iPercentUsed);
155 std::string GetHddSpaceInfo(
int& percent,
int drive,
bool shortText=
false);
156 std::string GetHddSpaceInfo(
int drive,
bool shortText=
false);
158 int GetTotalUptime()
const {
return m_iSystemTimeTotalUp; }
159 void SetTotalUptime(
int uptime) { m_iSystemTimeTotalUp = uptime; }
161 static std::string GetBuildTargetPlatformName(
void);
162 static std::string GetBuildTargetPlatformVersion(
void);
163 static std::string GetBuildTargetPlatformVersionDecoded(
void);
164 static std::string GetBuildTargetCpuFamily(
void);
166 static std::string GetUsedCompilerNameAndVer(
void);
167 std::string GetPrivacyPolicy();
169 static WindowsDeviceFamily GetWindowsDeviceFamily();
172 CJob *GetJob()
const override;
173 std::string TranslateInfo(
int info)
const override;
174 void OnJobComplete(
unsigned int jobID,
bool success,
CJob *job)
override;
178 std::string m_privacyPolicy;
179 static WindowsVersion m_WinVer;
180 int m_iSystemTimeTotalUp;
Base class for jobs that are executed asynchronously.
Definition: Job.h:109
Definition: InfoLoader.h:15
Definition: SystemInfo.h:57
Definition: SystemInfo.h:81
Definition: SystemInfo.h:28
Definition: settings.py:1
Interface defining methods to load additional setting values from an XML file being loaded by the set...
Definition: ISubSettings.h:18