Dali 3D User Interface Engine
drag-and-drop-detector-impl.h
Go to the documentation of this file.
1 #ifndef __DALI_INTERNAL_DRAG_AND_DROP_DETECTOR_H__
2 #define __DALI_INTERNAL_DRAG_AND_DROP_DETECTOR_H__
3 
4 /*
5  * Copyright (c) 2014 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 // EXTERNAL INCLUDES
22 #include <string>
23 
26 
27 // INTERNAL INCLUDES
28 #include <drag-and-drop-detector.h>
29 
30 namespace Dali
31 {
32 
33 namespace Internal
34 {
35 
36 namespace Adaptor
37 {
38 
40 
45 {
46 public:
47 
48  typedef Dali::DragAndDropDetector::DragAndDropSignal DragAndDropSignal;
49 
50  // Creation
51 
57  static Dali::DragAndDropDetector New();
58 
59  // Public API
60 
64  const std::string& GetContent() const;
65 
70 
71  // Called by Drag & Drop Event Handler
72 
77  bool IsEnabled() const;
78 
83  void SetContent( const std::string& content );
84 
88  void ClearContent();
89 
93  void SetPosition( Vector2 screenPosition );
94 
98  void EmitEnteredSignal();
99 
103  void EmitExitedSignal();
104 
108  void EmitMovedSignal();
109 
113  void EmitDroppedSignal();
114 
115 public: // Signals
116 
121  {
122  return mEnteredSignal;
123  }
124 
129  {
130  return mExitedSignal;
131  }
132 
137  {
138  return mMovedSignal;
139  }
140 
145  {
146  return mDroppedSignal;
147  }
148 
149 private:
150 
151  // Construction & Destruction
152 
157 
161  virtual ~DragAndDropDetector();
162 
163  // Undefined
166 
167 private:
168 
169  std::string mContent;
171 
176 };
177 
178 } // namespace Adaptor
179 
180 } // namespace Internal
181 
182 // Helpers for public-api forwarding methods
183 
184 inline Internal::Adaptor::DragAndDropDetector& GetImplementation(Dali::DragAndDropDetector& detector)
185 {
186  DALI_ASSERT_ALWAYS( detector && "DragAndDropDetector handle is empty" );
187 
188  BaseObject& handle = detector.GetBaseObject();
189 
190  return static_cast<Internal::Adaptor::DragAndDropDetector&>(handle);
191 }
192 
193 inline const Internal::Adaptor::DragAndDropDetector& GetImplementation(const Dali::DragAndDropDetector& detector)
194 {
195  DALI_ASSERT_ALWAYS( detector && "DragAndDropDetector handle is empty" );
196 
197  const BaseObject& handle = detector.GetBaseObject();
198 
199  return static_cast<const Internal::Adaptor::DragAndDropDetector&>(handle);
200 }
201 
202 } // namespace Dali
203 
204 #endif // __DALI_INTERNAL_DRAG_AND_DROP_DETECTOR_H__
Dali Docs Home
Read more about Dali