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