Merge "Provide object to connect scrollable containers & scroll-bars etc."
[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 = 50000000; // TODO - expose CUSTOM_PROPERTY_START from Core
33
34 ScrollConnector* ScrollConnector::New()
35 {
36   return new ScrollConnector();
37 }
38
39 void ScrollConnector::SetLimits( float min, float max )
40 {
41   mMinLimit = min;
42   mMaxLimit = max;
43
44   mLimitsChangedSignal.Emit( mMinLimit, mMaxLimit );
45 }
46
47 ScrollConnector::ScrollConnector()
48 : mMinLimit( 0.0f ),
49   mMaxLimit( 0.0f )
50 {
51   mScrollPositionObject = Constrainable::New();
52
53   mScrollPositionObject.RegisterProperty( Toolkit::ScrollConnector::SCROLL_POSITION_PROPERTY_NAME, 0.0f );
54 }
55
56 ScrollConnector::~ScrollConnector()
57 {
58 }
59
60 } // namespace Internal
61
62 } // namespace Toolkit
63
64 } // namespace Dali