1 #ifndef DALI_TOOLKIT_PROGRESS_BAR_H
2 #define DALI_TOOLKIT_PROGRESS_BAR_H
5 * Copyright (c) 2020 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>
28 namespace Internal DALI_INTERNAL
33 * @addtogroup dali_toolkit_controls_progress_bar
38 * @brief ProgressBar is a control to give the user an indication of the progress of an operation.
41 * | %Signal Name | Method |
42 * |-------------------|-------------------------------|
43 * | valueChanged | @ref ValueChangedSignal() |
48 class DALI_TOOLKIT_API ProgressBar : public Control
54 * @brief The start and end property ranges for this control.
59 PROPERTY_START_INDEX = Control::CONTROL_PROPERTY_END_INDEX + 1, ///< Start Index. @SINCE_1_2.60
60 PROPERTY_END_INDEX = PROPERTY_START_INDEX + 1000 ///< Reserve property indices. @SINCE_1_2.60
64 * @brief Enumeration of properties belonging to the ProgressBar class.
70 * @brief Enumeration for the instance of properties belonging to the ProgressBar class.
76 * @brief The progress value of progress bar, progress runs form 0 to 1.
77 * @details Name "progressValue", type Property::FLOAT.
79 * @note Optional. If not supplied, the default is 0.
80 * @note Value should be between 0 to 1.
81 * @note If Value is set to 0, progress bar will be set to beginning.
82 * @note If Value is set to 1, progress bar will be set to end.
83 * @note Any Value outside of the range is ignored.
85 PROGRESS_VALUE = PROPERTY_START_INDEX,
88 * @brief The secondary progress value of progress bar, secondary progress runs form 0 to 1.
89 * @details Name "secondaryProgressValue", type Property::FLOAT.
91 * @note Optional. If not supplied, the default is 0.
92 * @note Value should be between 0 to 1.
93 * @note If Value is set to 0, progress bar will be set secondary progress to beginning.
94 * @note If Value is set to 1, progress bar will be set secondary progress to end.
95 * @note Any Value outside of the range is ignored.
97 SECONDARY_PROGRESS_VALUE,
100 * @brief Sets the progress-bar as \e indeterminate state.
101 * @details name "indeterminate", type Property::BOOLEAN.
107 * @brief The track Visual value of progress bar, it's a full progress area and it's shown behind PROGRESS_VISUAL.
108 * @details Name "trackVisual", type Property::MAP or Property::STRING (url to image).
110 * @note Optional. If not supplied, the default track visual will be shown.
115 * @brief The progress Visual value of progress bar, size of the progress visual is changed based on PROGRESS_VALUE.
116 * @details Name "progressVisual", type Property::MAP or Property::STRING (url to image).
118 * @note Optional. If not supplied, the default progress visual will be shown.
123 * @brief The secondary progress visual of progress bar, size of the secondary progress visual is changed based on SECONDARY_PROGRESS_VALUE.
124 * @details Name "secondaryProgressVisual", type Property::MAP or Property::STRING (url to image).
126 * @note Optional. If not supplied, the secondary progress visual will not be shown.
128 SECONDARY_PROGRESS_VISUAL,
131 * @brief The indeterminate visual of progress bar.
132 * @details Name "inditerminateVisual", type Property::MAP or Property::STRING (url to image).
134 * @note Optional. If not supplied, the default indeterminate visual will be shown.
136 INDETERMINATE_VISUAL,
139 * @brief The transition data for indeterminate visual animation.
140 * @details Name "indeterminateVisualAnimation", type Property::MAP or Property::ARRAY.
142 * @note Optional. If not supplied, default animation will be played.
144 INDETERMINATE_VISUAL_ANIMATION,
147 * @brief The Label visual of progress bar.
148 * @details Name "labelVisual", type Property::MAP.
157 * @brief Creates the ProgressBar control. It creates a horizontal linear shape of progress bar.
159 * @return A handle to the ProgressBar control
161 static ProgressBar New();
164 * @brief Creates an empty ProgressBar handle.
170 * @brief Copy constructor.
172 * Creates another handle that points to the same real object.
174 * @param[in] handle Handle to an object
176 ProgressBar(const ProgressBar& handle);
179 * @brief Move constructor
182 * @param[in] rhs A reference to the moved handle
184 ProgressBar(ProgressBar&& rhs);
187 * @brief Assignment operator.
189 * Changes this handle to point to another real object.
191 * @param[in] handle Handle to an object
192 * @return A reference to this
194 ProgressBar& operator=(const ProgressBar& handle);
197 * @brief Move assignment
200 * @param[in] rhs A reference to the moved handle
201 * @return A reference to this
203 ProgressBar& operator=(ProgressBar&& rhs);
208 * This is non-virtual since derived Handle types must not contain data or virtual methods.
214 * @brief Downcast an Object handle to ProgressBar.
216 * If handle points to a ProgressBar the
217 * downcast produces valid handle. If not the returned handle is left uninitialized.
219 * @param[in] handle Handle to an object
220 * @return handle to a ProgressBar or an uninitialized handle
222 static ProgressBar DownCast(BaseHandle handle);
226 * @brief Value changed signal type.
229 typedef Signal<void(ProgressBar, float, float)> ValueChangedSignalType;
232 * @brief Signal emitted when the ProgressBar value changes.
234 * A callback of the following type may be connected:
236 * void YourCallbackName( ProgressBar progressBar, float progressValue, float secondaryProgressValue );
239 * @return The signal to connect to
241 ValueChangedSignalType& ValueChangedSignal();
243 public: // Not intended for application developers
246 * @brief Creates a handle using the Toolkit::Internal implementation.
247 * @param[in] implementation The Control implementation
249 DALI_INTERNAL ProgressBar(Internal::ProgressBar& implementation);
252 * @brief Allows the creation of this Control from an Internal::CustomActor pointer.
253 * @param[in] internal A pointer to the internal CustomActor
255 explicit DALI_INTERNAL ProgressBar(Dali::Internal::CustomActor* internal);
262 } // namespace Toolkit
266 #endif // DALI_TOOLKIT_PROGRESS_BAR_H