78 lines
2.4 KiB
C++
78 lines
2.4 KiB
C++
/*
|
|
* This Source Code Form is subject to the terms of the Mozilla Public
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include "Base/Event.hpp"
|
|
#include <string>
|
|
|
|
namespace OpenVulkano
|
|
{
|
|
struct OsVersion
|
|
{
|
|
int major, minor, patch, build;
|
|
};
|
|
|
|
enum class DeviceType { Phone, Tablet, PC, TV, VR, Unknown };
|
|
|
|
enum class CpuThermalState { Normal, Fair, Serious, Critical };
|
|
|
|
enum class BatteryState { Unavailable, Unplugged, Charging, ChargingFull, NotCharging };
|
|
|
|
enum class DeviceOrientation { Portrait, PortraitUpsideDown, LandscapeLeft, LandscapeRight, FaceUp, FaceDown, Unknown };
|
|
|
|
enum class InterfaceOrientation { Portrait, PortraitUpsideDown, LandscapeLeft, LandscapeRight, Landscape = LandscapeLeft };
|
|
|
|
class SystemInfo
|
|
{
|
|
public:
|
|
static size_t GetSystemRam();
|
|
static size_t GetSystemRamAvailable();
|
|
static size_t GetAppRamMax();
|
|
static size_t GetAppVirtualMemoryMax();
|
|
static size_t GetAppRamAvailable();
|
|
static size_t GetAppRamUsed();
|
|
|
|
static std::string GetUserName();
|
|
static std::string GetHostName();
|
|
|
|
// Device name as given by the user
|
|
static std::string GetDeviceName();
|
|
static std::string GetDeviceVendorName();
|
|
static std::string GetDeviceModelName();
|
|
static std::string GetOsName();
|
|
static OsVersion GetOsVersion();
|
|
static std::string GetOsNameHumanReadable();
|
|
static DeviceType GetDeviceType();
|
|
|
|
static size_t GetCpuCoreCount();
|
|
static size_t GetCpuThreadCount();
|
|
static int32_t GetCpuTemperature();
|
|
static CpuThermalState GetCpuThermalState();
|
|
|
|
static bool IsDeviceInLowPowerMode();
|
|
static bool GetDeviceHasBattery() { return GetDeviceBatteryState() != BatteryState::Unavailable; }
|
|
static BatteryState GetDeviceBatteryState();
|
|
static float GetDeviceBatteryLevel();
|
|
static void EnableEnergyEvents();
|
|
|
|
/**
|
|
* Checks if device allows to run multiple applications at the same time.
|
|
* Will probably return true, for everything but smartphones.
|
|
* @return true if multiple applications can run at the same time, false if not
|
|
*/
|
|
static bool IsMultitaskingSupported();
|
|
static DeviceOrientation GetDeviceOrientation();
|
|
static void EnableDeviceOrientationEvents();
|
|
static InterfaceOrientation GetInterfaceOrientation();
|
|
|
|
static Event<> OnLowPowerModeChanged;
|
|
static Event<> OnBatteryStateChanged;
|
|
static Event<> OnBatteryLevelChanged;
|
|
static Event<> OnDeviceOrientationChanged;
|
|
};
|
|
}
|