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.
52 class DALI_IMPORT_API PushButton : public Button
57 * @brief The start and end property ranges for this control.
62 PROPERTY_START_INDEX = Button::PROPERTY_END_INDEX + 1, ///< @SINCE_1_0.0
63 PROPERTY_END_INDEX = PROPERTY_START_INDEX + 1000 ///< Reserving 1000 property indices @SINCE_1_0.0
67 * @brief An enumeration of properties belonging to the PushButton class.
74 UNSELECTED_ICON = PROPERTY_START_INDEX, ///< Property, name "unselectedIcon", type std::string @SINCE_1_0.0
75 SELECTED_ICON, ///< Property, name "selectedIcon", type std::string @SINCE_1_0.0
76 ICON_ALIGNMENT, ///< Property, name "iconAlignment", type std::string @SINCE_1_0.0
77 LABEL_PADDING, ///< Property, name "labelPadding", type Vector4 @SINCE_1_0.0
78 ICON_PADDING, ///< Property, name "iconPadding", type Vector4 @SINCE_1_0.0
85 * @brief Create an uninitialized PushButton; this can be initialized with PushButton::New().
87 * Calling member functions with an uninitialized Dali::Object is not allowed.
93 * @brief Copy constructor.
96 PushButton( const PushButton& pushButton );
99 * @brief Assignment operator.
102 PushButton& operator=( const PushButton& pushButton );
107 * This is non-virtual since derived Handle types must not contain data or virtual methods.
113 * @brief Create an initialized PushButton.
116 * @return A handle to a newly allocated Dali resource.
118 static PushButton New();
121 * @brief Downcast an Object handle to PushButton.
123 * If handle points to a PushButton the downcast produces valid
124 * handle. If not the returned handle is left uninitialized.
127 * @param[in] handle Handle to an object
128 * @return handle to a PushButton or an uninitialized handle
130 static PushButton DownCast( BaseHandle handle );
135 using Button::SetButtonImage;
140 * @brief Sets the unselected image with an Actor.
143 * @param[in] image The Actor to use.
145 void SetButtonImage( Actor image );
147 using Button::SetBackgroundImage;
152 * @brief Sets the background image with an Actor.
155 * @param[in] image The Actor to use.
157 void SetBackgroundImage( Actor image );
159 using Button::SetSelectedImage;
164 * @brief Sets the selected image with an Actor.
167 * @param[in] image The Actor to use.
169 void SetSelectedImage( Actor image );
171 using Button::SetSelectedBackgroundImage;
176 * @brief Sets the selected background image with an Actor.
179 * @param[in] image The Actor to use.
181 void SetSelectedBackgroundImage( Actor image );
183 using Button::SetDisabledBackgroundImage;
188 * @brief Sets the disabled background image with an Actor.
191 * @param[in] image The Actor to use.
193 void SetDisabledBackgroundImage( Actor image );
195 using Button::SetDisabledImage;
200 * @brief Sets the disabled image with an Actor.
203 * @param[in] image The Actor to use.
205 void SetDisabledImage( Actor image );
207 using Button::SetDisabledSelectedImage;
212 * @brief Sets the disabled selected image with an Actor.
215 * @param[in] image The Actor to use.
217 void SetDisabledSelectedImage( Actor image );
220 public: // Not intended for application developers
223 * @brief Creates a handle using the Toolkit::Internal implementation.
226 * @param[in] implementation The Control implementation.
228 DALI_INTERNAL PushButton( Internal::PushButton& implementation );
231 * @brief Allows the creation of this Control from an Internal::CustomActor pointer.
234 * @param[in] internal A pointer to the internal CustomActor.
236 DALI_INTERNAL PushButton( Dali::Internal::CustomActor* internal );
242 } // namespace Toolkit
246 #endif // __DALI_TOOLKIT_PUSH_BUTTON_H__