X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git;a=blobdiff_plain;f=dali-toolkit%2Fpublic-api%2Fcontrols%2Fbuttons%2Fcheck-box-button.h;h=4ae4608c2243ff8653e2303fc50d4756b538b8b9;hp=975221305fb7b7a69183f02386420b60e5d26ea1;hb=d886d0a7b8637b2ad52844096091b63991157ff3;hpb=61be2f8d3c96e01da8e6ade2a76a192ff6ab6945 diff --git a/dali-toolkit/public-api/controls/buttons/check-box-button.h b/dali-toolkit/public-api/controls/buttons/check-box-button.h index 9752213..4ae4608 100644 --- a/dali-toolkit/public-api/controls/buttons/check-box-button.h +++ b/dali-toolkit/public-api/controls/buttons/check-box-button.h @@ -1,8 +1,8 @@ -#ifndef __DALI_TOOLKIT_CHECK_BOX_BUTTON_H__ -#define __DALI_TOOLKIT_CHECK_BOX_BUTTON_H__ +#ifndef DALI_TOOLKIT_CHECK_BOX_BUTTON_H +#define DALI_TOOLKIT_CHECK_BOX_BUTTON_H /* - * Copyright (c) 2015 Samsung Electronics Co., Ltd. + * Copyright (c) 2020 Samsung Electronics Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -33,153 +33,144 @@ namespace Internal DALI_INTERNAL { class CheckBoxButton; } +/** + * @addtogroup dali_toolkit_controls_buttons + * @{ + */ /** - * CheckBoxButton provides a check box button which user can check or uncheck. + * @brief CheckBoxButton provides a check box button which user can check or uncheck. * - * By default a CheckBoxButton emits a Button::ClickedSignal() signal when the button changes its state to selected or unselected. + * By default, a CheckBoxButton emits a Button::ClickedSignal() signal when the button changes its state to selected or unselected. * - * The button's appearance could be modified by setting images or actors with CheckBoxButton::SetBackgroundImage, - * CheckBoxButton::SetSelectedImage, CheckBoxButton::SetDisabledBackgroundImage and CheckBoxButton::SetDisabledSelectedImage. + * The button's appearance could be modified by Button::SetUnselectedImage, Button::SetBackgroundImage, + * Button::SetSelectedImage, Button::SetSelectedBackgroundImage, Button::SetDisabledBackgroundImage, + * Button::SetDisabledImage, and Button::SetDisabledSelectedImage. * * 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 * \e background image when the box is selected (\e background image is not replaced by \e selected image). * * When the button is disabled, \e background image and \e selected image are replaced by \e disabled images. * - * CheckBoxButton doesn't have a text. However, a Dali::Toolkit::TableView with a Dali::TextActor or a Dali::Toolkit::TextView - * and a CheckBoxButton could be used instead. + * Usage example: - + * + * @code + * // in Creating a DALi Application + * void HelloWorldExample::Create( Application& application ) + * { + * CheckBoxButton button = CheckBoxButton::New(); + * button.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); + * button.SetProperty( Button::Property::LABEL, "Check" ); + * button.SetProperty( Actor::Property::SIZE, Vector2( 200, 40 ); + * button.SetBackgroundColor( Color::WHITE ); + * Stage::GetCurrent().Add( button ); + * + * // Connect to a button signal emitted by the button + * button.StateChangedSignal().Connect( this, &HelloWorldExample::OnButtonStateChanged ); + * } + * + * bool HelloWorldExample::OnButtonStateChanged( Button button ) + * { + * // Do something when the button state is changed + * // You can get the state using button.IsSelected() call + * return true; + * } + * @endcode + * @SINCE_1_0.0 */ -class DALI_IMPORT_API CheckBoxButton : public Button +class DALI_TOOLKIT_API CheckBoxButton : public Button { public: /** - * Create an uninitialized CheckBoxButton; this can be initialized with CheckBoxButton::New() + * @brief Creates an uninitialized CheckBoxButton; this can be initialized with CheckBoxButton::New(). * Calling member functions with an uninitialized Dali::Object is not allowed. + * @SINCE_1_0.0 */ CheckBoxButton(); /** - * Copy constructor. + * @brief Copy constructor. + * @SINCE_1_0.0 + * @param[in] checkBox Handle to an object */ CheckBoxButton( const CheckBoxButton& checkBox ); /** - * Assignment operator. - */ - CheckBoxButton& operator=( const CheckBoxButton& checkBox ); - - /** - * @brief Destructor + * @brief Move constructor + * @SINCE_1_9.23 * - * This is non-virtual since derived Handle types must not contain data or virtual methods. - */ - ~CheckBoxButton(); - - /** - * Create an initialized CheckBoxButton. - * @return A handle to a newly allocated Dali resource. - */ - static CheckBoxButton New(); - - /** - * Downcast an Object handle to CheckBoxButton. If handle points to a CheckBoxButton the - * downcast produces valid handle. If not the returned handle is left uninitialized. - * @param[in] handle Handle to an object - * @return handle to a CheckBoxButton or an uninitialized handle - */ - static CheckBoxButton DownCast( BaseHandle handle ); - - /** - * Sets the background image. - * - * @param[in] image The background image. - */ - void SetBackgroundImage( Image image ); - - /** - * @copydoc SetBackgroundImage( Image image ) + * @param[in] rhs A reference to the moved handle */ - void SetBackgroundImage( Actor image ); + CheckBoxButton( CheckBoxButton&& rhs ); /** - * Gets the background image. - * @return An actor with the background image. + * @brief Assignment operator. + * @SINCE_1_0.0 + * @param[in] checkBox Handle to an object + * @return A reference to this */ - Actor GetBackgroundImage() const; + CheckBoxButton& operator=( const CheckBoxButton& checkBox ); /** - * Sets the selected image. + * @brief Move assignment + * @SINCE_1_9.23 * - * @param[in] image The selected image. + * @param[in] rhs A reference to the moved handle + * @return A reference to this */ - void SetSelectedImage( Image image ); + CheckBoxButton& operator=( CheckBoxButton&& rhs ); /** - * @copydoc SetSelectedImage( Image image ) - */ - void SetSelectedImage( Actor image ); - - /** - * Gets the selected image. - * @return An actor with the selected image. - */ - Actor GetSelectedImage() const; - - /** - * Sets the disabled background image. + * @brief Destructor. * - * @param[in] image The disabled background image. - */ - void SetDisabledBackgroundImage( Image image ); - - /** - * @copydoc SetDisabledBackgroundImage( Image image ) + * This is non-virtual since derived Handle types must not contain data or virtual methods. + * @SINCE_1_0.0 */ - void SetDisabledBackgroundImage( Actor image ); + ~CheckBoxButton(); /** - * Gets the disabled background image. - * @return An actor with the disabled background image. + * @brief Creates an initialized CheckBoxButton. + * @SINCE_1_0.0 + * @return A handle to a newly allocated Dali resource */ - Actor GetDisabledBackgroundImage() const; + static CheckBoxButton New(); /** - * Sets the disabled selected image. + * @brief Downcasts a handle to CheckBoxButton handle. * - * @param[in] image The disabled selected image. - */ - void SetDisabledSelectedImage( Image image ); - - /** - * @copydoc SetDisabledSelectedImage( Image image ) - */ - void SetDisabledSelectedImage( Actor image ); - - /** - * Gets the disabled selected image. - * @return An actor with the disabled selected image. + * If handle points to a CheckBoxButton, the downcast produces valid handle. + * If not, the returned handle is left uninitialized. + * @SINCE_1_0.0 + * @param[in] handle Handle to an object + * @return Handle to a CheckBoxButton or an uninitialized handle */ - Actor GetDisabledSelectedImage() const; + static CheckBoxButton DownCast( BaseHandle handle ); public: // Not intended for application developers + /// @cond internal /** - * Creates a handle using the Toolkit::Internal implementation. - * @param[in] implementation The Control implementation. + * @brief Creates a handle using the Toolkit::Internal implementation. + * @SINCE_1_0.0 + * @param[in] implementation The Control implementation */ DALI_INTERNAL CheckBoxButton( Internal::CheckBoxButton& implementation ); /** - * Allows the creation of this Control from an Internal::CustomActor pointer. - * @param[in] internal A pointer to the internal CustomActor. + * @brief Allows the creation of this Control from an Internal::CustomActor pointer. + * @SINCE_1_0.0 + * @param[in] internal A pointer to the internal CustomActor */ DALI_INTERNAL CheckBoxButton( Dali::Internal::CustomActor* internal ); + /// @endcond }; +/** + * @} + */ } // namespace Toolkit } // namespace Dali -#endif // __DALI_TOOLKIT_CHECK_BOX_BUTTON_H__ +#endif // DALI_TOOLKIT_CHECK_BOX_BUTTON_H