2 // Generated by gtkmmproc -- DO NOT MODIFY!
3 #ifndef _GTKMM_PROGRESSBAR_H
4 #define _GTKMM_PROGRESSBAR_H
12 * Copyright (C) 1998-2002 The gtkmm Development Team
14 * This library is free software; you can redistribute it and/or
15 * modify it under the terms of the GNU Library General Public
16 * License as published by the Free Software Foundation; either
17 * version 2 of the License, or (at your option) any later version.
19 * This library is distributed in the hope that it will be useful,
20 * but WITHOUT ANY WARRANTY; without even the implied warranty of
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
22 * Library General Public License for more details.
24 * You should have received a copy of the GNU Library General Public
25 * License along with this library; if not, write to the Free
26 * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
29 #include <gtkmm/widget.h>
32 #ifndef DOXYGEN_SHOULD_SKIP_THIS
33 typedef struct _GtkProgressBar GtkProgressBar;
34 typedef struct _GtkProgressBarClass GtkProgressBarClass;
35 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
39 { class ProgressBar_Class; } // namespace Gtk
44 /** @addtogroup gtkmmEnums Enums and Flags */
58 #ifndef DOXYGEN_SHOULD_SKIP_THIS
63 class Value<Gtk::ProgressBarStyle> : public Glib::Value_Enum<Gtk::ProgressBarStyle>
66 static GType value_type() G_GNUC_CONST;
70 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
79 enum ProgressBarOrientation
81 PROGRESS_LEFT_TO_RIGHT,
82 PROGRESS_RIGHT_TO_LEFT,
83 PROGRESS_BOTTOM_TO_TOP,
84 PROGRESS_TOP_TO_BOTTOM
90 #ifndef DOXYGEN_SHOULD_SKIP_THIS
95 class Value<Gtk::ProgressBarOrientation> : public Glib::Value_Enum<Gtk::ProgressBarOrientation>
98 static GType value_type() G_GNUC_CONST;
102 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
109 /** A widget which indicates progress visually.
111 * The Gtk::ProgressBar is typically used to display the progress of a long
112 * running operation. It provides a visual clue that processing is underway.
113 * The Gtk::ProgressBar can be used in two different modes: percentage mode
116 * When an application can determine how much work needs to take place (e.g.
117 * read a fixed number of bytes from a file) and can monitor its progress,
118 * it can use the Gtk::ProgressBar in percentage mode and the user sees a
119 * growing bar indicating the percentage of the work that has been
120 * completed. In this mode, the application is required to call
121 * set_fraction() periodically to update the progress bar.
123 * When an application has no accurate way of knowing the amount of work to
124 * do, it can use the Gtk::ProgressBar in activity mode, which shows
125 * activity by a block moving back and forth within the progress area. In
126 * this mode, the application is required to call pulse() perodically to
127 * update the progress bar.
129 * There is quite a bit of flexibility provided to control the appearance of
130 * the Gtk::ProgressBar. Functions are provided to control the orientation of
131 * the bar, optional text can be displayed along with the bar, and the step
132 * size used in activity mode can be set.
137 class ProgressBar : public Widget
140 #ifndef DOXYGEN_SHOULD_SKIP_THIS
141 typedef ProgressBar CppObjectType;
142 typedef ProgressBar_Class CppClassType;
143 typedef GtkProgressBar BaseObjectType;
144 typedef GtkProgressBarClass BaseClassType;
145 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
147 virtual ~ProgressBar();
149 #ifndef DOXYGEN_SHOULD_SKIP_THIS
152 friend class ProgressBar_Class;
153 static CppClassType progressbar_class_;
156 ProgressBar(const ProgressBar&);
157 ProgressBar& operator=(const ProgressBar&);
160 explicit ProgressBar(const Glib::ConstructParams& construct_params);
161 explicit ProgressBar(GtkProgressBar* castitem);
163 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
166 #ifndef DOXYGEN_SHOULD_SKIP_THIS
167 static GType get_type() G_GNUC_CONST;
168 static GType get_base_type() G_GNUC_CONST;
171 ///Provides access to the underlying C GtkObject.
172 GtkProgressBar* gobj() { return reinterpret_cast<GtkProgressBar*>(gobject_); }
174 ///Provides access to the underlying C GtkObject.
175 const GtkProgressBar* gobj() const { return reinterpret_cast<GtkProgressBar*>(gobject_); }
179 //C++ methods used to invoke GTK+ virtual functions:
182 //GTK+ Virtual Functions (override these to change behaviour):
184 //Default Signal Handlers::
194 /** Indicates that some progress is made, but you don't know how much.
195 * Causes the progress bar to enter "activity mode," where a block
196 * bounces back and forth. Each call to pulse()
197 * causes the block to move by a little bit (the amount of movement
198 * per pulse is determined by set_pulse_step()).
203 /** Retrieves the text displayed superimposed on the progress bar,
204 * if any, otherwise <tt>0</tt>. The return value is a reference
205 * to the text, not a copy of it, so will become invalid
206 * if you change the text in the progress bar.
207 * @return Text, or <tt>0</tt>; this string is owned by the widget
208 * and should not be modified or freed.
210 Glib::ustring get_text() const;
212 /** Causes the given @a text to appear superimposed on the progress bar.
213 * @param text A UTF-8 string.
215 void set_text(const Glib::ustring& text);
218 /** Returns the current fraction of the task that's been completed.
219 * @return A fraction from 0.0 to 1.0.
221 double get_fraction() const;
223 /** Causes the progress bar to "fill in" the given fraction
224 * of the bar. The fraction should be between 0.0 and 1.0,
226 * @param fraction Fraction of the task that's been completed.
228 void set_fraction(double fraction);
231 /** Retrieves the pulse step set with set_pulse_step()
232 * @return A fraction from 0.0 to 1.0.
234 double get_pulse_step() const;
236 /** Sets the fraction of total progress bar length to move the
237 * bouncing block for each call to pulse().
238 * @param fraction Fraction between 0.0 and 1.0.
240 void set_pulse_step(double fraction);
243 /** Causes the progress bar to switch to a different orientation
244 * (left-to-right, right-to-left, top-to-bottom, or bottom-to-top).
245 * @param orientation Orientation of the progress bar.
247 void set_orientation(ProgressBarOrientation orientation = PROGRESS_LEFT_TO_RIGHT);
249 /** Retrieves the current progress bar orientation.
250 * @return Orientation of the progress bar.
252 ProgressBarOrientation get_orientation() const;
255 /** Sets the mode used to ellipsize (add an ellipsis: "...") the text
256 * if there is not enough space to render the entire string.
259 * @param mode A Pango::EllipsizeMode.
261 void set_ellipsize(Pango::EllipsizeMode mode);
263 Pango::EllipsizeMode get_ellipsize() const;
265 /** The fraction of total work that has been completed.
267 * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
268 * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
269 * the value of the property changes.
271 Glib::PropertyProxy<double> property_fraction() ;
273 /** The fraction of total work that has been completed.
275 * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
276 * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
277 * the value of the property changes.
279 Glib::PropertyProxy_ReadOnly<double> property_fraction() const;
281 /** The fraction of total progress to move the bouncing block when pulsed.
283 * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
284 * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
285 * the value of the property changes.
287 Glib::PropertyProxy<double> property_pulse_step() ;
289 /** The fraction of total progress to move the bouncing block when pulsed.
291 * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
292 * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
293 * the value of the property changes.
295 Glib::PropertyProxy_ReadOnly<double> property_pulse_step() const;
297 /** Orientation and growth direction of the progress bar.
299 * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
300 * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
301 * the value of the property changes.
303 Glib::PropertyProxy<ProgressBarOrientation> property_orientation() ;
305 /** Orientation and growth direction of the progress bar.
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<ProgressBarOrientation> property_orientation() const;
313 /** Text to be displayed in the progress bar.
315 * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
316 * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
317 * the value of the property changes.
319 Glib::PropertyProxy<Glib::ustring> property_text() ;
321 /** Text to be displayed in the progress bar.
323 * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
324 * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
325 * the value of the property changes.
327 Glib::PropertyProxy_ReadOnly<Glib::ustring> property_text() const;
329 /** The preferred place to ellipsize the string
331 * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
332 * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
333 * the value of the property changes.
335 Glib::PropertyProxy<bool> property_ellipsize() ;
337 /** The preferred place to ellipsize the string
339 * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
340 * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
341 * the value of the property changes.
343 Glib::PropertyProxy_ReadOnly<bool> property_ellipsize() const;
353 /** @relates Gtk::ProgressBar
354 * @param object The C instance
355 * @param take_copy False if the result should take ownership of the C instance. True if it should take a new copy or ref.
356 * @result A C++ instance that wraps this C instance.
358 Gtk::ProgressBar* wrap(GtkProgressBar* object, bool take_copy = false);
360 #endif /* _GTKMM_PROGRESSBAR_H */