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