1 #ifndef DALI_TOOLKIT_INTERNAL_PUSH_BUTTON_H
2 #define DALI_TOOLKIT_INTERNAL_PUSH_BUTTON_H
5 * Copyright (c) 2019 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.
22 #include <dali/public-api/common/vector-wrapper.h>
25 #include <dali-toolkit/public-api/controls/buttons/push-button.h>
26 #include "button-impl.h"
38 * PushButton implementation class.
40 * \sa Dali::Toolkit::PushButton
42 class PushButton : public Button
47 * Create a new PushButton.
48 * @return A smart-pointer to the newly allocated PushButton.
50 static Dali::Toolkit::PushButton New();
55 * Construct a new PushButton.
60 * A reference counted object may only be deleted by calling Unreference()
62 virtual ~PushButton();
69 * Enum for the alignment modes of the icon.
81 * Called when a property of an object of this type is set.
82 * @param[in] object The object whose property is set.
83 * @param[in] index The property index.
84 * @param[in] value The new property value.
86 static void SetProperty( BaseObject* object, Property::Index index, const Property::Value& value );
89 * Called to retrieve a property of an object of this type.
90 * @param[in] object The object whose property is to be retrieved.
91 * @param[in] index The property index.
92 * @return The current value of the property.
94 static Property::Value GetProperty( BaseObject* object, Property::Index propertyIndex );
97 * Deprecated API for Setting Pushbutton image using an Actor
98 * @param[in] image, Image Actor that has a url which can be used to create an image visual
100 void SetButtonImage( Actor image );
103 * Deprecated API for Setting Pushbutton image using an Actor
104 * @param[in] image, Image Actor that has a url which can be used to create an image visual
106 void SetBackgroundImage( Actor image );
109 * Deprecated API for Setting Pushbutton image using an Actor
110 * @param[in] image, Image Actor that has a url which can be used to create an image visual
112 void SetSelectedImage( Actor image );
115 * Deprecated API for Setting Pushbutton image using an Actor
116 * @param[in] image, Image Actor that has a url which can be used to create an image visual
118 void SetSelectedBackgroundImage( Actor image );
121 * Deprecated API for Setting Pushbutton image using an Actor
122 * @param[in] image, Image Actor that has a url which can be used to create an image visual
124 void SetDisabledBackgroundImage( Actor image );
127 * Deprecated API for Setting Pushbutton image using an Actor
128 * @param[in] image, Image Actor that has a url which can be used to create an image visual
130 void SetDisabledImage( Actor image );
133 * Deprecated API for Setting Pushbutton image using an Actor
134 * @param[in] image, Image Actor that has a url which can be used to create an image visual
136 void SetDisabledSelectedImage( Actor image );
138 private: // From Button
141 * @copydoc Toolkit::Internal::Button::OnInitialize
143 virtual void OnInitialize();
148 * @brief Sets the alignment mode to use to align the icon to the label.
150 * @param[in] iconAlignment The alignment mode to use
152 void SetIconAlignment( const PushButton::IconAlignment iconAlignment );
155 * @brief Gets the alignment mode used to align the icon to the label.
157 * @return The alignment mode in use
159 const PushButton::IconAlignment GetIconAlignment() const;
164 PushButton( const PushButton& );
167 PushButton& operator=( const PushButton& );
171 IconAlignment mIconAlignment; ///< The alignment of the icon against the label.
174 } // namespace Internal
176 // Helpers for public-api forwarding methods
178 inline Toolkit::Internal::PushButton& GetImplementation( Toolkit::PushButton& button )
180 DALI_ASSERT_ALWAYS( button );
182 Dali::RefObject& handle = button.GetImplementation();
184 return static_cast<Toolkit::Internal::PushButton&>( handle );
187 inline const Toolkit::Internal::PushButton& GetImplementation( const Toolkit::PushButton& button )
189 DALI_ASSERT_ALWAYS( button );
191 const Dali::RefObject& handle = button.GetImplementation();
193 return static_cast<const Toolkit::Internal::PushButton&>( handle );
196 } // namespace Toolkit
200 #endif // DALI_TOOLKIT_INTERNAL_PUSH_BUTTON_H