357c3e1e7e9c18d01b8e2cfad8d7b777fbfeb5b2
[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) 2015 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  * 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 setting images or actors with CheckBoxButton::SetBackgroundImage,
47  * CheckBoxButton::SetSelectedImage, CheckBoxButton::SetDisabledBackgroundImage and CheckBoxButton::SetDisabledSelectedImage.
48  *
49  * 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
50  * \e background image when the box is selected (\e background image is not replaced by \e selected image).
51  *
52  * When the button is disabled, \e background image and \e selected image are replaced by \e disabled images.
53  *
54  * CheckBoxButton doesn't have a text. However, a Dali::Toolkit::TableView with a Dali::TextActor or a Dali::Toolkit::TextView
55  * and a CheckBoxButton could be used instead.
56  */
57 class DALI_IMPORT_API CheckBoxButton : public Button
58 {
59 public:
60
61   /**
62    * Create an uninitialized CheckBoxButton; this can be initialized with CheckBoxButton::New()
63    * Calling member functions with an uninitialized Dali::Object is not allowed.
64    */
65   CheckBoxButton();
66
67   /**
68    * Copy constructor.
69    */
70   CheckBoxButton( const CheckBoxButton& checkBox );
71
72   /**
73    * Assignment operator.
74    */
75   CheckBoxButton& operator=( const CheckBoxButton& checkBox );
76
77   /**
78    * @brief Destructor
79    *
80    * This is non-virtual since derived Handle types must not contain data or virtual methods.
81    */
82   ~CheckBoxButton();
83
84   /**
85    * Create an initialized CheckBoxButton.
86    * @return A handle to a newly allocated Dali resource.
87    */
88   static CheckBoxButton New();
89
90   /**
91    * Downcast an Object handle to CheckBoxButton. If handle points to a CheckBoxButton the
92    * downcast produces valid handle. If not the returned handle is left uninitialized.
93    * @param[in] handle Handle to an object
94    * @return handle to a CheckBoxButton or an uninitialized handle
95    */
96   static CheckBoxButton DownCast( BaseHandle handle );
97
98 public: // Not intended for application developers
99
100   /**
101    * Creates a handle using the Toolkit::Internal implementation.
102    * @param[in]  implementation  The Control implementation.
103    */
104   DALI_INTERNAL CheckBoxButton( Internal::CheckBoxButton& implementation );
105
106   /**
107    * Allows the creation of this Control from an Internal::CustomActor pointer.
108    * @param[in]  internal  A pointer to the internal CustomActor.
109    */
110   DALI_INTERNAL CheckBoxButton( Dali::Internal::CustomActor* internal );
111 };
112
113 /**
114  * @}
115  */
116 } // namespace Toolkit
117
118 } // namespace Dali
119
120 #endif // __DALI_TOOLKIT_CHECK_BOX_BUTTON_H__