Revert "License conversion from Flora to Apache 2.0"
[platform/core/uifw/dali-toolkit.git] / base / dali-toolkit / internal / controls / scrollable / scroll-connector-impl.cpp
1 //
2 // Copyright (c) 2014 Samsung Electronics Co., Ltd.
3 //
4 // Licensed under the Flora License, Version 1.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://floralicense.org/license/
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 // CLASS HEADER
18 #include <dali-toolkit/internal/controls/scrollable/scroll-connector-impl.h>
19
20 // EXTERNAL INCLUDES
21 #include <dali/integration-api/debug.h>
22
23 namespace Dali
24 {
25
26 namespace Toolkit
27 {
28
29 namespace Internal
30 {
31
32 const Property::Index ScrollConnector::SCROLL_POSITION = Dali::PROPERTY_CUSTOM_START_INDEX;
33 const Property::Index ScrollConnector::OVERSHOOT       = Dali::PROPERTY_CUSTOM_START_INDEX + 1;
34
35 ScrollConnector* ScrollConnector::New()
36 {
37   return new ScrollConnector();
38 }
39
40 void ScrollConnector::SetScrollDomain( float min, float max, float length )
41 {
42   mMinLimit = min;
43   mMaxLimit = max;
44   mContentLength = length;
45
46   mDomainChangedSignal.Emit( mMinLimit, mMaxLimit, mContentLength );
47 }
48
49 ScrollConnector::ScrollConnector()
50 : mMinLimit( 0.0f ),
51   mMaxLimit( 0.0f ),
52   mContentLength( 0.0f )
53 {
54   mScrollPositionObject = Constrainable::New();
55
56   mScrollPositionObject.RegisterProperty( Toolkit::ScrollConnector::SCROLL_POSITION_PROPERTY_NAME, 0.0f );
57   mScrollPositionObject.RegisterProperty( Toolkit::ScrollConnector::OVERSHOOT_PROPERTY_NAME, 0.0f );
58 }
59
60 ScrollConnector::~ScrollConnector()
61 {
62 }
63
64 } // namespace Internal
65
66 } // namespace Toolkit
67
68 } // namespace Dali