X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git;a=blobdiff_plain;f=dali-toolkit%2Finternal%2Fcontrols%2Fbuttons%2Fpush-button-default-painter-impl.h;h=312a43c3d36b59c12bb3bb3408eab40891c15bb3;hp=c1ea5672351a343438197878d9d6adecee62dd11;hb=228286f3af41623416b6d78abf194a395fec711d;hpb=e2eda444afbe82e9591fe198eef339227f90a616 diff --git a/dali-toolkit/internal/controls/buttons/push-button-default-painter-impl.h b/dali-toolkit/internal/controls/buttons/push-button-default-painter-impl.h index c1ea567..312a43c 100644 --- a/dali-toolkit/internal/controls/buttons/push-button-default-painter-impl.h +++ b/dali-toolkit/internal/controls/buttons/push-button-default-painter-impl.h @@ -1,28 +1,30 @@ #ifndef __DALI_TOOLKIT_INTERNAL_PUSH_BUTTON_DEFAULT_PAINTER_H__ #define __DALI_TOOLKIT_INTERNAL_PUSH_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 #include #include #include +// INTERNAL INCLUDES #include "push-button-painter-impl.h" namespace Dali @@ -67,150 +69,89 @@ public: */ ~PushButtonDefaultPainter(); + ///////////////////////////////////////////////////////////////////////////// + // ButtonPainter interface + ///////////////////////////////////////////////////////////////////////////// + /** - * Sets the button image. - * - * It adds the button image to the root actor and creates the image transition if needed. - * - * @param[inout] pushButton The button in which all actors that form its appearance are going to be added. - * @param[in] image The button image. + * @copydoc ButtonPainter::Initialize( Toolkit::Button& button ) */ - void SetButtonImage( Toolkit::PushButton& pushButton, Actor image ); + virtual void Initialize( Toolkit::Button& button ); /** - * Sets the background image. - * - * It adds the background image to the root actor and creates the image transition if needed. - * - * @param[inout] pushButton The button in which all actors that form its appearance are going to be added. - * @param[in] image The background image. + * @copydoc ButtonPainter::SetSize( Toolkit::Button& button, const Vector3& size ) */ - void SetBackgroundImage( Toolkit::PushButton& pushButton, Actor image ); + virtual void SetSize( Toolkit::Button& button, const Vector3& size ); /** - * Sets the pressed image. - * - * It adds the pressed image to the root actor and creates the image transition if needed. - * - * @param[inout] pushButton The button in which all actors that form its appearance are going to be added. - * @param[in] image The pressed image. + * @copydoc ButtonPainter::SetDisabled( Toolkit::Button& button, bool disabled ) */ - void SetPressedImage( Toolkit::PushButton& pushButton, Actor image ); + virtual void SetDisabled( Toolkit::Button& button, bool disabled ); /** - * Sets the dimmed background image. - * - * It adds the dimmed background image to the root actor and creates the image transition if needed. - * - * @param[inout] pushButton The button in which all actors that form its appearance are going to be added. - * @param[in] image The dimmed background image. + * @copydoc ButtonPainter::SetAnimationTime( float animationTime ) */ - void SetDimmedBackgroundImage( Toolkit::PushButton& pushButton, Actor image ); + virtual void SetAnimationTime( float animationTime ); /** - * Sets the dimmed image. - * - * It adds the dimmed image to the root actor and creates the image transition if needed. - * - * @param[inout] pushButton The button in which all actors that form its appearance are going to be added. - * @param[in] image The image. + * @copydoc ButtonPainter::GetAnimationTime() */ - void SetDimmedImage( Toolkit::PushButton& pushButton, Actor image ); + virtual float GetAnimationTime() const; /** - * Sets the text label. - * - * It adds the text to the root actor. - * - * @param[inout] pushButton The button in which all actors that form its appearance are going to be added. - * @param[in] text Label text. + * @copydoc ButtonPainter::SetLabel( Toolkit::Button& button, Actor label ) */ - void SetLabelText( Toolkit::PushButton& pushButton, Actor text ); - - ///////////////////////////////////////////////////////////////////////////// - // ButtonPainter interface - ///////////////////////////////////////////////////////////////////////////// + virtual void SetLabel( Toolkit::Button& button, Actor label ); /** - * 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::SetAutoRepeating( bool autorepeating ) */ - void Initialize( Toolkit::Button& button ); + virtual void SetAutoRepeating( bool autorepeating ); /** - * Sets the new size. - * - * Resizes actors. It applies size constraints. - * - * @param[inout] button The button which stores button's images. - * @param[in] size The new size. + * @copydoc ButtonPainter::SetButtonImage( Toolkit::Button& button, Actor image ) */ - void SetSize( Toolkit::Button& button, const Vector3& size ); + virtual void SetButtonImage( Toolkit::Button& button, Actor image ); /** - * This method is called when the \e dimmed property in the Dali::Toolkit::PushButton changes. - * - * Creates image transitions if needed. - * - * @param[inout] button The button in which all actors that form its appearance are going to be added. - * @param[in] dimmed property. + * @copydoc ButtonPainter::SetSelectedImage( Toolkit::Button& button, Actor image ) */ - void SetDimmed( Toolkit::Button& button, bool dimmed ); + virtual void SetSelectedImage( Toolkit::Button& button, Actor image ); /** - * Sets the animation time. - * @param[in] animationTime The animation time. + * @copydoc ButtonPainter::SetBackgroundImage( Toolkit::Button& button, Actor image ) */ - void SetAnimationTime( float animationTime ); + virtual void SetBackgroundImage( Toolkit::Button& button, Actor image ); /** - * Retrieves the animation time. - * @return The animation time. + * @copydoc ButtonPainter::SetDisabledImage( Toolkit::Button& button, Actor image ) */ - float GetAnimationTime() const; - - ///////////////////////////////////////////////////////////////////////////// - // PushButtonPainter interface - ///////////////////////////////////////////////////////////////////////////// + virtual void SetDisabledImage( Toolkit::Button& button, Actor image ); /** - * This method is called when the \e autorepeating property in the Dali::Toolkit::PushButton changes. - * @param[in] autorepeating property. + * @copydoc ButtonPainter::SetDisabledBackgroundImage( Toolkit::Button& button, Actor image ) */ - void SetAutoRepeating( bool autorepeating ); + virtual void SetDisabledBackgroundImage( Toolkit::Button& button, Actor image ); /** - * This method is called when the Dali::Toolkit::Internal::PushButton in which this object is registered - * is pressed. It changes to the pressed image with a transition. - * - * @param[inout] button The Dali::Toolkit::PushButton in which this object is registered. + * @copydoc ButtonPainter::Pressed( Toolkit::Button& button ) */ - void Pressed( Toolkit::PushButton& button ); + void Pressed( Toolkit::Button& button ); /** - * This method is called when the Dali::Toolkit::Internal::PushButton in which this object is registered - * is released. It changes to the button image with a transition. - * - * @param[inout] button The Dali::Toolkit::PushButton in which this object is registered. + * @copydoc ButtonPainter::Released( Toolkit::Button& button ) */ - void Released( Toolkit::PushButton& button ); + void Released( Toolkit::Button& button ); /** - * This method is called when the Dali::Toolkit::Internal::PushButton in which this object is registered - * is clicked. - * - * @param[inout] button The Dali::Toolkit::PushButton in which this object is registered. + * @copydoc ButtonPainter::Clicked( Toolkit::Button& button ) */ - void Clicked( Toolkit::PushButton& button ); + void Clicked( Toolkit::Button& button ); /** - * This method is called when the Dali::Toolkit::Internal::PushButton in which this object is registered - * is toggled. - * - * @param[inout] button The Dali::Toolkit::PushButton in which this object is registered. + * @copydoc ButtonPainter::Selected( Toolkit::Button& button ) */ - void Toggled( Toolkit::PushButton& button ); + void Selected( Toolkit::Button& button ); private: @@ -227,16 +168,16 @@ private: */ enum PaintState { - ReleasedState, ///< The push button is released. - PressedState, ///< The push button is pressed. - DimmedReleasedState, ///< The push button is dimmed and released. - DimmedPressedState, ///< The push button is dimemd and pressed. - ReleasedPressedTransition, ///< The push button is in transition from released to pressed. - PressedReleasedTransition, ///< The push button is in transition from pressed to released. - ReleasedDimmedTransition, ///< The push button is in transition from released to dimmed. - DimmedReleasedTransition, ///< The push button is in transition from dimmed to released. - PressedDimmedTransition, ///< The push button is in transition from pressed to dimmed. - DimmedPressedTransition ///< The push button is in transition from dimmed to pressed. + ReleasedState, ///< The push button is released. + PressedState, ///< The push button is pressed. + DisabledReleasedState, ///< The push button is disabled and released. + DisabledPressedState, ///< The push button is Disabled and pressed. + ReleasedPressedTransition, ///< The push button is in transition from released to pressed. + PressedReleasedTransition, ///< The push button is in transition from pressed to released. + ReleasedDisabledTransition, ///< The push button is in transition from released to disabled. + DisabledReleasedTransition, ///< The push button is in transition from disabled to released. + PressedDisabledTransition, ///< The push button is in transition from pressed to disabled. + DisabledPressedTransition ///< The push button is in transition from disabled to pressed. }; /** @@ -336,7 +277,7 @@ private: private: bool mAutoRepeating; ///< Stores the autorepeating property. - bool mDimmed; ///< Stores the dimmed property. + bool mDisabled; ///< Stores the disabled property. PaintState mPaintState; ///< The painter state. Animation mFadeInAnimation; ///< Animation used in the state transitions.