[dali_1.4.16] Merge branch 'devel/master'
[platform/core/uifw/dali-toolkit.git] / automated-tests / src / dali-toolkit / custom-layout-impl.h
index b2dcb99..375b491 100644 (file)
@@ -2,7 +2,7 @@
 #define TEST_INTERNAL_CUSTOM_LAYOUT_H
 
 /*
- * Copyright (c) 2018 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.
@@ -20,6 +20,7 @@
 // EXTERNAL INCLUDES
 #include <dali/public-api/common/intrusive-ptr.h>
 #include <dali-toolkit/devel-api/layouting/layout-group-impl.h>
+#include <dali-toolkit/devel-api/layouting/layout-item-impl.h>
 
 // INTERNAL INCLUDES
 #include "custom-layout.h"
@@ -57,12 +58,27 @@ public:
   CustomLayout( CustomLayout&& other ) = default;
   CustomLayout& operator=( CustomLayout&& other ) = default;
 
+  /**
+   * @copydoc CustomLayout::SetCustomBehaviourFlag
+   */
+  void SetCustomBehaviourFlag( int flag );
+
+  /**
+   * @copydoc CustomLayout::GetCustomBehaviourFlags
+   */
+  bool GetCustomBehaviourFlags( int flagToCheck );
+
+  /**
+   * @copydoc CustomLayout::ClearPrivateFlag
+   */
+  void ClearPrivateFlag( int flag );
+
 private:
 
   /**
    * @brief Default Constructor
    */
-  CustomLayout() = default;
+  CustomLayout();
 
   /**
    * Virtual Destructor
@@ -83,6 +99,22 @@ private:
    */
   virtual void OnLayout( bool changed, LayoutLength left, LayoutLength top, LayoutLength right, LayoutLength bottom ) override;
 
+  /**
+   * Measure children with parent's measure spec unless BehaviourFlag set to use an unconstrained width or height.
+   * @param[in] childLayout child to measure
+   * @param[in] widthMeasureSpec default layout width measure spec
+   * @param[in] heightMeasureSpec default layout height measure spec
+   * @param[out] resultingWidth resulting width of layout after children are measured
+   * @param[out] resultingHeight resulting height of layout after children are measured
+   */
+  void MeasureChildren( Dali::Toolkit::Internal::LayoutItemPtr childLayout, MeasureSpec widthMeasureSpec, MeasureSpec heightMeasureSpec, LayoutLength resultingWidth, LayoutLength resultingHeight );
+
+  using Dali::Toolkit::Internal::LayoutGroup::MeasureChildren; ///< To tell the compiler that we really do want to overload MeasureChildren in this class & were not trying to override it
+
+  private:
+
+  int mBehaviourFlags; // flags to alter behaviour of this custom layout
+
 };
 
 } // namespace Internal