Fix build error.
[platform/core/uifw/dali-adaptor.git] / adaptors / common / drag-and-drop-detector-impl.cpp
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
19 #include "drag-and-drop-detector-impl.h"
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
42 Vector2 DragAndDropDetector::GetCurrentScreenPosition() const
43 {
44   return mScreenPosition;
45 }
46
47 bool DragAndDropDetector::IsEnabled() const
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
57 void DragAndDropDetector::ClearContent()
58 {
59   mContent.clear();
60 }
61
62 void DragAndDropDetector::SetPosition( Vector2 screenPosition )
63 {
64   mScreenPosition = screenPosition;
65 }
66
67 void DragAndDropDetector::EmitEnteredSignal()
68 {
69   if ( !mEnteredSignal.Empty() )
70   {
71     Dali::DragAndDropDetector handle( this );
72     mEnteredSignal.Emit( handle );
73   }
74 }
75
76 void DragAndDropDetector::EmitExitedSignal()
77 {
78   if ( !mExitedSignal.Empty() )
79   {
80     Dali::DragAndDropDetector handle( this );
81     mExitedSignal.Emit( handle );
82   }
83 }
84
85 void DragAndDropDetector::EmitMovedSignal()
86 {
87   if ( !mMovedSignal.Empty() )
88   {
89     Dali::DragAndDropDetector handle( this );
90     mMovedSignal.Emit( handle );
91   }
92 }
93
94 void DragAndDropDetector::EmitDroppedSignal()
95 {
96   if ( !mDroppedSignal.Empty() )
97   {
98     Dali::DragAndDropDetector handle( this );
99     mDroppedSignal.Emit( handle );
100   }
101 }
102
103 DragAndDropDetector::DragAndDropDetector()
104 : mContent(),
105   mScreenPosition()
106 {
107 }
108
109 DragAndDropDetector::~DragAndDropDetector()
110 {
111 }
112
113 } // namespace Adaptor
114
115 } // namespace Internal
116
117 } // namespace Dali