1db9119c9ebb326eaed8562d13b48782ad75d4e9
[platform/core/uifw/dali-toolkit.git] / 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::SetLimits( float min, float max )
41 {
42   mMinLimit = min;
43   mMaxLimit = max;
44
45   mLimitsChangedSignal.Emit( mMinLimit, mMaxLimit );
46 }
47
48 ScrollConnector::ScrollConnector()
49 : mMinLimit( 0.0f ),
50   mMaxLimit( 0.0f )
51 {
52   mScrollPositionObject = Constrainable::New();
53
54   mScrollPositionObject.RegisterProperty( Toolkit::ScrollConnector::SCROLL_POSITION_PROPERTY_NAME, 0.0f );
55   mScrollPositionObject.RegisterProperty( Toolkit::ScrollConnector::OVERSHOOT_PROPERTY_NAME, 0.0f );
56 }
57
58 ScrollConnector::~ScrollConnector()
59 {
60 }
61
62 } // namespace Internal
63
64 } // namespace Toolkit
65
66 } // namespace Dali