Removed OnButton virtual functions and simplified RadioButton logic
[platform/core/uifw/dali-toolkit.git] / dali-toolkit / public-api / controls / buttons / button.h
1 #ifndef __DALI_TOOLKIT_BUTTON_H__
2 #define __DALI_TOOLKIT_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/control.h>
23
24 namespace Dali
25 {
26
27 namespace Toolkit
28 {
29
30 namespace Internal DALI_INTERNAL
31 {
32 class Button;
33 }
34 /**
35  * @addtogroup dali_toolkit_controls_buttons
36  * @{
37  */
38
39 /**
40  * @brief Button is a base class for different kinds of buttons.
41  *
42  * This class provides the disabled property and the clicked signal.
43  *
44  * A ClickedSignal() is emitted when the button is touched and the touch point doesn't leave the boundary of the button.
45  *
46  * When the \e disabled property is set to \e true, no signal is emitted.
47  *
48  * Button provides the following properties which modify the signals emitted:
49  * <ul>
50  *   <li>\e autorepeating
51  *       When \e autorepeating is set to \e true, a Button::PressedSignal(), Button::ReleasedSignal() and Button::ClickedSignal() signals are emitted at regular
52  *       intervals while the button is touched.
53  *       The intervals could be modified with the Button::SetInitialAutoRepeatingDelay and Button::SetNextAutoRepeatingDelay methods.
54  *
55  *       A \e togglable button can't be \e autorepeating. If the \e autorepeating property is set to \e true, then the \e togglable property is set to
56  *       false but no signal is emitted.
57  *
58  *   <li>\e togglable
59  *       When \e togglable is set to \e true, a Button::StateChangedSignal() signal is emitted, with the selected state.
60  * </ul>
61  *
62  * 'Visual' describes not just traditional images like png, bmp but refers to whatever is used to show the button, it could be a color, gradient or some other kind of renderer.
63  *
64  * The button's appearance can be modified by setting properties for the various images.
65  *
66  * It is not mandatory to set all visuals. A button could be defined only by setting its \e background visual or by setting its \e background and \e selected visuals.
67  *
68  * The \e button visual is shown over the \e background visual..
69  * When pressed the unselected visuals are replaced by the \e selected visual. The text label is always placed on the top of all images.
70  *
71  * When the button is disabled, \e background, \e button and \e selected visuals are replaced by their \e disabled visuals.
72  *
73
74  *
75   * @brief A control which renders a short text string.
76  *
77  * Text labels are lightweight, non-editable and do not respond to user input.
78  *
79  *
80  * @section ButtonProperties Properties
81  * |%Property enum                                         |String name                             |Type          |Writable|Animatable|
82  * |-------------------------------------------------------|----------------------------------------|--------------|--------|----------|
83  * | Property::DISABLED                                    | disabled                               |  BOOLEAN     | Y      | N        |
84  * | Property::AUTO_REPEATING                              | autoRepeating                          |  BOOLEAN     | Y      | N        |
85  * | Property::INITIAL_AUTO_REPEATING_DELAY                | initialAutoRepeatingDelay              |  FLOAT       | Y      | N        |
86  * | Property::NEXT_AUTO_REPEATING_DELAY                   | nextAutoRepeatingDelay                 |  FLOAT       | Y      | N        |
87  * | Property::TOGGLABLE                                   | togglable                              |  BOOLEAN     | Y      | N        |
88  * | Property::SELECTED                                    | selected                               |  BOOLEAN     | Y      | N        |
89  * | Property::LABEL                                       | label                                  |  MAP         | Y      | N        |
90  * | Property::UNSELECTED_STATE_VISUAL                     | unselectedVisual                       |  MAP         | Y      | N        |
91  * | Property::SELECTED_VISUAL                             | selectedVisual                         |  MAP         | Y      | N        |
92  * | Property::DISABLED_SELECTED_VISUAL                    | disabledSelectedVisual                 |  MAP         | Y      | N        |
93  * | Property::DISABLED_UNSELECTED_VISUAL                  | disabledUnselectedVisual               |  MAP         | Y      | N        |
94  * | Property::UNSELECTED_BACKGROUND_VISUAL                | unselectedBackgroundVisual             |  MAP         | Y      | N        |
95  * | Property::SELECTED_BACKGROUND_VISUAL                  | selectedBackgroundVisual               |  MAP         | Y      | N        |
96  * | Property::DISABLED_UNSELECTED_BACKGROUND_VISUAL       | disabledUnselectedBackgroundVisual     |  MAP         | Y      | N        |
97  * | Property::DISABLED_SELECTED_BACKGROUND_VISUAL         | disabledSelectedBackgroundVisual       |  MAP         | Y      | N        |
98  * | Property::LABEL_RELATIVE_ALIGNMENT                    | labelRelativeAlignment                 |  STRING      | Y      | N        |
99  * -------------------------------------------------------------------------------------------------------------------------------------
100  *
101  * Note, *_VISUAL properties of type MAP can also be passed a uri of type STRING
102  *
103  * Signals
104  * | %Signal Name     | Method                      |
105  * |------------------|-----------------------------|
106  * | pressed          | @ref PressedSignal()        |
107  * | released         | @ref ReleasedSignal()       |
108  * | clicked          | @ref ClickedSignal()        |
109  * | stateChanged     | @ref StateChangedSignal()   |
110  *
111  * Actions
112  * | %Action Name     | Attributes              | Description                                   |
113  * |------------------|-------------------------|-----------------------------------------------|
114  * | buttonClick      | Doesn't have attributes | Simulates a button click. See @ref DoAction() |
115  * @SINCE_1_0.0
116  */
117 class DALI_IMPORT_API Button : public Control
118 {
119 public:
120
121   /**
122    * @brief The start and end property ranges for this control.
123    * @SINCE_1_0.0
124    */
125   enum PropertyRange
126   {
127     PROPERTY_START_INDEX = Control::CONTROL_PROPERTY_END_INDEX + 1, ///< @SINCE_1_0.0
128     PROPERTY_END_INDEX =   PROPERTY_START_INDEX + 1000              ///< Reserve property indices @SINCE_1_0.0
129   };
130
131   /**
132    * @brief An enumeration of properties belonging to the Button class.
133    * @SINCE_1_0.0
134    */
135   struct Property
136   {
137     /**
138      * @brief An enumeration of properties belonging to the Button class.
139      * @SINCE_1_0.0
140      */
141     enum
142     {
143       /**
144        * @brief name "disabled", type bool
145        * @details Sets the button as \e disabled.
146        * @SINCE_1_0.0
147        */
148       DISABLED = PROPERTY_START_INDEX,
149
150       /**
151        * @brief name "autoRepeating", type bool
152        * @details If the \e autorepeating property is set to \e true then the \e togglable property is set to false
153        * @SINCE_1_0.0
154        */
155       AUTO_REPEATING,
156
157       /**
158        * @brief name "initialAutoRepeatingDelay", type float
159        * @details By default this value is set to 0.15 seconds.
160        * @SINCE_1_0.0
161        */
162       INITIAL_AUTO_REPEATING_DELAY,
163
164       /**
165        * @brief name "nextAutoRepeatingDelay", type float
166        * @details default this value is set to 0.05 seconds
167        * @SINCE_1_0.0
168        */
169       NEXT_AUTO_REPEATING_DELAY,
170
171       /**
172        * @brief name "togglable", type bool
173        * @details If the \e togglable property is set to \e true, then the \e autorepeating property is set to false.
174        * @SINCE_1_0.0
175        */
176       TOGGLABLE,
177
178       /**
179        * @brief name "selected", type bool
180        * @details Sets the togglable button as either selected or unselected, \e togglable property must be set to \e true.
181        * @SINCE_1_0.0
182        */
183       SELECTED,
184
185       /**
186        * @DEPRECATED_1_1.XX Use UNSELECTED_VISUAL
187        * @brief name "unselectedStateImage", type string if it is a url, map otherwise
188        * @details Sets the unselected button foreground image
189        * @SINCE_1_0.0
190        */
191       UNSELECTED_STATE_IMAGE,
192
193       /**
194        * @DEPRECATED_1_1.XX Use SELECTED_VISUAL
195        * @brief name "selectedStateImage", type string if it is a url, map otherwise
196        * @details Sets the selected button foreground image
197        * @SINCE_1_0.0
198        */
199       SELECTED_STATE_IMAGE,
200
201       /**
202        * @DEPRECATED_1_1.XX Use DISABLED_UNSELECTED_VISUAL
203        * @brief name "disabledStateImage", type string if it is a url, map otherwise
204        * @details Sets the disabled whilst unselected foreground button visual
205        * @SINCE_1_0.0
206        */
207       DISABLED_STATE_IMAGE,
208
209       /**
210        * @DEPRECATED_1_1.XX Use UNSELECTED_BACKGROUND_VISUAL
211        * @brief name "unselectedColor", type Vector4
212        * @SINCE_1_0.0
213        */
214       UNSELECTED_COLOR,
215
216       /**
217        * @DEPRECATED_1_1.XX Use SELECTED_BACKGROUND_VISUAL
218        * @brief name "selectedColor", type Vector4
219        * @SINCE_1_0.0
220        */
221       SELECTED_COLOR,
222
223       /**
224        * @brief name "label", type Property::Map
225        * @SINCE_1_0.0
226        */
227       LABEL,
228
229       /**
230        * @DEPRECATED_1_1.32 Use LABEL
231        * @brief name "labelText", type std::string
232        * @SINCE_1_0.0
233        */
234       LABEL_TEXT,
235
236       /**
237        * @brief name "unselectedVisual", type string if it is a url, map otherwise
238        * @details Sets the unselected button foreground/icon visual
239        * @SINCE_1_2.XX
240        */
241       UNSELECTED_VISUAL,
242
243       /**
244        * @brief name "selectedImage", type string if it is a url, map otherwise
245        * @details Sets the selected button foreground/icon visual
246        * @SINCE_1_2.XX
247        */
248       SELECTED_VISUAL,
249
250       /**
251        * @brief name "disabledSelectedVisual", type string if it is a url, map otherwise
252        * @details Sets the disabled selected state foreground/icon button visual
253        * @SINCE_1_2.XX
254        */
255       DISABLED_SELECTED_VISUAL,
256
257       /**
258        * @brief name "disabledUnSelectedVisual", type string if it is a url, map otherwise
259        * @details Sets the disabled unselected state foreground/icon visual
260        * @SINCE_1_2.XX
261        */
262       DISABLED_UNSELECTED_VISUAL,
263
264       /**
265        * @brief name "unselectedBackgroundVisual", type string if it is a url, map otherwise
266        * @details Sets the disabled in the unselected state background, button visual
267        * @SINCE_1_2.XX
268        */
269       UNSELECTED_BACKGROUND_VISUAL,
270
271       /**
272        * @brief name "selectedBackgroundVisual", type string if it is a url, map otherwise
273        * @details Sets the selected background button visual
274        * @SINCE_1_2.XX
275        */
276       SELECTED_BACKGROUND_VISUAL,
277
278       /**
279        * @brief name "disabledUnselectedBackgroundVisual", type string if it is a url, map otherwise
280        * @details Sets the disabled while unselected background button visual
281        * @SINCE_1_2.XX
282        */
283       DISABLED_UNSELECTED_BACKGROUND_VISUAL,
284
285       /**
286        * @brief name "disabledSelectedBackgroundVisual", type string if it is a url, map otherwise
287        * @details Sets the disabled while selected background button visual
288        * @SINCE_1_2.XX
289        */
290       DISABLED_SELECTED_BACKGROUND_VISUAL,
291
292       /**
293        * @brief name "labelRelativeAlignment", type STRING
294        * @details Sets the position of the the label in relation to the foreground/icon if both present
295        * @SINCE_1_2.XX
296        */
297       LABEL_RELATIVE_ALIGNMENT,
298     };
299   };
300
301 public:
302
303   /**
304    * @brief Create an uninitialized Button.
305    *
306    * Only derived versions can be instantiated.  Calling member
307    * functions with an uninitialized Dali::Object is not allowed.
308    * @SINCE_1_0.0
309    */
310   Button();
311
312   /**
313    * @brief Copy constructor.
314    * @SINCE_1_0.0
315    * @param[in] button Handle to an object
316    */
317   Button( const Button& button );
318
319   /**
320    * @brief Assignment operator.
321    * @SINCE_1_0.0
322    * @param[in] button Handle to an object
323    * @return A reference to this
324    */
325   Button& operator=( const Button& button );
326
327   /**
328    * @brief Downcast a handle to Button handle.
329    *
330    * If handle points to a Button the downcast produces valid
331    * handle. If not the returned handle is left uninitialized.
332    *
333    * @SINCE_1_0.0
334    * @param[in] handle Handle to an object
335    * @return A handle to a Button or an uninitialized handle
336    */
337   static Button DownCast( BaseHandle handle );
338
339   /**
340    * @brief Destructor
341    *
342    * This is non-virtual since derived Handle types must not contain data or virtual methods.
343    * @SINCE_1_0.0
344    */
345   ~Button();
346
347   // Deprecated API
348
349   /**
350    * @DEPRECATED_1_1.32 Use SetProperty DISABLED or Styling file
351    *
352    * @brief Sets the button as \e disabled.
353    *
354    * No signals are emitted when the \e disabled property is set.
355    *
356    * @SINCE_1_0.0
357    * @param[in] disabled property.
358    */
359   void SetDisabled( bool disabled ) DALI_DEPRECATED_API;
360
361   /**
362    * @DEPRECATED_1_1.32 Use GetProperty DISABLED
363    *
364    * @brief Returns if the button is disabled.
365    * @SINCE_1_0.0
366    * @return \e true if the button is \e disabled.
367    */
368   bool IsDisabled() const DALI_DEPRECATED_API;
369
370   /**
371    * @DEPRECATED_1_1.32 SetProperty AUTO_REPEATING or Styling file
372    *
373    * @brief Sets the \e autorepeating property.
374    *
375    * If the \e autorepeating property is set to \e true, then the \e togglable property is set to false
376    * but no signal is emitted.
377    *
378    * @SINCE_1_0.0
379    * @param[in] autoRepeating \e autorepeating property.
380    */
381   void SetAutoRepeating( bool autoRepeating ) DALI_DEPRECATED_API;
382
383   /**
384    * @DEPRECATED_1_1.32 GetProperty AUTO_REPEATING
385    *
386    * @brief Returns if the autorepeating property is set.
387    * @SINCE_1_0.0
388    * @return \e true if the \e autorepeating property is set.
389    */
390   bool IsAutoRepeating() const DALI_DEPRECATED_API;
391
392   /**
393    * @DEPRECATED_1_1.32 SetProperty INITIAL_AUTO_REPEATING_DELAY or Styling file
394    *
395    * @brief Sets the initial autorepeating delay.
396    *
397    * By default this value is set to 0.15 seconds.
398    *
399    * @SINCE_1_0.0
400    * @param[in] initialAutoRepeatingDelay in seconds.
401    * @pre initialAutoRepeatingDelay must be greater than zero.
402    */
403   void SetInitialAutoRepeatingDelay( float initialAutoRepeatingDelay ) DALI_DEPRECATED_API;
404
405   /**
406    * @DEPRECATED_1_1.32 GetProperty INITIAL_AUTO_REPEATING_DELAY
407    *
408    * @brief Gets the initial autorepeating delay in seconds.
409    * @SINCE_1_0.0
410    * @return the initial autorepeating delay in seconds.
411    */
412   float GetInitialAutoRepeatingDelay() const DALI_DEPRECATED_API;
413
414   /**
415    * @DEPRECATED_1_1.32 SetProperty NEXT_AUTO_REPEATING_DELAY or Styling file
416    *
417    * @brief Sets the next autorepeating delay.
418    *
419    * By default this value is set to 0.05 seconds.
420    *
421    * @SINCE_1_0.0
422    * @param[in] nextAutoRepeatingDelay in seconds.
423    * @pre nextAutoRepeatingDelay must be greater than zero.
424    */
425   void SetNextAutoRepeatingDelay( float nextAutoRepeatingDelay ) DALI_DEPRECATED_API;
426
427   /**
428    * @DEPRECATED_1_1.32 GetProperty NEXT_AUTO_REPEATING_DELAY
429    *
430    * @brief Gets the next autorepeating delay in seconds.
431    * @SINCE_1_0.0
432    * @return the next autorepeating delay in seconds.
433    */
434   float GetNextAutoRepeatingDelay() const DALI_DEPRECATED_API;
435
436   /**
437    * @DEPRECATED_1_1.32 SetProperty TOGGLABLE or Styling file
438    *
439    * @brief Sets the \e togglable property.
440    *
441    * If the \e togglable property is set to \e true, then the \e autorepeating property is set to false.
442    *
443    * @SINCE_1_0.0
444    * @param[in] togglable property.
445    */
446   void SetTogglableButton( bool togglable ) DALI_DEPRECATED_API;
447
448   /**
449    * @DEPRECATED_1_1.32 GetProperty TOGGLABLE
450    *
451    * @brief Returns if the togglable property is set.
452    * @SINCE_1_0.0
453    * @return \e true if the \e togglable property is set.
454    */
455   bool IsTogglableButton() const DALI_DEPRECATED_API;
456
457   /**
458    * @DEPRECATED_1_1.32 SetProperty SELECTED
459    *
460    * @brief Sets the button as selected or unselected.
461    *
462    * \e togglable property must be set to \e true.
463    *
464    * Emits a Button::StateChangedSignal() signal.
465    *
466    * @SINCE_1_0.0
467    * @param[in] selected property.
468    */
469   void SetSelected( bool selected ) DALI_DEPRECATED_API;
470
471   /**
472    * DEPRECATED_1_1.32  GetProperty SELECTED
473    *
474    * @brief Returns if the selected property is set and the button is togglable.
475    * @SINCE_1_0.0
476    * @return \e true if the button is \e selected.
477    */
478   bool IsSelected() const DALI_DEPRECATED_API;
479
480   /**
481    * @DEPRECATED_1_1.32 Use Styling file to set animation
482    *
483    * @brief Sets the animation time.
484    *
485    * @SINCE_1_0.0
486    * @param[in] animationTime The animation time in seconds.
487    */
488   void SetAnimationTime( float animationTime ) DALI_DEPRECATED_API;
489
490   /**
491    * DEPRECATED_1_1.32 Use Styling file to set animation
492    *
493    * @brief Retrieves button's animation time.
494    *
495    * @SINCE_1_0.0
496    * @return The animation time in seconds.
497    */
498   float GetAnimationTime() const DALI_DEPRECATED_API;
499
500   /**
501    * @DEPRECATED_1_1.32 SetProperty Property::LABEL or Styling file
502    *
503    * @brief Sets the button's label.
504    *
505    * @SINCE_1_0.0
506    * @param[in] label The label text.
507    */
508   void SetLabelText( const std::string& label ) DALI_DEPRECATED_API;
509
510   /**
511    * DEPRECATED_1_1.32 GetProperty LABEL
512    *
513    * @brief Gets the label.
514    *
515    * @SINCE_1_0.0
516    * @return The label text.
517    */
518   std::string GetLabelText() const DALI_DEPRECATED_API;
519
520   /**
521    * @DEPRECATED_1_1.32 Use Styling file Property::UNSELECTED_STATE_IMAGE
522    *
523    * @brief Sets the unselected button image.
524    *
525    * @SINCE_1_0.0
526    * @param[in] filename The button image.
527    */
528   void SetUnselectedImage( const std::string& filename ) DALI_DEPRECATED_API;
529
530   /**
531    * @DEPRECATED_1_1.32 Use styling
532    * Use Property::UNSELECTED_BACKGROUND_VISUAL
533    *
534    * @brief Sets the unselected background image.
535    *
536    * @SINCE_1_0.0
537    * @param[in] filename The background image.
538    */
539   void SetBackgroundImage( const std::string& filename ) DALI_DEPRECATED_API;
540
541   /**
542    * @DEPRECATED_1_1.32 Use styling file, Property::SELECTED_STATE_IMAGE
543    *
544    * @brief Sets the selected image.
545    *
546    * @SINCE_1_0.0
547    * @param[in] filename The selected image.
548    */
549   void SetSelectedImage( const std::string& filename ) DALI_DEPRECATED_API;
550
551   /**
552    * @DEPRECATED_1_2.32 Use styling file
553    * Use Property::SELECTED_BACKGROUND_VISUAL
554    *
555    * @brief Sets the selected background image.
556    *
557    * @SINCE_1_0.0
558    * @param[in] filename The selected background image.
559    */
560   void SetSelectedBackgroundImage( const std::string& filename ) DALI_DEPRECATED_API;
561
562   /**
563    * @DEPRECATED_1_1.32 Use styling file
564    * Use Property::DISABLED_SELECTED_BACKGROUND_VISUAL
565    *
566    * @brief Sets the disabled background image.
567    *
568    * @SINCE_1_0.0
569    * @param[in] filename The disabled background image.
570    */
571   void SetDisabledBackgroundImage( const std::string& filename ) DALI_DEPRECATED_API;
572
573   /**
574    * @DEPRECATED_1_1.32 Use styling file Property::DISABLED_STATE_IMAGE
575    *
576    * @brief Sets the disabled button image.
577    *
578    * @SINCE_1_0.0
579    * @param[in] filename The disabled button image.
580    */
581   void SetDisabledImage( const std::string& filename ) DALI_DEPRECATED_API;
582
583   /**
584    * @DEPRECATED_1_1.32 Use styling file
585    * Use Property::DISABLED_SELECTED_VISUAL
586    *
587    * @brief Sets the disabled selected button image.
588    *
589    * @SINCE_1_0.0
590    * @param[in] filename The disabled selected button image.
591    */
592   void SetDisabledSelectedImage( const std::string& filename ) DALI_DEPRECATED_API;
593
594   /**
595    * @DEPRECATED_1_0.50. Instead, use SetLabelText.
596    *
597    * @brief Sets the label with an actor.
598    *
599    * @SINCE_1_0.0
600    * @param[in]  label The actor to use as a label
601    */
602   void SetLabel( Actor label ) DALI_DEPRECATED_API;
603
604   /**
605    * @DEPRECATED_1_0.50. Instead, use SetUnselectedImage.
606    *
607    * @brief Sets the button image.
608    *
609    * @SINCE_1_0.0
610    * @param[in]  image The button image.
611    */
612   void SetButtonImage( Image image ) DALI_DEPRECATED_API;
613
614   /**
615    * @DEPRECATED_1_0.50. Instead, use SetSelectedImage( const std::string& filename ).
616    *
617    * @brief Sets the selected image.
618    *
619    * @SINCE_1_0.0
620    * @param[in]  image The selected image.
621    */
622   void SetSelectedImage( Image image ) DALI_DEPRECATED_API;
623
624   /**
625    * @DEPRECATED_1_0.50
626    *
627    * @brief Gets the button image.
628    *
629    * @SINCE_1_0.0
630    * @remarks Avoid using this method as it's a legacy code.
631    * @return     An actor with the button image.
632    */
633   Actor GetButtonImage() const DALI_DEPRECATED_API;
634
635   /**
636    * @DEPRECATED_1_0.50
637    *
638    * @brief Gets the selected image.
639    *
640    * @SINCE_1_0.0
641    * @remarks Avoid using this method as it's a legacy code.
642    * @return     An actor with the selected image.
643    */
644   Actor GetSelectedImage() const DALI_DEPRECATED_API;
645
646 public: //Signals
647
648   /**
649    * @brief Button signal type
650    * @SINCE_1_0.0
651    */
652   typedef Signal< bool ( Button ) > ButtonSignalType;
653
654   /**
655    * @brief This signal is emitted when the button is touched.
656    *
657    * A callback of the following type may be connected:
658    * @code
659    *   bool YourCallbackName( Button button );
660    * @endcode
661    * @SINCE_1_0.0
662    * @return The signal to connect to.
663    */
664   ButtonSignalType& PressedSignal();
665
666   /**
667    * @brief This signal is emitted when the button is touched and the touch point leaves the boundary of the button.
668    *
669    * A callback of the following type may be connected:
670    * @code
671    *   bool YourCallbackName( Button button );
672    * @endcode
673    * @SINCE_1_0.0
674    * @return The signal to connect to.
675    */
676   ButtonSignalType& ReleasedSignal();
677
678   /**
679    * @brief This signal is emitted when the button is touched and the touch point doesn't leave the boundary of the button.
680    *
681    * A callback of the following type may be connected:
682    * @code
683    *   bool YourCallbackName( Button button );
684    * @endcode
685    * @SINCE_1_0.0
686    * @return The signal to connect to.
687    */
688   ButtonSignalType& ClickedSignal();
689
690   /**
691    * @brief This signal is emitted when the button's state is changed.
692    *
693    * The application can get the state by calling IsSelected().
694    *
695    * A callback of the following type may be connected:
696    * @code
697    *   bool YourCallbackName( Button button );
698    * @endcode
699    * @SINCE_1_0.0
700    * @return The signal to connect to.
701    */
702   ButtonSignalType& StateChangedSignal();
703
704 public: // Not intended for application developers
705
706   /// @cond internal
707   /**
708    * @brief Creates a handle using the Toolkit::Internal implementation.
709    *
710    * @SINCE_1_0.0
711    * @param[in]  implementation  The Control implementation.
712    */
713   DALI_INTERNAL Button( Internal::Button& implementation );
714
715   /**
716    * @brief Allows the creation of this Control from an Internal::CustomActor pointer.
717    *
718    * @SINCE_1_0.0
719    * @param[in]  internal  A pointer to the internal CustomActor.
720    */
721   DALI_INTERNAL Button( Dali::Internal::CustomActor* internal );
722   /// @endcond
723 };
724
725 /**
726  * @}
727  */
728 } // namespace Toolkit
729
730 } // namespace Dali
731
732 #endif // __DALI_TOOLKIT_BUTTON_H__