Merge "Controls are LayoutGroups instead of LayoutItems" into devel/master
[platform/core/uifw/dali-toolkit.git] / dali-toolkit / devel-api / layouting / linear-layout.cpp
1 /*
2  * Copyright (c) 2018 Samsung Electronics Co., Ltd.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16
17 //CLASS HEADER
18 #include "linear-layout.h"
19
20 //INTERNAL INCLUDES
21 #include <dali-toolkit/internal/layouting/linear-layout-impl.h>
22
23 namespace Dali
24 {
25 namespace Toolkit
26 {
27
28 LinearLayout::LinearLayout()
29 {
30 }
31
32 LinearLayout LinearLayout::New()
33 {
34   Internal::LinearLayoutPtr internal = Internal::LinearLayout::New();
35   return LinearLayout( internal.Get() );
36 }
37
38 LinearLayout LinearLayout::DownCast( BaseHandle handle )
39 {
40   return LinearLayout( dynamic_cast< Dali::Toolkit::Internal::LinearLayout*>( handle.GetObjectPtr() ) );
41 }
42
43 LinearLayout::LinearLayout( const LinearLayout& other )
44 : LayoutGroup( other )
45 {
46 }
47
48 LinearLayout& LinearLayout::operator=( const LinearLayout& other )
49 {
50   if( &other != this )
51   {
52     LayoutGroup::operator=( other );
53   }
54   return *this;
55 }
56
57 void LinearLayout::SetCellPadding( LayoutSize size )
58 {
59   GetImplementation(*this).SetCellPadding( size );
60 }
61
62 LayoutSize LinearLayout::GetCellPadding() const
63 {
64   return GetImplementation(*this).GetCellPadding();
65 }
66
67 void LinearLayout::SetOrientation( LinearLayout::Orientation orientation )
68 {
69   GetImplementation(*this).SetOrientation( orientation );
70 }
71
72 LinearLayout::Orientation LinearLayout::GetOrientation() const
73 {
74   return GetImplementation(*this).GetOrientation();
75 }
76
77 void LinearLayout::SetAlignment( unsigned int alignment )
78 {
79   GetImplementation(*this).SetAlignment( alignment );
80 }
81
82 unsigned int LinearLayout::GetAlignment() const
83 {
84   return GetImplementation(*this).GetAlignment();
85 }
86
87 LinearLayout::LinearLayout( Dali::Toolkit::Internal::LinearLayout* object )
88 : LayoutGroup( object )
89 {
90 }
91
92 } // namespace Toolkit
93 } // namespace Dali