Merge "Typo fixed in Control implementation doc." into tizen
[platform/core/uifw/dali-toolkit.git] / dali-toolkit / internal / controls / buttons / button-painter-impl.h
1 #ifndef __DALI_TOOLKIT_INTERNAL_BUTTON_PAINTER_H__
2 #define __DALI_TOOLKIT_INTERNAL_BUTTON_PAINTER_H__
3
4 /*
5  * Copyright (c) 2014 Samsung Electronics Co., Ltd.
6  *
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
10  *
11  * http://www.apache.org/licenses/LICENSE-2.0
12  *
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.
18  *
19  */
20
21 // INTERNAL INCLUDES
22 #include <dali/public-api/object/ref-object.h>
23 #include <dali/public-api/signals/connection-tracker.h>
24
25 // INTERNAL INCLUDES
26
27 namespace Dali
28 {
29
30 // Forward declarations
31
32 struct Vector3;
33
34 namespace Toolkit
35 {
36
37 // Forward declarations
38
39 class Button;
40
41 namespace Internal
42 {
43
44 // Forward declarations
45
46 class ButtonPainter;
47
48 // Type definitions
49
50 typedef IntrusivePtr<ButtonPainter> ButtonPainterPtr;
51
52 /**
53  * ButtonPainter is an interface which provides common functionality to all painters.
54  */
55 class ButtonPainter : public RefObject, public ConnectionTracker
56 {
57 public:
58   /**
59    * Destructor.
60    *
61    */
62   virtual ~ButtonPainter() {}
63
64   /**
65    * Initializes the painter.
66    *
67    * This method is called from the Dali::Toolkit::Internal::Button.
68    *
69    * @param[inout] button The button in which all actors that form its appearance are going to be added.
70    */
71   virtual void Initialize( Toolkit::Button& button ) = 0;
72
73   /**
74    * Sets the new size.
75    *
76    * This method is called from the Dali::Toolkit::Internal::Button when its size changes.
77    *
78    * @param[inout] button The button which stores button's images.
79    * @param[in] size The new size.
80    */
81   virtual void SetSize( Toolkit::Button& button, const Vector3& size ) = 0;
82
83   /**
84    * This method is called from the Dali::Toolkit::Internal::Button when the \e disabled property changes.
85    *
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.
88    */
89   virtual void SetDisabled( Toolkit::Button& button, bool disabled ) = 0;
90
91   /**
92    * This method is called from the Dali::Toolkit::Internal::PushButton when the \e autorepeating property changes.
93    * @param[in] autorepeating property.
94    */
95   virtual void SetAutoRepeating( bool autorepeating ) {}
96
97   /**
98    * Sets the animation time.
99    * @param [in] animationTime The animation time in seconds.
100    */
101   virtual void SetAnimationTime( float animationTime ) = 0;
102
103   /**
104    * Retrieves the animation time.
105    * @return The animation time in seconds.
106    */
107   virtual float GetAnimationTime() const = 0;
108
109   /**
110    * Sets the label.
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.
114    */
115   virtual void SetLabel( Toolkit::Button& button, Actor label ) {}
116
117   /**
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.
122    */
123   virtual void SetButtonImage( Toolkit::Button& button, Actor image ) {}
124
125   /**
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.
130    */
131   virtual void SetSelectedImage( Toolkit::Button& button, Actor image ) {}
132
133   /**
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.
138    */
139   virtual void SetBackgroundImage( Toolkit::Button& button, Actor image ) {}
140
141   /**
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.
146    */
147   virtual void SetDisabledImage( Toolkit::Button& button, Actor image ) {}
148
149   /**
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.
154    */
155   virtual void SetDisabledSelectedImage( Toolkit::Button& button, Actor image ) {}
156
157   /**
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.
162    */
163   virtual void SetDisabledBackgroundImage( Toolkit::Button& button, Actor image ) {}
164
165   /**
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.
170    */
171   virtual void Pressed( Toolkit::Button& button ) {}
172
173   /**
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.
178    */
179   virtual void Released( Toolkit::Button& button ) {}
180
181   /**
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.
186    */
187   virtual void Clicked( Toolkit::Button& button ) {}
188
189   /**
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.
194    */
195   virtual void Selected( Toolkit::Button& button ) {}
196 };
197
198 } // namespace Internal
199
200 } // namespace Toolkit
201
202 } // namespace Dali
203
204 #endif // __DALI_TOOLKIT_INTERNAL_BUTTON_PAINTER_H__