use modern construct 'override' in the derive class.
[platform/core/uifw/dali-core.git] / dali / internal / update / gestures / scene-graph-pan-gesture.h
index d766a18..017a5de 100644 (file)
@@ -1,8 +1,8 @@
-#ifndef __DALI_INTERNAL_SCENE_GRAPH_PAN_GESTURE_H__
-#define __DALI_INTERNAL_SCENE_GRAPH_PAN_GESTURE_H__
+#ifndef DALI_INTERNAL_SCENE_GRAPH_PAN_GESTURE_H
+#define DALI_INTERNAL_SCENE_GRAPH_PAN_GESTURE_H
 
 /*
- * 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.
 // INTERNAL INCLUDES
 #include <dali/devel-api/threading/mutex.h>
 #include <dali/public-api/common/vector-wrapper.h>
-#include <dali/public-api/events/pan-gesture.h>
+#include <dali/internal/event/events/pan-gesture/pan-gesture-impl.h>
 #include <dali/internal/update/common/property-owner.h>
 #include <dali/internal/update/gestures/gesture-properties.h>
 
 namespace Dali
 {
 
-struct PanGesture;
+class PanGesture;
 
 namespace Internal
 {
@@ -118,7 +118,7 @@ public:
      */
     PanInfo()
     : time( 0u ),
-      state( Gesture::Clear ),
+      state( GestureState::CLEAR ),
       read( true )
     {
     }
@@ -156,33 +156,33 @@ public:
      * Assignment operator
      * @param[in] gesture A Dali::Gesture
      */
-    PanInfo& operator=( const Dali::PanGesture& rhs )
+    PanInfo& operator=( const Internal::PanGesture& rhs )
     {
-      time = rhs.time;
-      state = rhs.state;
+      time = rhs.GetTime();
+      state = rhs.GetState();
 
-      local.velocity = rhs.velocity;
-      local.displacement = rhs.displacement;
-      local.position = rhs.position;
+      local.velocity = rhs.GetVelocity();
+      local.displacement = rhs.GetDisplacement();
+      local.position = rhs.GetPosition();
 
-      screen.velocity = rhs.screenVelocity;
-      screen.displacement = rhs.screenDisplacement;
-      screen.position = rhs.screenPosition;
+      screen.velocity = rhs.GetScreenVelocity();
+      screen.displacement = rhs.GetScreenDisplacement();
+      screen.position = rhs.GetScreenPosition();
 
       return *this;
     }
 
     // Data
     unsigned int time;
-    Gesture::State state;
+    GestureState state;
     Info local;
     Info screen;
     volatile bool read;
   };
 
-  typedef std::vector<PanInfo> PanInfoHistory;
-  typedef PanInfoHistory::iterator PanInfoHistoryIter;
-  typedef PanInfoHistory::const_iterator PanInfoHistoryConstIter;
+  using PanInfoHistory          = std::vector<PanInfo>;
+  using PanInfoHistoryIter      = PanInfoHistory::iterator;
+  using PanInfoHistoryConstIter = PanInfoHistory::const_iterator;
 
 private:
   static const unsigned int PAN_GESTURE_HISTORY = 30u;
@@ -197,13 +197,13 @@ public:
   /**
    * Virtual destructor
    */
-  virtual ~PanGesture();
+  ~PanGesture() override;
 
   /**
    * Adds a PanGesture to the internal circular-buffer waiting to be handled by UpdateProperties.
    * @param[in]  gesture  The latest pan gesture.
    */
-  void AddGesture( const Dali::PanGesture& gesture );
+  void AddGesture( const Internal::PanGesture& gesture );
 
   /**
    * @brief Removes pan events from the history that are older than maxAge, leaving at least minEvents
@@ -410,11 +410,13 @@ private:
 
   // Struct to keep pairs of local and screen data together.
   // TODO: This can encapsulate some functionality also.
-  typedef struct
+  using RelativeVectors = struct
+
   {
     Vector2 local;
+
     Vector2 screen;
-  } RelativeVectors;
+  };
 
   /**
    * Houses new code to process input events and generate an output point.
@@ -561,7 +563,7 @@ private:
   volatile unsigned int mWritePosition;       ///< The next PanInfo buffer to write to. (starts at 0).
   unsigned int mReadPosition;                 ///< The next PanInfo buffer to read. (starts at 0).
   bool mNotAtTarget;                          ///< Keeps track of if the last gesture used was the most recent received.
-  bool mInGesture;                            ///< True if the gesture is currently being handled i.e. between Started <-> Finished/Cancelled.
+  bool mInGesture;                            ///< True if the gesture is currently being handled i.e. between STARTED <-> FINISHED/CANCELLED.
   bool mPredictionAmountOverridden;
   bool mSmoothingAmountOverridden;
 
@@ -594,4 +596,4 @@ private:
 
 } // namespace Dali
 
-#endif // __DALI_INTERNAL_SCENE_GRAPH_PAN_GESTURE_H__
+#endif // DALI_INTERNAL_SCENE_GRAPH_PAN_GESTURE_H