1 #ifndef DALI_TOOLKIT_INTERNAL_BIN_LAYOUT_H
2 #define DALI_TOOLKIT_INTERNAL_BIN_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/bin-layout.h>
33 using BinLayoutPtr = IntrusivePtr<BinLayout>;
35 class BinLayout final : public LayoutGroup
38 static BinLayoutPtr New();
53 * @copydoc LayoutItem::OnMeasure
55 virtual void OnMeasure( MeasureSpec widthMeasureSpec, MeasureSpec heightMeasureSpec ) override;
58 * @copydoc LayoutItem::OnLayout
60 virtual void OnLayout( bool changed, LayoutLength l, LayoutLength t, LayoutLength r, LayoutLength b ) override;
63 BinLayout( const BinLayout& other ) = delete;
64 BinLayout& operator=( const BinLayout& other ) = delete;
68 } // namespace Internal
70 inline Internal::BinLayout& GetImplementation( Dali::Toolkit::BinLayout& handle )
72 DALI_ASSERT_ALWAYS( handle && "BinLayout handle is empty" );
73 BaseObject& object = handle.GetBaseObject();
74 return static_cast<Internal::BinLayout&>( object );
77 inline const Internal::BinLayout& GetImplementation( const Dali::Toolkit::BinLayout& handle )
79 DALI_ASSERT_ALWAYS( handle && "BinLayout handle is empty" );
80 const BaseObject& object = handle.GetBaseObject();
81 return static_cast<const Internal::BinLayout&>( object );
84 } // namespace Toolkit
87 #endif // DALI_TOOLKIT_INTERNAL_BIN_LAYOUT_H