Merged revisions 6293,6296-6306,6308 via svnmerge from
[ardour.git] / libs / gtkmm2 / gtk / src / progressbar.hg
1 /* $Id: progressbar.hg,v 1.2 2004/11/10 22:05:57 murrayc Exp $ */
2
3 /* progressbar.h
4  * 
5  * Copyright (C) 1998-2002 The gtkmm Development Team
6  *
7  * This library is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU Library General Public
9  * License as published by the Free Software Foundation; either
10  * version 2 of the License, or (at your option) any later version.
11  *
12  * This library is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
15  * Library General Public License for more details.
16  *
17  * You should have received a copy of the GNU Library General Public
18  * License along with this library; if not, write to the Free
19  * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
20  */
21
22 #include <gtkmm/widget.h>
23
24 _DEFS(gtkmm,gtk)
25 _PINCLUDE(gtkmm/private/widget_p.h)
26 _PINCLUDE(gtk/gtkprogress.h)
27
28
29 namespace Gtk
30 {
31
32 _CC_INCLUDE(gtk/gtktypebuiltins.h)
33 _WRAP_ENUM(ProgressBarStyle, GtkProgressBarStyle)
34 _WRAP_ENUM(ProgressBarOrientation, GtkProgressBarOrientation)
35
36
37 /** A widget which indicates progress visually.
38  *
39  * The Gtk::ProgressBar is typically used to display the progress of a long
40  * running operation. It provides a visual clue that processing is underway.
41  * The Gtk::ProgressBar can be used in two different modes: percentage mode
42  * and activity mode.
43  *
44  * When an application can determine how much work needs to take place (e.g.
45  * read a fixed number of bytes from a file) and can monitor its progress,
46  * it can use the Gtk::ProgressBar in percentage mode and the user sees a
47  * growing bar indicating the percentage of the work that has been
48  * completed. In this mode, the application is required to call
49  * set_fraction() periodically to update the progress bar.
50  *
51  * When an application has no accurate way of knowing the amount of work to
52  * do, it can use the Gtk::ProgressBar in activity mode, which shows
53  * activity by a block moving back and forth within the progress area. In
54  * this mode, the application is required to call pulse() perodically to
55  * update the progress bar.
56  *
57  * There is quite a bit of flexibility provided to control the appearance of
58  * the Gtk::ProgressBar. Functions are provided to control the orientation of
59  * the bar, optional text can be displayed along with the bar, and the step
60  * size used in activity mode can be set. 
61  *
62  * @ingroup Widgets
63  */
64 class ProgressBar : public Widget
65 {
66   _CLASS_GTKOBJECT(ProgressBar,GtkProgressBar,GTK_PROGRESS_BAR,Gtk::Widget,GtkWidget,GtkProgressBar,GtkProgress)
67   _IGNORE(gtk_progress_bar_new_with_adjustment, gtk_progress_bar_set_bar_style, gtk_progress_bar_set_discrete_blocks,
68           gtk_progress_bar_set_activity_step, gtk_progress_bar_set_activity_blocks, gtk_progress_bar_update)
69 public:
70   _CTOR_DEFAULT()
71
72   _WRAP_METHOD(void pulse(), gtk_progress_bar_pulse)
73
74   _WRAP_METHOD(Glib::ustring get_text() const, gtk_progress_bar_get_text)
75   _WRAP_METHOD(void set_text(const Glib::ustring& text), gtk_progress_bar_set_text)
76
77   _WRAP_METHOD(double get_fraction() const, gtk_progress_bar_get_fraction)
78   _WRAP_METHOD(void set_fraction(double fraction), gtk_progress_bar_set_fraction)
79
80   _WRAP_METHOD(double get_pulse_step() const, gtk_progress_bar_get_pulse_step)
81   _WRAP_METHOD(void set_pulse_step(double fraction), gtk_progress_bar_set_pulse_step)
82
83   _WRAP_METHOD(void set_orientation(ProgressBarOrientation orientation = PROGRESS_LEFT_TO_RIGHT),
84                gtk_progress_bar_set_orientation)
85   _WRAP_METHOD(ProgressBarOrientation get_orientation() const, gtk_progress_bar_get_orientation)
86
87   _WRAP_METHOD(void set_ellipsize(Pango::EllipsizeMode mode), gtk_progress_bar_set_ellipsize)
88   _WRAP_METHOD(Pango::EllipsizeMode get_ellipsize() const, gtk_progress_bar_get_ellipsize)
89
90   _WRAP_PROPERTY("fraction", double)
91   _WRAP_PROPERTY("pulse-step", double)
92   _WRAP_PROPERTY("orientation", ProgressBarOrientation)
93   _WRAP_PROPERTY("text", Glib::ustring)
94   _WRAP_PROPERTY("ellipsize", bool)
95 };
96
97 } // namespace Gtk
98