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_SESSION_WINDOW_EVENT_CHANNEL_INTERFACE_H 17 #define OHOS_WINDOW_SCENE_SESSION_WINDOW_EVENT_CHANNEL_INTERFACE_H 18 19 #include <iremote_broker.h> 20 #include <list> 21 #include <map> 22 23 #include "interfaces/include/ws_common.h" 24 25 namespace OHOS::MMI { 26 class PointerEvent; 27 class KeyEvent; 28 class AxisEvent; 29 } // namespace OHOS::MMI 30 namespace OHOS::Accessibility { 31 class AccessibilityElementInfo; 32 } 33 namespace OHOS::Rosen { 34 class IWindowEventChannel : public IRemoteBroker { 35 public: 36 DECLARE_INTERFACE_DESCRIPTOR(u"OHOS.IWindowEventChannel"); 37 38 virtual WSError TransferKeyEvent(const std::shared_ptr<MMI::KeyEvent>& keyEvent) = 0; 39 virtual WSError TransferPointerEvent(const std::shared_ptr<MMI::PointerEvent>& pointerEvent) = 0; 40 41 // transfer sync key event for weather consumed 42 virtual WSError TransferBackpressedEventForConsumed(bool& isConsumed) = 0; 43 virtual WSError TransferKeyEventForConsumed(const std::shared_ptr<MMI::KeyEvent>& keyEvent, bool& isConsumed) = 0; 44 virtual WSError TransferFocusActiveEvent(bool isFocusActive) = 0; 45 virtual WSError TransferFocusState(bool focusState) = 0; 46 virtual WSError TransferSearchElementInfo(int64_t elementId, int32_t mode, int64_t baseParent, 47 std::list<Accessibility::AccessibilityElementInfo>& infos) = 0; 48 virtual WSError TransferSearchElementInfosByText(int64_t elementId, const std::string& text, int64_t baseParent, 49 std::list<Accessibility::AccessibilityElementInfo>& infos) = 0; 50 virtual WSError TransferFindFocusedElementInfo(int64_t elementId, int32_t focusType, int64_t baseParent, 51 Accessibility::AccessibilityElementInfo& info) = 0; 52 virtual WSError TransferFocusMoveSearch(int64_t elementId, int32_t direction, int64_t baseParent, 53 Accessibility::AccessibilityElementInfo& info) = 0; 54 virtual WSError TransferExecuteAction(int64_t elementId, const std::map<std::string, std::string>& actionArguments, 55 int32_t action, int64_t baseParent) = 0; 56 }; 57 } // namespace OHOS::Rosen 58 #endif // OHOS_WINDOW_SCENE_SESSION_WINDOW_EVENT_CHANNEL_INTERFACE_H 59