Revert "[Tizen] Not execute the remove callback"
[platform/core/uifw/dali-core.git] / dali / internal / event / events / gesture-processor.h
index ed430df..85261e5 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_INTERNAL_GESTURE_PROCESSOR_H
 
 /*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2021 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/events/gesture-devel.h>
+#include <dali/internal/event/common/object-impl.h>
 #include <dali/internal/event/events/gesture-detector-impl.h>
-#include <dali/internal/event/events/hit-test-algorithm-impl.h>
 #include <dali/internal/event/events/gesture-recognizer.h>
-#include <dali/internal/event/common/object-impl.h>
+#include <dali/internal/event/events/hit-test-algorithm-impl.h>
 
 namespace Dali
 {
-
 class Actor;
 
 namespace Internal
 {
-
 /**
  * Base class for the different Gesture Processors.
  */
 class GestureProcessor : public Object::Observer
 {
 public:
-
   /**
    * Process the touch event in the attached recognizer
    * @param[in] scene Scene.
    * @param[in] event Touch event to process
    */
-  void ProcessTouch( Scene& scene, const Integration::TouchEvent& event );
+  void ProcessTouch(Scene& scene, const Integration::TouchEvent& event);
 
   /**
    * Returns whether any GestureDetector requires a Core::Update
@@ -54,28 +50,22 @@ public:
   inline bool NeedsUpdate()
   {
     bool updateRequired = mNeedsUpdate;
-    mNeedsUpdate = false;
+    mNeedsUpdate        = false;
     return updateRequired;
   }
 
 protected:
-
   // Construction & Destruction
 
   /**
    * Protected constructor.  Cannot create an instance of GestureProcessor
    */
-  GestureProcessor( DevelGesture::Type type );
-
-  /**
-   * Protected constructor.  Cannot create an instance of GestureProcessor
-   */
-  GestureProcessor( Gesture::Type type );
+  GestureProcessor(GestureType::Value type);
 
   /**
    * Virtual protected destructor.
    */
-  virtual ~GestureProcessor();
+  ~GestureProcessor() override;
 
   // Methods to be used by deriving classes
 
@@ -88,7 +78,7 @@ protected:
    * @note Uses CheckGestureDetector() to check if a the current gesture matches the criteria the gesture detector requires.
    * @pre gestureDetectors should be empty.
    */
-  void GetGesturedActor( Actor*& actor, GestureDetectorContainer& gestureDetectors );
+  void GetGesturedActor(Actor*& actor, GestureDetectorContainer& gestureDetectors);
 
   /**
    * Calls the emission method in the deriving class for matching gesture-detectors with the hit-actor (or one of its parents).
@@ -99,7 +89,7 @@ protected:
    *       and EmitGestureSignal() to emit the signal.
    * @pre Hit Testing should already be done.
    */
-  void ProcessAndEmit( HitTestAlgorithm::Results& hitTestResults );
+  void ProcessAndEmit(HitTestAlgorithm::Results& hitTestResults);
 
   /**
    * Hit test the screen coordinates, and place the results in hitTestResults.
@@ -108,13 +98,13 @@ protected:
    * @param[out] hitTestResults Structure to write results into.
    * @return false if the system overlay was hit or no actor was hit.
    */
-  virtual bool HitTest( Scene& scene, Vector2 screenCoordinates, HitTestAlgorithm::Results& hitTestResults);
+  virtual bool HitTest(Scene& scene, Vector2 screenCoordinates, HitTestAlgorithm::Results& hitTestResults);
 
   /**
    * Sets the mCurrentGesturedActor and connects to the required signals.
    * @actor  actor  The actor so set.
    */
-  void SetActor( Actor* actor );
+  void SetActor(Actor* actor);
 
   /**
    * Resets the set actor and disconnects any connected signals.
@@ -129,7 +119,6 @@ protected:
   Actor* GetCurrentGesturedActor();
 
 private:
-
   // For derived classes to override
 
   /**
@@ -146,7 +135,7 @@ private:
    *
    * @return true, if the detector meets the parameters, false otherwise.
    */
-  virtual bool CheckGestureDetector( GestureDetector* detector, Actor* actor ) = 0;
+  virtual bool CheckGestureDetector(GestureDetector* detector, Actor* actor) = 0;
 
   /**
    * Called by the ProcessAndEmit() method when the gesture meets all applicable criteria and
@@ -157,12 +146,12 @@ private:
    * @param[in]  gestureDetectors  The detectors that should emit the signal.
    * @param[in]  actorCoordinates  The local actor coordinates where the gesture took place.
    */
-  virtual void EmitGestureSignal( Actor* actor, const GestureDetectorContainer& gestureDetectors, Vector2 actorCoordinates ) = 0;
+  virtual void EmitGestureSignal(Actor* actor, const GestureDetectorContainer& gestureDetectors, Vector2 actorCoordinates) = 0;
 
   // Undefined
 
-  GestureProcessor( const GestureProcessor& );
-  GestureProcessor& operator=( const GestureProcessor& );
+  GestureProcessor(const GestureProcessor&);
+  GestureProcessor& operator=(const GestureProcessor&);
 
   // SceneObject overrides
 
@@ -171,7 +160,9 @@ private:
    * @param[in] object The object object.
    * @see Object::Observer::SceneObjectAdded()
    */
-  virtual void SceneObjectAdded(Object& object) { }
+  void SceneObjectAdded(Object& object) override
+  {
+  }
 
   /**
    * This will be called when the actor is removed from the stage, we should clear and stop
@@ -179,26 +170,23 @@ private:
    * @param[in] object The object object.
    * @see Object::Observer::SceneObjectRemoved()
    */
-  virtual void SceneObjectRemoved(Object& object);
+  void SceneObjectRemoved(Object& object) override;
 
   /**
    * This will be called when the actor is destroyed. We should clear the actor.
    * No need to stop observing as the object is being destroyed anyway.
    * @see Object::Observer::ObjectDestroyed()
    */
-  virtual void ObjectDestroyed(Object& object);
-
-
-protected:  //Data
-
-  GestureRecognizerPtr mGestureRecognizer;  ///< The gesture recognizer
-  bool   mNeedsUpdate;                 ///< Indicates if any GestureDetector requires a Core::Update
+  void ObjectDestroyed(Object& object) override;
 
-private: // Data
+protected:                                 //Data
+  GestureRecognizerPtr mGestureRecognizer; ///< The gesture recognizer
+  bool                 mNeedsUpdate;       ///< Indicates if any GestureDetector requires a Core::Update
 
-  DevelGesture::Type mType;            ///< Type of GestureProcessor
-  Actor* mCurrentGesturedActor;        ///< The current actor that has been gestured.
-  bool   mGesturedActorDisconnected:1; ///< Indicates whether the gestured actor has been disconnected from the scene
+private:                                             // Data
+  GestureType::Value mType;                          ///< Type of GestureProcessor
+  Actor*             mCurrentGesturedActor;          ///< The current actor that has been gestured.
+  bool               mGesturedActorDisconnected : 1; ///< Indicates whether the gestured actor has been disconnected from the scene
 };
 
 } // namespace Internal