1/*
2 * Copyright (c) 2023 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_MOTION_V1_1_MOTIONINTERFACESTUB_H
17#define OHOS_HDI_MOTION_V1_1_MOTIONINTERFACESTUB_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/motion_interface_stub.h"
25#include "v1_1/imotion_interface.h"
26
27namespace OHOS {
28namespace HDI {
29namespace Motion {
30namespace V1_1 {
31
32using namespace OHOS;
33class MotionInterfaceStub : public IPCObjectStub {
34public:
35    explicit MotionInterfaceStub(const sptr<IMotionInterface> &impl);
36    virtual ~MotionInterfaceStub();
37
38    int32_t OnRemoteRequest(uint32_t code, MessageParcel &data, MessageParcel &reply, MessageOption &option) override;
39
40    static int32_t MotionInterfaceStubSetMotionConfig_(MessageParcel& motionInterfaceData, MessageParcel& motionInterfaceReply, MessageOption& motionInterfaceOption, sptr<OHOS::HDI::Motion::V1_1::IMotionInterface> impl);
41
42private:
43    int32_t MotionInterfaceStubSetMotionConfig(MessageParcel& motionInterfaceData, MessageParcel& motionInterfaceReply, MessageOption& motionInterfaceOption);
44
45    int32_t MotionInterfaceStubEnableMotion(MessageParcel& motionInterfaceData, MessageParcel& motionInterfaceReply, MessageOption& motionInterfaceOption);
46
47    int32_t MotionInterfaceStubDisableMotion(MessageParcel& motionInterfaceData, MessageParcel& motionInterfaceReply, MessageOption& motionInterfaceOption);
48
49    int32_t MotionInterfaceStubRegister(MessageParcel& motionInterfaceData, MessageParcel& motionInterfaceReply, MessageOption& motionInterfaceOption);
50
51    int32_t MotionInterfaceStubUnregister(MessageParcel& motionInterfaceData, MessageParcel& motionInterfaceReply, MessageOption& motionInterfaceOption);
52
53    int32_t MotionInterfaceStubGetVersion(MessageParcel& motionInterfaceData, MessageParcel& motionInterfaceReply, MessageOption& motionInterfaceOption);
54
55
56    static inline ObjectDelegator<OHOS::HDI::Motion::V1_1::MotionInterfaceStub, OHOS::HDI::Motion::V1_1::IMotionInterface> objDelegator_;
57    sptr<OHOS::HDI::Motion::V1_1::IMotionInterface> impl_;
58};
59} // V1_1
60} // Motion
61} // HDI
62} // OHOS
63
64#endif // OHOS_HDI_MOTION_V1_1_MOTIONINTERFACESTUB_H
65
66