Merge "Exporting one constructor used by csharpbinder and making an API private....
[platform/core/uifw/dali-toolkit.git] / dali-toolkit / internal / layouting / absolute-layout-impl.h
1 #ifndef DALI_TOOLKIT_INTERNAL_ABSOLUTE_LAYOUT_H
2 #define DALI_TOOLKIT_INTERNAL_ABSOLUTE_LAYOUT_H
3
4 /*
5  * Copyright (c) 2018 Samsung Electronics Co., Ltd.
6  *
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
10  *
11  * http://www.apache.org/licenses/LICENSE-2.0
12  *
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.
18  */
19
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/absolute-layout.h>
24
25 namespace Dali
26 {
27 namespace Toolkit
28 {
29 namespace Internal
30 {
31
32 class AbsoluteLayout;
33 using AbsoluteLayoutPtr = IntrusivePtr<AbsoluteLayout>;
34
35 class AbsoluteLayout final : public LayoutGroup
36 {
37 public:
38   static AbsoluteLayoutPtr New();
39
40 protected:
41
42   /**
43    * Constructor
44    */
45   AbsoluteLayout();
46
47   /**
48    * Destructor
49    */
50   virtual ~AbsoluteLayout();
51
52   /**
53    * @copydoc LayoutItem::OnMeasure
54    */
55   virtual void OnMeasure( MeasureSpec widthMeasureSpec, MeasureSpec heightMeasureSpec ) override;
56
57   /**
58    * @copydoc LayoutItem::OnLayout
59    */
60   virtual void OnLayout( bool changed, LayoutLength l, LayoutLength t, LayoutLength r, LayoutLength b ) override;
61
62 private:
63   AbsoluteLayout( const AbsoluteLayout& other ) = delete;
64   AbsoluteLayout& operator=( const AbsoluteLayout& other ) = delete;
65
66   void ForceUniformHeight( int count, MeasureSpec widthMeasureSpec );
67
68 };
69
70 } // namespace Internal
71
72 inline Internal::AbsoluteLayout& GetImplementation( Dali::Toolkit::AbsoluteLayout& handle )
73 {
74   DALI_ASSERT_ALWAYS( handle && "AbsoluteLayout handle is empty" );
75   BaseObject& object = handle.GetBaseObject();
76   return static_cast<Internal::AbsoluteLayout&>( object );
77 }
78
79 inline const Internal::AbsoluteLayout& GetImplementation( const Dali::Toolkit::AbsoluteLayout& handle )
80 {
81   DALI_ASSERT_ALWAYS( handle && "AbsoluteLayout handle is empty" );
82   const BaseObject& object = handle.GetBaseObject();
83   return static_cast<const Internal::AbsoluteLayout&>( object );
84 }
85
86 } // namespace Toolkit
87 } // namespace Dali
88
89 #endif // DALI_TOOLKIT_INTERNAL_ABSOLUTE_LAYOUT_H