#ifndef __DALI_TOOLKIT_INTERNAL_CHECK_BOX_BUTTON_DEFAULT_PAINTER_H__
#define __DALI_TOOLKIT_INTERNAL_CHECK_BOX_BUTTON_DEFAULT_PAINTER_H__
-//
-// Copyright (c) 2014 Samsung Electronics Co., Ltd.
-//
-// Licensed under the Flora License, Version 1.0 (the License);
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://floralicense.org/license/
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an AS IS BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
+/*
+ * Copyright (c) 2014 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.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
-// INTERNAL INCLUDES
+// EXTERNAL INCLUDES
#include <dali/public-api/images/image.h>
#include <dali/public-api/actors/actor.h>
#include <dali/public-api/math/vector2.h>
#include <dali/public-api/animation/animation.h>
-#include <dali-toolkit/public-api/shader-effects/image-region-effect.h>
+// INTERNAL INCLUDES
+#include <dali-toolkit/public-api/shader-effects/image-region-effect.h>
#include "check-box-button-painter-impl.h"
namespace Dali
*/
~CheckBoxButtonDefaultPainter();
+ /////////////////////////////////////////////////////////////////////////////
+ // ButtonPainter interface
+ /////////////////////////////////////////////////////////////////////////////
+
/**
- * Sets the background image.
- *
- * It adds the background image to the root actor and creates the image transition if needed.
- *
- * @param[inout] checkBox The button in which all actors that form its appearance are going to be added.
- * @param[in] image The background image.
+ * @copydoc ButtonPainter::Initialize( Toolkit::Button& button )
*/
- void SetBackgroundImage( Toolkit::CheckBoxButton& checkBox, Actor image );
+ virtual void Initialize( Toolkit::Button& button );
/**
- * Sets the checked image.
- *
- * It adds the checked image to the root actor and creates the image transition if needed.
- *
- * @param[inout] checkBox The button in which all actors that form its appearance are going to be added.
- * @param[in] image The checked image.
+ * @copydoc ButtonPainter::SetSize( Toolkit::Button& button, const Vector3& size )
*/
- void SetCheckedImage( Toolkit::CheckBoxButton& checkBox, Actor image );
+ virtual void SetSize( Toolkit::Button& button, const Vector3& size );
/**
- * Sets the dimmed backgroundimage.
- *
- * It adds the dimmed backgroundimage to the root actor and creates the image transition if needed.
- *
- * @param[inout] checkBox The button in which all actors that form its appearance are going to be added.
- * @param[in] image The dimmed backgroundimage.
+ * @copydoc ButtonPainter::SetDisabled( Toolkit::Button& button, bool disabled )
*/
- void SetDimmedBackgroundImage( Toolkit::CheckBoxButton& checkBox, Actor image );
+ virtual void SetDisabled( Toolkit::Button& button, bool disabled );
/**
- * Sets the dimmed checked image.
- *
- * It adds the dimmed checked image to the root actor and creates the image transition if needed.
- *
- * @param[inout] checkBox The button in which all actors that form its appearance are going to be added.
- * @param[in] image The dimmed checked image.
+ * @copydoc ButtonPainter::SetAnimationTime( float animationTime )
*/
- void SetDimmedCheckedImage( Toolkit::CheckBoxButton& checkBox, Actor image );
-
- /////////////////////////////////////////////////////////////////////////////
- // ButtonPainter interface
- /////////////////////////////////////////////////////////////////////////////
+ virtual void SetAnimationTime( float animationTime );
/**
- * Initializes the painter by setting the default images.
- *
- * @param[inout] button The button in which all actors that form its appearance are going to be added.
+ * @copydoc ButtonPainter::GetAnimationTime()
*/
- void Initialize( Toolkit::Button& button );
+ virtual float GetAnimationTime() const;
/**
- * Sets the new size.
- *
- * Resizes images. It applies size constraints.
- *
- * @param[inout] button The button which stores button's images.
- * @param[in] size The new size.
+ * @copydoc ButtonPainter::SetSelectedImage( Toolkit::Button& button, Actor image )
*/
- void SetSize( Toolkit::Button& button, const Vector3& size );
+ virtual void SetSelectedImage( Toolkit::Button& button, Actor image );
/**
- * Changes the Vega::Toolkit::CheckBoxButton for the given dimmed state.
- *
- * It creates the image transition if needed.
- *
- * @param[inout] button The button in which all actors that form its appearance are going to be added.
- * @param[in] dimmed The dimmed state.
+ * @copydoc ButtonPainter::SetBackgroundImage( Toolkit::Button& button, Actor image )
*/
- void SetDimmed( Toolkit::Button& button, bool dimmed );
+ virtual void SetBackgroundImage( Toolkit::Button& button, Actor image );
/**
- * Sets the animation time.
- * @param[in] animationTime The animation time.
+ * @copydoc ButtonPainter::SetDisabledSelectedImage( Toolkit::Button& button, Actor image )
*/
- void SetAnimationTime( float animationTime );
+ virtual void SetDisabledSelectedImage( Toolkit::Button& button, Actor image );
/**
- * Retrieves the animation time.
- * @return The animation time.
+ * @copydoc ButtonPainter::SetDisabledBackgroundImage( Toolkit::Button& button, Actor image )
*/
- float GetAnimationTime() const;
+ virtual void SetDisabledBackgroundImage( Toolkit::Button& button, Actor image );
/////////////////////////////////////////////////////////////////////////////
// CheckBoxButtonPainter interface
*
* @param[inout] checkBox The Dali::Toolkit::CheckBoxButton in which this object is registered.
*/
- void Checked( Toolkit::CheckBoxButton& checkBox );
+ void Selected( Toolkit::Button& checkBox );
private:
*/
enum PaintState
{
- UncheckedState, ///< The check box button is unchecked.
- CheckedState, ///< The check box button is checked.
- DimmedUncheckedState, ///< The check box button is dimmed and unchecked.
- DimmedCheckedState, ///< The check box button is dimmed and checked.
- UncheckedCheckedTransition, ///< The check box button is in transition from unchecked to checked.
- CheckedUncheckedTransition, ///< The check box button is in transition from checked to unchecked.
- UncheckedDimmedTransition, ///< The check box button is in transition from unchecked to dimmed.
- DimmedUncheckedTransition, ///< The check box button is in transition from dimmed to unchecked.
- CheckedDimmedTransition, ///< The check box button is in transition from checked to dimmed.
- DimmedCheckedTransition ///< The check box button is in transition from dimmed to checked.
+ UnselectedState, ///< The check box button is unselected.
+ SelectedState, ///< The check box button is selected.
+ DisabledUnselectedState, ///< The check box button is disabled and unselected.
+ DisabledSelectedState, ///< The check box button is disabled and selected.
+ UnselectedSelectedTransition, ///< The check box button is in transition from unselected to selected.
+ SelectedUnselectedTransition, ///< The check box button is in transition from selected to unselected.
+ UnselectedDisabledTransition, ///< The check box button is in transition from unselected to disabled.
+ DisabledUnselectedTransition, ///< The check box button is in transition from disabled to unselected.
+ SelectedDisabledTransition, ///< The check box button is in transition from selected to disabled.
+ DisabledSelectedTransition ///< The check box button is in transition from disabled to selected.
};
/**
* @param[inout] actor The actor.
* @param[in] depth Depth position.
*/
- void ApplyCheckedConstraint( Actor& actor, float depth );
+ void ApplySelectedConstraint( Actor& actor, float depth );
/**
* Adds the actor to the fade in animation. It creates a fade in animation if needed.
* Stops the fade out animation.
*
* It removes the actor stored in CheckBoxButtonDefaultPainter::mFadeOutBackgroundImage and
- * CheckBoxButtonDefaultPainter::mFadeOutCheckedImage.
+ * CheckBoxButtonDefaultPainter::mFadeOutSelectedImage.
*
* @param[inout] checkBox The button which holds images.
* @param[in] remove If true, removes the fadeout actor from root.
* It adds the actor fade out animation and stores it to be removed when the animation finishes.
*
* @param[inout] checkBox The button which holds images.
- * @param[in] layer Defines if the actor is going to be stored in the mFadeOutBackgroundImage or mFadeOutCheckedImage member.
+ * @param[in] layer Defines if the actor is going to be stored in the mFadeOutBackgroundImage or mFadeOutSelectedImage member.
* @param[inout] image The actor.
* @param[in] opacity The initial opacity.
*/
* @param[inout] checkBox The button which holds images.
* @param[inout] image The actor.
*/
- void SetupCheckedAnimation( Toolkit::CheckBoxButton& checkBox, Actor& image );
+ void SetupSelectedAnimation( Toolkit::CheckBoxButton& checkBox, Actor& image );
/**
* Signal end of check out animation
void CheckInAnimationFinished( Dali::Animation& source );
private:
- bool mDimmed; ///< Stores the dimmed property.
+ bool mDisabled; ///< Stores the disabled property.
PaintState mPaintState; ///< The painter state.