1 #ifndef DALI_TOOLKIT_PROGRESS_BAR_H
2 #define DALI_TOOLKIT_PROGRESS_BAR_H
5 * Copyright (c) 2017 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
35 * @addtogroup dali_toolkit_controls_progress_bar
40 * @brief ProgressBar is a control to give the user an indication of the progress of an operation.
43 * | %Signal Name | Method |
44 * |-------------------|-------------------------------|
45 * | valueChanged | @ref ValueChangedSignal() |
50 class DALI_IMPORT_API ProgressBar : public Control
57 * @brief The start and end property ranges for this control.
62 PROPERTY_START_INDEX = Control::CONTROL_PROPERTY_END_INDEX + 1, ///< Start Index. @SINCE_1_2.60
63 PROPERTY_END_INDEX = PROPERTY_START_INDEX + 1000 ///< Reserve property indices. @SINCE_1_2.60
67 * @brief An enumeration of properties belonging to the ProgressBar class.
75 * @brief The progress value of progress bar, progress runs form 0 to 1.
76 * @details Name "progressValue", type Property::FLOAT.
78 * @note Optional. If not supplied, the default is 0.
79 * @note Value should be between 0 to 1.
80 * @note If Value is set to 0, progress bar will be set to beginning.
81 * @note If Value is set to 1, progress bar will be set to end.
82 * @note Any Value outside of the range is ignored.
84 PROGRESS_VALUE = PROPERTY_START_INDEX,
87 * @brief The secondary progress value of progress bar, secondary progress runs form 0 to 1.
88 * @details Name "secondaryProgressValue", type Property::FLOAT.
90 * @note Optional. If not supplied, the default is 0.
91 * @note Value should be between 0 to 1.
92 * @note If Value is set to 0, progress bar will be set secondary progress to beginning.
93 * @note If Value is set to 1, progress bar will be set secondary progress to end.
94 * @note Any Value outside of the range is ignored.
96 SECONDARY_PROGRESS_VALUE,
99 * @brief Sets the progress-bar as \e indeterminate state.
100 * @details name "indeterminate", type Property::BOOLEAN.
106 * @brief The track Visual value of progress bar, it's a full progress area and it's shown behind PROGRESS_VISUAL.
107 * @details Name "trackVisual", type Property::MAP or Property::STRING (url to image).
109 * @note Optional. If not supplied, the default track visual will be shown.
114 * @brief The progress Visual value of progress bar, size of the progress visual is changed based on PROGRESS_VALUE.
115 * @details Name "progressVisual", type Property::MAP or Property::STRING (url to image).
117 * @note Optional. If not supplied, the default progress visual will be shown.
122 * @brief The secondary progress visual of progress bar, size of the secondary progress visual is changed based on SECONDARY_PROGRESS_VALUE.
123 * @details Name "secondaryProgressVisual", type Property::MAP or Property::STRING (url to image).
125 * @note Optional. If not supplied, the secondary progress visual will not be shown.
127 SECONDARY_PROGRESS_VISUAL,
130 * @brief The indeterminate visual of progress bar.
131 * @details Name "inditerminateVisual", type Property::MAP or Property::STRING (url to image).
133 * @note Optional. If not supplied, the default indeterminate visual will be shown.
135 INDETERMINATE_VISUAL,
138 * @brief The transition data for indeterminate visual animation.
139 * @details Name "indeterminateVisualAnimation", type Property::MAP or Property::ARRAY.
141 * @note Optional. If not supplied, default animation will be played.
143 INDETERMINATE_VISUAL_ANIMATION,
146 * @brief The Label visual of progress bar.
147 * @details Name "labelVisual", type Property::MAP.
157 * @brief Creates the ProgressBar control.
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.
175 ProgressBar( const ProgressBar& handle );
178 * @brief Assignment operator.
180 * Changes this handle to point to another real object.
183 ProgressBar& operator=( const ProgressBar& handle );
188 * This is non-virtual since derived Handle types must not contain data or virtual methods.
194 * @brief Downcast an Object handle to ProgressBar.
196 * If handle points to a ProgressBar the
197 * downcast produces valid handle. If not the returned handle is left uninitialized.
199 * @param[in] handle Handle to an object
200 * @return handle to a ProgressBar or an uninitialized handle
202 static ProgressBar DownCast( BaseHandle handle );
207 * @brief Value changed signal type.
210 typedef Signal< void ( ProgressBar, float, float ) > ValueChangedSignalType;
213 * @brief Signal emitted when the ProgressBar value changes.
215 * A callback of the following type may be connected:
217 * void YourCallbackName( ProgressBar progressBar, float progressValue, float secondaryProgressValue );
220 * @return The signal to connect to
222 ValueChangedSignalType& ValueChangedSignal();
224 public: // Not intended for application developers
228 * @brief Creates a handle using the Toolkit::Internal implementation.
229 * @param[in] implementation The Control implementation
231 DALI_INTERNAL ProgressBar(Internal::ProgressBar& implementation);
234 * @brief Allows the creation of this Control from an Internal::CustomActor pointer.
235 * @param[in] internal A pointer to the internal CustomActor
237 explicit DALI_INTERNAL ProgressBar( Dali::Internal::CustomActor* internal );
244 } // namespace Toolkit
248 #endif // DALI_TOOLKIT_PROGRESS_BAR_H