/* $Id: progressbar.hg,v 1.2 2004/11/10 22:05:57 murrayc Exp $ */

/* progressbar.h
 * 
 * Copyright (C) 1998-2002 The gtkmm Development Team
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Library General Public
 * License as published by the Free Software Foundation; either
 * version 2 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Library General Public License for more details.
 *
 * You should have received a copy of the GNU Library General Public
 * License along with this library; if not, write to the Free
 * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 */

#include <gtkmm/widget.h>

_DEFS(gtkmm,gtk)
_PINCLUDE(gtkmm/private/widget_p.h)
_PINCLUDE(gtk/gtkprogress.h)


namespace Gtk
{

_CC_INCLUDE(gtk/gtktypebuiltins.h)
_WRAP_ENUM(ProgressBarStyle, GtkProgressBarStyle)
_WRAP_ENUM(ProgressBarOrientation, GtkProgressBarOrientation)


/** A widget which indicates progress visually.
 *
 * The Gtk::ProgressBar is typically used to display the progress of a long
 * running operation. It provides a visual clue that processing is underway.
 * The Gtk::ProgressBar can be used in two different modes: percentage mode
 * and activity mode.
 *
 * When an application can determine how much work needs to take place (e.g.
 * read a fixed number of bytes from a file) and can monitor its progress,
 * it can use the Gtk::ProgressBar in percentage mode and the user sees a
 * growing bar indicating the percentage of the work that has been
 * completed. In this mode, the application is required to call
 * set_fraction() periodically to update the progress bar.
 *
 * When an application has no accurate way of knowing the amount of work to
 * do, it can use the Gtk::ProgressBar in activity mode, which shows
 * activity by a block moving back and forth within the progress area. In
 * this mode, the application is required to call pulse() perodically to
 * update the progress bar.
 *
 * There is quite a bit of flexibility provided to control the appearance of
 * the Gtk::ProgressBar. Functions are provided to control the orientation of
 * the bar, optional text can be displayed along with the bar, and the step
 * size used in activity mode can be set. 
 *
 * @ingroup Widgets
 */
class ProgressBar : public Widget
{
  _CLASS_GTKOBJECT(ProgressBar,GtkProgressBar,GTK_PROGRESS_BAR,Gtk::Widget,GtkWidget,GtkProgressBar,GtkProgress)
  _IGNORE(gtk_progress_bar_new_with_adjustment, gtk_progress_bar_set_bar_style, gtk_progress_bar_set_discrete_blocks,
          gtk_progress_bar_set_activity_step, gtk_progress_bar_set_activity_blocks, gtk_progress_bar_update)
public:
  _CTOR_DEFAULT()

  _WRAP_METHOD(void pulse(), gtk_progress_bar_pulse)

  _WRAP_METHOD(Glib::ustring get_text() const, gtk_progress_bar_get_text)
  _WRAP_METHOD(void set_text(const Glib::ustring& text), gtk_progress_bar_set_text)

  _WRAP_METHOD(double get_fraction() const, gtk_progress_bar_get_fraction)
  _WRAP_METHOD(void set_fraction(double fraction), gtk_progress_bar_set_fraction)

  _WRAP_METHOD(double get_pulse_step() const, gtk_progress_bar_get_pulse_step)
  _WRAP_METHOD(void set_pulse_step(double fraction), gtk_progress_bar_set_pulse_step)

  _WRAP_METHOD(void set_orientation(ProgressBarOrientation orientation = PROGRESS_LEFT_TO_RIGHT),
               gtk_progress_bar_set_orientation)
  _WRAP_METHOD(ProgressBarOrientation get_orientation() const, gtk_progress_bar_get_orientation)

  _WRAP_METHOD(void set_ellipsize(Pango::EllipsizeMode mode), gtk_progress_bar_set_ellipsize)
  _WRAP_METHOD(Pango::EllipsizeMode get_ellipsize() const, gtk_progress_bar_get_ellipsize)

  _WRAP_PROPERTY("fraction", double)
  _WRAP_PROPERTY("pulse-step", double)
  _WRAP_PROPERTY("orientation", ProgressBarOrientation)
  _WRAP_PROPERTY("text", Glib::ustring)
  _WRAP_PROPERTY("ellipsize", bool)
};

} // namespace Gtk

