/* 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 Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 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
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, see <https://www.gnu.org/licenses/>.
 */

_DEFS(gtkmm,gtk)
_CONFIGINCLUDE(gtkmmconfig.h)
_IS_DEPRECATED // The entire file is deprecated.

#include <gtkmm/widget.h>

_PINCLUDE(gtkmm/private/widget_p.h)

#m4 _PUSH(SECTION_CC_PRE_INCLUDES)
#undef GTK_DISABLE_DEPRECATED
#define GDK_DISABLE_DEPRECATION_WARNINGS 1
#m4 _POP()

namespace Gtk
{

/** %Text status indicator.
 *
 * A %Gtk::Statusbar widget is usually placed along the bottom of
 * an application's main window.
 *
 * A %Gtk::Statusbar may provide a regular commentary of the application's
 * status (as is usually the case in a web browser, for example), or may be
 * used to simply output a message when the status changes, (when an upload
 * is complete in an FTP client, for example).
 *
 * Status bars in GTK maintain a stack of messages. The message at
 * the top of the each bar’s stack is the one that will currently be displayed.
 *
 * Any messages added to a statusbar’s stack must specify a context id that
 * is used to uniquely identify the source of a message. This context id can
 * be generated by get_context_id(). Note that messages are stored in a
 * stack, and when choosing which message to display, the stack structure is
 * adhered to, regardless of the context identifier of a message.
 *
 * One could say that a statusbar maintains one stack of messages for
 * display purposes, but allows multiple message producers to maintain
 * sub-stacks of the messages they produced (via context ids).
 *
 * Messages are added to the bar’s stack with push().
 *
 * The message at the top of the stack can be removed using
 * pop(). A message can be removed from anywhere in the
 * stack if its message id was recorded at the time it was added. This is done
 * using remove_message().
 *
 * The %Statusbar widget looks like this:
 * @image html statusbar1.png
 *
 * @deprecated 4.10: A simple statusbar can be made with a Gtk::Label.
 * @ingroup Widgets
 */
class GTKMM_API Statusbar : public Widget
{
  _CLASS_GTKOBJECT(Statusbar, GtkStatusbar, GTK_STATUSBAR, Gtk::Widget, GtkWidget, , , GTKMM_API)
public:
  _CTOR_DEFAULT

  _WRAP_METHOD(guint get_context_id(const Glib::ustring& context_description), gtk_statusbar_get_context_id)
  /** Pushes a new message onto a statusbar’s stack.
   *
   * @param text The message to add to the statusbar.
   * @param context_id The message’s context id, as returned by get_context_id().
   * @return A message id that can be used with remove_message().
   */
  _WRAP_METHOD(guint push(const Glib::ustring& text{.}, guint context_id{.} = 0), gtk_statusbar_push)
  _WRAP_METHOD(void pop(guint context_id = 0), gtk_statusbar_pop)
  _WRAP_METHOD(void remove_message(guint message_id{.}, guint context_id{.} = 0), gtk_statusbar_remove)
  _WRAP_METHOD(void remove_all_messages(guint context_id = 0), gtk_statusbar_remove_all)

  // no_default_handler because GtkStatusbarClass is private.
#m4 _CONVERSION(`const char*',`const Glib::ustring&',__GCHARP_TO_USTRING)
  _WRAP_SIGNAL(void text_pushed(guint context_id, const Glib::ustring& text), "text_pushed", no_default_handler)
  _WRAP_SIGNAL(void text_popped(guint context_id, const Glib::ustring& text), "text_popped", no_default_handler)
};

} //namespace Gtk
