2 // Generated by gtkmmproc -- DO NOT MODIFY!
3 #ifndef _GTKMM_PROGRESSBAR_H
4 #define _GTKMM_PROGRESSBAR_H
13 * Copyright (C) 1998-2002 The gtkmm Development Team
15 * This library is free software; you can redistribute it and/or
16 * modify it under the terms of the GNU Library General Public
17 * License as published by the Free Software Foundation; either
18 * version 2 of the License, or (at your option) any later version.
20 * This library is distributed in the hope that it will be useful,
21 * but WITHOUT ANY WARRANTY; without even the implied warranty of
22 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
23 * Library General Public License for more details.
25 * You should have received a copy of the GNU Library General Public
26 * License along with this library; if not, write to the Free
27 * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
30 #include <gtkmm/widget.h>
33 #ifndef DOXYGEN_SHOULD_SKIP_THIS
34 typedef struct _GtkProgressBar GtkProgressBar;
35 typedef struct _GtkProgressBarClass GtkProgressBarClass;
36 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
40 { class ProgressBar_Class; } // namespace Gtk
45 /** @addtogroup gtkmmEnums Enums and Flags */
59 #ifndef DOXYGEN_SHOULD_SKIP_THIS
64 class Value<Gtk::ProgressBarStyle> : public Glib::Value_Enum<Gtk::ProgressBarStyle>
67 static GType value_type() G_GNUC_CONST;
71 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
80 enum ProgressBarOrientation
82 PROGRESS_LEFT_TO_RIGHT,
83 PROGRESS_RIGHT_TO_LEFT,
84 PROGRESS_BOTTOM_TO_TOP,
85 PROGRESS_TOP_TO_BOTTOM
91 #ifndef DOXYGEN_SHOULD_SKIP_THIS
96 class Value<Gtk::ProgressBarOrientation> : public Glib::Value_Enum<Gtk::ProgressBarOrientation>
99 static GType value_type() G_GNUC_CONST;
103 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
110 /** A widget which indicates progress visually.
112 * The Gtk::ProgressBar is typically used to display the progress of a long
113 * running operation. It provides a visual clue that processing is underway.
114 * The Gtk::ProgressBar can be used in two different modes: percentage mode
117 * When an application can determine how much work needs to take place (e.g.
118 * read a fixed number of bytes from a file) and can monitor its progress,
119 * it can use the Gtk::ProgressBar in percentage mode and the user sees a
120 * growing bar indicating the percentage of the work that has been
121 * completed. In this mode, the application is required to call
122 * set_fraction() periodically to update the progress bar.
124 * When an application has no accurate way of knowing the amount of work to
125 * do, it can use the Gtk::ProgressBar in activity mode, which shows
126 * activity by a block moving back and forth within the progress area. In
127 * this mode, the application is required to call pulse() perodically to
128 * update the progress bar.
130 * There is quite a bit of flexibility provided to control the appearance of
131 * the Gtk::ProgressBar. Functions are provided to control the orientation of
132 * the bar, optional text can be displayed along with the bar, and the step
133 * size used in activity mode can be set.
138 class ProgressBar : public Widget
141 #ifndef DOXYGEN_SHOULD_SKIP_THIS
142 typedef ProgressBar CppObjectType;
143 typedef ProgressBar_Class CppClassType;
144 typedef GtkProgressBar BaseObjectType;
145 typedef GtkProgressBarClass BaseClassType;
146 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
148 virtual ~ProgressBar();
150 #ifndef DOXYGEN_SHOULD_SKIP_THIS
153 friend class ProgressBar_Class;
154 static CppClassType progressbar_class_;
157 ProgressBar(const ProgressBar&);
158 ProgressBar& operator=(const ProgressBar&);
161 explicit ProgressBar(const Glib::ConstructParams& construct_params);
162 explicit ProgressBar(GtkProgressBar* castitem);
164 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
167 #ifndef DOXYGEN_SHOULD_SKIP_THIS
168 static GType get_type() G_GNUC_CONST;
169 static GType get_base_type() G_GNUC_CONST;
172 ///Provides access to the underlying C GtkObject.
173 GtkProgressBar* gobj() { return reinterpret_cast<GtkProgressBar*>(gobject_); }
175 ///Provides access to the underlying C GtkObject.
176 const GtkProgressBar* gobj() const { return reinterpret_cast<GtkProgressBar*>(gobject_); }
180 //C++ methods used to invoke GTK+ virtual functions:
181 #ifdef GLIBMM_VFUNCS_ENABLED
182 #endif //GLIBMM_VFUNCS_ENABLED
185 //GTK+ Virtual Functions (override these to change behaviour):
186 #ifdef GLIBMM_VFUNCS_ENABLED
187 #endif //GLIBMM_VFUNCS_ENABLED
189 //Default Signal Handlers::
190 #ifdef GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
191 #endif //GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
201 /** Indicates that some progress is made, but you don't know how much.
202 * Causes the progress bar to enter "activity mode," where a block
203 * bounces back and forth. Each call to pulse()
204 * causes the block to move by a little bit (the amount of movement
205 * per pulse is determined by set_pulse_step()).
210 /** Retrieves the text displayed superimposed on the progress bar,
214 Glib::ustring get_text() const;
216 /** Causes the given @a text to appear superimposed on the progress bar.
217 * @param text A UTF-8 string, or <tt>0</tt>.
219 void set_text(const Glib::ustring& text);
222 /** Return value: a fraction from 0.0 to 1.0
223 * @return A fraction from 0.0 to 1.0.
225 double get_fraction() const;
227 /** Causes the progress bar to "fill in" the given fraction
228 * of the bar. The fraction should be between 0.0 and 1.0,
230 * @param fraction Fraction of the task that's been completed.
232 void set_fraction(double fraction);
235 /** Retrieves the pulse step set with set_pulse_step()
236 * @return A fraction from 0.0 to 1.0.
238 double get_pulse_step() const;
240 /** Sets the fraction of total progress bar length to move the
241 * bouncing block for each call to pulse().
242 * @param fraction Fraction between 0.0 and 1.0.
244 void set_pulse_step(double fraction);
247 /** Causes the progress bar to switch to a different orientation
248 * (left-to-right, right-to-left, top-to-bottom, or bottom-to-top).
249 * @param orientation Orientation of the progress bar.
251 void set_orientation(ProgressBarOrientation orientation = PROGRESS_LEFT_TO_RIGHT);
253 /** Retrieves the current progress bar orientation.
254 * @return Orientation of the progress bar.
256 ProgressBarOrientation get_orientation() const;
259 /** Sets the mode used to ellipsize (add an ellipsis: "...") the text
260 * if there is not enough space to render the entire string.
263 * @param mode A Pango::EllipsizeMode.
265 void set_ellipsize(Pango::EllipsizeMode mode);
267 /** Return value: Pango::EllipsizeMode
268 * @return Pango::EllipsizeMode
272 Pango::EllipsizeMode get_ellipsize() const;
274 #ifdef GLIBMM_PROPERTIES_ENABLED
275 /** The fraction of total work that has been completed.
277 * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
278 * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
279 * the value of the property changes.
281 Glib::PropertyProxy<double> property_fraction() ;
282 #endif //#GLIBMM_PROPERTIES_ENABLED
284 #ifdef GLIBMM_PROPERTIES_ENABLED
285 /** The fraction of total work that has been completed.
287 * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
288 * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
289 * the value of the property changes.
291 Glib::PropertyProxy_ReadOnly<double> property_fraction() const;
292 #endif //#GLIBMM_PROPERTIES_ENABLED
294 #ifdef GLIBMM_PROPERTIES_ENABLED
295 /** The fraction of total progress to move the bouncing block when pulsed.
297 * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
298 * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
299 * the value of the property changes.
301 Glib::PropertyProxy<double> property_pulse_step() ;
302 #endif //#GLIBMM_PROPERTIES_ENABLED
304 #ifdef GLIBMM_PROPERTIES_ENABLED
305 /** The fraction of total progress to move the bouncing block when pulsed.
307 * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
308 * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
309 * the value of the property changes.
311 Glib::PropertyProxy_ReadOnly<double> property_pulse_step() const;
312 #endif //#GLIBMM_PROPERTIES_ENABLED
314 #ifdef GLIBMM_PROPERTIES_ENABLED
315 /** Orientation and growth direction of the progress bar.
317 * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
318 * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
319 * the value of the property changes.
321 Glib::PropertyProxy<ProgressBarOrientation> property_orientation() ;
322 #endif //#GLIBMM_PROPERTIES_ENABLED
324 #ifdef GLIBMM_PROPERTIES_ENABLED
325 /** Orientation and growth direction of the progress bar.
327 * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
328 * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
329 * the value of the property changes.
331 Glib::PropertyProxy_ReadOnly<ProgressBarOrientation> property_orientation() const;
332 #endif //#GLIBMM_PROPERTIES_ENABLED
334 #ifdef GLIBMM_PROPERTIES_ENABLED
335 /** Text to be displayed in the progress bar.
337 * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
338 * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
339 * the value of the property changes.
341 Glib::PropertyProxy<Glib::ustring> property_text() ;
342 #endif //#GLIBMM_PROPERTIES_ENABLED
344 #ifdef GLIBMM_PROPERTIES_ENABLED
345 /** Text to be displayed in the progress bar.
347 * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
348 * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
349 * the value of the property changes.
351 Glib::PropertyProxy_ReadOnly<Glib::ustring> property_text() const;
352 #endif //#GLIBMM_PROPERTIES_ENABLED
354 #ifdef GLIBMM_PROPERTIES_ENABLED
355 /** The preferred place to ellipsize the string
357 * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
358 * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
359 * the value of the property changes.
361 Glib::PropertyProxy<bool> property_ellipsize() ;
362 #endif //#GLIBMM_PROPERTIES_ENABLED
364 #ifdef GLIBMM_PROPERTIES_ENABLED
365 /** The preferred place to ellipsize the string
367 * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
368 * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
369 * the value of the property changes.
371 Glib::PropertyProxy_ReadOnly<bool> property_ellipsize() const;
372 #endif //#GLIBMM_PROPERTIES_ENABLED
382 /** A Glib::wrap() method for this object.
384 * @param object The C instance.
385 * @param take_copy False if the result should take ownership of the C instance. True if it should take a new copy or ref.
386 * @result A C++ instance that wraps this C instance.
388 * @relates Gtk::ProgressBar
390 Gtk::ProgressBar* wrap(GtkProgressBar* object, bool take_copy = false);
394 #endif /* _GTKMM_PROGRESSBAR_H */