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.
188 Slider( const Slider& handle );
191 * @brief Assignment operator.
193 * Changes this handle to point to another real object.
196 Slider& operator=( const Slider& handle );
201 * This is non-virtual since derived Handle types must not contain data or virtual methods.
207 * @brief Downcast an Object handle to Slider.
209 * If handle points to a Slider the
210 * downcast produces valid handle. If not the returned handle is left uninitialized.
212 * @param[in] handle Handle to an object
213 * @return handle to a Slider or an uninitialized handle
215 static Slider DownCast( BaseHandle handle );
220 * @brief Value changed signal type.
223 typedef Signal< bool ( Slider, float ) > ValueChangedSignalType;
226 * @brief Mark reached signal type.
229 typedef Signal< bool ( Slider, int ) > MarkReachedSignalType;
232 * @brief Signal emitted when the slider value changes.
234 * A callback of the following type may be connected:
236 * bool YourCallbackName( Slider slider, float value );
239 * @return The signal to connect to
241 ValueChangedSignalType& ValueChangedSignal();
244 * @brief Signal emitted when the sliding is finished.
246 * A callback of the following type may be connected:
248 * bool YourCallbackName( Slider slider, float value );
251 * @return The signal to connect to
253 ValueChangedSignalType& SlidingFinishedSignal();
256 * @brief Signal emitted when the slider handle reaches a mark.
258 * A callback of the following type may be connected:
260 * bool YourCallbackName( Slider slider, int value );
263 * @return The signal to connect to
265 MarkReachedSignalType& MarkReachedSignal();
267 public: // Not intended for application developers
271 * @brief Creates a handle using the Toolkit::Internal implementation.
274 * @param[in] implementation The Control implementation
276 DALI_INTERNAL Slider(Internal::Slider& implementation);
280 * @brief Allows the creation of this Control from an Internal::CustomActor pointer.
283 * @param[in] internal A pointer to the internal CustomActor
285 explicit DALI_INTERNAL Slider( Dali::Internal::CustomActor* internal );
291 } // namespace Toolkit
295 #endif // __DALI_TOOLKIT_SLIDER_H__