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_WINDOW_SCENE_WINDOW_EVENT_CHANNEL_RPOXY_H 17 #define OHOS_WINDOW_SCENE_WINDOW_EVENT_CHANNEL_RPOXY_H 18 19 #include <iremote_proxy.h> 20 #include <list> 21 #include <map> 22 23 #include "accessibility_element_info.h" 24 #include "interfaces/include/ws_common.h" 25 #include "window_event_channel_interface.h" 26 27 namespace OHOS::Rosen { 28 class WindowEventChannelProxy : public IRemoteProxy<IWindowEventChannel> { 29 public: WindowEventChannelProxy(const sptr<IRemoteObject> & impl)30 explicit WindowEventChannelProxy(const sptr<IRemoteObject>& impl) : IRemoteProxy<IWindowEventChannel>(impl) {}; 31 ~WindowEventChannelProxy()32 ~WindowEventChannelProxy() {}; 33 34 WSError TransferBackpressedEventForConsumed(bool& isConsumed) override; 35 WSError TransferKeyEvent(const std::shared_ptr<MMI::KeyEvent>& keyEvent) override; 36 WSError TransferPointerEvent(const std::shared_ptr<MMI::PointerEvent>& pointerEvent) override; 37 WSError TransferKeyEventForConsumed(const std::shared_ptr<MMI::KeyEvent>& keyEvent, bool& isConsumed, 38 bool isPreImeEvent = false) override; 39 WSError TransferKeyEventForConsumedAsync(const std::shared_ptr<MMI::KeyEvent>& keyEvent, bool isPreImeEvent, 40 const sptr<IRemoteObject>& listener) override; 41 WSError TransferFocusActiveEvent(bool isFocusActive) override; 42 WSError TransferFocusState(bool focusState) override; 43 WSError TransferAccessibilityHoverEvent(float pointX, float pointY, int32_t sourceType, int32_t eventType, 44 int64_t timeMs) override; 45 WSError TransferAccessibilityChildTreeRegister( 46 uint32_t windowId, int32_t treeId, int64_t accessibilityId) override; 47 WSError TransferAccessibilityChildTreeUnregister() override; 48 WSError TransferAccessibilityDumpChildInfo( 49 const std::vector<std::string>& params, std::vector<std::string>& info) override; 50 private: 51 static inline BrokerDelegator<WindowEventChannelProxy> delegator_; 52 }; 53 } // namespace OHOS::Rosen 54 #endif // OHOS_WINDOW_SCENE_WINDOW_EVENT_CHANNEL_RPOXY_H 55 56