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_ACE_ENGINE_ADAPTER_OHOS_CAPABILITY_INTERACTION_IMPL_H 17 #define FOUNDATION_ACE_ACE_ENGINE_ADAPTER_OHOS_CAPABILITY_INTERACTION_IMPL_H 18 19 #include "core/common/interaction/interaction_interface.h" 20 21 #include "coordination_listener_impl.h" 22 23 namespace OHOS::Ace { 24 class InteractionImpl : public InteractionInterface { 25 DECLARE_ACE_TYPE(InteractionImpl, InteractionInterface); 26 27 public: 28 int32_t UpdateShadowPic(const ShadowInfoCore& shadowInfo) override; 29 30 int32_t SetDragWindowVisible(bool visible, 31 const std::shared_ptr<Rosen::RSTransaction>& rSTransaction = nullptr) override; 32 33 int32_t SetMouseDragMonitorState(bool state) override; 34 35 int32_t StartDrag(const DragDataCore& dragData, 36 std::function<void(const OHOS::Ace::DragNotifyMsg&)> callback) override; 37 38 int32_t GetDragBundleInfo(DragBundleInfo& dragBundleInfo) override; 39 40 int32_t UpdateDragStyle(DragCursorStyleCore style, const int32_t eventId = -1) override; 41 42 int32_t UpdatePreviewStyle(const PreviewStyle& previewStyle) override; 43 44 int32_t UpdatePreviewStyleWithAnimation(const PreviewStyle& previewStyle, 45 const PreviewAnimation& animation) override; 46 47 int32_t StopDrag(DragDropRet result) override; 48 49 int32_t GetUdKey(std::string& udKey) override; 50 51 int32_t GetShadowOffset(ShadowOffsetData& shadowOffsetData) override; 52 53 int32_t GetDragSummary(std::map<std::string, int64_t>& summary, 54 std::map<std::string, int64_t>& detailedSummary, std::map<std::string, std::vector<int32_t>>& summaryFormat, 55 int32_t& version, int64_t& totalSize) override; 56 57 int32_t GetDragExtraInfo(std::string& extraInfo) override; 58 59 int32_t GetDragState(DragState& dragState) const override; 60 61 int32_t AddPrivilege() override; 62 63 int32_t EnterTextEditorArea(bool enable) override; 64 65 int32_t RegisterCoordinationListener(std::function<void()> dragOutCallback) override; 66 67 int32_t UnRegisterCoordinationListener() override; 68 69 int32_t SetDraggableState(bool state) override; 70 71 int32_t GetAppDragSwitchState(bool& state) override; 72 73 void SetDraggableStateAsync(bool state, int64_t downTime) override; 74 75 int32_t EnableInternalDropAnimation(const std::string& animationInfo) override; 76 77 bool IsDragStart() const override; 78 private: 79 std::shared_ptr<CoordinationListenerImpl> consumer_; 80 }; 81 } // namespace OHOS::Ace 82 #endif // FOUNDATION_ACE_ACE_ENGINE_ADAPTER_OHOS_CAPABILITY_INTERACTION_IMPL_H