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


#include <glibmm.h>

#include <gtkmm/filelauncher.h>
#include <gtkmm/private/filelauncher_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::FileLauncher> wrap(GtkFileLauncher* object, bool take_copy)
{
  return Glib::make_refptr_for_instance<Gtk::FileLauncher>( dynamic_cast<Gtk::FileLauncher*> (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& FileLauncher_Class::init()
{
  if(!gtype_) // create the GType if necessary
  {
    // Do not derive a GType, or use a derived class:
    gtype_ = gtk_file_launcher_get_type();

  }

  return *this;
}


Glib::ObjectBase* FileLauncher_Class::wrap_new(GObject* object)
{
  return new FileLauncher((GtkFileLauncher*)object);
}


/* The implementation: */

GtkFileLauncher* FileLauncher::gobj_copy()
{
  reference();
  return gobj();
}

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

}

FileLauncher::FileLauncher(GtkFileLauncher* castitem)
:
  Glib::Object((GObject*)(castitem))
{}


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

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


FileLauncher::~FileLauncher() noexcept
{}


FileLauncher::CppClassType FileLauncher::filelauncher_class_; // initialize static member

GType FileLauncher::get_type()
{
  return filelauncher_class_.init().get_type();
}


GType FileLauncher::get_base_type()
{
  return gtk_file_launcher_get_type();
}


FileLauncher::FileLauncher(const Glib::RefPtr<Gio::File>& file)
:
  // Mark this class as non-derived to allow C++ vfuncs to be skipped.
  Glib::ObjectBase(nullptr),
  Glib::Object(Glib::ConstructParams(filelauncher_class_.init(), "file", const_cast<GFile*>(Glib::unwrap<Gio::File>(file)), nullptr))
{
  

}

Glib::RefPtr<FileLauncher> FileLauncher::create(const Glib::RefPtr<Gio::File>& file)
{
  return Glib::make_refptr_for_instance<FileLauncher>( new FileLauncher(file) );
}

Glib::RefPtr<Gio::File> FileLauncher::get_file()
{
  auto retvalue = Glib::wrap(gtk_file_launcher_get_file(gobj()));
  if(retvalue)
    retvalue->reference(); //The function does not do a ref for us.
  return retvalue;
}

Glib::RefPtr<const Gio::File> FileLauncher::get_file() const
{
  return const_cast<FileLauncher*>(this)->get_file();
}

void FileLauncher::set_file(const Glib::RefPtr<Gio::File>& file)
{
  gtk_file_launcher_set_file(gobj(), const_cast<GFile*>(Glib::unwrap<Gio::File>(file)));
}

bool FileLauncher::get_always_ask() const
{
  return gtk_file_launcher_get_always_ask(const_cast<GtkFileLauncher*>(gobj()));
}

void FileLauncher::set_always_ask(bool always_ask)
{
  gtk_file_launcher_set_always_ask(gobj(), static_cast<int>(always_ask));
}

void FileLauncher::launch(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_file_launcher_launch(const_cast<GtkFileLauncher*>(gobj()), (parent).gobj(), const_cast<GCancellable*>(Glib::unwrap(cancellable)), &Gdk::gdkmm_SignalProxy_async_callback, slot_copy);
}

void FileLauncher::launch(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_file_launcher_launch(const_cast<GtkFileLauncher*>(gobj()), nullptr, const_cast<GCancellable*>(Glib::unwrap(cancellable)), &Gdk::gdkmm_SignalProxy_async_callback, slot_copy);
}

bool FileLauncher::launch_finish(const Glib::RefPtr<Gio::AsyncResult>& result) const
{
  GError* gerror = nullptr;
  auto retvalue = gtk_file_launcher_launch_finish(const_cast<GtkFileLauncher*>(gobj()), Glib::unwrap(result), &(gerror));
  if(gerror)
    ::Glib::Error::throw_exception(gerror);
  return retvalue;
}

void FileLauncher::open_containing_folder(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_file_launcher_open_containing_folder(const_cast<GtkFileLauncher*>(gobj()), (parent).gobj(), const_cast<GCancellable*>(Glib::unwrap(cancellable)), &Gdk::gdkmm_SignalProxy_async_callback, slot_copy);
}

void FileLauncher::open_containing_folder(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_file_launcher_open_containing_folder(const_cast<GtkFileLauncher*>(gobj()), nullptr, const_cast<GCancellable*>(Glib::unwrap(cancellable)), &Gdk::gdkmm_SignalProxy_async_callback, slot_copy);
}

bool FileLauncher::open_containing_folder_finish(const Glib::RefPtr<Gio::AsyncResult>& result) const
{
  GError* gerror = nullptr;
  auto retvalue = gtk_file_launcher_open_containing_folder_finish(const_cast<GtkFileLauncher*>(gobj()), Glib::unwrap(result), &(gerror));
  if(gerror)
    ::Glib::Error::throw_exception(gerror);
  return retvalue;
}


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

Glib::PropertyProxy< Glib::RefPtr<Gio::File> > FileLauncher::property_file() 
{
  return Glib::PropertyProxy< Glib::RefPtr<Gio::File> >(this, "file");
}

Glib::PropertyProxy_ReadOnly< Glib::RefPtr<Gio::File> > FileLauncher::property_file() const
{
  return Glib::PropertyProxy_ReadOnly< Glib::RefPtr<Gio::File> >(this, "file");
}

Glib::PropertyProxy< bool > FileLauncher::property_always_ask() 
{
  return Glib::PropertyProxy< bool >(this, "always-ask");
}

Glib::PropertyProxy_ReadOnly< bool > FileLauncher::property_always_ask() const
{
  return Glib::PropertyProxy_ReadOnly< bool >(this, "always-ask");
}


} // namespace Gtk


