add new sigc++2 directory
[ardour.git] / libs / gtkmm2 / gtk / gtkmm / progressbar.h
1 // -*- c++ -*-
2 // Generated by gtkmmproc -- DO NOT MODIFY!
3 #ifndef _GTKMM_PROGRESSBAR_H
4 #define _GTKMM_PROGRESSBAR_H
5
6
7 #include <glibmm.h>
8
9 /* $Id$ */
10
11 /* progressbar.h
12  * 
13  * Copyright (C) 1998-2002 The gtkmm Development Team
14  *
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.
19  *
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.
24  *
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.
28  */
29
30 #include <gtkmm/widget.h>
31
32
33 #ifndef DOXYGEN_SHOULD_SKIP_THIS
34 typedef struct _GtkProgressBar GtkProgressBar;
35 typedef struct _GtkProgressBarClass GtkProgressBarClass;
36 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
37
38
39 namespace Gtk
40 { class ProgressBar_Class; } // namespace Gtk
41 namespace Gtk
42 {
43
44
45 /** @addtogroup gtkmmEnums Enums and Flags */
46
47 /**
48  * @ingroup gtkmmEnums
49  */
50 enum ProgressBarStyle
51 {
52   PROGRESS_CONTINUOUS,
53   PROGRESS_DISCRETE
54 };
55
56 } // namespace Gtk
57
58
59 #ifndef DOXYGEN_SHOULD_SKIP_THIS
60 namespace Glib
61 {
62
63 template <>
64 class Value<Gtk::ProgressBarStyle> : public Glib::Value_Enum<Gtk::ProgressBarStyle>
65 {
66 public:
67   static GType value_type() G_GNUC_CONST;
68 };
69
70 } // namespace Glib
71 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
72
73
74 namespace Gtk
75 {
76
77 /**
78  * @ingroup gtkmmEnums
79  */
80 enum ProgressBarOrientation
81 {
82   PROGRESS_LEFT_TO_RIGHT,
83   PROGRESS_RIGHT_TO_LEFT,
84   PROGRESS_BOTTOM_TO_TOP,
85   PROGRESS_TOP_TO_BOTTOM
86 };
87
88 } // namespace Gtk
89
90
91 #ifndef DOXYGEN_SHOULD_SKIP_THIS
92 namespace Glib
93 {
94
95 template <>
96 class Value<Gtk::ProgressBarOrientation> : public Glib::Value_Enum<Gtk::ProgressBarOrientation>
97 {
98 public:
99   static GType value_type() G_GNUC_CONST;
100 };
101
102 } // namespace Glib
103 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
104
105
106 namespace Gtk
107 {
108
109
110 /** A widget which indicates progress visually.
111  *
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
115  * and activity mode.
116  *
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.
123  *
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.
129  *
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. 
134  *
135  * @ingroup Widgets
136  */
137
138 class ProgressBar : public Widget
139 {
140   public:
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 */
147
148   virtual ~ProgressBar();
149
150 #ifndef DOXYGEN_SHOULD_SKIP_THIS
151
152 private:
153   friend class ProgressBar_Class;
154   static CppClassType progressbar_class_;
155
156   // noncopyable
157   ProgressBar(const ProgressBar&);
158   ProgressBar& operator=(const ProgressBar&);
159
160 protected:
161   explicit ProgressBar(const Glib::ConstructParams& construct_params);
162   explicit ProgressBar(GtkProgressBar* castitem);
163
164 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
165
166 public:
167 #ifndef DOXYGEN_SHOULD_SKIP_THIS
168   static GType get_type()      G_GNUC_CONST;
169   static GType get_base_type() G_GNUC_CONST;
170 #endif
171
172   ///Provides access to the underlying C GtkObject.
173   GtkProgressBar*       gobj()       { return reinterpret_cast<GtkProgressBar*>(gobject_); }
174
175   ///Provides access to the underlying C GtkObject.
176   const GtkProgressBar* gobj() const { return reinterpret_cast<GtkProgressBar*>(gobject_); }
177
178
179 public:
180   //C++ methods used to invoke GTK+ virtual functions:
181 #ifdef GLIBMM_VFUNCS_ENABLED
182 #endif //GLIBMM_VFUNCS_ENABLED
183
184 protected:
185   //GTK+ Virtual Functions (override these to change behaviour):
186 #ifdef GLIBMM_VFUNCS_ENABLED
187 #endif //GLIBMM_VFUNCS_ENABLED
188
189   //Default Signal Handlers::
190 #ifdef GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
191 #endif //GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
192
193
194 private:
195
196   
197 public:
198   ProgressBar();
199
200   
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()).
206    */
207   void pulse();
208
209   
210   /** Retrieves the text displayed superimposed on the progress bar,
211    * if any.
212    * @return Text.
213    */
214   Glib::ustring get_text() const;
215   
216   /** Causes the given @a text  to appear superimposed on the progress bar.
217    * @param text A UTF-8 string, or <tt>0</tt>.
218    */
219   void set_text(const Glib::ustring& text);
220
221   
222   /** Return value: a fraction from 0.0 to 1.0
223    * @return A fraction from 0.0 to 1.0.
224    */
225   double get_fraction() const;
226   
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,
229    * inclusive.
230    * @param fraction Fraction of the task that's been completed.
231    */
232   void set_fraction(double fraction);
233
234   
235   /** Retrieves the pulse step set with set_pulse_step()
236    * @return A fraction from 0.0 to 1.0.
237    */
238   double get_pulse_step() const;
239   
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.
243    */
244   void set_pulse_step(double fraction);
245
246   
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.
250    */
251   void set_orientation(ProgressBarOrientation orientation = PROGRESS_LEFT_TO_RIGHT);
252   
253   /** Retrieves the current progress bar orientation.
254    * @return Orientation of the progress bar.
255    */
256   ProgressBarOrientation get_orientation() const;
257
258   
259   /** Sets the mode used to ellipsize (add an ellipsis: "...") the text 
260    * if there is not enough space to render the entire string.
261    * 
262    * @newin2p6
263    * @param mode A Pango::EllipsizeMode.
264    */
265   void set_ellipsize(Pango::EllipsizeMode mode);
266   
267   /** Return value: Pango::EllipsizeMode
268    * @return Pango::EllipsizeMode
269    * 
270    * @newin2p6.
271    */
272   Pango::EllipsizeMode get_ellipsize() const;
273
274   #ifdef GLIBMM_PROPERTIES_ENABLED
275 /** The fraction of total work that has been completed.
276    *
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.
280    */
281   Glib::PropertyProxy<double> property_fraction() ;
282 #endif //#GLIBMM_PROPERTIES_ENABLED
283
284 #ifdef GLIBMM_PROPERTIES_ENABLED
285 /** The fraction of total work that has been completed.
286    *
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.
290    */
291   Glib::PropertyProxy_ReadOnly<double> property_fraction() const;
292 #endif //#GLIBMM_PROPERTIES_ENABLED
293
294   #ifdef GLIBMM_PROPERTIES_ENABLED
295 /** The fraction of total progress to move the bouncing block when pulsed.
296    *
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.
300    */
301   Glib::PropertyProxy<double> property_pulse_step() ;
302 #endif //#GLIBMM_PROPERTIES_ENABLED
303
304 #ifdef GLIBMM_PROPERTIES_ENABLED
305 /** The fraction of total progress to move the bouncing block when pulsed.
306    *
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.
310    */
311   Glib::PropertyProxy_ReadOnly<double> property_pulse_step() const;
312 #endif //#GLIBMM_PROPERTIES_ENABLED
313
314   #ifdef GLIBMM_PROPERTIES_ENABLED
315 /** Orientation and growth direction of the progress bar.
316    *
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.
320    */
321   Glib::PropertyProxy<ProgressBarOrientation> property_orientation() ;
322 #endif //#GLIBMM_PROPERTIES_ENABLED
323
324 #ifdef GLIBMM_PROPERTIES_ENABLED
325 /** Orientation and growth direction of the progress bar.
326    *
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.
330    */
331   Glib::PropertyProxy_ReadOnly<ProgressBarOrientation> property_orientation() const;
332 #endif //#GLIBMM_PROPERTIES_ENABLED
333
334   #ifdef GLIBMM_PROPERTIES_ENABLED
335 /** Text to be displayed in the progress bar.
336    *
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.
340    */
341   Glib::PropertyProxy<Glib::ustring> property_text() ;
342 #endif //#GLIBMM_PROPERTIES_ENABLED
343
344 #ifdef GLIBMM_PROPERTIES_ENABLED
345 /** Text to be displayed in the progress bar.
346    *
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.
350    */
351   Glib::PropertyProxy_ReadOnly<Glib::ustring> property_text() const;
352 #endif //#GLIBMM_PROPERTIES_ENABLED
353
354   #ifdef GLIBMM_PROPERTIES_ENABLED
355 /** The preferred place to ellipsize the string
356    *
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.
360    */
361   Glib::PropertyProxy<bool> property_ellipsize() ;
362 #endif //#GLIBMM_PROPERTIES_ENABLED
363
364 #ifdef GLIBMM_PROPERTIES_ENABLED
365 /** The preferred place to ellipsize the string
366    *
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.
370    */
371   Glib::PropertyProxy_ReadOnly<bool> property_ellipsize() const;
372 #endif //#GLIBMM_PROPERTIES_ENABLED
373
374
375 };
376
377 } // namespace Gtk
378
379
380 namespace Glib
381 {
382   /** A Glib::wrap() method for this object.
383    * 
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.
387    *
388    * @relates Gtk::ProgressBar
389    */
390   Gtk::ProgressBar* wrap(GtkProgressBar* object, bool take_copy = false);
391 } //namespace Glib
392
393
394 #endif /* _GTKMM_PROGRESSBAR_H */
395