2 * Copyright (c) 2014 Samsung Electronics Co., Ltd.
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
8 * http://www.apache.org/licenses/LICENSE-2.0
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.
19 #include <dali-toolkit/internal/controls/scrollable/scroll-connector-impl.h>
22 #include <dali/public-api/object/property-index.h>
23 #include <dali/integration-api/debug.h>
34 const Property::Index ScrollConnector::SCROLL_POSITION = Dali::PROPERTY_CUSTOM_START_INDEX;
35 const Property::Index ScrollConnector::OVERSHOOT = Dali::PROPERTY_CUSTOM_START_INDEX + 1;
37 ScrollConnector* ScrollConnector::New()
39 return new ScrollConnector();
42 void ScrollConnector::SetScrollDomain( float min, float max, float length )
46 mContentLength = length;
48 mDomainChangedSignal.Emit( mMinLimit, mMaxLimit, mContentLength );
51 void ScrollConnector::SetScrollPosition( float position )
53 mScrollPositionObject.SetProperty( Toolkit::ScrollConnector::SCROLL_POSITION, position );
54 mScrollPositionChangedSignal.Emit( position );
57 ScrollConnector::ScrollConnector()
60 mContentLength( 0.0f )
62 mScrollPositionObject = Constrainable::New();
64 mScrollPositionObject.RegisterProperty( Toolkit::ScrollConnector::SCROLL_POSITION_PROPERTY_NAME, 0.0f );
65 mScrollPositionObject.RegisterProperty( Toolkit::ScrollConnector::OVERSHOOT_PROPERTY_NAME, 0.0f );
68 ScrollConnector::~ScrollConnector()
72 } // namespace Internal
74 } // namespace Toolkit