1 #ifndef __DALI_TOOLKIT_SLIDER_H__
2 #define __DALI_TOOLKIT_SLIDER_H__
5 * Copyright (c) 2015 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 * @brief The start and end property ranges for this control.
53 PROPERTY_START_INDEX = Control::CONTROL_PROPERTY_END_INDEX + 1,
54 PROPERTY_END_INDEX = PROPERTY_START_INDEX + 1000 ///< Reserving 1000 property indices
58 * @brief An enumeration of properties belonging to the Slider class.
64 LOWER_BOUND = PROPERTY_START_INDEX, ///< Property, name "lower-bound", type float
65 UPPER_BOUND, ///< Property, name "upper-bound", type float
66 VALUE, ///< Property, name "value", type float
67 HIT_REGION, ///< Property, name "hit-region", type Vector2
68 BACKING_REGION, ///< Property, name "backing-region", type Vector2
69 HANDLE_REGION, ///< Property, name "handle-region", type Vector2
70 BACKING_IMAGE_NAME, ///< Property, name "backing-image-name", type std::string
71 HANDLE_IMAGE_NAME, ///< Property, name "handle-image-name", type std::string
72 PROGRESS_IMAGE_NAME, ///< Property, name "progress-image-name", type std::string
73 POPUP_IMAGE_NAME, ///< Property, name "popup-image-name", type std::string
74 POPUP_ARROW_IMAGE_NAME, ///< Property, name "popup-arrow-image-name", type std::string
75 DISABLE_COLOR, ///< Property, name "disable-color", type Vector4
76 POPUP_TEXT_COLOR, ///< Property, name "popup-text-color", type Vector4
77 VALUE_PRECISION, ///< Property, name "value-precision", type int
78 SHOW_POPUP, ///< Property, name "show-popup", type bool
79 SHOW_VALUE, ///< Property, name "show-value", type bool
80 ENABLED, ///< Property, name "enabled", type bool
81 MARKS, ///< Property, name "marks", type Property::Array<float>
82 SNAP_TO_MARKS, ///< Property, name "snap-to-marks", type bool
83 MARK_TOLERANCE, ///< Property, name "mark-tolerance", type float
90 * Create the Slider control
91 * @return A handle to the Slider control.
96 * Creates an empty Slider handle
101 * Copy constructor. Creates another handle that points to the same real object
103 Slider( const Slider& handle );
106 * Assignment operator. Changes this handle to point to another real object
108 Slider& operator=( const Slider& handle );
113 * This is non-virtual since derived Handle types must not contain data or virtual methods.
118 * Downcast an Object handle to Slider. If handle points to a Slider the
119 * downcast produces valid handle. If not the returned handle is left uninitialized.
120 * @param[in] handle Handle to an object
121 * @return handle to a Slider or an uninitialized handle
123 static Slider DownCast( BaseHandle handle );
130 typedef Signal< bool ( Slider, float ) > ValueChangedSignalType;
131 typedef Signal< bool ( Slider, int ) > MarkSignalType;
134 * Signal emitted when the slider value changes
136 ValueChangedSignalType& ValueChangedSignal();
139 * Signal emitted when the sliding is finished
141 ValueChangedSignalType& SlidingFinishedSignal();
144 * Signal emitted when the slider handle reaches a mark
146 MarkSignalType& MarkSignal();
148 public: // Not intended for application developers
151 * Creates a handle using the Toolkit::Internal implementation.
152 * @param[in] implementation The Control implementation.
154 DALI_INTERNAL Slider(Internal::Slider& implementation);
157 * Allows the creation of this Control from an Internal::CustomActor pointer.
158 * @param[in] internal A pointer to the internal CustomActor.
160 explicit DALI_INTERNAL Slider( Dali::Internal::CustomActor* internal );
163 } // namespace Toolkit
167 #endif // __DALI_TOOLKIT_SLIDER_H__