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_MOTION_V1_0_MOTIONCALLBACKSTUB_H
17#define OHOS_HDI_MOTION_V1_0_MOTIONCALLBACKSTUB_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/imotion_callback.h"
25
26namespace OHOS {
27namespace HDI {
28namespace Motion {
29namespace V1_0 {
30
31using namespace OHOS;
32class MotionCallbackStub : public IPCObjectStub {
33public:
34    explicit MotionCallbackStub(const sptr<IMotionCallback> &impl);
35    virtual ~MotionCallbackStub();
36
37    int32_t OnRemoteRequest(uint32_t code, MessageParcel &data, MessageParcel &reply, MessageOption &option) override;
38
39    static int32_t MotionCallbackStubOnDataEvent_(MessageParcel& motionCallbackData, MessageParcel& motionCallbackReply, MessageOption& motionCallbackOption, sptr<OHOS::HDI::Motion::V1_0::IMotionCallback> impl);
40
41    static int32_t MotionCallbackStubGetVersion_(MessageParcel& motionCallbackData, MessageParcel& motionCallbackReply, MessageOption& motionCallbackOption, sptr<OHOS::HDI::Motion::V1_0::IMotionCallback> impl);
42
43private:
44    int32_t MotionCallbackStubOnDataEvent(MessageParcel& motionCallbackData, MessageParcel& motionCallbackReply, MessageOption& motionCallbackOption);
45
46    int32_t MotionCallbackStubGetVersion(MessageParcel& motionCallbackData, MessageParcel& motionCallbackReply, MessageOption& motionCallbackOption);
47
48
49    static inline ObjectDelegator<OHOS::HDI::Motion::V1_0::MotionCallbackStub, OHOS::HDI::Motion::V1_0::IMotionCallback> objDelegator_;
50    sptr<OHOS::HDI::Motion::V1_0::IMotionCallback> impl_;
51};
52} // V1_0
53} // Motion
54} // HDI
55} // OHOS
56
57#endif // OHOS_HDI_MOTION_V1_0_MOTIONCALLBACKSTUB_H
58
59