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_PROXY_H 17 #define FOUNDATION_EVENT_CESFWK_INNERKITS_INCLUDE_EVENT_RECEIVE_PROXY_H 18 19 #include "common_event_data.h" 20 #include "common_event_service_ipc_interface_code.h" 21 #include "ievent_receive.h" 22 #include "iremote_proxy.h" 23 24 namespace OHOS { 25 namespace EventFwk { 26 class EventReceiveProxy : public IRemoteProxy<IEventReceive> { 27 public: 28 /** 29 * Constructor. 30 * 31 * @param object Indicates the remote object. 32 */ 33 explicit EventReceiveProxy(const sptr<IRemoteObject> &object); 34 35 virtual ~EventReceiveProxy() override; 36 37 /** 38 * Notifies event. 39 * 40 * @param commonEventData Indicates the common event data. 41 * @param ordered Indicates whether it is an ordered common event. 42 * @param sticky Indicates whether it is a sticky common event. 43 * 44 */ 45 virtual void NotifyEvent(const CommonEventData &commonEventData, const bool &ordered, const bool &sticky) override; 46 47 private: 48 static inline BrokerDelegator<EventReceiveProxy> delegator_; 49 }; 50 } // namespace EventFwk 51 } // namespace OHOS 52 53 #endif // FOUNDATION_EVENT_CESFWK_INNERKITS_INCLUDE_EVENT_RECEIVE_PROXY_H