Purge underscored header file barriers
[platform/core/uifw/dali-toolkit.git] / dali-toolkit / public-api / controls / buttons / check-box-button.h
1 #ifndef DALI_TOOLKIT_CHECK_BOX_BUTTON_H
2 #define DALI_TOOLKIT_CHECK_BOX_BUTTON_H
3
4 /*
5  * Copyright (c) 2019 Samsung Electronics Co., Ltd.
6  *
7  * Licensed under the Apache License, Version 2.0 (the "License");
8  * you may not use this file except in compliance with the License.
9  * You may obtain a copy of the License at
10  *
11  * http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing, software
14  * distributed under the License is distributed on an "AS IS" BASIS,
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  * See the License for the specific language governing permissions and
17  * limitations under the License.
18  *
19  */
20
21 // INTERNAL INCLUDES
22 #include <dali-toolkit/public-api/controls/buttons/button.h>
23
24 namespace Dali
25 {
26
27 namespace Toolkit
28 {
29
30 // Forward declarations
31
32 namespace Internal DALI_INTERNAL
33 {
34 class CheckBoxButton;
35 }
36 /**
37  * @addtogroup dali_toolkit_controls_buttons
38  * @{
39  */
40
41 /**
42  * @brief CheckBoxButton provides a check box button which user can check or uncheck.
43  *
44  * By default, a CheckBoxButton emits a Button::ClickedSignal() signal when the button changes its state to selected or unselected.
45  *
46  * The button's appearance could be modified by Button::SetUnselectedImage, Button::SetBackgroundImage,
47  * Button::SetSelectedImage, Button::SetSelectedBackgroundImage, Button::SetDisabledBackgroundImage,
48  * Button::SetDisabledImage, and Button::SetDisabledSelectedImage.
49  *
50  * When the button is not disabled, if it's not selected it only shows the \e background image. The \e selected image is shown over the
51  * \e background image when the box is selected (\e background image is not replaced by \e selected image).
52  *
53  * When the button is disabled, \e background image and \e selected image are replaced by \e disabled images.
54  *
55  * Usage example: -
56  *
57  * @code
58  * // in Creating a DALi Application
59  * void HelloWorldExample::Create( Application& application )
60  * {
61  *   CheckBoxButton button = CheckBoxButton::New();
62  *   button.SetParentOrigin( ParentOrigin::CENTER );
63  *   button.SetProperty( Button::Property::LABEL, "Check" );
64  *   button.SetSize( 200, 40 );
65  *   button.SetBackgroundColor( Color::WHITE );
66  *   Stage::GetCurrent().Add( button );
67  *
68  *   // Connect to a button signal emitted by the button
69  *   button.StateChangedSignal().Connect( this, &HelloWorldExample::OnButtonStateChanged );
70  * }
71  *
72  * bool HelloWorldExample::OnButtonStateChanged( Button button )
73  * {
74  *   // Do something when the button state is changed
75  *   // You can get the state using button.IsSelected() call
76  *   return true;
77  * }
78  * @endcode
79  * @SINCE_1_0.0
80  */
81 class DALI_TOOLKIT_API CheckBoxButton : public Button
82 {
83 public:
84
85   /**
86    * @brief Creates an uninitialized CheckBoxButton; this can be initialized with CheckBoxButton::New().
87    * Calling member functions with an uninitialized Dali::Object is not allowed.
88    * @SINCE_1_0.0
89    */
90   CheckBoxButton();
91
92   /**
93    * @brief Copy constructor.
94    * @SINCE_1_0.0
95    * @param[in] checkBox Handle to an object
96    */
97   CheckBoxButton( const CheckBoxButton& checkBox );
98
99   /**
100    * @brief Assignment operator.
101    * @SINCE_1_0.0
102    * @param[in] checkBox Handle to an object
103    * @return A reference to this
104    */
105   CheckBoxButton& operator=( const CheckBoxButton& checkBox );
106
107   /**
108    * @brief Destructor.
109    *
110    * This is non-virtual since derived Handle types must not contain data or virtual methods.
111    * @SINCE_1_0.0
112    */
113   ~CheckBoxButton();
114
115   /**
116    * @brief Creates an initialized CheckBoxButton.
117    * @SINCE_1_0.0
118    * @return A handle to a newly allocated Dali resource
119    */
120   static CheckBoxButton New();
121
122   /**
123    * @brief Downcasts a handle to CheckBoxButton handle.
124    *
125    * If handle points to a CheckBoxButton, the downcast produces valid handle.
126    * If not, the returned handle is left uninitialized.
127    * @SINCE_1_0.0
128    * @param[in] handle Handle to an object
129    * @return Handle to a CheckBoxButton or an uninitialized handle
130    */
131   static CheckBoxButton DownCast( BaseHandle handle );
132
133 public: // Not intended for application developers
134
135   /// @cond internal
136   /**
137    * @brief Creates a handle using the Toolkit::Internal implementation.
138    * @SINCE_1_0.0
139    * @param[in] implementation The Control implementation
140    */
141   DALI_INTERNAL CheckBoxButton( Internal::CheckBoxButton& implementation );
142
143   /**
144    * @brief Allows the creation of this Control from an Internal::CustomActor pointer.
145    * @SINCE_1_0.0
146    * @param[in] internal A pointer to the internal CustomActor
147    */
148   DALI_INTERNAL CheckBoxButton( Dali::Internal::CustomActor* internal );
149   /// @endcond
150 };
151
152 /**
153  * @}
154  */
155 } // namespace Toolkit
156
157 } // namespace Dali
158
159 #endif // DALI_TOOLKIT_CHECK_BOX_BUTTON_H