xtd 0.2.0
xtd::forms::power_status Class Reference

Definition

Indicates current system power status information.

Header
#include <xtd/forms/power_status>
Namespace
xtd::forms
Library
xtd.forms
Remarks
The xtd::forms::power_status class represents information about the current AC line power status, battery charging status, and battery charge status.
This class is used by the xtd::forms::system_information::power_status property of the xtd::forms::system_information class to indicate current system power information.

Peorperties

xtd::forms::battery_charge_status battery_charge_status () const noexcept
 Gets the current battery charge status. More...
 
int32 battery_full_life_time () const noexcept
 Gets the reported full charge lifetime of the primary battery power source in seconds. More...
 
float battery_life_percent () const noexcept
 Gets the approximate amount of full battery charge remaining. More...
 
int32 battery_life_remaining () const noexcept
 Gets the approximate number of seconds of battery time remaining. More...
 
xtd::forms::power_line_status power_line_status () const noexcept
 Gets the current system power status. More...
 

Additional Inherited Members

- Public Member Functions inherited from xtd::object
 object ()=default
 Create a new instance of the ultimate base class object. More...
 
bool equals (const object &obj) const noexcept
 Determines whether the specified object is equal to the current object. More...
 
virtual size_t get_hash_code () const noexcept
 Serves as a hash function for a particular type. More...
 
virtual type_object get_type () const noexcept
 Gets the type of the current instance. More...
 
template<typename object_t >
std::unique_ptr< object_t > memberwise_clone () const noexcept
 Creates a shallow copy of the current object. More...
 
virtual xtd::ustring to_string () const noexcept
 Returns a sxd::ustring that represents the current object. More...
 
- Static Public Member Functions inherited from xtd::object
static bool equals (const object &object_a, const object &object_b) noexcept
 Determines whether the specified object instances are considered equal. More...
 
static bool reference_equals (const object &object_a, const object &object_b) noexcept
 Determines whether the specified object instances are the same instance. More...
 

Member Function Documentation

◆ battery_charge_status()

xtd::forms::battery_charge_status xtd::forms::power_status::battery_charge_status ( ) const
noexcept

Gets the current battery charge status.

Returns
One of the xtd::forms::battery_charge_status values indicating the current battery charge level or charging status.
Remarks
This property indicates the current battery charge level or battery charging status.

◆ battery_full_life_time()

int32 xtd::forms::power_status::battery_full_life_time ( ) const
noexcept

Gets the reported full charge lifetime of the primary battery power source in seconds.

Returns
The reported number of seconds of battery life available when the battery is fully charged, or -1 if the battery life is unknown.

◆ battery_life_percent()

float xtd::forms::power_status::battery_life_percent ( ) const
noexcept

Gets the approximate amount of full battery charge remaining.

Returns
The approximate amount, from 0.0 to 1.0, of full battery charge remaining.

◆ battery_life_remaining()

int32 xtd::forms::power_status::battery_life_remaining ( ) const
noexcept

Gets the approximate number of seconds of battery time remaining.

Returns
The approximate number of seconds of battery life remaining, or -1 if the approximate remaining battery life is unknown.

◆ power_line_status()

xtd::forms::power_line_status xtd::forms::power_status::power_line_status ( ) const
noexcept

Gets the current system power status.

Returns
One of the xtd::forms::power_line_status values indicating the current system power status.
Remarks
This property indicates whether the system power is online, or that the system power status is unknown.

The documentation for this class was generated from the following file: