use modern construct 'override' in the derive class.
[platform/core/uifw/dali-core.git] / dali / internal / event / size-negotiation / relayout-controller-impl.h
index aa277c5..5117371 100644 (file)
@@ -1,8 +1,8 @@
-#ifndef __DALI_INTERNAL_RELAYOUT_CONTROLLER_IMPL_H__
-#define __DALI_INTERNAL_RELAYOUT_CONTROLLER_IMPL_H__
+#ifndef DALI_INTERNAL_RELAYOUT_CONTROLLER_IMPL_H
+#define DALI_INTERNAL_RELAYOUT_CONTROLLER_IMPL_H
 
 /*
- * Copyright (c) 2015 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.
@@ -18,6 +18,9 @@
  *
  */
 
+// EXTERNAL INCLUDES
+#include <cstdint>
+
 // INTERNAL INCLUDES
 #include <dali/public-api/common/vector-wrapper.h>
 #include <dali/public-api/object/base-object.h>
 namespace Dali
 {
 
+namespace Integration
+{
+class RenderController;
+}
+
 namespace Internal
 {
 
@@ -43,13 +51,14 @@ public:
   /**
    * @brief Constructor.
    * We should only create a unique instance.
+   * @param[in] controller to request a render from the RenderController if core is not processing events.
    */
-  RelayoutController();
+  RelayoutController( Integration::RenderController& controller );
 
   /**
    * Destructor
    */
-  virtual ~RelayoutController();
+  ~RelayoutController() override;
 
   /**
    * @brief Get the singleton of RelayoutController object.
@@ -111,6 +120,13 @@ public:
    */
   bool IsPerformingRelayout() const;
 
+  /**
+   * @brief Sets whether core is processing events.
+   *
+   * @param[in] processingEvents whether core is processing events.
+   */
+  void SetProcessingCoreEvents( bool processingEvents );
+
 public: // CALLBACKS
 
   /**
@@ -127,7 +143,7 @@ public: // CALLBACKS
 
 private:
 
-  typedef Dali::Vector< BaseObject* > RawActorList;
+  using RawActorList = Dali::Vector< Dali::Internal::Actor* >;
 
   /**
    * @brief Request for relayout. Relays out whole scene.
@@ -171,7 +187,7 @@ private:
    * @param[in] actors The container to add the actor to
    * @param[in] size The size that this actor should be
    */
-  void QueueActor( Dali::Actor& actor, RelayoutContainer& actors, Vector2 size );
+  void QueueActor( Internal::Actor* actor, RelayoutContainer& actors, Vector2 size );
 
   /**
    * @brief Find the given object in the list and null it out
@@ -182,21 +198,24 @@ private:
   void FindAndZero( const RawActorList& list, const Dali::RefObject* object );
 
   // Undefined
-  RelayoutController(const RelayoutController&);
-  RelayoutController& operator=(const RelayoutController&);
+  RelayoutController(const RelayoutController&) = delete;
+  RelayoutController& operator=(const RelayoutController&) = delete;
 
 private:
 
+  Integration::RenderController& mRenderController;
   MemoryPoolObjectAllocator< MemoryPoolRelayoutContainer::RelayoutInfo > mRelayoutInfoAllocator;
 
   SlotDelegate< RelayoutController > mSlotDelegate;
 
   RawActorList mDirtyLayoutSubTrees;    ///< List of roots of sub trees that are dirty
   MemoryPoolRelayoutContainer* mRelayoutStack;  ///< Stack for relayouting
-  bool mRelayoutConnection : 1;         ///< Whether EventProcessingFinishedSignal signal is connected.
-  bool mRelayoutFlag : 1;               ///< Relayout flag to avoid unnecessary calls
-  bool mEnabled : 1;                    ///< Initially disabled. Must be enabled at some point.
-  bool mPerformingRelayout : 1;         ///< The relayout controller is currently performing a relayout
+
+  bool mRelayoutConnection : 1;    ///< Whether EventProcessingFinishedSignal signal is connected.
+  bool mRelayoutFlag : 1;          ///< Relayout flag to avoid unnecessary calls
+  bool mEnabled : 1;               ///< Initially disabled. Must be enabled at some point.
+  bool mPerformingRelayout : 1;    ///< The relayout controller is currently performing a relayout
+  bool mProcessingCoreEvents : 1;  ///< Whether core is processing events.
 
 };
 
@@ -204,4 +223,4 @@ private:
 
 } // namespace Dali
 
-#endif // __DALI_INTERNAL_RELAYOUT_CONTROLLER_IMPL_H__
+#endif // DALI_INTERNAL_RELAYOUT_CONTROLLER_IMPL_H