1 #ifndef __DALI_TOOLKIT_SLIDER_H__
2 #define __DALI_TOOLKIT_SLIDER_H__
5 * Copyright (c) 2016 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>
30 namespace Internal DALI_INTERNAL
35 * @addtogroup dali_toolkit_controls_slider
40 * @brief Slider is a control to enable sliding an indicator between two values
43 * | %Signal Name | Method |
44 * |-------------------|-------------------------------|
45 * | valueChanged | @ref ValueChangedSignal() |
46 * | markReached | @ref MarkReachedSignal() |
47 * | slidingFinished | @ref SlidingFinishedSignal() |
50 class DALI_IMPORT_API Slider : public Control
57 * @brief The start and end property ranges for this control.
62 PROPERTY_START_INDEX = Control::CONTROL_PROPERTY_END_INDEX + 1, ///< @SINCE_1_1.39
63 PROPERTY_END_INDEX = PROPERTY_START_INDEX + 1000 ///< Reserve property indices @SINCE_1_1.39
67 * @brief An enumeration of properties belonging to the Slider class.
73 * @brief An enumeration of properties belonging to the Slider class.
80 * @brief name "lowerBound", type float
83 LOWER_BOUND = PROPERTY_START_INDEX,
86 * @brief name "upperBound", type float
92 * @brief name "value", type float
98 * @brief name "trackVisual", type string if it is a url, map otherwise
104 * @brief name "handleVisual", type string if it is a url, map otherwise
110 * @brief name "progressVisual", type string if it is a url, map otherwise
116 * @brief name "popupVisual", type string if it is a url, map otherwise
122 * @brief name "popupArrowVisual", type string if it is a url, map otherwise
128 * @brief name "disabledColor", type Vector4
134 * @brief name "valuePrecision", type int
140 * @brief name "showPopup", type bool
146 * @brief name "showValue", type bool
152 * @brief name "marks", type Property::Array<float>
158 * @brief name "snapToMarks", type bool
164 * @brief name "markTolerance", type float
174 * @brief Creates the Slider control.
176 * @return A handle to the Slider control
181 * @brief Creates an empty Slider handle.
187 * @brief Copy constructor.
189 * Creates another handle that points to the same real object.
191 * @param[in] handle Handle to an object
193 Slider( const Slider& handle );
196 * @brief Assignment operator.
198 * Changes this handle to point to another real object.
200 * @param[in] handle Handle to an object
201 * @return A reference to this
203 Slider& operator=( const Slider& handle );
208 * This is non-virtual since derived Handle types must not contain data or virtual methods.
214 * @brief Downcast an Object handle to Slider.
216 * If handle points to a Slider the
217 * downcast produces valid handle. If not the returned handle is left uninitialized.
219 * @param[in] handle Handle to an object
220 * @return handle to a Slider or an uninitialized handle
222 static Slider DownCast( BaseHandle handle );
227 * @brief Value changed signal type.
230 typedef Signal< bool ( Slider, float ) > ValueChangedSignalType;
233 * @brief Mark reached signal type.
236 typedef Signal< bool ( Slider, int ) > MarkReachedSignalType;
239 * @brief Signal emitted when the slider value changes.
241 * A callback of the following type may be connected:
243 * bool YourCallbackName( Slider slider, float value );
246 * @return The signal to connect to
248 ValueChangedSignalType& ValueChangedSignal();
251 * @brief Signal emitted when the sliding is finished.
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& SlidingFinishedSignal();
263 * @brief Signal emitted when the slider handle reaches a mark.
265 * A callback of the following type may be connected:
267 * bool YourCallbackName( Slider slider, int value );
270 * @return The signal to connect to
272 MarkReachedSignalType& MarkReachedSignal();
274 public: // Not intended for application developers
278 * @brief Creates a handle using the Toolkit::Internal implementation.
281 * @param[in] implementation The Control implementation
283 DALI_INTERNAL Slider(Internal::Slider& implementation);
287 * @brief Allows the creation of this Control from an Internal::CustomActor pointer.
290 * @param[in] internal A pointer to the internal CustomActor
292 explicit DALI_INTERNAL Slider( Dali::Internal::CustomActor* internal );
298 } // namespace Toolkit
302 #endif // __DALI_TOOLKIT_SLIDER_H__