2 * Copyright (c) 2022 Samsung Electronics Co., Ltd.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
19 #include <dali/internal/drag-and-drop/generic/drag-and-drop-impl-generic.h>
22 #include <dali/devel-api/common/singleton-service.h>
31 Dali::DragAndDrop GetDragAndDrop()
33 Dali::DragAndDrop dnd;
35 Dali::SingletonService service(SingletonService::Get());
38 // Check whether the singleton is already created
39 Dali::BaseHandle handle = service.GetSingleton(typeid(Dali::DragAndDrop));
42 // If so, downcast the handle
43 dnd = Dali::DragAndDrop(dynamic_cast<DragAndDrop*>(handle.GetObjectPtr()));
47 // Create a singleon instance
48 dnd = Dali::DragAndDrop(new DragAndDropGeneric());
49 service.Register(typeid(Dali::DragAndDrop), dnd);
56 DragAndDropGeneric::DragAndDropGeneric()
60 DragAndDropGeneric::~DragAndDropGeneric()
64 bool DragAndDropGeneric::StartDragAndDrop(Dali::Actor source, Dali::Actor shadow, const Dali::DragAndDrop::DragData& dragData)
69 bool DragAndDropGeneric::AddListener(Dali::Actor target, Dali::DragAndDrop::DragAndDropFunction callback)
74 bool DragAndDropGeneric::RemoveListener(Dali::Actor target)
79 void DragAndDropGeneric::SendData(void* event)
84 void DragAndDropGeneric::ReceiveData(void* event)
89 bool DragAndDropGeneric::CalculateDragEvent(void* event)
94 bool DragAndDropGeneric::CalculateViewRegion(void* event)
99 } // namespace Adaptor
101 } // namespace Internal