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 Sets the unselected image with an Actor.
130 * @param[in] image The Actor to use.
132 void SetButtonImage( Actor image );
134 using Button::SetBackgroundImage;
137 * @deprecated Sets the background image with an Actor.
138 * @param[in] image The Actor to use.
140 void SetBackgroundImage( Actor image );
142 using Button::SetSelectedImage;
145 * @deprecated Sets the selected image with an Actor.
146 * @param[in] image The Actor to use.
148 void SetSelectedImage( Actor image );
150 using Button::SetSelectedBackgroundImage;
153 * @deprecated Sets the selected background image with an Actor.
154 * @param[in] image The Actor to use.
156 void SetSelectedBackgroundImage( Actor image );
158 using Button::SetDisabledBackgroundImage;
161 * @deprecated Sets the disabled background image with an Actor.
162 * @param[in] image The Actor to use.
164 void SetDisabledBackgroundImage( Actor image );
166 using Button::SetDisabledImage;
169 * @deprecated Sets the disabled image with an Actor.
170 * @param[in] image The Actor to use.
172 void SetDisabledImage( Actor image );
174 using Button::SetDisabledSelectedImage;
177 * @deprecated Sets the disabled selected image with an Actor.
178 * @param[in] image The Actor to use.
180 void SetDisabledSelectedImage( Actor image );
183 public: // Not intended for application developers
186 * @brief Creates a handle using the Toolkit::Internal implementation.
188 * @param[in] implementation The Control implementation.
190 DALI_INTERNAL PushButton( Internal::PushButton& implementation );
193 * @brief Allows the creation of this Control from an Internal::CustomActor pointer.
195 * @param[in] internal A pointer to the internal CustomActor.
197 DALI_INTERNAL PushButton( Dali::Internal::CustomActor* internal );
203 } // namespace Toolkit
207 #endif // __DALI_TOOLKIT_PUSH_BUTTON_H__