1f16e0440Sopenharmony_ci/*
2f16e0440Sopenharmony_ci * Copyright (c) 2022 Huawei Device Co., Ltd.
3f16e0440Sopenharmony_ci * Licensed under the Apache License, Version 2.0 (the "License");
4f16e0440Sopenharmony_ci * you may not use this file except in compliance with the License.
5f16e0440Sopenharmony_ci * You may obtain a copy of the License at
6f16e0440Sopenharmony_ci *
7f16e0440Sopenharmony_ci *     http://www.apache.org/licenses/LICENSE-2.0
8f16e0440Sopenharmony_ci *
9f16e0440Sopenharmony_ci * Unless required by applicable law or agreed to in writing, software
10f16e0440Sopenharmony_ci * distributed under the License is distributed on an "AS IS" BASIS,
11f16e0440Sopenharmony_ci * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12f16e0440Sopenharmony_ci * See the License for the specific language governing permissions and
13f16e0440Sopenharmony_ci * limitations under the License.
14f16e0440Sopenharmony_ci */
15f16e0440Sopenharmony_ci
16f16e0440Sopenharmony_ci#ifndef POWERMGR_BATTERY_MANAGER_BATTERY_LIGHT_H
17f16e0440Sopenharmony_ci#define POWERMGR_BATTERY_MANAGER_BATTERY_LIGHT_H
18f16e0440Sopenharmony_ci
19f16e0440Sopenharmony_ci#include "battery_info.h"
20f16e0440Sopenharmony_ci
21f16e0440Sopenharmony_cinamespace OHOS {
22f16e0440Sopenharmony_cinamespace PowerMgr {
23f16e0440Sopenharmony_ciclass BatteryLight {
24f16e0440Sopenharmony_cipublic:
25f16e0440Sopenharmony_ci    BatteryLight() = default;
26f16e0440Sopenharmony_ci    ~BatteryLight() = default;
27f16e0440Sopenharmony_ci
28f16e0440Sopenharmony_ci    void InitLight();
29f16e0440Sopenharmony_ci    void TurnOff();
30f16e0440Sopenharmony_ci    void TurnOn(uint32_t color = 0);
31f16e0440Sopenharmony_ci    bool UpdateColor(BatteryChargeState chargeState, int32_t capacity);
32f16e0440Sopenharmony_ci    bool isAvailable() const;
33f16e0440Sopenharmony_ci    uint32_t GetLightColor() const;
34f16e0440Sopenharmony_ci
35f16e0440Sopenharmony_ciprivate:
36f16e0440Sopenharmony_ci    bool available_ {false};
37f16e0440Sopenharmony_ci#ifdef HAS_SENSORS_MISCDEVICE_PART
38f16e0440Sopenharmony_ci    int32_t lightId_ {-1};
39f16e0440Sopenharmony_ci#endif
40f16e0440Sopenharmony_ci    uint32_t lightColor_ {0};
41f16e0440Sopenharmony_ci};
42f16e0440Sopenharmony_ci} // namespace PowerMgr
43f16e0440Sopenharmony_ci} // namespace OHOS
44f16e0440Sopenharmony_ci#endif // POWERMGR_BATTERY_MANAGER_BATTERY_LIGHT_H
45