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=ca5c288c9b1a3feb67d8e03093fdb514880e7a6e;hp=e321ce42f85f00bf0cf95925ffeff868ef95cedb;hb=938ea2d2a1a42930cf12c743d839aded892949ea;hpb=2ddfbb9e23a7c3fc30e604236c41e0ef6d2ed6a2 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 e321ce4..ca5c288 100644 --- a/dali-toolkit/public-api/controls/buttons/check-box-button.h +++ b/dali-toolkit/public-api/controls/buttons/check-box-button.h @@ -2,7 +2,7 @@ #define __DALI_TOOLKIT_CHECK_BOX_BUTTON_H__ /* - * Copyright (c) 2014 Samsung Electronics Co., Ltd. + * Copyright (c) 2015 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,44 +33,71 @@ 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. + * + * The button's appearance could be modified by Button::SetUnselectedImage, Button::SetBackgroundImage, + * Button::SetSelectedImage, Button::SetSelectedBackgroundImage, Button::SetDisabledBackgroundImage, + * Button::SetDisabledImage, and Button::SetDisabledSelectedImage. * - * By default a CheckBoxButton emits a Button::ClickedSignal() signal when the button changes its state to checked or unchecked. + * 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). * - * The button's appearance could be modified by setting images or actors with CheckBoxButton::SetBackgroundImage, - * CheckBoxButton::SetCheckedImage, CheckBoxButton::SetDisabledBackgroundImage and CheckBoxButton::SetDisabledCheckedImage. + * When the button is disabled, \e background image and \e selected image are replaced by \e disabled images. * - * When the button is not disabled, if it's not checked it only shows the \e background image. The \e checked image is shown over the - * \e background image when the box is checked (\e background image is not replaced by \e checked image). + * Usage example: - * - * When the button is disabled, \e background image and \e checked image are replaced by \e disabled images. + * @code + * // in Creating a DALi Application + * void HelloWorldExample::Create( Application& application ) + * { + * CheckBoxButton button = CheckBoxButton::New(); + * button.SetParentOrigin( ParentOrigin::CENTER ); + * button.SetLabelText( "Check" ); + * button.SetSize( 200, 40 ); + * button.SetBackgroundColor( Color::WHITE ); + * Stage::GetCurrent().Add( button ); * - * 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. + * // 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 { public: - //Action Names - static const char* const ACTION_CHECK_BOX_BUTTON_CLICK; - -public: /** - * Create an uninitialized CheckBoxButton; this can be initialized with CheckBoxButton::New() + * @brief Create 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 */ CheckBoxButton( const CheckBoxButton& checkBox ); /** - * Assignment operator. + * @brief Assignment operator. + * @SINCE_1_0.0 */ CheckBoxButton& operator=( const CheckBoxButton& checkBox ); @@ -78,125 +105,50 @@ public: * @brief Destructor * * This is non-virtual since derived Handle types must not contain data or virtual methods. + * @SINCE_1_0.0 */ ~CheckBoxButton(); /** - * Create an initialized CheckBoxButton. + * @brief Create an initialized CheckBoxButton. + * @SINCE_1_0.0 * @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 + * @brief Downcast a handle to CheckBoxButton handle. + * + * 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 */ static CheckBoxButton DownCast( BaseHandle handle ); - /** - * Sets the button as checked or unchecked. - * - * Emits a Button::ClickedSignal() signal if the checkbox is not disabled and the new state, - * given in the \e checked param, is different than the previous one. - * - * @param[in] checked state. - */ - void SetChecked( bool checked ); - - /** - * @return \e true if the button is checked. - */ - bool IsChecked() const; - - /** - * Sets the background image. - * - * @param[in] image The background image. - */ - void SetBackgroundImage( Image image ); - - /** - * @copydoc SetBackgroundImage( Image image ) - */ - void SetBackgroundImage( Actor image ); - - /** - * Gets the background image. - * @return An actor with the background image. - */ - Actor GetBackgroundImage() const; - - /** - * Sets the checked image. - * - * @param[in] image The checked image. - */ - void SetCheckedImage( Image image ); - - /** - * @copydoc SetCheckedImage( Image image ) - */ - void SetCheckedImage( Actor image ); - - /** - * Gets the checked image. - * @return An actor with the checked image. - */ - Actor GetCheckedImage() const; - - /** - * Sets the disabled background image. - * - * @param[in] image The disabled background image. - */ - void SetDisabledBackgroundImage( Image image ); - - /** - * @copydoc SetDisabledBackgroundImage( Image image ) - */ - void SetDisabledBackgroundImage( Actor image ); - - /** - * Gets the disabled background image. - * @return An actor with the disabled background image. - */ - Actor GetDisabledBackgroundImage() const; - - /** - * Sets the disabled checked image. - * - * @param[in] image The disabled checked image. - */ - void SetDisabledCheckedImage( Image image ); - - /** - * @copydoc SetDisabledCheckedImage( Image image ) - */ - void SetDisabledCheckedImage( Actor image ); - - /** - * Gets the disabled checked image. - * @return An actor with the disabled checked image. - */ - Actor GetDisabledCheckedImage() const; - public: // Not intended for application developers + /// @cond internal /** - * Creates a handle using the Toolkit::Internal 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. + * @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