Calculate EncodedImageBuffer's hash in generate time
[platform/core/uifw/dali-adaptor.git] / dali / internal / drag-and-drop / tizen-wayland / drag-and-drop-impl-ecore-wl2.h
1 #ifndef DALI_INTERNAL_DRAG_AND_DROP_ECORE_WL2_H
2 #define DALI_INTERNAL_DRAG_AND_DROP_ECORE_WL2_H
3
4 /*
5  * Copyright (c) 2022 Samsung Electronics Co., Ltd.
6  *
7  * Licensed under the Apache License, Version 2.0 (the "License");
8  * you may not use this file except in compliance with the License.
9  * You may obtain a copy of the License at
10  *
11  * http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing, software
14  * distributed under the License is distributed on an "AS IS" BASIS,
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  * See the License for the specific language governing permissions and
17  * limitations under the License.
18  *
19  */
20
21 // INTERNAL INCLUDES
22 #include <dali/internal/drag-and-drop/common/drag-and-drop-impl.h>
23 #include <dali/internal/system/linux/dali-ecore.h>
24
25 namespace Dali
26 {
27 class DragAndDrop;
28
29 namespace Internal
30 {
31 namespace Adaptor
32 {
33 struct DropTarget
34 {
35   Dali::Actor                            target;
36   Dali::DragAndDrop::DragAndDropFunction callback;
37   bool                                   inside;
38 };
39
40 /**
41  * DragAndDrop Implementation
42  */
43 class DragAndDropEcoreWl : public Dali::Internal::Adaptor::DragAndDrop
44 {
45 public:
46   /**
47    * Constructor
48    */
49   DragAndDropEcoreWl();
50
51   /**
52    * Destructor
53    */
54   ~DragAndDropEcoreWl() override;
55
56   /**
57    * @copydoc Dali::DragAndDrop::StartDragAndDrop()
58    */
59   bool StartDragAndDrop(Dali::Actor source, Dali::Actor shadow, const Dali::DragAndDrop::DragData& data) override;
60
61   /**
62    * @copydoc Dali::DragAndDrop::AddListener()
63    */
64   bool AddListener(Dali::Actor target, Dali::DragAndDrop::DragAndDropFunction callback) override;
65
66   /**
67    * @copydoc Dali::DragAndDrop::RemoveListener()
68    */
69   bool RemoveListener(Dali::Actor target) override;
70
71   /**
72    * @copydoc Dali::DragAndDrop::SendData()
73    */
74   void SendData(void* event) override;
75
76   /**
77    * @copydoc Dali::DragAndDrop::ReceiveData()
78    */
79   void ReceiveData(void* event) override;
80
81   /**
82    * @copydoc Dali::DragAndDrop::CalculateDragEvent()
83    */
84   bool CalculateDragEvent(void* event) override;
85
86   /**
87    * @copydoc Dali::DragAndDrop::CalculateViewRegion()
88    */
89   bool CalculateViewRegion(void* event) override;
90
91 private:
92   DragAndDropEcoreWl(const DragAndDropEcoreWl&) = delete;
93   DragAndDropEcoreWl& operator=(DragAndDropEcoreWl&) = delete;
94   DragAndDropEcoreWl(DragAndDropEcoreWl&&)           = delete;
95   DragAndDropEcoreWl& operator=(DragAndDropEcoreWl&&) = delete;
96
97 private:
98   Dali::Window            mDragWindow;
99   uint32_t                mSerial{0u};
100   Ecore_Event_Handler*    mSendHandler{nullptr};
101   Ecore_Event_Handler*    mReceiveHandler{nullptr};
102   Ecore_Event_Handler*    mMotionHandler{nullptr};
103   Ecore_Event_Handler*    mDropHandler{nullptr};
104   int                     mTargetIndex{0};
105   std::string             mMimeType;
106   std::string             mData;
107   int                     mDataSize{0};
108   Dali::Vector2           mPosition;
109   std::vector<DropTarget> mDropTargets;
110 }; // class DragAndDropEcoreWl
111
112 } // namespace Adaptor
113
114 } // namespace Internal
115
116 } // namespace Dali
117
118 #endif // DALI_INTERNAL_DRAG_AND_DROP_ECORE_WL2_H