drag and drop: implements drag source events
[platform/core/uifw/dali-adaptor.git] / dali / internal / drag-and-drop / generic / drag-and-drop-impl-generic.cpp
1 /*
2  * Copyright (c) 2022 Samsung Electronics Co., Ltd.
3  *
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
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
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.
15  *
16  */
17
18 // CLASS HEADER
19 #include <dali/internal/drag-and-drop/generic/drag-and-drop-impl-generic.h>
20
21 // INTERNAL INCLUDES
22 #include <dali/devel-api/common/singleton-service.h>
23
24 namespace Dali
25 {
26 namespace Internal
27 {
28 namespace Adaptor
29 {
30
31 Dali::DragAndDrop GetDragAndDrop()
32 {
33   Dali::DragAndDrop dnd;
34
35   Dali::SingletonService service(SingletonService::Get());
36   if(service)
37   {
38     // Check whether the singleton is already created
39     Dali::BaseHandle handle = service.GetSingleton(typeid(Dali::DragAndDrop));
40     if(handle)
41     {
42       // If so, downcast the handle
43       dnd = Dali::DragAndDrop(dynamic_cast<DragAndDrop*>(handle.GetObjectPtr()));
44     }
45     else
46     {
47       // Create a singleon instance
48       dnd = Dali::DragAndDrop(new DragAndDropGeneric());
49       service.Register(typeid(Dali::DragAndDrop), dnd);
50     }
51   }
52
53   return dnd;
54 }
55
56 DragAndDropGeneric::DragAndDropGeneric()
57 {
58 }
59
60 DragAndDropGeneric::~DragAndDropGeneric()
61 {
62 }
63
64 bool DragAndDropGeneric::StartDragAndDrop(Dali::Actor source, Dali::Window shadowWindow, const Dali::DragAndDrop::DragData& dragData, Dali::DragAndDrop::SourceFunction callback)
65 {
66   return true;
67 }
68
69 bool DragAndDropGeneric::AddListener(Dali::Actor target, Dali::DragAndDrop::DragAndDropFunction callback)
70 {
71   return true;
72 }
73
74 bool DragAndDropGeneric::RemoveListener(Dali::Actor target)
75 {
76   return true;
77 }
78
79 void DragAndDropGeneric::SendData(void* event)
80 {
81   return;
82 }
83
84 void DragAndDropGeneric::ReceiveData(void* event)
85 {
86   return;
87 }
88
89 bool DragAndDropGeneric::CalculateDragEvent(void* event)
90 {
91   return true;
92 }
93
94 bool DragAndDropGeneric::CalculateViewRegion(void* event)
95 {
96   return true;
97 }
98
99 } // namespace Adaptor
100
101 } // namespace Internal
102
103 } // namespace Dali