// Generated by gmmproc 2.86.0 -- DO NOT MODIFY!


#include <glibmm.h>

#include <gtkmm/alertdialog.h>
#include <gtkmm/private/alertdialog_p.h>


/* Copyright 2022 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 <http://www.gnu.org/licenses/>.
 */

#include <gdkmm/slot_async.h>
#include <gtkmm/window.h>

namespace
{
} // anonymous namespace


namespace Glib
{

Glib::RefPtr<Gtk::AlertDialog> wrap(GtkAlertDialog* object, bool take_copy)
{
  return Glib::make_refptr_for_instance<Gtk::AlertDialog>( dynamic_cast<Gtk::AlertDialog*> (Glib::wrap_auto ((GObject*)(object), take_copy)) );
  //We use dynamic_cast<> in case of multiple inheritance.
}

} /* namespace Glib */


namespace Gtk
{


/* The *_Class implementation: */

const Glib::Class& AlertDialog_Class::init()
{
  if(!gtype_) // create the GType if necessary
  {
    // Do not derive a GType, or use a derived class:
    gtype_ = gtk_alert_dialog_get_type();

  }

  return *this;
}


Glib::ObjectBase* AlertDialog_Class::wrap_new(GObject* object)
{
  return new AlertDialog((GtkAlertDialog*)object);
}


/* The implementation: */

GtkAlertDialog* AlertDialog::gobj_copy()
{
  reference();
  return gobj();
}

AlertDialog::AlertDialog(const Glib::ConstructParams& construct_params)
:
  Glib::Object(construct_params)
{

}

AlertDialog::AlertDialog(GtkAlertDialog* castitem)
:
  Glib::Object((GObject*)(castitem))
{}


AlertDialog::AlertDialog(AlertDialog&& src) noexcept
: Glib::Object(std::move(src))
{}

AlertDialog& AlertDialog::operator=(AlertDialog&& src) noexcept
{
  Glib::Object::operator=(std::move(src));
  return *this;
}


AlertDialog::~AlertDialog() noexcept
{}


AlertDialog::CppClassType AlertDialog::alertdialog_class_; // initialize static member

GType AlertDialog::get_type()
{
  return alertdialog_class_.init().get_type();
}


GType AlertDialog::get_base_type()
{
  return gtk_alert_dialog_get_type();
}


AlertDialog::AlertDialog()
:
  // Mark this class as non-derived to allow C++ vfuncs to be skipped.
  Glib::ObjectBase(nullptr),
  Glib::Object(Glib::ConstructParams(alertdialog_class_.init()))
{
  

}

AlertDialog::AlertDialog(const Glib::ustring& message)
:
  // Mark this class as non-derived to allow C++ vfuncs to be skipped.
  Glib::ObjectBase(nullptr),
  Glib::Object(Glib::ConstructParams(alertdialog_class_.init(), "message", message.c_str(), nullptr))
{
  

}

Glib::RefPtr<AlertDialog> AlertDialog::create()
{
  return Glib::make_refptr_for_instance<AlertDialog>( new AlertDialog() );
}

Glib::RefPtr<AlertDialog> AlertDialog::create(const Glib::ustring& message)
{
  return Glib::make_refptr_for_instance<AlertDialog>( new AlertDialog(message) );
}

bool AlertDialog::get_modal() const
{
  return gtk_alert_dialog_get_modal(const_cast<GtkAlertDialog*>(gobj()));
}

void AlertDialog::set_modal(bool modal)
{
  gtk_alert_dialog_set_modal(gobj(), static_cast<int>(modal));
}

Glib::ustring AlertDialog::get_message() const
{
  return Glib::convert_const_gchar_ptr_to_ustring(gtk_alert_dialog_get_message(const_cast<GtkAlertDialog*>(gobj())));
}

void AlertDialog::set_message(const Glib::ustring& message)
{
  gtk_alert_dialog_set_message(gobj(), message.c_str());
}

Glib::ustring AlertDialog::get_detail() const
{
  return Glib::convert_const_gchar_ptr_to_ustring(gtk_alert_dialog_get_detail(const_cast<GtkAlertDialog*>(gobj())));
}

void AlertDialog::set_detail(const Glib::ustring& detail)
{
  gtk_alert_dialog_set_detail(gobj(), detail.c_str());
}

std::vector<Glib::ustring> AlertDialog::get_buttons() const
{
  return Glib::ArrayHandler<Glib::ustring>::array_to_vector(gtk_alert_dialog_get_buttons(const_cast<GtkAlertDialog*>(gobj())), Glib::OWNERSHIP_NONE);
}

void AlertDialog::set_buttons(const std::vector<Glib::ustring>& labels) const
{
  gtk_alert_dialog_set_buttons(const_cast<GtkAlertDialog*>(gobj()), Glib::ArrayHandler<Glib::ustring>::vector_to_array(labels).data ());
}

int AlertDialog::get_cancel_button() const
{
  return gtk_alert_dialog_get_cancel_button(const_cast<GtkAlertDialog*>(gobj()));
}

void AlertDialog::set_cancel_button(int button)
{
  gtk_alert_dialog_set_cancel_button(gobj(), button);
}

int AlertDialog::get_default_button() const
{
  return gtk_alert_dialog_get_default_button(const_cast<GtkAlertDialog*>(gobj()));
}

void AlertDialog::set_default_button(int button)
{
  gtk_alert_dialog_set_default_button(gobj(), button);
}

void AlertDialog::choose(Window& parent, const Gio::SlotAsyncReady& slot, const Glib::RefPtr<Gio::Cancellable>& cancellable) const
{
  // Create a copy of the slot.
  auto slot_copy = new Gio::SlotAsyncReady(slot); 

  gtk_alert_dialog_choose(const_cast<GtkAlertDialog*>(gobj()), (parent).gobj(), const_cast<GCancellable*>(Glib::unwrap(cancellable)), &Gdk::gdkmm_SignalProxy_async_callback, slot_copy);
}

void AlertDialog::choose(const Gio::SlotAsyncReady& slot, const Glib::RefPtr<Gio::Cancellable>& cancellable) const
{
  // Create a copy of the slot.
  auto slot_copy = new Gio::SlotAsyncReady(slot); 

  gtk_alert_dialog_choose(const_cast<GtkAlertDialog*>(gobj()), nullptr, const_cast<GCancellable*>(Glib::unwrap(cancellable)), &Gdk::gdkmm_SignalProxy_async_callback, slot_copy);
}

int AlertDialog::choose_finish(const Glib::RefPtr<Gio::AsyncResult>& result) const
{
  GError* gerror = nullptr;
  auto retvalue = gtk_alert_dialog_choose_finish(const_cast<GtkAlertDialog*>(gobj()), Glib::unwrap(result), &(gerror));
  if(gerror)
    ::Glib::Error::throw_exception(gerror);
  return retvalue;
}

void AlertDialog::show(Window& parent)
{
  gtk_alert_dialog_show(gobj(), (parent).gobj());
}

void AlertDialog::show()
{
  gtk_alert_dialog_show(gobj(), nullptr);
}


Glib::PropertyProxy< bool > AlertDialog::property_modal() 
{
  return Glib::PropertyProxy< bool >(this, "modal");
}

Glib::PropertyProxy_ReadOnly< bool > AlertDialog::property_modal() const
{
  return Glib::PropertyProxy_ReadOnly< bool >(this, "modal");
}

Glib::PropertyProxy< Glib::ustring > AlertDialog::property_message() 
{
  return Glib::PropertyProxy< Glib::ustring >(this, "message");
}

Glib::PropertyProxy_ReadOnly< Glib::ustring > AlertDialog::property_message() const
{
  return Glib::PropertyProxy_ReadOnly< Glib::ustring >(this, "message");
}

Glib::PropertyProxy< Glib::ustring > AlertDialog::property_detail() 
{
  return Glib::PropertyProxy< Glib::ustring >(this, "detail");
}

Glib::PropertyProxy_ReadOnly< Glib::ustring > AlertDialog::property_detail() const
{
  return Glib::PropertyProxy_ReadOnly< Glib::ustring >(this, "detail");
}

static_assert(Glib::Traits::ValueCompatibleWithWrapProperty<std::vector<Glib::ustring>>::value,
  "Type std::vector<Glib::ustring> cannot be used in _WRAP_PROPERTY. "
  "There is no suitable template specialization of Glib::Value<>.");

Glib::PropertyProxy< std::vector<Glib::ustring> > AlertDialog::property_buttons() 
{
  return Glib::PropertyProxy< std::vector<Glib::ustring> >(this, "buttons");
}

Glib::PropertyProxy_ReadOnly< std::vector<Glib::ustring> > AlertDialog::property_buttons() const
{
  return Glib::PropertyProxy_ReadOnly< std::vector<Glib::ustring> >(this, "buttons");
}

Glib::PropertyProxy< int > AlertDialog::property_cancel_button() 
{
  return Glib::PropertyProxy< int >(this, "cancel-button");
}

Glib::PropertyProxy_ReadOnly< int > AlertDialog::property_cancel_button() const
{
  return Glib::PropertyProxy_ReadOnly< int >(this, "cancel-button");
}

Glib::PropertyProxy< int > AlertDialog::property_default_button() 
{
  return Glib::PropertyProxy< int >(this, "default-button");
}

Glib::PropertyProxy_ReadOnly< int > AlertDialog::property_default_button() const
{
  return Glib::PropertyProxy_ReadOnly< int >(this, "default-button");
}


} // namespace Gtk


