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_PROXY_H 17 #define FOUNDATION_ACE_INTERFACE_INNERKITS_FORM_RENDERER_DISPATCHER_PROXY_H 18 19 #include "form_renderer_dispatcher_interface.h" 20 #include "iremote_proxy.h" 21 #include <transaction/rs_transaction.h> 22 23 #include "base/utils/macros.h" 24 25 namespace OHOS { 26 namespace Ace { 27 /** 28 * @class FormRendererDispatcherProxy 29 * FormRendererDispatcherProxy is used to access form render dispatcher. 30 */ 31 class ACE_EXPORT FormRendererDispatcherProxy : public IRemoteProxy<IFormRendererDispatcher> { 32 public: 33 explicit FormRendererDispatcherProxy(const sptr<IRemoteObject>& impl); 34 virtual ~FormRendererDispatcherProxy() = default; 35 36 void DispatchPointerEvent( 37 const std::shared_ptr<OHOS::MMI::PointerEvent>& pointerEvent, 38 SerializedGesture& serializedGesture) override; 39 40 void SetAllowUpdate(bool allowUpdate) override; 41 void SetMultiInstanceEnabled(bool isMultiInstanceEnabled) override; 42 43 void DispatchSurfaceChangeEvent(float width, float height, uint32_t reason = 0, 44 const std::shared_ptr<Rosen::RSTransaction>& rsTransaction = nullptr, float borderWidth = 0.0) override; 45 46 void SetObscured(bool isObscured) override; 47 void OnAccessibilityChildTreeRegister(uint32_t windowId, int32_t treeId, int64_t accessibilityId) override; 48 void OnAccessibilityChildTreeDeregister() override; 49 void OnAccessibilityDumpChildInfo(const std::vector<std::string>& params, std::vector<std::string>& info) override; 50 void OnAccessibilityTransferHoverEvent(float pointX, float pointY, int32_t sourceType, 51 int32_t eventType, int64_t timeMs) override; 52 void OnNotifyDumpInfo(const std::vector<std::string>& params, std::vector<std::string>& info) override; 53 54 private: 55 template<typename T> 56 int32_t GetParcelableInfos(MessageParcel &reply, std::vector<T> &parcelableInfos); 57 static bool WriteInterfaceToken(MessageParcel &data); 58 int32_t SendRequest(uint32_t code, MessageParcel &data, MessageParcel &reply, MessageOption &option); 59 60 static inline BrokerDelegator<FormRendererDispatcherProxy> delegator_; 61 }; 62 } // namespace Ace 63 } // namespace OHOS 64 #endif // FOUNDATION_ACE_INTERFACE_INNERKITS_FORM_RENDERER_DISPATCHER_PROXY_H 65