-#ifndef __DALI_TOOLKIT_SLIDER_H__
-#define __DALI_TOOLKIT_SLIDER_H__
-
-//
-// Copyright (c) 2014 Samsung Electronics Co., Ltd.
-//
-// Licensed under the Flora License, Version 1.0 (the License);
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://floralicense.org/license/
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an AS IS BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
+#ifndef DALI_TOOLKIT_SLIDER_H
+#define DALI_TOOLKIT_SLIDER_H
+
+/*
+ * Copyright (c) 2020 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
// INTERNAL INCLUDES
#include <dali-toolkit/public-api/controls/control.h>
-namespace Dali DALI_IMPORT_API
+namespace Dali
{
-
namespace Toolkit
{
-
namespace Internal DALI_INTERNAL
{
class Slider;
}
+/**
+ * @addtogroup dali_toolkit_controls_slider
+ * @{
+ */
/**
- * Slider is a control to enable sliding an indicator between two values
+ * @brief Slider is a control to enable sliding an indicator between two values.
+ *
+ * Signals
+ * | %Signal Name | Method |
+ * |-------------------|-------------------------------|
+ * | valueChanged | @ref ValueChangedSignal() |
+ * | markReached | @ref MarkReachedSignal() |
+ * | slidingFinished | @ref SlidingFinishedSignal() |
+ * @SINCE_1_1.39
*/
-class Slider : public Control
+class DALI_TOOLKIT_API Slider : public Control
{
public:
-
- //Signal Names
- static const char* const SIGNAL_VALUE_CHANGED;
- static const char* const SIGNAL_MARK;
-
// Properties
- static const std::string LOWER_BOUND_PROPERTY_NAME; ///< Property, name "lower-bound", type FLOAT
- static const std::string UPPER_BOUND_PROPERTY_NAME; ///< Property, name "upper-bound", type FLOAT
- static const std::string VALUE_PROPERTY_NAME; ///< Property, name "value", type FLOAT
-
- static const std::string HIT_REGION_PROPERTY_NAME; ///< Property, name "hit-region", type VECTOR2
- static const std::string BACKING_REGION_PROPERTY_NAME; ///< Property, name "backing-region", type VECTOR2
- static const std::string HANDLE_REGION_PROPERTY_NAME; ///< Property, name "handle-region", type VECTOR2
-
- static const std::string BACKING_IMAGE_NAME_PROPERTY_NAME; ///< Property, name "backing-image-name", type std::string
- static const std::string HANDLE_IMAGE_NAME_PROPERTY_NAME; ///< Property, name "handle-image-name", type std::string
- static const std::string PROGRESS_IMAGE_NAME_PROPERTY_NAME; ///< Property, name "progress-image-name", type std::string
- static const std::string POPUP_IMAGE_NAME_PROPERTY_NAME; ///< Property, name "popup-image-name", type std::string
- static const std::string POPUP_ARROW_IMAGE_NAME_PROPERTY_NAME; ///< Property, name "popup-arrow-image-name", type std::string
- static const std::string BACKING_SCALE9_BORDER_PROPERTY_NAME; ///< Property, name "backing-scale9-border", type VECTOR4
- static const std::string PROGRESS_SCALE9_BORDER_PROPERTY_NAME; ///< Property, name "progress-scale9-border", type VECTOR4
- static const std::string POPUP_SCALE9_BORDER_PROPERTY_NAME; ///< Property, name "popup-scale9-border", type VECTOR4
-
- static const std::string DISABLE_COLOR_PROPERTY_NAME; ///< Property, name "disable-color", type VECTOR4
- static const std::string POPUP_TEXT_COLOR_PROPERTY_NAME; ///< Property, name "popup-text-color", type VECTOR4
-
- static const std::string VALUE_PRECISION_PROPERTY_NAME; ///< Property, name "value-precision", type INT
-
- static const std::string SHOW_POPUP_PROPERTY_NAME; ///< Property, name "show-popup", type BOOLEAN
- static const std::string SHOW_VALUE_PROPERTY_NAME; ///< Property, name "show-value", type BOOLEAN
-
- static const std::string ENABLED_PROPERTY_NAME; ///< Property, name "enabled", type BOOLEAN
+ /**
+ * @brief Enumeration for the start and end property ranges for this control.
+ * @SINCE_1_1.39
+ */
+ enum PropertyRange
+ {
+ PROPERTY_START_INDEX = Control::CONTROL_PROPERTY_END_INDEX + 1, ///< @SINCE_1_1.39
+ PROPERTY_END_INDEX = PROPERTY_START_INDEX + 1000 ///< Reserve property indices @SINCE_1_1.39
+ };
- static const std::string MARKS_PROPERTY_NAME; ///< Property, name "marks", type Property::Array<float>
- static const std::string SNAP_TO_MARKS_PROPERTY_NAME; ///< Property, name "snap-to-marks", type BOOLEAN
- static const std::string MARK_TOLERANCE_PROPERTY_NAME; ///< Property, name "mark-tolerance", type FLOAT
+ /**
+ * @brief Enumeration for the instance of properties belonging to the Slider class.
+ * @SINCE_1_1.39
+ */
+ struct Property
+ {
+ /**
+ * @brief Enumeration for the instance of properties belonging to the Slider class.
+ * @SINCE_1_1.39
+ */
+ enum
+ {
+
+ /**
+ * @brief name "lowerBound", type float.
+ * @SINCE_1_1.39
+ */
+ LOWER_BOUND = PROPERTY_START_INDEX,
+
+ /**
+ * @brief name "upperBound", type float.
+ * @SINCE_1_1.39
+ */
+ UPPER_BOUND,
+
+ /**
+ * @brief name "value", type float.
+ * @SINCE_1_1.39
+ */
+ VALUE,
+
+ /**
+ * @brief name "trackVisual", type string if it is a url, map otherwise.
+ * @SINCE_1_1.39
+ */
+ TRACK_VISUAL,
+
+ /**
+ * @brief name "handleVisual", type string if it is a url, map otherwise.
+ * @SINCE_1_1.39
+ */
+ HANDLE_VISUAL,
+
+ /**
+ * @brief name "progressVisual", type string if it is a url, map otherwise.
+ * @SINCE_1_1.39
+ */
+ PROGRESS_VISUAL,
+
+ /**
+ * @brief name "popupVisual", type string if it is a url, map otherwise.
+ * @SINCE_1_1.39
+ */
+ POPUP_VISUAL,
+
+ /**
+ * @brief name "popupArrowVisual", type string if it is a url, map otherwise.
+ * @SINCE_1_1.39
+ */
+ POPUP_ARROW_VISUAL,
+
+ /**
+ * @brief name "disabledColor", type Vector4.
+ * @SINCE_1_1.39
+ */
+ DISABLED_COLOR,
+
+ /**
+ * @brief name "valuePrecision", type int.
+ * @SINCE_1_1.39
+ */
+ VALUE_PRECISION,
+
+ /**
+ * @brief name "showPopup", type bool.
+ * @SINCE_1_1.39
+ */
+ SHOW_POPUP,
+
+ /**
+ * @brief name "showValue", type bool.
+ * @SINCE_1_1.39
+ */
+ SHOW_VALUE,
+
+ /**
+ * @brief name "marks", type Property::Array<float>.
+ * @SINCE_1_1.39
+ */
+ MARKS,
+
+ /**
+ * @brief name "snapToMarks", type bool.
+ * @SINCE_1_1.39
+ */
+ SNAP_TO_MARKS,
+
+ /**
+ * @brief name "markTolerance", type float.
+ * @SINCE_1_1.39
+ */
+ MARK_TOLERANCE,
+ };
+ };
public:
-
/**
- * Create the Slider control
- * @return A handle to the Slider control.
+ * @brief Creates the Slider control.
+ * @SINCE_1_1.39
+ * @return A handle to the Slider control
*/
static Slider New();
/**
- * Creates an empty Slider handle
+ * @brief Creates an empty Slider handle.
+ * @SINCE_1_1.39
*/
Slider();
/**
- * Copy constructor. Creates another handle that points to the same real object
+ * @brief Copy constructor.
+ *
+ * Creates another handle that points to the same real object.
+ * @SINCE_1_1.39
+ * @param[in] handle Handle to an object
*/
- Slider( const Slider& handle );
+ Slider(const Slider& handle);
/**
- * Assignment operator. Changes this handle to point to another real object
+ * @brief Move constructor
+ * @SINCE_1_9.23
+ *
+ * @param[in] rhs A reference to the moved handle
+ */
+ Slider(Slider&& rhs);
+
+ /**
+ * @brief Assignment operator.
+ *
+ * Changes this handle to point to another real object.
+ * @SINCE_1_1.39
+ * @param[in] handle Handle to an object
+ * @return A reference to this
*/
- Slider& operator=( const Slider& handle );
+ Slider& operator=(const Slider& handle);
/**
- * Virtual destructor.
- * Dali::Object derived classes typically do not contain member data.
+ * @brief Move assignment
+ * @SINCE_1_9.23
+ *
+ * @param[in] rhs A reference to the moved handle
+ * @return A reference to this
*/
- virtual ~Slider();
+ Slider& operator=(Slider&& rhs);
/**
- * Downcast an Object handle to Slider. If handle points to a Slider the
- * downcast produces valid handle. If not the returned handle is left uninitialized.
+ * @brief Destructor.
+ *
+ * This is non-virtual since derived Handle types must not contain data or virtual methods.
+ * @SINCE_1_1.39
+ */
+ ~Slider();
+
+ /**
+ * @brief Downcasts an Object handle to Slider.
+ *
+ * If handle points to a Slider, the downcast produces valid handle.
+ * If not, the returned handle is left uninitialized.
+ * @SINCE_1_1.39
* @param[in] handle Handle to an object
* @return handle to a Slider or an uninitialized handle
*/
- static Slider DownCast( BaseHandle handle );
+ static Slider DownCast(BaseHandle handle);
-public:
-
- // Signals
+public: // Signals
+ /**
+ * @brief Value changed signal type.
+ * @SINCE_1_1.39
+ */
+ typedef Signal<bool(Slider, float)> ValueChangedSignalType;
- // Value changed
- typedef SignalV2< bool ( Slider, float ) > ValueChangedSignalType;
- typedef SignalV2< bool ( Slider, int ) > MarkSignalType;
+ /**
+ * @brief Mark reached signal type.
+ * @SINCE_1_1.39
+ */
+ typedef Signal<bool(Slider, int)> MarkReachedSignalType;
/**
- * Signal emitted when the slider value changes
+ * @brief Signal emitted when the slider value changes.
+ *
+ * A callback of the following type may be connected:
+ * @code
+ * bool YourCallbackName( Slider slider, float value );
+ * @endcode
+ * @SINCE_1_1.39
+ * @return The signal to connect to
*/
ValueChangedSignalType& ValueChangedSignal();
/**
- * Signal emitted when the sliding is finished
+ * @brief Signal emitted when the sliding is finished.
+ *
+ * A callback of the following type may be connected:
+ * @code
+ * bool YourCallbackName( Slider slider, float value );
+ * @endcode
+ * @SINCE_1_1.39
+ * @return The signal to connect to
*/
ValueChangedSignalType& SlidingFinishedSignal();
/**
- * Signal emitted when the slider handle reaches a mark
+ * @brief Signal emitted when the slider handle reaches a mark.
+ *
+ * A callback of the following type may be connected:
+ * @code
+ * bool YourCallbackName( Slider slider, int value );
+ * @endcode
+ * @SINCE_1_1.39
+ * @return The signal to connect to
*/
- MarkSignalType& MarkSignal();
+ MarkReachedSignalType& MarkReachedSignal();
public: // Not intended for application developers
-
+ /// @cond internal
/**
- * Creates a handle using the Toolkit::Internal implementation.
- * @param[in] implementation The Control implementation.
+ * @brief Creates a handle using the Toolkit::Internal implementation.
+ *
+ * @SINCE_1_1.39
+ * @param[in] implementation The Control implementation
*/
- Slider(Internal::Slider& implementation);
+ DALI_INTERNAL Slider(Internal::Slider& implementation);
/**
- * Allows the creation of this Control from an Internal::CustomActor pointer.
- * @param[in] internal A pointer to the internal CustomActor.
+ * @brief Allows the creation of this Control from an Internal::CustomActor pointer.
+ *
+ * @SINCE_1_1.39
+ * @param[in] internal A pointer to the internal CustomActor
*/
- Slider( Dali::Internal::CustomActor* internal );
+ explicit DALI_INTERNAL Slider(Dali::Internal::CustomActor* internal);
+ /// @endcond
};
+/**
+ * @}
+ */
} // namespace Toolkit
} // namespace Dali
-#endif // __DALI_TOOLKIT_SLIDER_H__
+#endif // DALI_TOOLKIT_SLIDER_H