[Tizen] Revert "Use touch consumed return to set whether we process a gesture or...
[platform/core/uifw/dali-core.git] / dali / internal / event / events / touch-event-processor.h
index 2b73ce1..9306e6f 100644 (file)
@@ -1,25 +1,26 @@
-#ifndef __DALI_INTERNAL_TOUCH_EVENT_PROCESSOR_H__
-#define __DALI_INTERNAL_TOUCH_EVENT_PROCESSOR_H__
-
-//
-// 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.
-//
+#ifndef DALI_INTERNAL_TOUCH_EVENT_PROCESSOR_H
+#define DALI_INTERNAL_TOUCH_EVENT_PROCESSOR_H
+
+/*
+ * 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.
+ * 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.
+ *
+ */
 
 // INTERNAL INCLUDES
-#include <dali/public-api/render-tasks/render-task.h>
-#include <dali/internal/event/common/proxy-object.h>
+#include <dali/internal/event/events/actor-observer.h>
+#include <dali/internal/event/render-tasks/render-task-impl.h>
 
 namespace Dali
 {
@@ -37,7 +38,8 @@ namespace Internal
 {
 
 class Actor;
-class Stage;
+class Scene;
+struct ActorObserver;
 
 /**
  * <h3>Multi-Touch Event Processing:</h3>
@@ -53,9 +55,9 @@ public:
 
   /**
    * Create an event processor.
-   * @param[in] stage The stage.
+   * @param[in] scene The scene the event processor belongs to.
    */
-  TouchEventProcessor( Stage& stage );
+  TouchEventProcessor( Scene& scene );
 
   /**
    * Non-virtual destructor; TouchEventProcessor is not a base class
@@ -78,88 +80,24 @@ private:
 
 private:
 
+  Scene& mScene; ///< Used to deliver touch events
+
   /**
-   * Stores an actor pointer and connects/disconnects to any required signals appropriately when set/unset.
+   * Called by some actor-observers when the observed actor is disconnected.
+   *
+   * @param[in]  actor  The actor that has been disconnected.
    */
-  struct ActorObserver : public ProxyObject::Observer
-  {
-  public:
-
-    // Construction & Destruction
-
-    /**
-     * Constructor.
-     */
-    ActorObserver();
-
-    /**
-     * Non virtual destructor
-     */
-    ~ActorObserver();
-
-    // Methods
-
-    /**
-     * Return the stored Actor pointer.
-     * @return The Actor pointer.
-     */
-    Actor* GetActor();
-
-    /**
-     * Assignment operator.
-     * This disconnects the required signals from the currently set actor and connects to the required
-     * signals for the the actor specified (if set).
-     */
-    void SetActor( Actor* actor );
-
-    /**
-     * Resets the set actor and disconnects any connected signals.
-     */
-    void ResetActor();
-
-  private:
-
-    // Undefined
-    ActorObserver( const ActorObserver& );
-    ActorObserver& operator=( const ActorObserver& );
-
-  private:
-
-    /**
-     * This will never get called as we do not observe objects that have not been added to the scene.
-     * @param[in] proxy The proxy object.
-     * @see ProxyObject::Observer::SceneObjectAdded()
-     */
-    virtual void SceneObjectAdded(ProxyObject& proxy) { }
-
-    /**
-     * This will be called when the actor is removed from the stage, we should clear and stop
-     * observing it.
-     * @param[in] proxy The proxy object.
-     * @see ProxyObject::Observer::SceneObjectRemoved()
-     */
-    virtual void SceneObjectRemoved(ProxyObject& proxy);
-
-    /**
-     * 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 ProxyObject::Observer::ProxyDestroyed()
-     */
-    virtual void ProxyDestroyed(ProxyObject& proxy);
-
-  private:
-    Actor* mActor;              ///< Raw pointer to an Actor.
-    bool   mActorDisconnected;  ///< Indicates whether the actor has been disconnected from the scene
-  };
-
-  Stage& mStage; ///< Used to deliver touch events
+  void OnObservedActorDisconnected( Actor* actor );
+
   ActorObserver mLastPrimaryHitActor; ///< Stores the last primary point hit actor
   ActorObserver mLastConsumedActor; ///< Stores the last consumed actor
-  Dali::RenderTask mLastRenderTask; ///< The RenderTask used for the last hit actor
+  ActorObserver mCapturingTouchActor; ///< Stored the actor that captures touch
+  ActorObserver mTouchDownConsumedActor; ///< Stores the touch-down consumed actor
+  RenderTaskPtr mLastRenderTask; ///< The RenderTask used for the last hit actor
 };
 
 } // namespace Internal
 
 } // namespace Dali
 
-#endif // __DALI_INTERNAL_TOUCH_EVENT_PROCESSOR_H__
+#endif // DALI_INTERNAL_TOUCH_EVENT_PROCESSOR_H