1 #ifndef __DALI_TOOLKIT_SLIDER_H__
2 #define __DALI_TOOLKIT_SLIDER_H__
5 * Copyright (c) 2014 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
36 * @brief Slider is a control to enable sliding an indicator between two values
39 * | %Signal Name | Method |
40 * |-------------------|-----------------------------|
41 * | value-changed | @ref ValueChangedSignal() |
42 * | mark | @ref MarkSignal() |
44 class DALI_IMPORT_API Slider : public Control
49 static const Property::Index LOWER_BOUND_PROPERTY; ///< Property, name "lower-bound", type FLOAT
50 static const Property::Index UPPER_BOUND_PROPERTY; ///< Property, name "upper-bound", type FLOAT
51 static const Property::Index VALUE_PROPERTY; ///< Property, name "value", type FLOAT
53 static const Property::Index HIT_REGION_PROPERTY; ///< Property, name "hit-region", type VECTOR2
54 static const Property::Index BACKING_REGION_PROPERTY; ///< Property, name "backing-region", type VECTOR2
55 static const Property::Index HANDLE_REGION_PROPERTY; ///< Property, name "handle-region", type VECTOR2
57 static const Property::Index BACKING_IMAGE_NAME_PROPERTY; ///< Property, name "backing-image-name", type STRING
58 static const Property::Index HANDLE_IMAGE_NAME_PROPERTY; ///< Property, name "handle-image-name", type STRING
59 static const Property::Index PROGRESS_IMAGE_NAME_PROPERTY; ///< Property, name "progress-image-name", type STRING
60 static const Property::Index POPUP_IMAGE_NAME_PROPERTY; ///< Property, name "popup-image-name", type STRING
61 static const Property::Index POPUP_ARROW_IMAGE_NAME_PROPERTY; ///< Property, name "popup-arrow-image-name", type STRING
63 static const Property::Index DISABLE_COLOR_PROPERTY; ///< Property, name "disable-color", type VECTOR4
64 static const Property::Index POPUP_TEXT_COLOR_PROPERTY; ///< Property, name "popup-text-color", type VECTOR4
66 static const Property::Index VALUE_PRECISION_PROPERTY; ///< Property, name "value-precision", type INT
68 static const Property::Index SHOW_POPUP_PROPERTY; ///< Property, name "show-popup", type BOOLEAN
69 static const Property::Index SHOW_VALUE_PROPERTY; ///< Property, name "show-value", type BOOLEAN
71 static const Property::Index ENABLED_PROPERTY; ///< Property, name "enabled", type BOOLEAN
73 static const Property::Index MARKS_PROPERTY; ///< Property, name "marks", type Property::Array<float>
74 static const Property::Index SNAP_TO_MARKS_PROPERTY; ///< Property, name "snap-to-marks", type BOOLEAN
75 static const Property::Index MARK_TOLERANCE_PROPERTY; ///< Property, name "mark-tolerance", type FLOAT
80 * Create the Slider control
81 * @return A handle to the Slider control.
86 * Creates an empty Slider handle
91 * Copy constructor. Creates another handle that points to the same real object
93 Slider( const Slider& handle );
96 * Assignment operator. Changes this handle to point to another real object
98 Slider& operator=( const Slider& handle );
103 * This is non-virtual since derived Handle types must not contain data or virtual methods.
108 * Downcast an Object handle to Slider. If handle points to a Slider the
109 * downcast produces valid handle. If not the returned handle is left uninitialized.
110 * @param[in] handle Handle to an object
111 * @return handle to a Slider or an uninitialized handle
113 static Slider DownCast( BaseHandle handle );
120 typedef Signal< bool ( Slider, float ) > ValueChangedSignalType;
121 typedef Signal< bool ( Slider, int ) > MarkSignalType;
124 * Signal emitted when the slider value changes
126 ValueChangedSignalType& ValueChangedSignal();
129 * Signal emitted when the sliding is finished
131 ValueChangedSignalType& SlidingFinishedSignal();
134 * Signal emitted when the slider handle reaches a mark
136 MarkSignalType& MarkSignal();
138 public: // Not intended for application developers
141 * Creates a handle using the Toolkit::Internal implementation.
142 * @param[in] implementation The Control implementation.
144 DALI_INTERNAL Slider(Internal::Slider& implementation);
147 * Allows the creation of this Control from an Internal::CustomActor pointer.
148 * @param[in] internal A pointer to the internal CustomActor.
150 explicit DALI_INTERNAL Slider( Dali::Internal::CustomActor* internal );
153 } // namespace Toolkit
157 #endif // __DALI_TOOLKIT_SLIDER_H__