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 FOUNDATION_EVENT_CESFWK_INNERKITS_INCLUDE_EVENT_RECEIVE_STUB_H
17 #define FOUNDATION_EVENT_CESFWK_INNERKITS_INCLUDE_EVENT_RECEIVE_STUB_H
18 
19 #include <mutex>
20 
21 #include "common_event_service_ipc_interface_code.h"
22 #include "ievent_receive.h"
23 #include "iremote_stub.h"
24 
25 namespace OHOS {
26 namespace EventFwk {
27 class EventReceiveStub : public IRemoteStub<IEventReceive> {
28 public:
29     EventReceiveStub();
30 
31     virtual ~EventReceiveStub() override;
32 
33     /**
34      * Processes the remote Request.
35      *
36      * @param code Indicates the code to send.
37      * @param data Indicates the message to send.
38      * @param reply Indicates the message to reply.
39      * @param option Indicates the message option.
40      * @return Returns ERR_NONE if success, otherwise ERR_CODE.
41      */
42     virtual int OnRemoteRequest(
43         uint32_t code, MessageParcel &data, MessageParcel &reply, MessageOption &option) override;
44 
45 private:
46     static std::mutex mutex_;
47 };
48 }  // namespace EventFwk
49 }  // namespace OHOS
50 
51 #endif  // FOUNDATION_EVENT_CESFWK_INNERKITS_INCLUDE_EVENT_RECEIVE_STUB_H
52