1 #ifndef __DALI_TOOLKIT_PUSH_BUTTON_H__
2 #define __DALI_TOOLKIT_PUSH_BUTTON_H__
5 * Copyright (c) 2015 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.
30 // Forward declarations
32 namespace Internal DALI_INTERNAL
34 // Forward declarations
39 * @addtogroup dali_toolkit_controls_buttons
44 * @brief A PushButton changes its appearance when is pressed and returns to its original when is released.
46 * By default a PushButton emits a Button::PressedSignal() signal when the button is pressed, a Button::ClickedSignal() signal when it's clicked
47 * and a Button::ReleasedSignal() signal when it's released or having pressed it, the touch point leaves the boundary of the button.
49 * See Button for more detail on signals and modifying appearance via properties.
51 class DALI_IMPORT_API PushButton : public Button
56 * @brief The start and end property ranges for this control.
60 PROPERTY_START_INDEX = Button::PROPERTY_END_INDEX + 1,
61 PROPERTY_END_INDEX = PROPERTY_START_INDEX + 1000 ///< Reserving 1000 property indices
65 * @brief An enumeration of properties belonging to the PushButton class.
71 UNSELECTED_ICON = PROPERTY_START_INDEX, ///< Property, name "unselected-icon", type std::string
72 SELECTED_ICON, ///< Property, name "selected-icon", type std::string
73 ICON_ALIGNMENT, ///< Property, name "icon-alignment", type std::string
74 LABEL_PADDING, ///< Property, name "label-padding", type Vector4
75 ICON_PADDING, ///< Property, name "icon-padding", type Vector4
82 * @brief Create an uninitialized PushButton; this can be initialized with PushButton::New().
84 * Calling member functions with an uninitialized Dali::Object is not allowed.
89 * @brief Copy constructor.
91 PushButton( const PushButton& pushButton );
94 * @brief Assignment operator.
96 PushButton& operator=( const PushButton& pushButton );
101 * This is non-virtual since derived Handle types must not contain data or virtual methods.
106 * @brief Create an initialized PushButton.
108 * @return A handle to a newly allocated Dali resource.
110 static PushButton New();
113 * @brief Downcast an Object handle to PushButton.
115 * If handle points to a PushButton the downcast produces valid
116 * handle. If not the returned handle is left uninitialized.
118 * @param[in] handle Handle to an object
119 * @return handle to a PushButton or an uninitialized handle
121 static PushButton DownCast( BaseHandle handle );
126 using Button::SetButtonImage;
129 * @deprecated DALi 1.0.50
131 * @brief Sets the unselected image with an Actor.
133 * @param[in] image The Actor to use.
135 void SetButtonImage( Actor image );
137 using Button::SetBackgroundImage;
140 * @deprecated DALi 1.0.50
142 * @brief Sets the background image with an Actor.
144 * @param[in] image The Actor to use.
146 void SetBackgroundImage( Actor image );
148 using Button::SetSelectedImage;
151 * @deprecated DALi 1.0.50
153 * @brief Sets the selected image with an Actor.
155 * @param[in] image The Actor to use.
157 void SetSelectedImage( Actor image );
159 using Button::SetSelectedBackgroundImage;
162 * @deprecated DALi 1.0.50
164 * @brief Sets the selected background image with an Actor.
166 * @param[in] image The Actor to use.
168 void SetSelectedBackgroundImage( Actor image );
170 using Button::SetDisabledBackgroundImage;
173 * @deprecated DALi 1.0.50
175 * @brief Sets the disabled background image with an Actor.
177 * @param[in] image The Actor to use.
179 void SetDisabledBackgroundImage( Actor image );
181 using Button::SetDisabledImage;
184 * @deprecated DALi 1.0.50
186 * @brief Sets the disabled image with an Actor.
188 * @param[in] image The Actor to use.
190 void SetDisabledImage( Actor image );
192 using Button::SetDisabledSelectedImage;
195 * @deprecated DALi 1.0.50
197 * @brief Sets the disabled selected image with an Actor.
199 * @param[in] image The Actor to use.
201 void SetDisabledSelectedImage( Actor image );
204 public: // Not intended for application developers
207 * @brief Creates a handle using the Toolkit::Internal implementation.
209 * @param[in] implementation The Control implementation.
211 DALI_INTERNAL PushButton( Internal::PushButton& implementation );
214 * @brief Allows the creation of this Control from an Internal::CustomActor pointer.
216 * @param[in] internal A pointer to the internal CustomActor.
218 DALI_INTERNAL PushButton( Dali::Internal::CustomActor* internal );
224 } // namespace Toolkit
228 #endif // __DALI_TOOLKIT_PUSH_BUTTON_H__