Improved layout in text-field example
[platform/core/uifw/dali-demo.git] / examples / text / vertical-layout.cpp
1 /*
2  * Copyright (c) 2015 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
18 // CLASS HEADER
19 #include "vertical-layout.h"
20
21 // INTERNAL INCLUDES
22 #include "vertical-layout-impl.h"
23
24 namespace Dali
25 {
26
27 namespace Toolkit
28 {
29
30 VerticalLayout VerticalLayout::New()
31 {
32   return Internal::VerticalLayout::New();
33 }
34
35 VerticalLayout::VerticalLayout()
36 {
37 }
38
39 VerticalLayout::VerticalLayout( const VerticalLayout& handle )
40 : Control( handle )
41 {
42 }
43
44 VerticalLayout& VerticalLayout::operator=( const VerticalLayout& handle )
45 {
46   if( &handle != this )
47   {
48     Control::operator=( handle );
49   }
50   return *this;
51 }
52
53 VerticalLayout VerticalLayout::DownCast( BaseHandle handle )
54 {
55   return Control::DownCast<VerticalLayout, Internal::VerticalLayout>( handle );
56 }
57
58 VerticalLayout::~VerticalLayout()
59 {
60 }
61
62 VerticalLayout::VerticalLayout( Internal::VerticalLayout& internal )
63 : Control( internal )
64 {
65 }
66
67 VerticalLayout::VerticalLayout( Dali::Internal::CustomActor* internal )
68 : Control( internal )
69 {
70 }
71
72 void VerticalLayout::AddLabel( TextLabel label )
73 {
74   GetImpl( *this ).AddLabel( label );
75 }
76
77 Internal::VerticalLayout& VerticalLayout::GetImpl( VerticalLayout& verticalLayout )
78 {
79   DALI_ASSERT_ALWAYS( verticalLayout );
80
81   Dali::RefObject& handle = verticalLayout.GetImplementation();
82
83   return static_cast<Internal::VerticalLayout&>(handle);
84 }
85
86 } // namespace Toolkit
87
88 } // namespace Dali