1/* 2 * Copyright (c) 2022 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_HDI_LIGHT_V1_0_LIGHTINTERFACESTUB_H 17#define OHOS_HDI_LIGHT_V1_0_LIGHTINTERFACESTUB_H 18 19#include <ipc_object_stub.h> 20#include <message_option.h> 21#include <message_parcel.h> 22#include <object_collector.h> 23#include <refbase.h> 24#include "v1_0/ilight_interface.h" 25 26namespace OHOS { 27namespace HDI { 28namespace Light { 29namespace V1_0 { 30 31using namespace OHOS; 32class LightInterfaceStub : public IPCObjectStub { 33public: 34 explicit LightInterfaceStub(const sptr<ILightInterface> &impl); 35 virtual ~LightInterfaceStub(); 36 37 int32_t OnRemoteRequest(uint32_t code, MessageParcel &data, MessageParcel &reply, MessageOption &option) override; 38 39 static int32_t LightInterfaceStubGetLightInfo_(MessageParcel& lightInterfaceData, MessageParcel& lightInterfaceReply, MessageOption& lightInterfaceOption, sptr<OHOS::HDI::Light::V1_0::ILightInterface> impl); 40 41 static int32_t LightInterfaceStubTurnOnLight_(MessageParcel& lightInterfaceData, MessageParcel& lightInterfaceReply, MessageOption& lightInterfaceOption, sptr<OHOS::HDI::Light::V1_0::ILightInterface> impl); 42 43 static int32_t LightInterfaceStubTurnOnMultiLights_(MessageParcel& lightInterfaceData, MessageParcel& lightInterfaceReply, MessageOption& lightInterfaceOption, sptr<OHOS::HDI::Light::V1_0::ILightInterface> impl); 44 45 static int32_t LightInterfaceStubTurnOffLight_(MessageParcel& lightInterfaceData, MessageParcel& lightInterfaceReply, MessageOption& lightInterfaceOption, sptr<OHOS::HDI::Light::V1_0::ILightInterface> impl); 46 47 static int32_t LightInterfaceStubGetVersion_(MessageParcel& lightInterfaceData, MessageParcel& lightInterfaceReply, MessageOption& lightInterfaceOption, sptr<OHOS::HDI::Light::V1_0::ILightInterface> impl); 48 49private: 50 int32_t LightInterfaceStubGetLightInfo(MessageParcel& lightInterfaceData, MessageParcel& lightInterfaceReply, MessageOption& lightInterfaceOption); 51 52 int32_t LightInterfaceStubTurnOnLight(MessageParcel& lightInterfaceData, MessageParcel& lightInterfaceReply, MessageOption& lightInterfaceOption); 53 54 int32_t LightInterfaceStubTurnOnMultiLights(MessageParcel& lightInterfaceData, MessageParcel& lightInterfaceReply, MessageOption& lightInterfaceOption); 55 56 int32_t LightInterfaceStubTurnOffLight(MessageParcel& lightInterfaceData, MessageParcel& lightInterfaceReply, MessageOption& lightInterfaceOption); 57 58 int32_t LightInterfaceStubGetVersion(MessageParcel& lightInterfaceData, MessageParcel& lightInterfaceReply, MessageOption& lightInterfaceOption); 59 60 61 static inline ObjectDelegator<OHOS::HDI::Light::V1_0::LightInterfaceStub, OHOS::HDI::Light::V1_0::ILightInterface> objDelegator_; 62 sptr<OHOS::HDI::Light::V1_0::ILightInterface> impl_; 63}; 64} // V1_0 65} // Light 66} // HDI 67} // OHOS 68 69#endif // OHOS_HDI_LIGHT_V1_0_LIGHTINTERFACESTUB_H 70 71