Fix doc and comment for Native API Reference page
[platform/core/uifw/dali-toolkit.git] / dali-toolkit / public-api / controls / progress-bar / progress-bar.h
1 #ifndef DALI_TOOLKIT_PROGRESS_BAR_H
2 #define DALI_TOOLKIT_PROGRESS_BAR_H
3
4 /*
5  * Copyright (c) 2017 Samsung Electronics Co., Ltd.
6  *
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
10  *
11  * http://www.apache.org/licenses/LICENSE-2.0
12  *
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.
18  *
19  */
20
21 // INTERNAL INCLUDES
22 #include <dali-toolkit/public-api/controls/control.h>
23
24 namespace Dali
25 {
26
27 namespace Toolkit
28 {
29
30 namespace Internal DALI_INTERNAL
31 {
32 class ProgressBar;
33 }
34 /**
35  * @addtogroup dali_toolkit_controls_progress_bar
36  * @{
37  */
38
39 /**
40  * @brief ProgressBar is a control to give the user an indication of the progress of an operation.
41  *
42  * Signals
43  * | %Signal Name      | Method                        |
44  * |-------------------|-------------------------------|
45  * | valueChanged      | @ref ValueChangedSignal()     |
46  *
47  * @SINCE_1_2.60
48  */
49
50 class DALI_IMPORT_API ProgressBar : public Control
51 {
52 public:
53
54   // Properties
55
56   /**
57    * @brief The start and end property ranges for this control.
58    * @SINCE_1_2.60
59    */
60   enum PropertyRange
61   {
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
64   };
65
66   /**
67    * @brief An enumeration of properties belonging to the ProgressBar class.
68    * @SINCE_1_2.60
69    */
70   struct Property
71   {
72     enum
73     {
74       /**
75        * @brief The progress value of progress bar, progress runs form 0 to 1.
76        * @details Name "progressValue", type Property::FLOAT.
77        * @SINCE_1_2.60
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.
83        */
84       PROGRESS_VALUE = PROPERTY_START_INDEX,
85
86       /**
87        * @brief The secondary progress value of progress bar, secondary progress runs form 0 to 1.
88        * @details Name "secondaryProgressValue", type Property::FLOAT.
89        * @SINCE_1_2.60
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.
95        */
96       SECONDARY_PROGRESS_VALUE,
97
98       /**
99        * @brief Sets the progress-bar as \e indeterminate state.
100        * @details name "indeterminate", type Property::BOOLEAN.
101        * @SINCE_1_2.60
102        */
103       INDETERMINATE,
104
105       /**
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).
108        * @SINCE_1_2.60
109        * @note Optional. If not supplied, the default track visual will be shown.
110        */
111       TRACK_VISUAL,
112
113       /**
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).
116        * @SINCE_1_2.60
117        * @note Optional. If not supplied, the default progress visual will be shown.
118        */
119       PROGRESS_VISUAL,
120
121       /**
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).
124        * @SINCE_1_2.60
125        * @note Optional. If not supplied, the secondary progress visual will not be shown.
126        */
127       SECONDARY_PROGRESS_VISUAL,
128
129       /**
130        * @brief The indeterminate visual of progress bar.
131        * @details Name "inditerminateVisual", type Property::MAP or Property::STRING (url to image).
132        * @SINCE_1_2.60
133        * @note Optional. If not supplied, the default indeterminate visual will be shown.
134        */
135       INDETERMINATE_VISUAL,
136
137       /**
138        * @brief The transition data for indeterminate visual animation.
139        * @details Name "indeterminateVisualAnimation", type Property::MAP or Property::ARRAY.
140        * @SINCE_1_2.60
141        * @note Optional. If not supplied, default animation will be played.
142        */
143       INDETERMINATE_VISUAL_ANIMATION,
144
145       /**
146        * @brief The Label visual of progress bar.
147        * @details Name "labelVisual", type Property::MAP.
148        * @SINCE_1_2.60
149        */
150       LABEL_VISUAL,
151     };
152   };
153
154 public:
155
156   /**
157    * @brief Creates the ProgressBar control.
158    * @SINCE_1_2.60
159    * @return A handle to the ProgressBar control
160    */
161   static ProgressBar New();
162
163   /**
164    * @brief Creates an empty ProgressBar handle.
165    * @SINCE_1_2.60
166    */
167   ProgressBar();
168
169   /**
170    * @brief Copy constructor.
171    *
172    * Creates another handle that points to the same real object.
173    * @SINCE_1_2.60
174    */
175   ProgressBar( const ProgressBar& handle );
176
177   /**
178    * @brief Assignment operator.
179    *
180    * Changes this handle to point to another real object.
181    * @SINCE_1_2.60
182    */
183   ProgressBar& operator=( const ProgressBar& handle );
184
185   /**
186    * @brief Destructor.
187    *
188    * This is non-virtual since derived Handle types must not contain data or virtual methods.
189    * @SINCE_1_2.60
190    */
191   ~ProgressBar();
192
193   /**
194    * @brief Downcast an Object handle to ProgressBar.
195    *
196    * If handle points to a ProgressBar the
197    * downcast produces valid handle. If not the returned handle is left uninitialized.
198    * @SINCE_1_2.60
199    * @param[in] handle Handle to an object
200    * @return handle to a ProgressBar or an uninitialized handle
201    */
202   static ProgressBar DownCast( BaseHandle handle );
203
204 public:  // Signals
205
206   /**
207    * @brief Value changed signal type.
208    * @SINCE_1_2.60
209    */
210   typedef Signal< void ( ProgressBar, float, float ) > ValueChangedSignalType;
211
212   /**
213    * @brief Signal emitted when the ProgressBar value changes.
214    *
215    * A callback of the following type may be connected:
216    * @code
217    *   void YourCallbackName( ProgressBar progressBar, float progressValue, float secondaryProgressValue );
218    * @endcode
219    * @SINCE_1_2.60
220    * @return The signal to connect to
221    */
222   ValueChangedSignalType& ValueChangedSignal();
223
224 public: // Not intended for application developers
225
226   /// @cond internal
227   /**
228    * @brief Creates a handle using the Toolkit::Internal implementation.
229    * @param[in]  implementation  The Control implementation
230    */
231   DALI_INTERNAL ProgressBar(Internal::ProgressBar& implementation);
232
233   /**
234    * @brief Allows the creation of this Control from an Internal::CustomActor pointer.
235    * @param[in]  internal  A pointer to the internal CustomActor
236    */
237   explicit DALI_INTERNAL ProgressBar( Dali::Internal::CustomActor* internal );
238   /// @endcond
239 };
240
241 /**
242  * @}
243  */
244 } // namespace Toolkit
245
246 } // namespace Dali
247
248 #endif // DALI_TOOLKIT_PROGRESS_BAR_H