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_IMPL_H 17 #define FOUNDATION_ACE_INTERFACE_INNERKITS_FORM_RENDERER_DISPATCHER_IMPL_H 18 19 #include "form_renderer_dispatcher_stub.h" 20 21 #include "base/utils/macros.h" 22 #include "ui_content.h" 23 24 namespace OHOS { 25 namespace Ace { 26 class FormRenderer; 27 /** 28 * @class FormRendererDispatcher 29 * FormRendererDispatcher interface is used to form renderer dispatcher. 30 */ 31 class ACE_EXPORT FormRendererDispatcherImpl : public FormRendererDispatcherStub { 32 public: 33 FormRendererDispatcherImpl( 34 const std::shared_ptr<UIContent> uiContent, const std::shared_ptr<FormRenderer> formRenderer); 35 ~FormRendererDispatcherImpl() override = default; 36 /** 37 * @brief Dispatcher pointer event. 38 * @param pointerEvent The pointer event info. 39 */ 40 void DispatchPointerEvent(const std::shared_ptr<OHOS::MMI::PointerEvent>& pointerEvent) override; 41 /** 42 * @brief Set AllowUpdate. 43 * @param allowUpdate The allowUpdate. 44 */ 45 void SetAllowUpdate(bool allowUpdate) override; 46 bool IsAllowUpdate(); 47 48 void DispatchSurfaceChangeEvent(float width, float height) override; 49 50 private: 51 std::weak_ptr<UIContent> uiContent_; 52 std::weak_ptr<FormRenderer> formRenderer_; 53 bool allowUpdate_ = true; 54 }; 55 } // namespace Ace 56 } // namespace OHOS 57 #endif // FOUNDATION_ACE_INTERFACE_INNERKITS_FORM_RENDERER_DISPATCHER_IMPL_H 58