Symbian platform (C++)
SDK native APIs, runtime and tooling
Loading...
Searching...
No Matches
power.h
Go to the documentation of this file.
1
// Copyright 2026 The Symbian SDK Authors.
2
// Licensed under the Apache License, Version 2.0.
3
4
#ifndef SYMBIAN_API_POWER_POWER_H_
5
#define SYMBIAN_API_POWER_POWER_H_
6
7
#include <optional>
8
9
#include "absl/status/statusor.h"
10
11
namespace
symbian::api::power
{
12
13
// The platform's qualitative battery state. This is not a charge percentage.
14
enum class
BatteryCondition
{
kEmpty
,
kReplace
,
kLow
,
kGood
};
15
16
// A point-in-time collection of independently supported power observations.
17
struct
PowerSnapshot
{
18
// Whether the platform reports sufficient power to continue operating.
19
std::optional<bool>
power_good
;
20
// Whether an external supply is in use; charging is not implied.
21
std::optional<bool>
external_power
;
22
// Main battery's qualitative state, if the platform exposes it.
23
std::optional<BatteryCondition>
battery
;
24
};
25
26
// Reads supported native power attributes. Unsupported fields remain empty.
27
// Returns a status if no attribute can be read. This is a synchronous query;
28
// schedule it on a worker when the event thread must stay bounded-fast.
29
absl::StatusOr<PowerSnapshot>
ReadPowerSnapshot
();
30
31
}
// namespace symbian::api::power
32
33
#endif
// SYMBIAN_API_POWER_POWER_H_
symbian::api::power
Definition
power.h:11
symbian::api::power::ReadPowerSnapshot
absl::StatusOr< PowerSnapshot > ReadPowerSnapshot()
Definition
power.cc:11
symbian::api::power::BatteryCondition
BatteryCondition
Definition
power.h:14
symbian::api::power::BatteryCondition::kGood
@ kGood
symbian::api::power::BatteryCondition::kEmpty
@ kEmpty
symbian::api::power::BatteryCondition::kReplace
@ kReplace
symbian::api::power::BatteryCondition::kLow
@ kLow
symbian::api::power::PowerSnapshot
Definition
power.h:17
symbian::api::power::PowerSnapshot::power_good
std::optional< bool > power_good
Definition
power.h:19
symbian::api::power::PowerSnapshot::battery
std::optional< BatteryCondition > battery
Definition
power.h:23
symbian::api::power::PowerSnapshot::external_power
std::optional< bool > external_power
Definition
power.h:21
cpp
symbian
api
include
symbian
api
power
power.h
Generated by
1.9.8