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 THERMAL_SRV_PROXY_H 17 #define THERMAL_SRV_PROXY_H 18 19 #include "iremote_broker.h" 20 #include "iremote_object.h" 21 #include "iremote_proxy.h" 22 #include "ithermal_action_callback.h" 23 #include "ithermal_level_callback.h" 24 #include "ithermal_srv.h" 25 #include "nocopyable.h" 26 #include "refbase.h" 27 #include "thermal_level_info.h" 28 #include "thermal_srv_sensor_info.h" 29 #include <cstdint> 30 #include <functional> 31 #include <iosfwd> 32 #include <vector> 33 34 namespace OHOS { 35 namespace PowerMgr { 36 class ThermalSrvProxy : public IRemoteProxy<IThermalSrv> { 37 public: ThermalSrvProxy(const sptr<IRemoteObject> & impl)38 explicit ThermalSrvProxy(const sptr<IRemoteObject>& impl) : IRemoteProxy<IThermalSrv>(impl) {} 39 ~ThermalSrvProxy() = default; 40 DISALLOW_COPY_AND_MOVE(ThermalSrvProxy); 41 42 virtual bool SubscribeThermalTempCallback( 43 const std::vector<std::string>& typeList, const sptr<IThermalTempCallback>& callback) override; 44 virtual bool UnSubscribeThermalTempCallback(const sptr<IThermalTempCallback>& callback) override; 45 virtual bool SubscribeThermalLevelCallback(const sptr<IThermalLevelCallback>& callback) override; 46 virtual bool UnSubscribeThermalLevelCallback(const sptr<IThermalLevelCallback>& callback) override; 47 virtual bool SubscribeThermalActionCallback(const std::vector<std::string>& actionList, const std::string& desc, 48 const sptr<IThermalActionCallback>& callback) override; 49 virtual bool UnSubscribeThermalActionCallback(const sptr<IThermalActionCallback>& callback) override; 50 virtual bool GetThermalSrvSensorInfo(const SensorType& type, ThermalSrvSensorInfo& sensorInfo) override; 51 virtual bool GetThermalLevel(ThermalLevel& level) override; 52 virtual bool GetThermalInfo() override; 53 virtual bool SetScene(const std::string& scene) override; 54 virtual std::string ShellDump(const std::vector<std::string>& args, uint32_t argc) override; 55 56 private: 57 static inline BrokerDelegator<ThermalSrvProxy> delegator_; 58 }; 59 } // namespace PowerMgr 60 } // namespace OHOS 61 #endif // THERMAL_SRV_PROXY_H 62