[dali_2.3.19] 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 namespace Toolkit
33 {
34 Button::Button()
35 {
36 }
37
38 Button::Button(const Button& button) = default;
39
40 Button::Button(Button&& rhs) = default;
41
42 Button& Button::operator=(const Button& button) = default;
43
44 Button& Button::operator=(Button&& rhs) = default;
45
46 Button::~Button()
47 {
48 }
49
50 Button Button::DownCast(BaseHandle handle)
51 {
52   return Control::DownCast<Button, Internal::Button>(handle);
53 }
54
55 Button::ButtonSignalType& Button::PressedSignal()
56 {
57   return Dali::Toolkit::GetImplementation(*this).PressedSignal();
58 }
59
60 Button::ButtonSignalType& Button::ReleasedSignal()
61 {
62   return Dali::Toolkit::GetImplementation(*this).ReleasedSignal();
63 }
64
65 Button::ButtonSignalType& Button::ClickedSignal()
66 {
67   return Dali::Toolkit::GetImplementation(*this).ClickedSignal();
68 }
69
70 Button::ButtonSignalType& Button::StateChangedSignal()
71 {
72   return Dali::Toolkit::GetImplementation(*this).StateChangedSignal();
73 }
74
75 Button::Button(Internal::Button& implementation)
76 : Control(implementation)
77 {
78 }
79
80 Button::Button(Dali::Internal::CustomActor* internal)
81 : Control(internal)
82 {
83   VerifyCustomActorPointer<Internal::Button>(internal);
84 }
85
86 } // namespace Toolkit
87
88 } // namespace Dali