1 /* 2 * Copyright (c) 2021 Huawei Device Co., Ltd. 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15 16 #ifndef BATTERY_SRV_PROXY_H 17 #define BATTERY_SRV_PROXY_H 18 19 #include "ibattery_srv.h" 20 #include "nocopyable.h" 21 #include "iremote_proxy.h" 22 23 namespace OHOS { 24 namespace PowerMgr { 25 class BatterySrvProxy : public IRemoteProxy<IBatterySrv> { 26 public: BatterySrvProxy(const sptr<IRemoteObject> & impl)27 explicit BatterySrvProxy(const sptr<IRemoteObject>& impl) 28 : IRemoteProxy<IBatterySrv>(impl) {} 29 ~BatterySrvProxy() = default; 30 DISALLOW_COPY_AND_MOVE(BatterySrvProxy); 31 32 virtual int32_t GetCapacity() override; 33 virtual BatteryChargeState GetChargingStatus() override; 34 virtual BatteryHealthState GetHealthStatus() override; 35 virtual BatteryPluggedType GetPluggedType() override; 36 virtual int32_t GetVoltage() override; 37 virtual bool GetPresent() override; 38 virtual std::string GetTechnology() override; 39 virtual int32_t GetBatteryTemperature() override; 40 virtual int32_t GetBatteryLevel() override; 41 virtual int64_t GetRemainingChargeTime() override; 42 private: 43 static inline BrokerDelegator<BatterySrvProxy> delegator_; 44 }; 45 } // namespace PowerMgr 46 } // namespace OHOS 47 48 #endif // BATTERY_SRV_PROXY_H 49