2 * Copyright (c) 2018 Samsung Electronics Co., Ltd.
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
8 * http://www.apache.org/licenses/LICENSE-2.0
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.
18 #include "flex-layout.h"
21 #include <dali-toolkit/internal/layouting/flex-layout-impl.h>
28 FlexLayout::FlexLayout()
32 FlexLayout FlexLayout::New()
34 Internal::FlexLayoutPtr internal = Internal::FlexLayout::New();
35 return FlexLayout( internal.Get() );
38 FlexLayout FlexLayout::DownCast( BaseHandle handle )
40 return FlexLayout( dynamic_cast< Dali::Toolkit::Internal::FlexLayout*>( handle.GetObjectPtr() ) );
43 FlexLayout::FlexLayout( const FlexLayout& other )
44 : LayoutGroup( other )
48 FlexLayout& FlexLayout::operator=( const FlexLayout& other )
52 LayoutGroup::operator=( other );
57 void FlexLayout::SetFlexDirection( Dali::Toolkit::FlexLayout::FlexDirection flexDirection )
59 if( GetImplementation(*this).GetFlexDirection() != flexDirection )
61 GetImplementation(*this).SetFlexDirection( flexDirection );
62 GetImplementation(*this).RequestLayout();
66 Dali::Toolkit::FlexLayout::FlexDirection FlexLayout::GetFlexDirection() const
68 return GetImplementation(*this).GetFlexDirection();
71 void FlexLayout::SetFlexJustification( Dali::Toolkit::FlexLayout::Justification flexJustification )
73 if( GetImplementation(*this).GetFlexJustification() != flexJustification )
75 GetImplementation(*this).SetFlexJustification( flexJustification );
76 GetImplementation(*this).RequestLayout();
80 Dali::Toolkit::FlexLayout::Justification FlexLayout::GetFlexJustification() const
82 return GetImplementation(*this).GetFlexJustification();
85 void FlexLayout::SetFlexWrap( Dali::Toolkit::FlexLayout::WrapType flexWrap )
87 if( GetImplementation(*this).GetFlexWrap() != flexWrap )
89 GetImplementation(*this).SetFlexWrap( flexWrap );
90 GetImplementation(*this).RequestLayout();
94 Dali::Toolkit::FlexLayout::WrapType FlexLayout::GetFlexWrap() const
96 return GetImplementation(*this).GetFlexWrap();
99 void FlexLayout::SetFlexAlignment( Dali::Toolkit::FlexLayout::Alignment::Type flexAlignment )
101 if( GetImplementation(*this).GetFlexAlignment() != flexAlignment )
103 GetImplementation(*this).SetFlexAlignment( flexAlignment );
104 GetImplementation(*this).RequestLayout();
108 Dali::Toolkit::FlexLayout::Alignment::Type FlexLayout::GetFlexAlignment() const
110 return GetImplementation(*this).GetFlexAlignment();
113 void FlexLayout::SetFlexItemsAlignment( Dali::Toolkit::FlexLayout::Alignment::Type flexAlignment )
115 if( GetImplementation(*this).GetFlexItemsAlignment() != flexAlignment )
117 GetImplementation(*this).SetFlexItemsAlignment( flexAlignment );
118 GetImplementation(*this).RequestLayout();
122 Dali::Toolkit::FlexLayout::Alignment::Type FlexLayout::GetFlexItemsAlignment() const
124 return GetImplementation(*this).GetFlexItemsAlignment();
127 FlexLayout::FlexLayout( Dali::Toolkit::Internal::FlexLayout* object )
128 : LayoutGroup( object )
132 } // namespace Toolkit