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::Rosen { 28 class RSTransaction; 29 } 30 namespace OHOS { 31 namespace Ace { 32 /** 33 * @class IFormRendererDispatcher 34 * IFormRendererDispatcher interface is used to form render dispatcher. 35 */ 36 class ACE_EXPORT IFormRendererDispatcher : public OHOS::IRemoteBroker { 37 public: 38 DECLARE_INTERFACE_DESCRIPTOR(u"ohos.ace.FormRendererDispatcher") 39 40 IFormRendererDispatcher() = default; 41 ~IFormRendererDispatcher() override = default; 42 /** 43 * @brief Dispatcher pointer event. 44 * @param pointerEvent The pointer event info. 45 */ 46 virtual void DispatchPointerEvent( 47 const std::shared_ptr<OHOS::MMI::PointerEvent>& pointerEvent, 48 SerializedGesture& serializedGesture) = 0; 49 /** 50 * @brief Set AllowUpdate. 51 * @param allowUpdate The allowUpdate. 52 */ 53 virtual void SetAllowUpdate(bool allowUpdate) = 0; 54 virtual void SetMultiInstanceEnabled(bool isMultiInstanceEnabled) = 0; 55 56 virtual void DispatchSurfaceChangeEvent(float width, float height, uint32_t reason = 0, 57 const std::shared_ptr<Rosen::RSTransaction>& rsTransaction = nullptr, float borderWidth = 0.0) = 0; 58 virtual void SetObscured(bool isObscured) = 0; 59 60 virtual void OnAccessibilityChildTreeRegister(uint32_t windowId, int32_t treeId, int64_t accessibilityId) = 0; 61 virtual void OnAccessibilityChildTreeDeregister() = 0; 62 virtual void OnAccessibilityDumpChildInfo( 63 const std::vector<std::string>& params, std::vector<std::string>& info) = 0; 64 virtual void OnAccessibilityTransferHoverEvent(float pointX, float pointY, int32_t sourceType, 65 int32_t eventType, int64_t timeMs) = 0; 66 virtual void OnNotifyDumpInfo(const std::vector<std::string>& params, std::vector<std::string>& info) = 0; 67 68 enum Message : uint32_t { 69 DISPATCH_POINTER_EVENT = 1, 70 SET_ALLOW_UPDATE, 71 DISPATCH_SURFACE_CHANGE_EVENT, 72 SET_OBSCURED, 73 ACCESSIBILITY_CHILD_TREE_REGISTER, 74 ACCESSIBILITY_CHILD_TREE_DEREGISTER, 75 ACCESSIBILITY_DUMP_CHILD_INFO, 76 ACCESSIBILITY_TRANSFER_HOVER_EVENT, 77 NOTIFY_DUMP_INFO, 78 SET_MULTI_INSTANCE_ENABLED 79 }; 80 }; 81 } // namespace Ace 82 } // namespace OHOS 83 #endif // FOUNDATION_ACE_INTERFACE_INNERKITS_FORM_RENDERER_DISPATCHER_INTERFACE_H 84