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.
76 * @brief name "lowerBound", type float
79 LOWER_BOUND = PROPERTY_START_INDEX,
82 * @brief name "upperBound", type float
88 * @brief name "value", type float
94 * @brief name "trackVisual", type string if it is a url, map otherwise
100 * @brief name "handleVisual", type string if it is a url, map otherwise
106 * @brief name "progressVisual", type string if it is a url, map otherwise
112 * @brief name "popupVisual", type string if it is a url, map otherwise
118 * @brief name "popupArrowVisual", type string if it is a url, map otherwise
124 * @brief name "disabledColor", type Vector4
130 * @brief name "valuePrecision", type int
136 * @brief name "showPopup", type bool
142 * @brief name "showValue", type bool
148 * @brief name "marks", type Property::Array<float>
154 * @brief name "snapToMarks", type bool
160 * @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 Assignment operator.
194 * Changes this handle to point to another real object.
196 * @param[in] handle Handle to an object
197 * @return A reference to this
199 Slider& operator=( const Slider& handle );
204 * This is non-virtual since derived Handle types must not contain data or virtual methods.
210 * @brief Downcast an Object handle to Slider.
212 * If handle points to a Slider the
213 * downcast produces valid handle. If not the returned handle is left uninitialized.
215 * @param[in] handle Handle to an object
216 * @return handle to a Slider or an uninitialized handle
218 static Slider DownCast( BaseHandle handle );
223 * @brief Value changed signal type.
226 typedef Signal< bool ( Slider, float ) > ValueChangedSignalType;
229 * @brief Mark reached signal type.
232 typedef Signal< bool ( Slider, int ) > MarkReachedSignalType;
235 * @brief Signal emitted when the slider value changes.
237 * A callback of the following type may be connected:
239 * bool YourCallbackName( Slider slider, float value );
242 * @return The signal to connect to
244 ValueChangedSignalType& ValueChangedSignal();
247 * @brief Signal emitted when the sliding is finished.
249 * A callback of the following type may be connected:
251 * bool YourCallbackName( Slider slider, float value );
254 * @return The signal to connect to
256 ValueChangedSignalType& SlidingFinishedSignal();
259 * @brief Signal emitted when the slider handle reaches a mark.
261 * A callback of the following type may be connected:
263 * bool YourCallbackName( Slider slider, int value );
266 * @return The signal to connect to
268 MarkReachedSignalType& MarkReachedSignal();
270 public: // Not intended for application developers
274 * @brief Creates a handle using the Toolkit::Internal implementation.
277 * @param[in] implementation The Control implementation
279 DALI_INTERNAL Slider(Internal::Slider& implementation);
282 * @brief Allows the creation of this Control from an Internal::CustomActor pointer.
285 * @param[in] internal A pointer to the internal CustomActor
287 explicit DALI_INTERNAL Slider( Dali::Internal::CustomActor* internal );
294 } // namespace Toolkit
298 #endif // __DALI_TOOLKIT_SLIDER_H__