1 /*
2 * Copyright (c) 2022-2024 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 #include "core/components_ng/manager/drag_drop/drag_drop_manager.h"
17
18 namespace OHOS::Ace::NG {
19 namespace {
20 int64_t g_proxyId = 0;
21 } // namespace
22
CreateTextDragDropProxy()23 RefPtr<DragDropProxy> DragDropManager::CreateTextDragDropProxy()
24 {
25 return nullptr;
26 }
27
CreateDragWindow(const GestureEvent & info,uint32_t width,uint32_t height)28 void DragDropManager::CreateDragWindow(const GestureEvent& info, uint32_t width, uint32_t height) {}
29
CreateDragRootNode(const RefPtr<UINode> & customNode)30 RefPtr<FrameNode> DragDropManager::CreateDragRootNode(const RefPtr<UINode>& customNode)
31 {
32 return nullptr;
33 }
34
FindDragFrameNodeByPosition(float globalX,float globalY)35 RefPtr<FrameNode> DragDropManager::FindDragFrameNodeByPosition(float globalX, float globalY)
36 {
37 return nullptr;
38 }
39
CheckDragDropProxy(int64_t id) const40 bool DragDropManager::CheckDragDropProxy(int64_t id) const
41 {
42 return false;
43 }
44
CancelItemDrag()45 void DragDropManager::CancelItemDrag() {}
46
OnDragStart(const Point & point,const RefPtr<FrameNode> & frameNode)47 void DragDropManager::OnDragStart(const Point& point, const RefPtr<FrameNode>& frameNode) {}
48
OnDragMove(const PointerEvent & pointerEvent,const std::string & extraInfo)49 void DragDropManager::OnDragMove(const PointerEvent& pointerEvent, const std::string& extraInfo)
50 {
51 auto point = pointerEvent.GetPoint();
52 currentId_ = static_cast<int32_t>(point.GetX());
53 }
54
OnDragMoveOut(const PointerEvent & pointerEvent,const std::string & extraInfo)55 void DragDropManager::OnDragMoveOut(const PointerEvent& pointerEvent, const std::string& extraInfo) {}
56
OnDragEnd(const PointerEvent & pointerEvent,const std::string & extraInfo)57 void DragDropManager::OnDragEnd(const PointerEvent& pointerEvent, const std::string& extraInfo) {}
58
OnTextDragEnd(float globalX,float globalY,const std::string & extraInfo)59 void DragDropManager::OnTextDragEnd(float globalX, float globalY, const std::string& extraInfo) {}
60
onDragCancel()61 void DragDropManager::onDragCancel() {}
62
FireOnDragEvent(const RefPtr<FrameNode> & frameNode,const PointerEvent & pointerEvent,DragEventType type,const std::string & extraInfo)63 void DragDropManager::FireOnDragEvent(
64 const RefPtr<FrameNode>& frameNode, const PointerEvent& pointerEvent,
65 DragEventType type, const std::string& extraInfo)
66 {}
67
OnItemDragStart(float globalX,float globalY,const RefPtr<FrameNode> & frameNode)68 void DragDropManager::OnItemDragStart(float globalX, float globalY, const RefPtr<FrameNode>& frameNode) {}
69
OnItemDragMove(float globalX,float globalY,int32_t draggedIndex,DragType dragType)70 void DragDropManager::OnItemDragMove(float globalX, float globalY, int32_t draggedIndex, DragType dragType) {}
71
OnItemDragEnd(float globalX,float globalY,int32_t draggedIndex,DragType dragType)72 void DragDropManager::OnItemDragEnd(float globalX, float globalY, int32_t draggedIndex, DragType dragType) {}
73
onItemDragCancel()74 void DragDropManager::onItemDragCancel() {}
75
FireOnItemDragEvent(const RefPtr<FrameNode> & frameNode,DragType dragType,const OHOS::Ace::ItemDragInfo & itemDragInfo,DragEventType type,int32_t draggedIndex,int32_t insertIndex)76 void DragDropManager::FireOnItemDragEvent(const RefPtr<FrameNode>& frameNode, DragType dragType,
77 const OHOS::Ace::ItemDragInfo& itemDragInfo, DragEventType type, int32_t draggedIndex, int32_t insertIndex)
78 {}
79
FireOnItemDropEvent(const RefPtr<FrameNode> & frameNode,DragType dragType,const OHOS::Ace::ItemDragInfo & itemDragInfo,int32_t draggedIndex,int32_t insertIndex,bool isSuccess)80 bool DragDropManager::FireOnItemDropEvent(const RefPtr<FrameNode>& frameNode, DragType dragType,
81 const OHOS::Ace::ItemDragInfo& itemDragInfo, int32_t draggedIndex, int32_t insertIndex, bool isSuccess)
82 {
83 return true;
84 }
85
AddDataToClipboard(const std::string & extraInfo)86 void DragDropManager::AddDataToClipboard(const std::string& extraInfo) {}
87
GetExtraInfoFromClipboard(std::string & extraInfo)88 void DragDropManager::GetExtraInfoFromClipboard(std::string& extraInfo) {}
89
RestoreClipboardData()90 void DragDropManager::RestoreClipboardData() {}
91
DestroyDragWindow()92 void DragDropManager::DestroyDragWindow() {}
93 } // namespace OHOS::Ace::NG
94