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 OHOS_CAMERA_HCAMERA_SERVICE_CALLBACK_PROXY_H 17 #define OHOS_CAMERA_HCAMERA_SERVICE_CALLBACK_PROXY_H 18 #define EXPORT_API __attribute__((visibility("default"))) 19 20 #include "iremote_proxy.h" 21 #include "icamera_service_callback.h" 22 23 namespace OHOS { 24 namespace CameraStandard { 25 class EXPORT_API HCameraServiceCallbackProxy : public IRemoteProxy<ICameraServiceCallback> { 26 public: 27 explicit HCameraServiceCallbackProxy(const sptr<IRemoteObject> &impl); 28 virtual ~HCameraServiceCallbackProxy() = default; 29 30 int32_t OnCameraStatusChanged(const std::string& cameraId, const CameraStatus status, 31 const std::string& bundleName) override; 32 int32_t OnFlashlightStatusChanged(const std::string& cameraId, const FlashStatus status) override; 33 34 private: 35 static inline BrokerDelegator<HCameraServiceCallbackProxy> delegator_; 36 }; 37 38 class EXPORT_API HCameraMuteServiceCallbackProxy : public IRemoteProxy<ICameraMuteServiceCallback> { 39 public: 40 explicit HCameraMuteServiceCallbackProxy(const sptr<IRemoteObject> &impl); 41 virtual ~HCameraMuteServiceCallbackProxy() = default; 42 43 int32_t OnCameraMute(bool muteMode) override; 44 private: 45 static inline BrokerDelegator<HCameraMuteServiceCallbackProxy> delegator_; 46 }; 47 48 class EXPORT_API HTorchServiceCallbackProxy : public IRemoteProxy<ITorchServiceCallback> { 49 public: 50 explicit HTorchServiceCallbackProxy(const sptr<IRemoteObject> &impl); 51 virtual ~HTorchServiceCallbackProxy() = default; 52 53 int32_t OnTorchStatusChange(const TorchStatus torchStatus) override; 54 private: 55 static inline BrokerDelegator<HTorchServiceCallbackProxy> delegator_; 56 }; 57 58 class EXPORT_API HFoldServiceCallbackProxy : public IRemoteProxy<IFoldServiceCallback> { 59 public: 60 explicit HFoldServiceCallbackProxy(const sptr<IRemoteObject> &impl); 61 virtual ~HFoldServiceCallbackProxy() = default; 62 63 int32_t OnFoldStatusChanged(const FoldStatus foldStatus) override; 64 private: 65 static inline BrokerDelegator<HFoldServiceCallbackProxy> delegator_; 66 }; 67 } // namespace CameraStandard 68 } // namespace OHOS 69 #endif // OHOS_CAMERA_HCAMERA_SERVICE_CALLBACK_PROXY_H 70 71