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 FOUNDATION_ACE_INTERFACE_INNERKITS_FORM_RENDERER_DISPATCHER_INTERFACE_H 17 #define FOUNDATION_ACE_INTERFACE_INNERKITS_FORM_RENDERER_DISPATCHER_INTERFACE_H 18 19 #include <ipc_types.h> 20 #include <iremote_broker.h> 21 22 #include "pointer_event.h" 23 24 #include "base/utils/macros.h" 25 #include "interfaces/inner_api/ace/serialized_gesture.h" 26 27 namespace OHOS { 28 namespace Ace { 29 /** 30 * @class IFormRendererDispatcher 31 * IFormRendererDispatcher interface is used to form render dispatcher. 32 */ 33 class ACE_EXPORT IFormRendererDispatcher : public OHOS::IRemoteBroker { 34 public: 35 DECLARE_INTERFACE_DESCRIPTOR(u"ohos.ace.FormRendererDispatcher") 36 37 IFormRendererDispatcher() = default; 38 ~IFormRendererDispatcher() override = default; 39 /** 40 * @brief Dispatcher pointer event. 41 * @param pointerEvent The pointer event info. 42 */ 43 virtual void DispatchPointerEvent( 44 const std::shared_ptr<OHOS::MMI::PointerEvent>& pointerEvent, 45 SerializedGesture& serializedGesture) = 0; 46 /** 47 * @brief Set AllowUpdate. 48 * @param allowUpdate The allowUpdate. 49 */ 50 virtual void SetAllowUpdate(bool allowUpdate) = 0; 51 52 virtual void DispatchSurfaceChangeEvent(float width, float height, float borderWidth = 0.0) = 0; 53 virtual void SetObscured(bool isObscured) = 0; 54 55 virtual void OnAccessibilityChildTreeRegister(uint32_t windowId, int32_t treeId, int64_t accessibilityId) = 0; 56 virtual void OnAccessibilityChildTreeDeregister() = 0; 57 virtual void OnAccessibilityDumpChildInfo( 58 const std::vector<std::string>& params, std::vector<std::string>& info) = 0; 59 virtual void OnAccessibilityTransferHoverEvent(float pointX, float pointY, int32_t sourceType, 60 int32_t eventType, int64_t timeMs) = 0; 61 62 enum Message : uint32_t { 63 DISPATCH_POINTER_EVENT = 1, 64 SET_ALLOW_UPDATE, 65 DISPATCH_SURFACE_CHANGE_EVENT, 66 SET_OBSCURED, 67 ACCESSIBILITY_CHILD_TREE_REGISTER, 68 ACCESSIBILITY_CHILD_TREE_DEREGISTER, 69 ACCESSIBILITY_DUMP_CHILD_INFO, 70 ACCESSIBILITY_TRANSFER_HOVER_EVENT, 71 }; 72 }; 73 } // namespace Ace 74 } // namespace OHOS 75 #endif // FOUNDATION_ACE_INTERFACE_INNERKITS_FORM_RENDERER_DISPATCHER_INTERFACE_H 76