1 #ifndef DALI_TOOLKIT_SLIDER_H
2 #define DALI_TOOLKIT_SLIDER_H
5 * Copyright (c) 2020 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-toolkit/public-api/controls/control.h>
28 namespace Internal DALI_INTERNAL
33 * @addtogroup dali_toolkit_controls_slider
38 * @brief Slider is a control to enable sliding an indicator between two values.
41 * | %Signal Name | Method |
42 * |-------------------|-------------------------------|
43 * | valueChanged | @ref ValueChangedSignal() |
44 * | markReached | @ref MarkReachedSignal() |
45 * | slidingFinished | @ref SlidingFinishedSignal() |
48 class DALI_TOOLKIT_API Slider : public Control
54 * @brief Enumeration for the start and end property ranges for this control.
59 PROPERTY_START_INDEX = Control::CONTROL_PROPERTY_END_INDEX + 1, ///< @SINCE_1_1.39
60 PROPERTY_END_INDEX = PROPERTY_START_INDEX + 1000 ///< Reserve property indices @SINCE_1_1.39
64 * @brief Enumeration for the instance of properties belonging to the Slider class.
70 * @brief Enumeration for the instance of properties belonging to the Slider class.
77 * @brief name "lowerBound", type float.
80 LOWER_BOUND = PROPERTY_START_INDEX,
83 * @brief name "upperBound", type float.
89 * @brief name "value", type float.
95 * @brief name "trackVisual", type string if it is a url, map otherwise.
101 * @brief name "handleVisual", type string if it is a url, map otherwise.
107 * @brief name "progressVisual", type string if it is a url, map otherwise.
113 * @brief name "popupVisual", type string if it is a url, map otherwise.
119 * @brief name "popupArrowVisual", type string if it is a url, map otherwise.
125 * @brief name "disabledColor", type Vector4.
131 * @brief name "valuePrecision", type int.
137 * @brief name "showPopup", type bool.
143 * @brief name "showValue", type bool.
149 * @brief name "marks", type Property::Array<float>.
155 * @brief name "snapToMarks", type bool.
161 * @brief name "markTolerance", type float.
170 * @brief Creates the Slider control.
172 * @return A handle to the Slider control
177 * @brief Creates an empty Slider handle.
183 * @brief Copy constructor.
185 * Creates another handle that points to the same real object.
187 * @param[in] handle Handle to an object
189 Slider(const Slider& handle);
192 * @brief Move constructor
195 * @param[in] rhs A reference to the moved handle
197 Slider(Slider&& rhs);
200 * @brief Assignment operator.
202 * Changes this handle to point to another real object.
204 * @param[in] handle Handle to an object
205 * @return A reference to this
207 Slider& operator=(const Slider& handle);
210 * @brief Move assignment
213 * @param[in] rhs A reference to the moved handle
214 * @return A reference to this
216 Slider& operator=(Slider&& rhs);
221 * This is non-virtual since derived Handle types must not contain data or virtual methods.
227 * @brief Downcasts an Object handle to Slider.
229 * If handle points to a Slider, the downcast produces valid handle.
230 * If not, the returned handle is left uninitialized.
232 * @param[in] handle Handle to an object
233 * @return handle to a Slider or an uninitialized handle
235 static Slider DownCast(BaseHandle handle);
239 * @brief Value changed signal type.
242 typedef Signal<bool(Slider, float)> ValueChangedSignalType;
245 * @brief Mark reached signal type.
248 typedef Signal<bool(Slider, int)> MarkReachedSignalType;
251 * @brief Signal emitted when the slider value changes.
253 * A callback of the following type may be connected:
255 * bool YourCallbackName( Slider slider, float value );
258 * @return The signal to connect to
260 ValueChangedSignalType& ValueChangedSignal();
263 * @brief Signal emitted when the sliding is finished.
265 * A callback of the following type may be connected:
267 * bool YourCallbackName( Slider slider, float value );
270 * @return The signal to connect to
272 ValueChangedSignalType& SlidingFinishedSignal();
275 * @brief Signal emitted when the slider handle reaches a mark.
277 * A callback of the following type may be connected:
279 * bool YourCallbackName( Slider slider, int value );
282 * @return The signal to connect to
284 MarkReachedSignalType& MarkReachedSignal();
286 public: // Not intended for application developers
289 * @brief Creates a handle using the Toolkit::Internal implementation.
292 * @param[in] implementation The Control implementation
294 DALI_INTERNAL Slider(Internal::Slider& implementation);
297 * @brief Allows the creation of this Control from an Internal::CustomActor pointer.
300 * @param[in] internal A pointer to the internal CustomActor
302 explicit DALI_INTERNAL Slider(Dali::Internal::CustomActor* internal);
309 } // namespace Toolkit
313 #endif // DALI_TOOLKIT_SLIDER_H