1 #ifndef __DALI_TOOLKIT_SLIDER_H__
2 #define __DALI_TOOLKIT_SLIDER_H__
5 // Copyright (c) 2014 Samsung Electronics Co., Ltd.
7 // Licensed under the Flora License, Version 1.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://floralicense.org/license/
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.
21 #include <dali-toolkit/public-api/controls/control.h>
23 namespace Dali DALI_IMPORT_API
29 namespace Internal DALI_INTERNAL
35 * Slider is a control to enable sliding an indicator between two values
37 class Slider : public Control
42 static const char* const SIGNAL_VALUE_CHANGED;
43 static const char* const SIGNAL_MARK;
46 static const Property::Index LOWER_BOUND_PROPERTY; ///< Property, name "lower-bound", type FLOAT
47 static const Property::Index UPPER_BOUND_PROPERTY; ///< Property, name "upper-bound", type FLOAT
48 static const Property::Index VALUE_PROPERTY; ///< Property, name "value", type FLOAT
50 static const Property::Index HIT_REGION_PROPERTY; ///< Property, name "hit-region", type VECTOR2
51 static const Property::Index BACKING_REGION_PROPERTY; ///< Property, name "backing-region", type VECTOR2
52 static const Property::Index HANDLE_REGION_PROPERTY; ///< Property, name "handle-region", type VECTOR2
54 static const Property::Index BACKING_IMAGE_NAME_PROPERTY; ///< Property, name "backing-image-name", type STRING
55 static const Property::Index HANDLE_IMAGE_NAME_PROPERTY; ///< Property, name "handle-image-name", type STRING
56 static const Property::Index PROGRESS_IMAGE_NAME_PROPERTY; ///< Property, name "progress-image-name", type STRING
57 static const Property::Index POPUP_IMAGE_NAME_PROPERTY; ///< Property, name "popup-image-name", type STRING
58 static const Property::Index POPUP_ARROW_IMAGE_NAME_PROPERTY; ///< Property, name "popup-arrow-image-name", type STRING
60 static const Property::Index DISABLE_COLOR_PROPERTY; ///< Property, name "disable-color", type VECTOR4
61 static const Property::Index POPUP_TEXT_COLOR_PROPERTY; ///< Property, name "popup-text-color", type VECTOR4
63 static const Property::Index VALUE_PRECISION_PROPERTY; ///< Property, name "value-precision", type INT
65 static const Property::Index SHOW_POPUP_PROPERTY; ///< Property, name "show-popup", type BOOLEAN
66 static const Property::Index SHOW_VALUE_PROPERTY; ///< Property, name "show-value", type BOOLEAN
68 static const Property::Index ENABLED_PROPERTY; ///< Property, name "enabled", type BOOLEAN
70 static const Property::Index MARKS_PROPERTY; ///< Property, name "marks", type Property::Array<float>
71 static const Property::Index SNAP_TO_MARKS_PROPERTY; ///< Property, name "snap-to-marks", type BOOLEAN
72 static const Property::Index MARK_TOLERANCE_PROPERTY; ///< Property, name "mark-tolerance", type FLOAT
77 * Create the Slider control
78 * @return A handle to the Slider control.
83 * Creates an empty Slider handle
88 * Copy constructor. Creates another handle that points to the same real object
90 Slider( const Slider& handle );
93 * Assignment operator. Changes this handle to point to another real object
95 Slider& operator=( const Slider& handle );
99 * Dali::Object derived classes typically do not contain member data.
104 * Downcast an Object handle to Slider. If handle points to a Slider the
105 * downcast produces valid handle. If not the returned handle is left uninitialized.
106 * @param[in] handle Handle to an object
107 * @return handle to a Slider or an uninitialized handle
109 static Slider DownCast( BaseHandle handle );
116 typedef SignalV2< bool ( Slider, float ) > ValueChangedSignalType;
117 typedef SignalV2< bool ( Slider, int ) > MarkSignalType;
120 * Signal emitted when the slider value changes
122 ValueChangedSignalType& ValueChangedSignal();
125 * Signal emitted when the sliding is finished
127 ValueChangedSignalType& SlidingFinishedSignal();
130 * Signal emitted when the slider handle reaches a mark
132 MarkSignalType& MarkSignal();
134 public: // Not intended for application developers
137 * Creates a handle using the Toolkit::Internal implementation.
138 * @param[in] implementation The Control implementation.
140 Slider(Internal::Slider& implementation);
143 * Allows the creation of this Control from an Internal::CustomActor pointer.
144 * @param[in] internal A pointer to the internal CustomActor.
146 Slider( Dali::Internal::CustomActor* internal );
149 } // namespace Toolkit
153 #endif // __DALI_TOOLKIT_SLIDER_H__