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
40 * @brief A PushButton changes its appearance when is pressed and returns to its original when is released.
42 * By default a PushButton emits a Button::PressedSignal() signal when the button is pressed, a Button::ClickedSignal() signal when it's clicked
43 * and a Button::ReleasedSignal() signal when it's released or having pressed it, the touch point leaves the boundary of the button.
45 * See Button for more detail on signals and modifying appearance via properties.
47 class DALI_IMPORT_API PushButton : public Button
52 * @brief The start and end property ranges for this control.
56 PROPERTY_START_INDEX = Button::PROPERTY_END_INDEX + 1,
57 PROPERTY_END_INDEX = PROPERTY_START_INDEX + 1000 ///< Reserving 1000 property indices
61 * @brief An enumeration of properties belonging to the PushButton class.
67 UNSELECTED_ICON = PROPERTY_START_INDEX, ///< Property, name "unselected-icon", type std::string
68 SELECTED_ICON, ///< Property, name "selected-icon", type std::string
69 ICON_ALIGNMENT, ///< Property, name "icon-alignment", type std::string
70 LABEL_PADDING, ///< Property, name "label-padding", type Vector4
71 ICON_PADDING, ///< Property, name "icon-padding", type Vector4
78 * @brief Create an uninitialized PushButton; this can be initialized with PushButton::New().
80 * Calling member functions with an uninitialized Dali::Object is not allowed.
85 * @brief Copy constructor.
87 PushButton( const PushButton& pushButton );
90 * @brief Assignment operator.
92 PushButton& operator=( const PushButton& pushButton );
97 * This is non-virtual since derived Handle types must not contain data or virtual methods.
102 * @brief Create an initialized PushButton.
104 * @return A handle to a newly allocated Dali resource.
106 static PushButton New();
109 * @brief Downcast an Object handle to PushButton.
111 * If handle points to a PushButton the downcast produces valid
112 * handle. If not the returned handle is left uninitialized.
114 * @param[in] handle Handle to an object
115 * @return handle to a PushButton or an uninitialized handle
117 static PushButton DownCast( BaseHandle handle );
122 using Button::SetButtonImage;
125 * @deprecated Sets the unselected image with an Actor.
126 * @param[in] image The Actor to use.
128 void SetButtonImage( Actor image );
130 using Button::SetBackgroundImage;
133 * @deprecated Sets the background image with an Actor.
134 * @param[in] image The Actor to use.
136 void SetBackgroundImage( Actor image );
138 using Button::SetSelectedImage;
141 * @deprecated Sets the selected image with an Actor.
142 * @param[in] image The Actor to use.
144 void SetSelectedImage( Actor image );
146 using Button::SetSelectedBackgroundImage;
149 * @deprecated Sets the selected background image with an Actor.
150 * @param[in] image The Actor to use.
152 void SetSelectedBackgroundImage( Actor image );
154 using Button::SetDisabledBackgroundImage;
157 * @deprecated Sets the disabled background image with an Actor.
158 * @param[in] image The Actor to use.
160 void SetDisabledBackgroundImage( Actor image );
162 using Button::SetDisabledImage;
165 * @deprecated Sets the disabled image with an Actor.
166 * @param[in] image The Actor to use.
168 void SetDisabledImage( Actor image );
170 using Button::SetDisabledSelectedImage;
173 * @deprecated Sets the disabled selected image with an Actor.
174 * @param[in] image The Actor to use.
176 void SetDisabledSelectedImage( Actor image );
179 public: // Not intended for application developers
182 * @brief Creates a handle using the Toolkit::Internal implementation.
184 * @param[in] implementation The Control implementation.
186 DALI_INTERNAL PushButton( Internal::PushButton& implementation );
189 * @brief Allows the creation of this Control from an Internal::CustomActor pointer.
191 * @param[in] internal A pointer to the internal CustomActor.
193 DALI_INTERNAL PushButton( Dali::Internal::CustomActor* internal );
196 } // namespace Toolkit
200 #endif // __DALI_TOOLKIT_PUSH_BUTTON_H__