Move TouchPoint to Devel API
[platform/core/uifw/dali-toolkit.git] / dali-toolkit / internal / controls / scrollable / scroll-view / scroll-view-impl.cpp
old mode 100755 (executable)
new mode 100644 (file)
index 71304d6..2a3bbd5
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 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.
@@ -21,9 +21,9 @@
 // EXTERNAL INCLUDES
 #include <cstring> // for strcmp
 #include <dali/public-api/animation/constraints.h>
-#include <dali/public-api/common/stage.h>
+#include <dali/devel-api/common/stage.h>
 #include <dali/public-api/events/wheel-event.h>
-#include <dali/public-api/events/touch-data.h>
+#include <dali/public-api/events/touch-event.h>
 #include <dali/public-api/object/type-registry.h>
 #include <dali/public-api/object/type-registry-helper.h>
 #include <dali/public-api/object/property-map.h>
@@ -704,7 +704,7 @@ void ScrollView::OnInitialize()
   SetInternalConstraints();
 }
 
-void ScrollView::OnStageConnection( int depth )
+void ScrollView::OnSceneConnection( int depth )
 {
   DALI_LOG_SCROLL_STATE("[0x%X]", this);
 
@@ -720,16 +720,16 @@ void ScrollView::OnStageConnection( int depth )
     EnableScrollOvershoot(true);
   }
 
-  ScrollBase::OnStageConnection( depth );
+  ScrollBase::OnSceneConnection( depth );
 }
 
-void ScrollView::OnStageDisconnection()
+void ScrollView::OnSceneDisconnection()
 {
   DALI_LOG_SCROLL_STATE("[0x%X]", this);
 
   StopAnimation();
 
-  ScrollBase::OnStageDisconnection();
+  ScrollBase::OnSceneDisconnection();
 }
 
 ScrollView::~ScrollView()
@@ -2059,7 +2059,7 @@ bool ScrollView::OnTouchDownTimeout()
   return false;
 }
 
-bool ScrollView::OnTouch( Actor actor, const TouchData& touch )
+bool ScrollView::OnTouch( Actor actor, const TouchEvent& touch )
 {
   if(!mSensitive)
   {
@@ -2096,7 +2096,7 @@ bool ScrollView::OnTouch( Actor actor, const TouchData& touch )
   else if( ( pointState == PointState::UP ) ||
            ( ( pointState == PointState::INTERRUPTED ) && ( touch.GetHitActor( 0 )== Self() ) ) )
   {
-    DALI_LOG_SCROLL_STATE("[0x%X] %s", this, ( ( pointState == TouchPoint::Up ) ? "Up" : "Interrupted" ) );
+    DALI_LOG_SCROLL_STATE("[0x%X] %s", this, ( ( pointState == PointState::UP ) ? "Up" : "Interrupted" ) );
 
     StopTouchDownTimer();
 
@@ -2125,7 +2125,7 @@ bool ScrollView::OnTouch( Actor actor, const TouchData& touch )
     mScrollInterrupted = false;
   }
 
-  return true;
+  return false;
 }
 
 bool ScrollView::OnWheelEvent(const WheelEvent& event)
@@ -2144,14 +2144,14 @@ bool ScrollView::OnWheelEvent(const WheelEvent& event)
     if(mRulerX->GetType() == Ruler::Free)
     {
       // Free panning mode
-      targetScrollPosition.x += event.z * mWheelScrollDistanceStep.x;
+      targetScrollPosition.x += event.GetDelta() * mWheelScrollDistanceStep.x;
       ClampPosition(targetScrollPosition);
       ScrollTo(-targetScrollPosition);
     }
     else if(!mScrolling)
     {
       // Snap mode, only respond to the event when the previous snap animation is finished.
-      ScrollTo(GetCurrentPage() - event.z);
+      ScrollTo(GetCurrentPage() - event.GetDelta());
     }
   }
   else
@@ -2160,14 +2160,14 @@ bool ScrollView::OnWheelEvent(const WheelEvent& event)
     if(mRulerY->GetType() == Ruler::Free)
     {
       // Free panning mode
-      targetScrollPosition.y += event.z * mWheelScrollDistanceStep.y;
+      targetScrollPosition.y += event.GetDelta() * mWheelScrollDistanceStep.y;
       ClampPosition(targetScrollPosition);
       ScrollTo(-targetScrollPosition);
     }
     else if(!mScrolling)
     {
       // Snap mode, only respond to the event when the previous snap animation is finished.
-      ScrollTo(GetCurrentPage() - event.z * mRulerX->GetTotalPages());
+      ScrollTo(GetCurrentPage() - event.GetDelta() * mRulerX->GetTotalPages());
     }
   }