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


#include <glibmm.h>

#include <gtkmm/fontdialog.h>
#include <gtkmm/private/fontdialog_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 Gtk
{
std::tuple<Pango::FontDescription, Glib::ustring, Pango::Language>
  FontDialog::choose_font_and_features_finish(const Glib::RefPtr<Gio::AsyncResult>& result) const
{
  GError* gerror = nullptr;
  PangoFontDescription* font_desc = nullptr;
  char* font_features = nullptr;
  PangoLanguage* language = nullptr;

  // If the function returns FALSE, gerror will be set. No reason to test the return value.
  (void)gtk_font_dialog_choose_font_and_features_finish(const_cast<GtkFontDialog*>(gobj()),
    Glib::unwrap(result), &font_desc, &font_features, &language, &gerror);
  if (gerror)
    ::Glib::Error::throw_exception(gerror);

  return {Glib::wrap(font_desc),
    Glib::convert_return_gchar_ptr_to_ustring(font_features), Glib::wrap(language)};
}
}

namespace
{
} // anonymous namespace


namespace Glib
{

Glib::RefPtr<Gtk::FontDialog> wrap(GtkFontDialog* object, bool take_copy)
{
  return Glib::make_refptr_for_instance<Gtk::FontDialog>( dynamic_cast<Gtk::FontDialog*> (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& FontDialog_Class::init()
{
  if(!gtype_) // create the GType if necessary
  {
    // Do not derive a GType, or use a derived class:
    gtype_ = gtk_font_dialog_get_type();

  }

  return *this;
}


Glib::ObjectBase* FontDialog_Class::wrap_new(GObject* object)
{
  return new FontDialog((GtkFontDialog*)object);
}


/* The implementation: */

GtkFontDialog* FontDialog::gobj_copy()
{
  reference();
  return gobj();
}

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

}

FontDialog::FontDialog(GtkFontDialog* castitem)
:
  Glib::Object((GObject*)(castitem))
{}


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

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


FontDialog::~FontDialog() noexcept
{}


FontDialog::CppClassType FontDialog::fontdialog_class_; // initialize static member

GType FontDialog::get_type()
{
  return fontdialog_class_.init().get_type();
}


GType FontDialog::get_base_type()
{
  return gtk_font_dialog_get_type();
}


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

}

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

Glib::ustring FontDialog::get_title() const
{
  return Glib::convert_const_gchar_ptr_to_ustring(gtk_font_dialog_get_title(const_cast<GtkFontDialog*>(gobj())));
}

void FontDialog::set_title(const Glib::ustring& title)
{
  gtk_font_dialog_set_title(gobj(), title.c_str());
}

bool FontDialog::get_modal() const
{
  return gtk_font_dialog_get_modal(const_cast<GtkFontDialog*>(gobj()));
}

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

Pango::Language FontDialog::get_language() const
{
  return Pango::Language(gtk_font_dialog_get_language(const_cast<GtkFontDialog*>(gobj())));
}

void FontDialog::set_language(const Pango::Language& language)
{
  gtk_font_dialog_set_language(gobj(), const_cast<PangoLanguage*>((language).gobj()));
}

Glib::RefPtr<Pango::FontMap> FontDialog::get_font_map()
{
  auto retvalue = Glib::wrap(gtk_font_dialog_get_font_map(gobj()));
  if(retvalue)
    retvalue->reference(); //The function does not do a ref for us.
  return retvalue;
}

Glib::RefPtr<const Pango::FontMap> FontDialog::get_font_map() const
{
  return const_cast<FontDialog*>(this)->get_font_map();
}

void FontDialog::set_font_map(const Glib::RefPtr<Pango::FontMap>& fontmap)
{
  gtk_font_dialog_set_font_map(gobj(), Glib::unwrap(fontmap));
}

Glib::RefPtr<Filter> FontDialog::get_filter()
{
  auto retvalue = Glib::wrap(gtk_font_dialog_get_filter(gobj()));
  if(retvalue)
    retvalue->reference(); //The function does not do a ref for us.
  return retvalue;
}

Glib::RefPtr<const Filter> FontDialog::get_filter() const
{
  return const_cast<FontDialog*>(this)->get_filter();
}

void FontDialog::set_filter(const Glib::RefPtr<Filter>& filter)
{
  gtk_font_dialog_set_filter(gobj(), Glib::unwrap(filter));
}

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

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

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

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

Glib::RefPtr<Pango::FontFamily> FontDialog::choose_family_finish(const Glib::RefPtr<Gio::AsyncResult>& result)
{
  GError* gerror = nullptr;
  auto retvalue = Glib::wrap(gtk_font_dialog_choose_family_finish(gobj(), Glib::unwrap(result), &(gerror)));
  if(gerror)
    ::Glib::Error::throw_exception(gerror);
  return retvalue;
}

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

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

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

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

Glib::RefPtr<Pango::FontFace> FontDialog::choose_face_finish(const Glib::RefPtr<Gio::AsyncResult>& result)
{
  GError* gerror = nullptr;
  auto retvalue = Glib::wrap(gtk_font_dialog_choose_face_finish(gobj(), Glib::unwrap(result), &(gerror)));
  if(gerror)
    ::Glib::Error::throw_exception(gerror);
  return retvalue;
}

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

  gtk_font_dialog_choose_font(const_cast<GtkFontDialog*>(gobj()), (parent).gobj(), const_cast<PangoFontDescription*>((initial_value).gobj()), const_cast<GCancellable*>(Glib::unwrap(cancellable)), &Gdk::gdkmm_SignalProxy_async_callback, slot_copy);
}

void FontDialog::choose_font(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_font_dialog_choose_font(const_cast<GtkFontDialog*>(gobj()), (parent).gobj(), nullptr, const_cast<GCancellable*>(Glib::unwrap(cancellable)), &Gdk::gdkmm_SignalProxy_async_callback, slot_copy);
}

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

  gtk_font_dialog_choose_font(const_cast<GtkFontDialog*>(gobj()), nullptr, const_cast<PangoFontDescription*>((initial_value).gobj()), const_cast<GCancellable*>(Glib::unwrap(cancellable)), &Gdk::gdkmm_SignalProxy_async_callback, slot_copy);
}

void FontDialog::choose_font(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_font_dialog_choose_font(const_cast<GtkFontDialog*>(gobj()), nullptr, nullptr, const_cast<GCancellable*>(Glib::unwrap(cancellable)), &Gdk::gdkmm_SignalProxy_async_callback, slot_copy);
}

Pango::FontDescription FontDialog::choose_font_finish(const Glib::RefPtr<Gio::AsyncResult>& result) const
{
  GError* gerror = nullptr;
  auto retvalue = Glib::wrap(gtk_font_dialog_choose_font_finish(const_cast<GtkFontDialog*>(gobj()), Glib::unwrap(result), &(gerror)), false);
  if(gerror)
    ::Glib::Error::throw_exception(gerror);
  return retvalue;
}

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

  gtk_font_dialog_choose_font_and_features(const_cast<GtkFontDialog*>(gobj()), (parent).gobj(), const_cast<PangoFontDescription*>((initial_value).gobj()), const_cast<GCancellable*>(Glib::unwrap(cancellable)), &Gdk::gdkmm_SignalProxy_async_callback, slot_copy);
}

void FontDialog::choose_font_and_features(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_font_dialog_choose_font_and_features(const_cast<GtkFontDialog*>(gobj()), (parent).gobj(), nullptr, const_cast<GCancellable*>(Glib::unwrap(cancellable)), &Gdk::gdkmm_SignalProxy_async_callback, slot_copy);
}

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

  gtk_font_dialog_choose_font_and_features(const_cast<GtkFontDialog*>(gobj()), nullptr, const_cast<PangoFontDescription*>((initial_value).gobj()), const_cast<GCancellable*>(Glib::unwrap(cancellable)), &Gdk::gdkmm_SignalProxy_async_callback, slot_copy);
}

void FontDialog::choose_font_and_features(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_font_dialog_choose_font_and_features(const_cast<GtkFontDialog*>(gobj()), nullptr, nullptr, const_cast<GCancellable*>(Glib::unwrap(cancellable)), &Gdk::gdkmm_SignalProxy_async_callback, slot_copy);
}


Glib::PropertyProxy< Glib::ustring > FontDialog::property_title() 
{
  return Glib::PropertyProxy< Glib::ustring >(this, "title");
}

Glib::PropertyProxy_ReadOnly< Glib::ustring > FontDialog::property_title() const
{
  return Glib::PropertyProxy_ReadOnly< Glib::ustring >(this, "title");
}

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

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

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

Glib::PropertyProxy< Pango::Language > FontDialog::property_language() 
{
  return Glib::PropertyProxy< Pango::Language >(this, "language");
}

Glib::PropertyProxy_ReadOnly< Pango::Language > FontDialog::property_language() const
{
  return Glib::PropertyProxy_ReadOnly< Pango::Language >(this, "language");
}

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

Glib::PropertyProxy< Glib::RefPtr<Pango::FontMap> > FontDialog::property_font_map() 
{
  return Glib::PropertyProxy< Glib::RefPtr<Pango::FontMap> >(this, "font-map");
}

Glib::PropertyProxy_ReadOnly< Glib::RefPtr<Pango::FontMap> > FontDialog::property_font_map() const
{
  return Glib::PropertyProxy_ReadOnly< Glib::RefPtr<Pango::FontMap> >(this, "font-map");
}

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

Glib::PropertyProxy< Glib::RefPtr<Filter> > FontDialog::property_filter() 
{
  return Glib::PropertyProxy< Glib::RefPtr<Filter> >(this, "filter");
}

Glib::PropertyProxy_ReadOnly< Glib::RefPtr<Filter> > FontDialog::property_filter() const
{
  return Glib::PropertyProxy_ReadOnly< Glib::RefPtr<Filter> >(this, "filter");
}


} // namespace Gtk


