1 // Generated by gmmproc 2.60.0 -- DO NOT MODIFY! 2 #ifndef _GTKMM_PROGRESSBAR_H 3 #define _GTKMM_PROGRESSBAR_H 4 5 6 #include <glibmm/ustring.h> 7 #include <sigc++/sigc++.h> 8 9 /* 10 * Copyright (C) 1998-2002 The gtkmm Development Team 11 * 12 * This library is free software; you can redistribute it and/or 13 * modify it under the terms of the GNU Lesser General Public 14 * License as published by the Free Software Foundation; either 15 * version 2.1 of the License, or (at your option) any later version. 16 * 17 * This library is distributed in the hope that it will be useful, 18 * but WITHOUT ANY WARRANTY; without even the implied warranty of 19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 20 * Lesser General Public License for more details. 21 * 22 * You should have received a copy of the GNU Lesser General Public 23 * License along with this library; if not, write to the Free Software 24 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 25 */ 26 27 #include <gtkmm/widget.h> 28 #include <gtkmm/orientable.h> 29 30 31 #ifndef DOXYGEN_SHOULD_SKIP_THIS 32 using GtkProgressBar = struct _GtkProgressBar; 33 using GtkProgressBarClass = struct _GtkProgressBarClass; 34 #endif /* DOXYGEN_SHOULD_SKIP_THIS */ 35 36 37 #ifndef DOXYGEN_SHOULD_SKIP_THIS 38 namespace Gtk 39 { class ProgressBar_Class; } // namespace Gtk 40 #endif //DOXYGEN_SHOULD_SKIP_THIS 41 42 namespace Gtk 43 { 44 45 46 /** A widget which indicates progress visually. 47 * 48 * The Gtk::ProgressBar is typically used to display the progress of a long 49 * running operation. It provides a visual clue that processing is underway. 50 * The Gtk::ProgressBar can be used in two different modes: percentage mode 51 * and activity mode. 52 * 53 * When an application can determine how much work needs to take place (e.g. 54 * read a fixed number of bytes from a file) and can monitor its progress, 55 * it can use the Gtk::ProgressBar in percentage mode and the user sees a 56 * growing bar indicating the percentage of the work that has been 57 * completed. In this mode, the application is required to call 58 * set_fraction() periodically to update the progress bar. 59 * 60 * When an application has no accurate way of knowing the amount of work to 61 * do, it can use the Gtk::ProgressBar in activity mode, which shows 62 * activity by a block moving back and forth within the progress area. In 63 * this mode, the application is required to call pulse() perodically to 64 * update the progress bar. 65 * 66 * There is quite a bit of flexibility provided to control the appearance of 67 * the Gtk::ProgressBar. Functions are provided to control the orientation of 68 * the bar, optional text can be displayed along with the bar, and the step 69 * size used in activity mode can be set. 70 * 71 * The ProgressBar widget looks like this: 72 * @image html progressbar1.png 73 * 74 * @ingroup Widgets 75 */ 76 77 class ProgressBar 78 : public Widget, 79 public Orientable 80 { 81 public: 82 #ifndef DOXYGEN_SHOULD_SKIP_THIS 83 typedef ProgressBar CppObjectType; 84 typedef ProgressBar_Class CppClassType; 85 typedef GtkProgressBar BaseObjectType; 86 typedef GtkProgressBarClass BaseClassType; 87 #endif /* DOXYGEN_SHOULD_SKIP_THIS */ 88 89 ProgressBar(ProgressBar&& src) noexcept; 90 ProgressBar& operator=(ProgressBar&& src) noexcept; 91 92 // noncopyable 93 ProgressBar(const ProgressBar&) = delete; 94 ProgressBar& operator=(const ProgressBar&) = delete; 95 96 ~ProgressBar() noexcept override; 97 98 #ifndef DOXYGEN_SHOULD_SKIP_THIS 99 100 private: 101 friend class ProgressBar_Class; 102 static CppClassType progressbar_class_; 103 104 protected: 105 explicit ProgressBar(const Glib::ConstructParams& construct_params); 106 explicit ProgressBar(GtkProgressBar* castitem); 107 108 #endif /* DOXYGEN_SHOULD_SKIP_THIS */ 109 110 public: 111 112 /** Get the GType for this class, for use with the underlying GObject type system. 113 */ 114 static GType get_type() G_GNUC_CONST; 115 116 #ifndef DOXYGEN_SHOULD_SKIP_THIS 117 118 119 static GType get_base_type() G_GNUC_CONST; 120 #endif 121 122 /// Provides access to the underlying C GObject. gobj()123 GtkProgressBar* gobj() { return reinterpret_cast<GtkProgressBar*>(gobject_); } 124 125 /// Provides access to the underlying C GObject. gobj()126 const GtkProgressBar* gobj() const { return reinterpret_cast<GtkProgressBar*>(gobject_); } 127 128 129 public: 130 //C++ methods used to invoke GTK+ virtual functions: 131 132 protected: 133 //GTK+ Virtual Functions (override these to change behaviour): 134 135 //Default Signal Handlers:: 136 137 138 private: 139 140 141 public: 142 ProgressBar(); 143 144 145 /** Indicates that some progress has been made, but you don’t know how much. 146 * Causes the progress bar to enter “activity mode,” where a block 147 * bounces back and forth. Each call to pulse() 148 * causes the block to move by a little bit (the amount of movement 149 * per pulse is determined by set_pulse_step()). 150 */ 151 void pulse(); 152 153 154 /** Retrieves the text displayed superimposed on the progress bar, 155 * if any. 156 * 157 * @return Text. 158 */ 159 Glib::ustring get_text() const; 160 161 /** Causes the given @a text to appear next to the progress bar. 162 * 163 * If @a text is <tt>nullptr</tt> and Gtk::ProgressBar::property_show_text() is <tt>true</tt>, the current 164 * value of Gtk::ProgressBar::property_fraction() will be displayed as a percentage. 165 * 166 * If @a text is non-<tt>nullptr</tt> and Gtk::ProgressBar::property_show_text() is <tt>true</tt>, the text 167 * will be displayed. In this case, it will not display the progress 168 * percentage. If @a text is the empty string, the progress bar will still 169 * be styled and sized suitably for containing text, as long as 170 * Gtk::ProgressBar::property_show_text() is <tt>true</tt>. 171 * 172 * @param text A UTF-8 string, or <tt>nullptr</tt>. 173 */ 174 void set_text(const Glib::ustring& text); 175 176 177 /** Returns the current fraction of the task that’s been completed. 178 * 179 * @return A fraction from 0.0 to 1.0. 180 */ 181 double get_fraction() const; 182 183 /** Causes the progress bar to “fill in” the given fraction 184 * of the bar. The fraction should be between 0.0 and 1.0, 185 * inclusive. 186 * 187 * @param fraction Fraction of the task that’s been completed. 188 */ 189 void set_fraction(double fraction); 190 191 192 /** Retrieves the pulse step set with set_pulse_step(). 193 * 194 * @return A fraction from 0.0 to 1.0. 195 */ 196 double get_pulse_step() const; 197 198 /** Sets the fraction of total progress bar length to move the 199 * bouncing block for each call to pulse(). 200 * 201 * @param fraction Fraction between 0.0 and 1.0. 202 */ 203 void set_pulse_step(double fraction); 204 205 206 /** Progress bars normally grow from top to bottom or left to right. 207 * Inverted progress bars grow in the opposite direction. 208 * 209 * @param inverted <tt>true</tt> to invert the progress bar. 210 */ 211 void set_inverted(bool inverted = true); 212 213 /** Gets the value set by set_inverted(). 214 * 215 * @return <tt>true</tt> if the progress bar is inverted. 216 */ 217 bool get_inverted() const; 218 219 220 /** Sets the mode used to ellipsize (add an ellipsis: "...") the 221 * text if there is not enough space to render the entire string. 222 * 223 * @newin{2,6} 224 * 225 * @param mode A Pango::EllipsizeMode. 226 */ 227 void set_ellipsize(Pango::EllipsizeMode mode); 228 229 /** Returns the ellipsizing position of the progress bar. 230 * See set_ellipsize(). 231 * 232 * @newin{2,6} 233 * 234 * @return Pango::EllipsizeMode. 235 */ 236 Pango::EllipsizeMode get_ellipsize() const; 237 238 239 /** Sets whether the progress bar will show text next to the bar. 240 * The shown text is either the value of the Gtk::ProgressBar::property_text() 241 * property or, if that is <tt>nullptr</tt>, the Gtk::ProgressBar::property_fraction() value, 242 * as a percentage. 243 * 244 * To make a progress bar that is styled and sized suitably for containing 245 * text (even if the actual text is blank), set Gtk::ProgressBar::property_show_text() to 246 * <tt>true</tt> and Gtk::ProgressBar::property_text() to the empty string (not <tt>nullptr</tt>). 247 * 248 * @newin{3,0} 249 * 250 * @param show_text Whether to show text. 251 */ 252 void set_show_text(bool show_text = true); 253 254 /** Gets the value of the Gtk::ProgressBar::property_show_text() property. 255 * See set_show_text(). 256 * 257 * @newin{3,0} 258 * 259 * @return <tt>true</tt> if text is shown in the progress bar. 260 */ 261 bool get_show_text() const; 262 263 /** The fraction of total work that has been completed. 264 * 265 * Default value: 0 266 * 267 * @return A PropertyProxy that allows you to get or set the value of the property, 268 * or receive notification when the value of the property changes. 269 */ 270 Glib::PropertyProxy< double > property_fraction() ; 271 272 /** The fraction of total work that has been completed. 273 * 274 * Default value: 0 275 * 276 * @return A PropertyProxy_ReadOnly that allows you to get the value of the property, 277 * or receive notification when the value of the property changes. 278 */ 279 Glib::PropertyProxy_ReadOnly< double > property_fraction() const; 280 281 /** The fraction of total progress to move the bouncing block when pulsed. 282 * 283 * Default value: 0.1 284 * 285 * @return A PropertyProxy that allows you to get or set the value of the property, 286 * or receive notification when the value of the property changes. 287 */ 288 Glib::PropertyProxy< double > property_pulse_step() ; 289 290 /** The fraction of total progress to move the bouncing block when pulsed. 291 * 292 * Default value: 0.1 293 * 294 * @return A PropertyProxy_ReadOnly that allows you to get the value of the property, 295 * or receive notification when the value of the property changes. 296 */ 297 Glib::PropertyProxy_ReadOnly< double > property_pulse_step() const; 298 299 /** Text to be displayed in the progress bar. 300 * 301 * Default value: "" 302 * 303 * @return A PropertyProxy that allows you to get or set the value of the property, 304 * or receive notification when the value of the property changes. 305 */ 306 Glib::PropertyProxy< Glib::ustring > property_text() ; 307 308 /** Text to be displayed in the progress bar. 309 * 310 * Default value: "" 311 * 312 * @return A PropertyProxy_ReadOnly that allows you to get the value of the property, 313 * or receive notification when the value of the property changes. 314 */ 315 Glib::PropertyProxy_ReadOnly< Glib::ustring > property_text() const; 316 317 /** The preferred place to ellipsize the string, if the progress bar does 318 * not have enough room to display the entire string, specified as a 319 * Pango::EllipsizeMode. 320 * 321 * Note that setting this property to a value other than 322 * Pango::ELLIPSIZE_NONE has the side-effect that the progress bar requests 323 * only enough space to display the ellipsis ("..."). Another means to set a 324 * progress bar's width is Gtk::Widget::set_size_request(). 325 * 326 * @newin{2,6} 327 * 328 * Default value: Pango::ELLIPSIZE_NONE 329 * 330 * @return A PropertyProxy that allows you to get or set the value of the property, 331 * or receive notification when the value of the property changes. 332 */ 333 Glib::PropertyProxy< bool > property_ellipsize() ; 334 335 /** The preferred place to ellipsize the string, if the progress bar does 336 * not have enough room to display the entire string, specified as a 337 * Pango::EllipsizeMode. 338 * 339 * Note that setting this property to a value other than 340 * Pango::ELLIPSIZE_NONE has the side-effect that the progress bar requests 341 * only enough space to display the ellipsis ("..."). Another means to set a 342 * progress bar's width is Gtk::Widget::set_size_request(). 343 * 344 * @newin{2,6} 345 * 346 * Default value: Pango::ELLIPSIZE_NONE 347 * 348 * @return A PropertyProxy_ReadOnly that allows you to get the value of the property, 349 * or receive notification when the value of the property changes. 350 */ 351 Glib::PropertyProxy_ReadOnly< bool > property_ellipsize() const; 352 353 /** Sets whether the progress bar will show a text in addition 354 * to the bar itself. The shown text is either the value of 355 * the Gtk::ProgressBar::property_text() property or, if that is <tt>nullptr</tt>, 356 * the Gtk::ProgressBar::property_fraction() value, as a percentage. 357 * 358 * To make a progress bar that is styled and sized suitably for 359 * showing text (even if the actual text is blank), set 360 * Gtk::ProgressBar::property_show_text() to <tt>true</tt> and Gtk::ProgressBar::property_text() 361 * to the empty string (not <tt>nullptr</tt>). 362 * 363 * @newin{3,0} 364 * 365 * Default value: <tt>false</tt> 366 * 367 * @return A PropertyProxy that allows you to get or set the value of the property, 368 * or receive notification when the value of the property changes. 369 */ 370 Glib::PropertyProxy< bool > property_show_text() ; 371 372 /** Sets whether the progress bar will show a text in addition 373 * to the bar itself. The shown text is either the value of 374 * the Gtk::ProgressBar::property_text() property or, if that is <tt>nullptr</tt>, 375 * the Gtk::ProgressBar::property_fraction() value, as a percentage. 376 * 377 * To make a progress bar that is styled and sized suitably for 378 * showing text (even if the actual text is blank), set 379 * Gtk::ProgressBar::property_show_text() to <tt>true</tt> and Gtk::ProgressBar::property_text() 380 * to the empty string (not <tt>nullptr</tt>). 381 * 382 * @newin{3,0} 383 * 384 * Default value: <tt>false</tt> 385 * 386 * @return A PropertyProxy_ReadOnly that allows you to get the value of the property, 387 * or receive notification when the value of the property changes. 388 */ 389 Glib::PropertyProxy_ReadOnly< bool > property_show_text() const; 390 391 /** Invert the direction in which the progress bar grows. 392 * 393 * Default value: <tt>false</tt> 394 * 395 * @return A PropertyProxy that allows you to get or set the value of the property, 396 * or receive notification when the value of the property changes. 397 */ 398 Glib::PropertyProxy< bool > property_inverted() ; 399 400 /** Invert the direction in which the progress bar grows. 401 * 402 * Default value: <tt>false</tt> 403 * 404 * @return A PropertyProxy_ReadOnly that allows you to get the value of the property, 405 * or receive notification when the value of the property changes. 406 */ 407 Glib::PropertyProxy_ReadOnly< bool > property_inverted() const; 408 409 410 }; 411 412 } // namespace Gtk 413 414 415 namespace Glib 416 { 417 /** A Glib::wrap() method for this object. 418 * 419 * @param object The C instance. 420 * @param take_copy False if the result should take ownership of the C instance. True if it should take a new copy or ref. 421 * @result A C++ instance that wraps this C instance. 422 * 423 * @relates Gtk::ProgressBar 424 */ 425 Gtk::ProgressBar* wrap(GtkProgressBar* object, bool take_copy = false); 426 } //namespace Glib 427 428 429 #endif /* _GTKMM_PROGRESSBAR_H */ 430 431