Added support for Rotation Gestures
[platform/core/uifw/dali-core.git] / dali / internal / event / events / gesture-processor.h
index 8b661b3..ed430df 100644 (file)
@@ -1,8 +1,8 @@
-#ifndef __DALI_INTERNAL_GESTURE_PROCESSOR_H__
-#define __DALI_INTERNAL_GESTURE_PROCESSOR_H__
+#ifndef DALI_INTERNAL_GESTURE_PROCESSOR_H
+#define DALI_INTERNAL_GESTURE_PROCESSOR_H
 
 /*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2019 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/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>
 
 namespace Dali
@@ -36,6 +38,26 @@ namespace Internal
  */
 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 );
+
+  /**
+   * Returns whether any GestureDetector requires a Core::Update
+   * @return true if update required
+   */
+  inline bool NeedsUpdate()
+  {
+    bool updateRequired = mNeedsUpdate;
+    mNeedsUpdate = false;
+    return updateRequired;
+  }
+
 protected:
 
   // Construction & Destruction
@@ -43,6 +65,11 @@ protected:
   /**
    * Protected constructor.  Cannot create an instance of GestureProcessor
    */
+  GestureProcessor( DevelGesture::Type type );
+
+  /**
+   * Protected constructor.  Cannot create an instance of GestureProcessor
+   */
   GestureProcessor( Gesture::Type type );
 
   /**
@@ -76,12 +103,12 @@ protected:
 
   /**
    * Hit test the screen coordinates, and place the results in hitTestResults.
-   * @param[in] stage Stage.
+   * @param[in] scene Scene.
    * @param[in] screenCoordinates The screen coordinates to test.
    * @param[out] hitTestResults Structure to write results into.
    * @return false if the system overlay was hit or no actor was hit.
    */
-  virtual bool HitTest(Stage& stage, Vector2 screenCoordinates, HitTestAlgorithm::Results& hitTestResults);
+  virtual bool HitTest( Scene& scene, Vector2 screenCoordinates, HitTestAlgorithm::Results& hitTestResults);
 
   /**
    * Sets the mCurrentGesturedActor and connects to the required signals.
@@ -161,9 +188,15 @@ private:
    */
   virtual void ObjectDestroyed(Object& object);
 
+
+protected:  //Data
+
+  GestureRecognizerPtr mGestureRecognizer;  ///< The gesture recognizer
+  bool   mNeedsUpdate;                 ///< Indicates if any GestureDetector requires a Core::Update
+
 private: // Data
 
-  Gesture::Type mType;                 ///< Type of GestureProcessor
+  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
 };
@@ -172,4 +205,4 @@ private: // Data
 
 } // namespace Dali
 
-#endif // __DALI_INTERNAL_GESTURE_PROCESSOR_H__
+#endif // DALI_INTERNAL_GESTURE_PROCESSOR_H