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