31d172939726d48e585755b9e06bec2a05c27ced
[platform/core/uifw/dali-core.git] / dali / public-api / actors / layer.cpp
1 /*
2  * Copyright (c) 2022 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/public-api/actors/layer.h>
20
21 // INTERNAL INCLUDES
22 #include <dali/internal/event/actors/layer-impl.h>
23
24 namespace Dali
25 {
26 Layer::Layer() = default;
27
28 Layer Layer::New()
29 {
30   Internal::LayerPtr internal = Internal::Layer::New();
31
32   return Layer(internal.Get());
33 }
34
35 Layer Layer::DownCast(BaseHandle handle)
36 {
37   return Layer(dynamic_cast<Dali::Internal::Layer*>(handle.GetObjectPtr()));
38 }
39
40 Layer::~Layer() = default;
41
42 Layer::Layer(const Layer& copy) = default;
43
44 Layer& Layer::operator=(const Layer& rhs) = default;
45
46 Layer::Layer(Layer&& rhs) = default;
47
48 Layer& Layer::operator=(Layer&& rhs) = default;
49
50 void Layer::Raise()
51 {
52   GetImplementation(*this).Raise();
53 }
54
55 void Layer::Lower()
56 {
57   GetImplementation(*this).Lower();
58 }
59
60 void Layer::RaiseAbove(Layer target)
61 {
62   GetImplementation(*this).RaiseAbove(GetImplementation(target));
63 }
64
65 void Layer::LowerBelow(Layer target)
66 {
67   GetImplementation(*this).LowerBelow(GetImplementation(target));
68 }
69
70 void Layer::RaiseToTop()
71 {
72   GetImplementation(*this).RaiseToTop();
73 }
74
75 void Layer::LowerToBottom()
76 {
77   GetImplementation(*this).LowerToBottom();
78 }
79
80 void Layer::MoveAbove(Layer target)
81 {
82   GetImplementation(*this).MoveAbove(GetImplementation(target));
83 }
84
85 void Layer::MoveBelow(Layer target)
86 {
87   GetImplementation(*this).MoveBelow(GetImplementation(target));
88 }
89
90 void Layer::SetSortFunction(SortFunctionType function)
91 {
92   GetImplementation(*this).SetSortFunction(function);
93 }
94
95 Layer::Layer(Internal::Layer* internal)
96 : Actor(internal)
97 {
98 }
99
100 } // namespace Dali