1 #ifndef DALI_TOOLKIT_INTERNAL_LAYOUTING_VBOX_LAYOUT_H
2 #define DALI_TOOLKIT_INTERNAL_LAYOUTING_VBOX_LAYOUT_H
5 * Copyright (c) 2018 Samsung Electronics Co., Ltd.
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
11 * http://www.apache.org/licenses/LICENSE-2.0
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
20 #include <dali/public-api/common/intrusive-ptr.h>
21 #include <dali/public-api/object/base-object.h>
22 #include <dali-toolkit/devel-api/layouting/layout-group-impl.h>
23 #include <dali-toolkit/devel-api/layouting/vbox-layout.h>
33 using VboxLayoutPtr = IntrusivePtr<VboxLayout>;
35 class VboxLayout final : public LayoutGroup
38 static VboxLayoutPtr New();
43 * Set the inter-cell padding
44 * @param[in] size The size of the inter-cell padding
46 void SetCellPadding( LayoutSize size );
49 * Get the inter-cell padding
50 * @return The size of the inter-cell padding
52 LayoutSize GetCellPadding();
63 virtual ~VboxLayout();
66 * @copydoc LayoutItem::DoInitialize
68 virtual void DoInitialize() override;
71 * @copydoc LayoutItem::DoRegisterChildProperties()
73 virtual void DoRegisterChildProperties( const std::string& containerType ) override;
76 * @copydoc LayoutItem::OnChildAdd
78 virtual void OnChildAdd( LayoutItem& child ) override;
81 * @copydoc LayoutItem::OnMeasure
83 virtual void OnMeasure( MeasureSpec widthMeasureSpec, MeasureSpec heightMeasureSpec ) override;
86 * @copydoc LayoutItem::OnLayout
88 virtual void OnLayout( bool changed, LayoutLength l, LayoutLength t, LayoutLength r, LayoutLength b ) override;
91 VboxLayout( const VboxLayout& other ) = delete;
92 VboxLayout& operator=( const VboxLayout& other ) = delete;
95 * Apply a uniform width to the children
97 void ForceUniformWidth( int count, MeasureSpec heightMeasureSpec );
100 LayoutSize mCellPadding;
101 LayoutLength mTotalLength;
104 } // namespace Internal
106 inline Internal::VboxLayout& GetImplementation( Dali::Toolkit::VboxLayout& handle )
108 DALI_ASSERT_ALWAYS( handle && "VboxLayout handle is empty" );
109 BaseObject& object = handle.GetBaseObject();
110 return static_cast<Internal::VboxLayout&>( object );
113 inline const Internal::VboxLayout& GetImplementation( const Dali::Toolkit::VboxLayout& handle )
115 DALI_ASSERT_ALWAYS( handle && "VboxLayout handle is empty" );
116 const BaseObject& object = handle.GetBaseObject();
117 return static_cast<const Internal::VboxLayout&>( object );
120 } // namespace Toolkit
123 #endif // DALI_TOOLKIT_INTERNAL_LAYOUTING_VBOX_LAYOUT_H