[dali_2.3.21] Merge branch 'devel/master'
[platform/core/uifw/dali-toolkit.git] / dali-toolkit / devel-api / controls / shadow-view / shadow-view.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-toolkit/devel-api/controls/shadow-view/shadow-view.h>
20
21 // INTERNAL INCLUDES
22 #include <dali-toolkit/internal/controls/shadow-view/shadow-view-impl.h>
23
24 namespace
25 {
26 const float GAUSSIAN_BLUR_VIEW_DEFAULT_DOWNSAMPLE_WIDTH_SCALE  = 1.0f;
27 const float GAUSSIAN_BLUR_VIEW_DEFAULT_DOWNSAMPLE_HEIGHT_SCALE = 1.0f;
28
29 } // namespace
30
31 namespace Dali
32 {
33 namespace Toolkit
34 {
35 ShadowView::ShadowView()
36 {
37 }
38
39 ShadowView::~ShadowView()
40 {
41 }
42
43 ShadowView::ShadowView(const ShadowView& handle) = default;
44
45 ShadowView& ShadowView::operator=(const ShadowView& handle) = default;
46
47 ShadowView::ShadowView(ShadowView&& rhs) = default;
48
49 ShadowView& ShadowView::operator=(ShadowView&& rhs) = default;
50
51 ShadowView ShadowView::New()
52 {
53   return Internal::ShadowView::New(GAUSSIAN_BLUR_VIEW_DEFAULT_DOWNSAMPLE_WIDTH_SCALE,
54                                    GAUSSIAN_BLUR_VIEW_DEFAULT_DOWNSAMPLE_HEIGHT_SCALE);
55 }
56
57 ShadowView ShadowView::New(float downsampleWidthScale, float downsampleHeightScale)
58 {
59   return Internal::ShadowView::New(downsampleWidthScale, downsampleHeightScale);
60 }
61
62 ShadowView::ShadowView(Internal::ShadowView& implementation)
63 : Control(implementation)
64 {
65 }
66
67 ShadowView::ShadowView(Dali::Internal::CustomActor* internal)
68 : Control(internal)
69 {
70   VerifyCustomActorPointer<Internal::ShadowView>(internal);
71 }
72
73 ShadowView ShadowView::DownCast(BaseHandle handle)
74 {
75   return Control::DownCast<ShadowView, Internal::ShadowView>(handle);
76 }
77
78 void ShadowView::SetShadowPlaneBackground(Actor shadowPlaneBackground)
79 {
80   GetImpl(*this).SetShadowPlaneBackground(shadowPlaneBackground);
81 }
82
83 void ShadowView::SetPointLight(Actor pointLight)
84 {
85   GetImpl(*this).SetPointLight(pointLight);
86 }
87
88 void ShadowView::SetPointLightFieldOfView(float fieldOfView)
89 {
90   GetImpl(*this).SetPointLightFieldOfView(fieldOfView);
91 }
92
93 void ShadowView::SetShadowColor(Vector4 color)
94 {
95   GetImpl(*this).SetShadowColor(color);
96 }
97
98 void ShadowView::Activate()
99 {
100   GetImpl(*this).Activate();
101 }
102
103 void ShadowView::Deactivate()
104 {
105   GetImpl(*this).Deactivate();
106 }
107
108 Property::Index ShadowView::GetBlurStrengthPropertyIndex() const
109 {
110   return GetImpl(*this).GetBlurStrengthPropertyIndex();
111 }
112
113 Property::Index ShadowView::GetShadowColorPropertyIndex() const
114 {
115   return GetImpl(*this).GetShadowColorPropertyIndex();
116 }
117
118 } // namespace Toolkit
119
120 } // namespace Dali