1 #ifndef __DALI_TOOLKIT_INTERNAL_BUTTON_PAINTER_H__
2 #define __DALI_TOOLKIT_INTERNAL_BUTTON_PAINTER_H__
5 * Copyright (c) 2014 Samsung Electronics Co., Ltd.
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
11 * http://www.apache.org/licenses/LICENSE-2.0
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.
22 #include <dali/public-api/object/ref-object.h>
23 #include <dali/public-api/signals/connection-tracker.h>
30 // Forward declarations
37 // Forward declarations
44 // Forward declarations
50 typedef IntrusivePtr<ButtonPainter> ButtonPainterPtr;
53 * ButtonPainter is an interface which provides common functionality to all painters.
55 class ButtonPainter : public RefObject, public ConnectionTracker
62 virtual ~ButtonPainter() {}
65 * Initializes the painter.
67 * This method is called from the Dali::Toolkit::Internal::Button.
69 * @param[inout] button The button in which all actors that form its appearance are going to be added.
71 virtual void Initialize( Toolkit::Button& button ) = 0;
76 * This method is called from the Dali::Toolkit::Internal::Button when its size changes.
78 * @param[inout] button The button which stores button's images.
79 * @param[in] size The new size.
81 virtual void SetSize( Toolkit::Button& button, const Vector3& size ) = 0;
84 * This method is called from the Dali::Toolkit::Internal::Button when the \e disabled property changes.
86 * @param[inout] button The button in which all actors that form its appearance are going to be added.
87 * @param[in] disabled The disabled state.
89 virtual void SetDisabled( Toolkit::Button& button, bool disabled ) = 0;
92 * This method is called from the Dali::Toolkit::Internal::PushButton when the \e autorepeating property changes.
93 * @param[in] autorepeating property.
95 virtual void SetAutoRepeating( bool autorepeating ) {}
98 * Sets the animation time.
99 * @param [in] animationTime The animation time in seconds.
101 virtual void SetAnimationTime( float animationTime ) = 0;
104 * Retrieves the animation time.
105 * @return The animation time in seconds.
107 virtual float GetAnimationTime() const = 0;
111 * It adds the label to the root actor.
112 * @param[inout] button The button in which all actors that form its appearance are going to be added.
113 * @param[in] label Button label.
115 virtual void SetLabel( Toolkit::Button& button, Actor label ) {}
118 * Sets the button image.
119 * It adds the button image to the root actor and creates the image transition if needed.
120 * @param[inout] button The button in which all actors that form its appearance are going to be added.
121 * @param[in] image The button image.
123 virtual void SetButtonImage( Toolkit::Button& button, Actor image ) {}
126 * Sets the selected image.
127 * It adds the selected image to the root actor and creates the image transition if needed.
128 * @param[inout] button The button in which all actors that form its appearance are going to be added.
129 * @param[in] image The selected image.
131 virtual void SetSelectedImage( Toolkit::Button& button, Actor image ) {}
134 * Sets the background image.
135 * It adds the background image to the root actor and creates the image transition if needed.
136 * @param[inout] button The button in which all actors that form its appearance are going to be added.
137 * @param[in] image The background image.
139 virtual void SetBackgroundImage( Toolkit::Button& button, Actor image ) {}
142 * Sets the disabled image.
143 * It adds the disabled image to the root actor and creates the image transition if needed.
144 * @param[inout] button The button in which all actors that form its appearance are going to be added.
145 * @param[in] image The disabled button image.
147 virtual void SetDisabledImage( Toolkit::Button& button, Actor image ) {}
150 * Sets the disabled selected image.
151 * It adds the disabled selected image to the root actor and creates the image transition if needed.
152 * @param[inout] button The button in which all actors that form its appearance are going to be added.
153 * @param[in] image The disabled selected image.
155 virtual void SetDisabledSelectedImage( Toolkit::Button& button, Actor image ) {}
158 * Sets the disabled background image.
159 * It adds the disabled background image to the root actor and creates the image transition if needed.
160 * @param[inout] button The button in which all actors that form its appearance are going to be added.
161 * @param[in] image The disabled background image.
163 virtual void SetDisabledBackgroundImage( Toolkit::Button& button, Actor image ) {}
166 * This method is called when the Dali::Toolkit::Internal::Button, in which this
167 * object is registered, is pressed.
168 * @param[inout] button The Dali::Toolkit::Button, linked to the internal
169 * implementation, in which this object is registered.
171 virtual void Pressed( Toolkit::Button& button ) {}
174 * This method is called when the Dali::Toolkit::Internal::Button, in which this
175 * object is registered, is released.
176 * @param[inout] button The Dali::Toolkit::Button, linked to the internal
177 * implementation, in which this object is registered.
179 virtual void Released( Toolkit::Button& button ) {}
182 * This method is called when the Dali::Toolkit::Internal::Button, in which this
183 * object is registered, is clicked.
184 * @param[inout] button The Dali::Toolkit::Button, linked to the internal
185 * implementation, in which this object is registered.
187 virtual void Clicked( Toolkit::Button& button ) {}
190 * This method is called when the Dali::Toolkit::Internal::Button, in which this
191 * object is registered, changes its state.
192 * @param[inout] button The Dali::Toolkit::Button, linked to the internal
193 * implementation, in which this object is registered.
195 virtual void Selected( Toolkit::Button& button ) {}
198 } // namespace Internal
200 } // namespace Toolkit
204 #endif // __DALI_TOOLKIT_INTERNAL_BUTTON_PAINTER_H__