ScrollView - Added APIs for minimum pan speed/distance before being considered a...
[platform/core/uifw/dali-toolkit.git] / base / dali-toolkit / public-api / controls / scrollable / scroll-view / scroll-view.cpp
index 874e2b8..aba1054 100644 (file)
@@ -1,18 +1,19 @@
-//
-// Copyright (c) 2014 Samsung Electronics Co., Ltd.
-//
-// Licensed under the Flora License, Version 1.0 (the License);
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//     http://floralicense.org/license/
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an AS IS BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
+/*
+ * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
 
 #include <dali-toolkit/public-api/controls/scrollable/scrollable.h>
 #include <dali-toolkit/public-api/controls/scrollable/scroll-view/scroll-view.h>
@@ -279,7 +280,7 @@ const std::string ScrollView::SCROLL_START_PAGE_POSITION_PROPERTY_NAME( "scroll-
 
 const float ScrollView::DEFAULT_SLOW_SNAP_ANIMATION_DURATION(0.5f);
 const float ScrollView::DEFAULT_FAST_SNAP_ANIMATION_DURATION(0.25f);
-const float ScrollView::DEFAULT_SNAP_OVERSHOOT_DURATION(1.0f);
+const float ScrollView::DEFAULT_SNAP_OVERSHOOT_DURATION(0.5f);
 const float ScrollView::DEFAULT_MAX_OVERSHOOT(100.0f);  // 100 pixels
 
 const float ScrollView::DEFAULT_AXIS_AUTO_LOCK_GRADIENT(0.36f);
@@ -437,6 +438,16 @@ void ScrollView::SetRefreshInterval(int milliseconds)
   GetImpl(*this).SetRefreshInterval(milliseconds);
 }
 
+int ScrollView::GetScrollUpdateDistance() const
+{
+  return GetImpl(*this).GetScrollUpdateDistance();
+}
+
+void ScrollView::SetScrollUpdateDistance(int distance)
+{
+  GetImpl(*this).SetScrollUpdateDistance(distance);
+}
+
 bool ScrollView::GetAxisAutoLock() const
 {
   return GetImpl(*this).GetAxisAutoLock();
@@ -477,6 +488,26 @@ void ScrollView::SetFlickSpeedCoefficient(float speed)
   GetImpl(*this).SetFlickSpeedCoefficient(speed);
 }
 
+Vector2 ScrollView::GetMinimumDistanceForFlick() const
+{
+  return GetImpl(*this).GetMinimumDistanceForFlick();
+}
+
+void ScrollView::SetMinimumDistanceForFlick( const Vector2& distance )
+{
+  GetImpl(*this).SetMinimumDistanceForFlick(distance);
+}
+
+float ScrollView::GetMinimumSpeedForFlick() const
+{
+  return GetImpl(*this).GetMinimumSpeedForFlick();
+}
+
+void ScrollView::SetMinimumSpeedForFlick( float speed )
+{
+  GetImpl(*this).SetMinimumSpeedForFlick(speed);
+}
+
 float ScrollView::GetMaxFlickSpeed() const
 {
   return GetImpl(*this).GetMaxFlickSpeed();
@@ -502,6 +533,11 @@ Vector3 ScrollView::GetCurrentScrollPosition() const
   return GetImpl(*this).GetCurrentScrollPosition();
 }
 
+void ScrollView::SetScrollPosition(const Vector3& position)
+{
+  GetImpl(*this).SetScrollPosition(position);
+}
+
 Vector3 ScrollView::GetCurrentScrollScale() const
 {
   return GetImpl(*this).GetCurrentScrollScale();