Split dali-toolkit into Base & Optional
[platform/core/uifw/dali-toolkit.git] / optional / dali-toolkit / public-api / controls / shadow-view / shadow-view.cpp
1 //
2 // Copyright (c) 2014 Samsung Electronics Co., Ltd.
3 //
4 // Licensed under the Flora License, Version 1.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://floralicense.org/license/
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 // CLASS HEADER
18 #include <dali-toolkit/public-api/controls/shadow-view/shadow-view.h>
19
20 // INTERNAL INCLUDES
21 #include <dali-toolkit/internal/controls/shadow-view/shadow-view-impl.h>
22
23 namespace
24 {
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
34 namespace Toolkit
35 {
36
37 ShadowView::ShadowView()
38 {
39 }
40
41 ShadowView::~ShadowView()
42 {
43 }
44
45 ShadowView::ShadowView(const ShadowView& handle)
46   : Control( handle )
47 {
48 }
49
50 ShadowView& ShadowView::operator=(const ShadowView& rhs)
51 {
52   if( &rhs != this )
53   {
54     Control::operator=(rhs);
55   }
56   return *this;
57 }
58
59 ShadowView ShadowView::New()
60 {
61   return Internal::ShadowView::New(GAUSSIAN_BLUR_VIEW_DEFAULT_DOWNSAMPLE_WIDTH_SCALE,
62                                    GAUSSIAN_BLUR_VIEW_DEFAULT_DOWNSAMPLE_HEIGHT_SCALE);
63 }
64
65 ShadowView ShadowView::New(float downsampleWidthScale, float downsampleHeightScale)
66 {
67   return Internal::ShadowView::New(downsampleWidthScale, downsampleHeightScale);
68 }
69
70 ShadowView::ShadowView( Internal::ShadowView& implementation )
71 : Control( implementation )
72 {
73 }
74
75 ShadowView::ShadowView( Dali::Internal::CustomActor* internal )
76 : Control( internal )
77 {
78   VerifyCustomActorPointer<Internal::ShadowView>(internal);
79 }
80
81 ShadowView ShadowView::DownCast( BaseHandle handle )
82 {
83   return Control::DownCast<ShadowView, Internal::ShadowView>(handle);
84 }
85
86 void ShadowView::Add(Actor child)
87 {
88   GetImpl(*this).Add(child);
89 }
90
91 void ShadowView::Remove(Actor child)
92 {
93   GetImpl(*this).Remove(child);
94 }
95
96 void ShadowView::SetShadowPlane(ImageActor shadowPlane)
97 {
98   GetImpl(*this).SetShadowPlane(shadowPlane);
99 }
100
101 void ShadowView::SetPointLight(Actor pointLight)
102 {
103   GetImpl(*this).SetPointLight(pointLight);
104 }
105
106 void ShadowView::SetPointLightFieldOfView(float fieldOfView)
107 {
108   GetImpl(*this).SetPointLightFieldOfView(fieldOfView);
109 }
110
111 void ShadowView::SetShadowColor(Vector4 color)
112 {
113   GetImpl(*this).SetShadowColor(color);
114 }
115
116 void ShadowView::Activate()
117 {
118   GetImpl(*this).Activate();
119 }
120
121 void ShadowView::Deactivate()
122 {
123   GetImpl(*this).Deactivate();
124 }
125
126 Property::Index ShadowView::GetBlurStrengthPropertyIndex() const
127 {
128   return GetImpl(*this).GetBlurStrengthPropertyIndex();
129 }
130
131 Property::Index ShadowView::GetShadowColorPropertyIndex() const
132 {
133   return GetImpl(*this).GetShadowColorPropertyIndex();
134 }
135
136 } // namespace Toolkit
137
138 } // namespace Dali