/* Copyright (C) 2009 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>
#include <gtkmm/button.h>
#include <gtkmm/enums.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
{

/** This widget can be used to show messages to the user without showing a dialog.
 * It is often temporarily shown at the top or bottom of a document. In contrast to
 * Dialog, which has a horizontal action area at the bottom, InfoBar has a vertical
 * action area at the side.
 *
 * The API is very similar to Dialog, allowing you to add buttons to the action
 * area with add_button(). The sensitivity of action widgets can be controlled
 * with set_response_sensitive(). To add widgets to the main content area, use
 * add_child().
 *
 * Similar to MessageDialog, the contents can by classified as error message,
 * warning, informational message, etc, by using set_message_type(). This
 * determines the background color of the message area.
 *
 * The InfoBar widget looks like
 * @image html infobar1.png
 *
 * @ingroup Widgets
 * @deprecated 4.10: There is no replacement in GTK for an "info bar" widget.
 *   You can use Gtk::Revealer with a Gtk::Box containing a Gtk::Label and
 *   an optional Gtk::Button, according to your application's design.
 */
class GTKMM_API InfoBar : public Widget
{
  _CLASS_GTKOBJECT(InfoBar, GtkInfoBar, GTK_INFO_BAR, Gtk::Widget, GtkWidget, , , GTKMM_API)
public:

  _CTOR_DEFAULT
  _IGNORE(gtk_info_bar_new, gtk_info_bar_new_with_buttons)

  _WRAP_METHOD(void add_action_widget(Widget& child, int response_id), gtk_info_bar_add_action_widget)
  _WRAP_METHOD(void remove_action_widget(Widget& widget), gtk_info_bar_remove_action_widget)

  _WRAP_METHOD(Button* add_button(const Glib::ustring& button_text, int response_id), gtk_info_bar_add_button)

  _WRAP_METHOD(void add_child(Widget& widget), gtk_info_bar_add_child)
  _WRAP_METHOD(void remove_child(Widget& widget), gtk_info_bar_remove_child)

  _IGNORE(gtk_info_bar_add_buttons)
  _WRAP_METHOD(void set_response_sensitive(int response_id, bool setting = true), gtk_info_bar_set_response_sensitive)
  _WRAP_METHOD(void set_default_response(int response_id), gtk_info_bar_set_default_response)

  _WRAP_METHOD(void response(int response_id), gtk_info_bar_response)

  _WRAP_METHOD(void set_message_type(MessageType message_type), gtk_info_bar_set_message_type)
  _WRAP_METHOD(MessageType get_message_type() const, gtk_info_bar_get_message_type)

  _WRAP_METHOD(void set_show_close_button(bool setting = true), gtk_info_bar_set_show_close_button)
  _WRAP_METHOD(bool get_show_close_button() const, gtk_info_bar_get_show_close_button)

  _WRAP_METHOD(void set_revealed(bool revealed = true), gtk_info_bar_set_revealed)
  _WRAP_METHOD(bool get_revealed() const, gtk_info_bar_get_revealed)

  _IGNORE_SIGNAL("close")

  // no_default_handler because GtkInfoBarClass is private.
  _WRAP_SIGNAL(void response(int response_id), "response", no_default_handler)

  _WRAP_PROPERTY("message-type", MessageType)
  _WRAP_PROPERTY("show-close-button", bool)
  _WRAP_PROPERTY("revealed", bool)
};

} // namespace Gtk
