11 #include "InfoLoader.h" 12 #include "settings/ISubSettings.h" 16 #define KB (1024) // 1 KiloByte (1KB) 1024 Byte (2^10 Byte) 17 #define MB (1024*KB) // 1 MegaByte (1MB) 1024 KB (2^10 KB) 18 #define GB (1024*MB) // 1 GigaByte (1GB) 1024 MB (2^10 MB) 19 #define TB (1024*GB) // 1 TerraByte (1TB) 1024 GB (2^10 GB) 21 #define MAX_KNOWN_ATTRIBUTES 46 23 #define REG_CURRENT_VERSION L"Software\\Microsoft\\Windows NT\\CurrentVersion" 29 enum INTERNET_STATE { UNKNOWN, CONNECTED, DISCONNECTED };
37 internetState = UNKNOWN;
40 std::string systemUptime;
41 std::string systemTotalUptime;
42 INTERNET_STATE internetState;
43 std::string videoEncoder;
44 std::string cpuFrequency;
45 std::string osVersionInfo;
46 std::string macAddress;
47 std::string batteryLevel;
55 bool DoWork()
override;
58 static CSysData::INTERNET_STATE GetInternetState();
60 static bool SystemUpTime(
int iInputMinutes,
int &iMinutes,
int &iHours,
int &iDays);
61 static std::string GetSystemUpTime(
bool bTotalUptime);
62 static std::string GetMACAddress();
63 static std::string GetVideoEncoder();
64 static std::string GetBatteryLevel();
74 WindowsVersionUnknown = -1,
77 WindowsVersionWin10_1709,
78 WindowsVersionWin10_1803,
79 WindowsVersionWin10_1809,
80 WindowsVersionWin10_1903,
81 WindowsVersionWin10_1909,
82 WindowsVersionWin10_2004,
83 WindowsVersionWin10_Future,
86 WindowsVersionFuture = 100
88 enum WindowsDeviceFamily
101 bool Load(
const TiXmlNode *
settings)
override;
102 bool Save(TiXmlNode *settings)
const override;
104 char MD5_Sign[32 + 1];
106 static const std::string& GetAppName(
void);
108 static std::string GetKernelName(
bool emptyIfUnknown =
false);
109 static std::string GetKernelVersionFull(
void);
110 static std::string GetKernelVersion(
void);
111 static std::string GetOsName(
bool emptyIfUnknown =
false);
112 static std::string GetOsVersion(
void);
113 static std::string GetOsPrettyNameWithVersion(
void);
114 static std::string GetUserAgent();
115 static std::string GetDeviceName();
116 static std::string GetVersion();
117 static std::string GetVersionShort();
118 static std::string GetVersionCode();
119 static std::string GetVersionGit();
120 static std::string GetBuildDate();
123 bool IsAeroDisabled();
124 static bool IsWindowsVersion(WindowsVersion ver);
125 static bool IsWindowsVersionAtLeast(WindowsVersion ver);
126 static WindowsVersion GetWindowsVersion();
127 static int GetKernelBitness(
void);
128 static int GetXbmcBitness(
void);
129 static const std::string& GetKernelCpuFamily(
void);
130 static std::string GetManufacturerName(
void);
131 static std::string GetModelName(
void);
132 bool GetDiskSpace(std::string drive,
int& iTotal,
int& iTotalFree,
int& iTotalUsed,
int& iPercentFree,
int& iPercentUsed);
133 std::string GetHddSpaceInfo(
int& percent,
int drive,
bool shortText=
false);
134 std::string GetHddSpaceInfo(
int drive,
bool shortText=
false);
136 int GetTotalUptime()
const {
return m_iSystemTimeTotalUp; }
137 void SetTotalUptime(
int uptime) { m_iSystemTimeTotalUp = uptime; }
139 static std::string GetBuildTargetPlatformName(
void);
140 static std::string GetBuildTargetPlatformVersion(
void);
141 static std::string GetBuildTargetPlatformVersionDecoded(
void);
142 static std::string GetBuildTargetCpuFamily(
void);
144 static std::string GetUsedCompilerNameAndVer(
void);
145 std::string GetPrivacyPolicy();
147 static WindowsDeviceFamily GetWindowsDeviceFamily();
150 CJob *GetJob()
const override;
151 std::string TranslateInfo(
int info)
const override;
152 void OnJobComplete(
unsigned int jobID,
bool success,
CJob *job)
override;
156 std::string m_privacyPolicy;
157 static WindowsVersion m_WinVer;
158 int m_iSystemTimeTotalUp;
Base class for jobs that are executed asynchronously.
Definition: Job.h:109
Definition: InfoLoader.h:15
Definition: SystemInfo.h:50
Definition: SystemInfo.h:69
Definition: SystemInfo.h:26
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