Split dali-toolkit into Base & Optional
[platform/core/uifw/dali-toolkit.git] / optional / dali-toolkit / public-api / controls / image-view / masked-image-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 // INTERNAL INCLUDES
18 #include <dali-toolkit/public-api/controls/image-view/masked-image-view.h>
19 #include <dali-toolkit/internal/controls/image-view/masked-image-view-impl.h>
20
21 namespace Dali
22 {
23
24 namespace Toolkit
25 {
26
27 const float MaskedImageView::DEFAULT_MAXIMUM_SOURCE_SCALE(3.0f);
28
29 MaskedImageView::MaskedImageView()
30 {
31 }
32
33 MaskedImageView::MaskedImageView( const MaskedImageView& handle )
34 : Control( handle )
35 {
36 }
37
38 MaskedImageView& MaskedImageView::operator=( const MaskedImageView& handle )
39 {
40   if( &handle != this )
41   {
42     Control::operator=( handle );
43   }
44   return *this;
45 }
46
47 MaskedImageView::~MaskedImageView()
48 {
49 }
50
51 MaskedImageView MaskedImageView::New( unsigned int targetWidth,
52                                       unsigned int targetHeight,
53                                       Image sourceImage,
54                                       Image maskImage )
55 {
56   return Internal::MaskedImageView::New( targetWidth, targetHeight, sourceImage, maskImage );
57 }
58
59 MaskedImageView MaskedImageView::DownCast( BaseHandle handle )
60 {
61   return Control::DownCast<MaskedImageView, Internal::MaskedImageView>( handle );
62 }
63
64 void MaskedImageView::SetSourceImage( Image sourceImage )
65 {
66   GetImpl(*this).SetSourceImage( sourceImage );
67 }
68
69 Image MaskedImageView::GetSourceImage()
70 {
71   return GetImpl(*this).GetSourceImage();
72 }
73
74 void MaskedImageView::SetMaskImage( Image sourceImage )
75 {
76   GetImpl(*this).SetMaskImage( sourceImage );
77 }
78
79 Image MaskedImageView::GetMaskImage()
80 {
81   return GetImpl(*this).GetMaskImage();
82 }
83
84 Property::Index MaskedImageView::GetPropertyIndex( MaskedImageView::CustomProperty customProperty ) const
85 {
86   return GetImpl(*this).GetPropertyIndex( customProperty );
87 }
88
89 void MaskedImageView::Pause()
90 {
91   GetImpl(*this).Pause();
92 }
93
94 void MaskedImageView::Resume()
95 {
96   GetImpl(*this).Resume();
97 }
98
99 bool MaskedImageView::IsPaused() const
100 {
101   return GetImpl(*this).IsPaused();
102 }
103
104 void MaskedImageView::SetEditMode( MaskedImageView::EditMode editMode )
105 {
106   GetImpl(*this).SetEditMode( editMode );
107 }
108
109 MaskedImageView::EditMode MaskedImageView::GetEditMode() const
110 {
111   return GetImpl(*this).GetEditMode();
112 }
113
114 void MaskedImageView::SetSourceAspectRatio( float widthOverHeight )
115 {
116   GetImpl(*this).SetSourceAspectRatio( widthOverHeight );
117 }
118
119 float MaskedImageView::GetSourceAspectRatio() const
120 {
121   return GetImpl(*this).GetSourceAspectRatio();
122 }
123
124 void MaskedImageView::SetMaximumSourceScale( float scale )
125 {
126   GetImpl(*this).SetMaximumSourceScale( scale );
127 }
128
129 float MaskedImageView::GetMaximumSourceScale() const
130 {
131   return GetImpl(*this).GetMaximumSourceScale();
132 }
133
134 void MaskedImageView::SetSourceRotation( MaskedImageView::ImageRotation rotation )
135 {
136   GetImpl(*this).SetSourceRotation( rotation );
137 }
138
139 MaskedImageView::ImageRotation MaskedImageView::GetSourceRotation() const
140 {
141   return GetImpl(*this).GetSourceRotation();
142 }
143
144 Dali::RenderTask::RenderTaskSignalV2& MaskedImageView::RenderFinishedSignal()
145 {
146   return GetImpl(*this).RenderFinishedSignal();
147 }
148
149 MaskedImageView::MaskedImageViewSignal& MaskedImageView::MaskFinishedSignal()
150 {
151   return GetImpl(*this).MaskFinishedSignal();
152 }
153
154 MaskedImageView::MaskedImageView(Internal::MaskedImageView& implementation)
155 : Control(implementation)
156 {
157 }
158
159 MaskedImageView::MaskedImageView( Dali::Internal::CustomActor* internal )
160 : Control( internal )
161 {
162   VerifyCustomActorPointer<Internal::MaskedImageView>(internal);
163 }
164
165 } // namespace Toolkit
166
167 } // namespace Dali