99566dc3c7781b34a6d6cd565a0673632fb0a587
[platform/core/uifw/dali-toolkit.git] / dali-toolkit / public-api / controls / alignment / alignment.cpp
1 /*
2  * Copyright (c) 2014 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 <dali-toolkit/public-api/controls/alignment/alignment.h>
20
21 // EXTERNAL INCLUDES
22 #include <dali/integration-api/debug.h>
23
24 // INTERNAL INCLUDES
25 #include <dali-toolkit/internal/controls/alignment/alignment-impl.h>
26
27 namespace Dali
28 {
29
30 namespace Toolkit
31 {
32
33 Alignment::Alignment()
34 {
35 }
36
37 Alignment Alignment::New( Type horizontal, Type vertical )
38 {
39   return Internal::Alignment::New( horizontal, vertical );
40 }
41
42 Alignment::Alignment(const Alignment& alignment)
43 : Control( alignment )
44 {
45 }
46
47 Alignment::~Alignment()
48 {
49 }
50
51 Alignment Alignment::DownCast( BaseHandle handle )
52 {
53   return Control::DownCast<Alignment, Internal::Alignment>(handle);
54 }
55
56 void Alignment::SetAlignmentType( Type type )
57 {
58   GetImpl( *this ).SetAlignmentType( type );
59 }
60
61 Alignment::Type Alignment::GetAlignmentType() const
62 {
63   return GetImpl( *this ).GetAlignmentType();
64 }
65
66 void Alignment::SetScaling( Scaling scaling )
67 {
68   GetImpl( *this ).SetScaling( scaling );
69 }
70
71 Alignment::Scaling Alignment::GetScaling() const
72 {
73   return GetImpl( *this ).GetScaling();
74 }
75
76 void Alignment::SetPadding( const Alignment::Padding& padding )
77 {
78   GetImpl( *this ).SetPadding( padding );
79 }
80
81 const Alignment::Padding& Alignment::GetPadding() const
82 {
83   return GetImpl( *this ).GetPadding();
84 }
85
86 Alignment::Alignment( Internal::Alignment& implementation )
87 : Control( implementation )
88 {
89 }
90
91 Alignment& Alignment::operator=(const Alignment& alignment)
92 {
93   if( &alignment != this )
94   {
95     Control::operator=( alignment );
96   }
97   return *this;
98 }
99
100 Alignment::Alignment( Dali::Internal::CustomActor* internal )
101 : Control( internal )
102 {
103   VerifyCustomActorPointer<Internal::Alignment>(internal);
104 }
105
106 } // namespace Toolkit
107
108 } // namespace Dali