[dali_1.9.22] Merge branch 'devel/master'
[platform/core/uifw/dali-toolkit.git] / dali-toolkit / public-api / controls / buttons / button.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/public-api/controls/buttons/button.h>
20
21 // EXTERNAL INCLUDES
22 #include <dali/integration-api/debug.h>
23 #include <dali/public-api/object/property-map.h>
24
25 // INTERNAL INCLUDES
26 #include <dali-toolkit/internal/controls/buttons/button-impl.h>
27 #include <dali-toolkit/public-api/controls/image-view/image-view.h>
28 #include <dali-toolkit/public-api/visuals/text-visual-properties.h>
29
30 namespace Dali
31 {
32
33 namespace Toolkit
34 {
35
36 Button::Button()
37 {}
38
39 Button::Button( const Button& button )
40 : Control( button )
41 {
42 }
43
44 Button& Button::operator=( const Button& button )
45 {
46   if( &button != this )
47   {
48     Control::operator=( button );
49   }
50   return *this;
51 }
52
53 Button::~Button()
54 {
55 }
56
57 Button Button::DownCast( BaseHandle handle )
58 {
59   return Control::DownCast<Button, Internal::Button>(handle);
60 }
61
62 Button::ButtonSignalType& Button::PressedSignal()
63 {
64   return Dali::Toolkit::GetImplementation( *this ).PressedSignal();
65 }
66
67 Button::ButtonSignalType& Button::ReleasedSignal()
68 {
69   return Dali::Toolkit::GetImplementation( *this ).ReleasedSignal();
70 }
71
72 Button::ButtonSignalType& Button::ClickedSignal()
73 {
74   return Dali::Toolkit::GetImplementation( *this ).ClickedSignal();
75 }
76
77 Button::ButtonSignalType& Button::StateChangedSignal()
78 {
79   return Dali::Toolkit::GetImplementation( *this ).StateChangedSignal();
80 }
81
82 Button::Button( Internal::Button& implementation )
83 : Control( implementation )
84 {
85 }
86
87 Button::Button( Dali::Internal::CustomActor* internal )
88 : Control( internal )
89 {
90   VerifyCustomActorPointer<Internal::Button>(internal);
91 }
92
93 } // namespace Toolkit
94
95 } // namespace Dali