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 std::string LOWER_BOUND_PROPERTY_NAME; ///< Property, name "lower-bound", type FLOAT
47 static const std::string UPPER_BOUND_PROPERTY_NAME; ///< Property, name "upper-bound", type FLOAT
48 static const std::string VALUE_PROPERTY_NAME; ///< Property, name "value", type FLOAT
50 static const std::string HIT_REGION_PROPERTY_NAME; ///< Property, name "hit-region", type VECTOR2
51 static const std::string BACKING_REGION_PROPERTY_NAME; ///< Property, name "backing-region", type VECTOR2
52 static const std::string HANDLE_REGION_PROPERTY_NAME; ///< Property, name "handle-region", type VECTOR2
54 static const std::string BACKING_IMAGE_NAME_PROPERTY_NAME; ///< Property, name "backing-image-name", type std::string
55 static const std::string HANDLE_IMAGE_NAME_PROPERTY_NAME; ///< Property, name "handle-image-name", type std::string
56 static const std::string PROGRESS_IMAGE_NAME_PROPERTY_NAME; ///< Property, name "progress-image-name", type std::string
57 static const std::string POPUP_IMAGE_NAME_PROPERTY_NAME; ///< Property, name "popup-image-name", type std::string
58 static const std::string POPUP_ARROW_IMAGE_NAME_PROPERTY_NAME; ///< Property, name "popup-arrow-image-name", type std::string
60 static const std::string BACKING_SCALE9_BORDER_PROPERTY_NAME; ///< Property, name "backing-scale9-border", type VECTOR4
61 static const std::string PROGRESS_SCALE9_BORDER_PROPERTY_NAME; ///< Property, name "progress-scale9-border", type VECTOR4
62 static const std::string POPUP_SCALE9_BORDER_PROPERTY_NAME; ///< Property, name "popup-scale9-border", type VECTOR4
64 static const std::string DISABLE_COLOR_PROPERTY_NAME; ///< Property, name "disable-color", type VECTOR4
65 static const std::string POPUP_TEXT_COLOR_PROPERTY_NAME; ///< Property, name "popup-text-color", type VECTOR4
67 static const std::string VALUE_PRECISION_PROPERTY_NAME; ///< Property, name "value-precision", type INT
69 static const std::string SHOW_POPUP_PROPERTY_NAME; ///< Property, name "show-popup", type BOOLEAN
70 static const std::string SHOW_VALUE_PROPERTY_NAME; ///< Property, name "show-value", type BOOLEAN
72 static const std::string ENABLED_PROPERTY_NAME; ///< Property, name "enabled", type BOOLEAN
74 static const std::string MARKS_PROPERTY_NAME; ///< Property, name "marks", type Property::Array<float>
75 static const std::string SNAP_TO_MARKS_PROPERTY_NAME; ///< Property, name "snap-to-marks", type BOOLEAN
76 static const std::string MARK_TOLERANCE_PROPERTY_NAME; ///< Property, name "mark-tolerance", type FLOAT
81 * Create the Slider control
82 * @return A handle to the Slider control.
87 * Creates an empty Slider handle
92 * Copy constructor. Creates another handle that points to the same real object
94 Slider( const Slider& handle );
97 * Assignment operator. Changes this handle to point to another real object
99 Slider& operator=( const Slider& handle );
102 * Virtual destructor.
103 * Dali::Object derived classes typically do not contain member data.
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 SignalV2< bool ( Slider, float ) > ValueChangedSignalType;
121 typedef SignalV2< bool ( Slider, int ) > MarkSignalType;
124 * Signal emitted when the slider value changes
126 ValueChangedSignalType& ValueChangedSignal();
129 * Signal emitted when the slider handle reaches a mark
131 MarkSignalType& MarkSignal();
133 public: // Not intended for application developers
136 * Creates a handle using the Toolkit::Internal implementation.
137 * @param[in] implementation The Control implementation.
139 Slider(Internal::Slider& implementation);
142 * Allows the creation of this Control from an Internal::CustomActor pointer.
143 * @param[in] internal A pointer to the internal CustomActor.
145 Slider( Dali::Internal::CustomActor* internal );
148 } // namespace Toolkit
152 #endif // __DALI_TOOLKIT_SLIDER_H__