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
38 class DALI_IMPORT_API Slider : public Control
43 static const char* const SIGNAL_VALUE_CHANGED;
44 static const char* const SIGNAL_MARK;
47 static const Property::Index LOWER_BOUND_PROPERTY; ///< Property, name "lower-bound", type FLOAT
48 static const Property::Index UPPER_BOUND_PROPERTY; ///< Property, name "upper-bound", type FLOAT
49 static const Property::Index VALUE_PROPERTY; ///< Property, name "value", type FLOAT
51 static const Property::Index HIT_REGION_PROPERTY; ///< Property, name "hit-region", type VECTOR2
52 static const Property::Index BACKING_REGION_PROPERTY; ///< Property, name "backing-region", type VECTOR2
53 static const Property::Index HANDLE_REGION_PROPERTY; ///< Property, name "handle-region", type VECTOR2
55 static const Property::Index BACKING_IMAGE_NAME_PROPERTY; ///< Property, name "backing-image-name", type STRING
56 static const Property::Index HANDLE_IMAGE_NAME_PROPERTY; ///< Property, name "handle-image-name", type STRING
57 static const Property::Index PROGRESS_IMAGE_NAME_PROPERTY; ///< Property, name "progress-image-name", type STRING
58 static const Property::Index POPUP_IMAGE_NAME_PROPERTY; ///< Property, name "popup-image-name", type STRING
59 static const Property::Index POPUP_ARROW_IMAGE_NAME_PROPERTY; ///< Property, name "popup-arrow-image-name", type STRING
61 static const Property::Index DISABLE_COLOR_PROPERTY; ///< Property, name "disable-color", type VECTOR4
62 static const Property::Index POPUP_TEXT_COLOR_PROPERTY; ///< Property, name "popup-text-color", type VECTOR4
64 static const Property::Index VALUE_PRECISION_PROPERTY; ///< Property, name "value-precision", type INT
66 static const Property::Index SHOW_POPUP_PROPERTY; ///< Property, name "show-popup", type BOOLEAN
67 static const Property::Index SHOW_VALUE_PROPERTY; ///< Property, name "show-value", type BOOLEAN
69 static const Property::Index ENABLED_PROPERTY; ///< Property, name "enabled", type BOOLEAN
71 static const Property::Index MARKS_PROPERTY; ///< Property, name "marks", type Property::Array<float>
72 static const Property::Index SNAP_TO_MARKS_PROPERTY; ///< Property, name "snap-to-marks", type BOOLEAN
73 static const Property::Index MARK_TOLERANCE_PROPERTY; ///< Property, name "mark-tolerance", type FLOAT
78 * Create the Slider control
79 * @return A handle to the Slider control.
84 * Creates an empty Slider handle
89 * Copy constructor. Creates another handle that points to the same real object
91 Slider( const Slider& handle );
94 * Assignment operator. Changes this handle to point to another real object
96 Slider& operator=( const Slider& handle );
101 * This is non-virtual since derived Handle types must not contain data or virtual methods.
106 * Downcast an Object handle to Slider. If handle points to a Slider the
107 * downcast produces valid handle. If not the returned handle is left uninitialized.
108 * @param[in] handle Handle to an object
109 * @return handle to a Slider or an uninitialized handle
111 static Slider DownCast( BaseHandle handle );
118 typedef SignalV2< bool ( Slider, float ) > ValueChangedSignalType;
119 typedef SignalV2< bool ( Slider, int ) > MarkSignalType;
122 * Signal emitted when the slider value changes
124 ValueChangedSignalType& ValueChangedSignal();
127 * Signal emitted when the sliding is finished
129 ValueChangedSignalType& SlidingFinishedSignal();
132 * Signal emitted when the slider handle reaches a mark
134 MarkSignalType& MarkSignal();
136 public: // Not intended for application developers
139 * Creates a handle using the Toolkit::Internal implementation.
140 * @param[in] implementation The Control implementation.
142 DALI_INTERNAL Slider(Internal::Slider& implementation);
145 * Allows the creation of this Control from an Internal::CustomActor pointer.
146 * @param[in] internal A pointer to the internal CustomActor.
148 explicit DALI_INTERNAL Slider( Dali::Internal::CustomActor* internal );
151 } // namespace Toolkit
155 #endif // __DALI_TOOLKIT_SLIDER_H__