Dali 3D User Interface Engine
drag-and-drop-detector-impl.cpp
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2014 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
20 
21 namespace Dali
22 {
23 
24 namespace Internal
25 {
26 
27 namespace Adaptor
28 {
29 
30 Dali::DragAndDropDetector DragAndDropDetector::New()
31 {
32  Dali::DragAndDropDetector detector = Dali::DragAndDropDetector(new DragAndDropDetector());
33 
34  return detector;
35 }
36 
37 const std::string& DragAndDropDetector::GetContent() const
38 {
39  return mContent;
40 }
41 
43 {
44  return mScreenPosition;
45 }
46 
48 {
49  return !mDroppedSignal.Empty() || !mEnteredSignal.Empty() || !mExitedSignal.Empty() || !mMovedSignal.Empty() ;
50 }
51 
52 void DragAndDropDetector::SetContent( const std::string& content )
53 {
54  mContent = content;
55 }
56 
58 {
59  mContent.clear();
60 }
61 
63 {
64  mScreenPosition = screenPosition;
65 }
66 
68 {
69  if ( !mEnteredSignal.Empty() )
70  {
71  Dali::DragAndDropDetector handle( this );
72  mEnteredSignal.Emit( handle );
73  }
74 }
75 
77 {
78  if ( !mExitedSignal.Empty() )
79  {
80  Dali::DragAndDropDetector handle( this );
81  mExitedSignal.Emit( handle );
82  }
83 }
84 
86 {
87  if ( !mMovedSignal.Empty() )
88  {
89  Dali::DragAndDropDetector handle( this );
90  mMovedSignal.Emit( handle );
91  }
92 }
93 
95 {
96  if ( !mDroppedSignal.Empty() )
97  {
98  Dali::DragAndDropDetector handle( this );
99  mDroppedSignal.Emit( handle );
100  }
101 }
102 
104 : mContent(),
105  mScreenPosition()
106 {
107 }
108 
110 {
111 }
112 
113 } // namespace Adaptor
114 
115 } // namespace Internal
116 
117 } // namespace Dali
Dali Docs Home
Read more about Dali