// Generated by gtkmmproc -- DO NOT MODIFY!


#include <giomm/dbusmethodinvocation.h>
#include <giomm/private/dbusmethodinvocation_p.h>

// -*- Mode: C++; indent-tabs-mode: nil; c-basic-offset: 2 -*-

/* Copyright (C) 2010 The giomm 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, write to the Free
 * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 */

#include <gio/gio.h>
#include <giomm/dbusconnection.h>
#include <giomm/dbusmessage.h>
#include <giomm/dbusintrospection.h>

namespace Gio
{

void DBusMethodInvocation::get_parameters(Glib::VariantBase& value) const
{
  GVariant* const g_value = g_dbus_method_invocation_get_parameters(const_cast<GDBusMethodInvocation*>(gobj()));

  if(!g_value)
    return;

  value.init(g_value, true /* take a reference */);
}

} // namespace Gio

namespace
{
} // anonymous namespace


namespace Glib
{

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

} /* namespace Glib */


namespace Gio
{


/* The *_Class implementation: */

const Glib::Class& DBusMethodInvocation_Class::init()
{
  if(!gtype_) // create the GType if necessary
  {
    // Glib::Class has to know the class init function to clone custom types.
    class_init_func_ = &DBusMethodInvocation_Class::class_init_function;

    // This is actually just optimized away, apparently with no harm.
    // Make sure that the parent type has been created.
    //CppClassParent::CppObjectType::get_type();

    // Create the wrapper type, with the same class/instance size as the base type.
    register_derived_type(g_dbus_method_invocation_get_type());

    // Add derived versions of interfaces, if the C type implements any interfaces:

  }

  return *this;
}


void DBusMethodInvocation_Class::class_init_function(void* g_class, void* class_data)
{
  BaseClassType *const klass = static_cast<BaseClassType*>(g_class);
  CppClassParent::class_init_function(klass, class_data);


}


Glib::ObjectBase* DBusMethodInvocation_Class::wrap_new(GObject* object)
{
  return new DBusMethodInvocation((GDBusMethodInvocation*)object);
}


/* The implementation: */

GDBusMethodInvocation* DBusMethodInvocation::gobj_copy()
{
  reference();
  return gobj();
}

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

}

DBusMethodInvocation::DBusMethodInvocation(GDBusMethodInvocation* castitem)
:
  Glib::Object((GObject*)(castitem))
{}


DBusMethodInvocation::~DBusMethodInvocation()
{}


DBusMethodInvocation::CppClassType DBusMethodInvocation::dbusmethodinvocation_class_; // initialize static member

GType DBusMethodInvocation::get_type()
{
  return dbusmethodinvocation_class_.init().get_type();
}


GType DBusMethodInvocation::get_base_type()
{
  return g_dbus_method_invocation_get_type();
}


Glib::ustring DBusMethodInvocation::get_sender() const
{
  return Glib::convert_const_gchar_ptr_to_ustring(g_dbus_method_invocation_get_sender(const_cast<GDBusMethodInvocation*>(gobj())));
}

Glib::ustring DBusMethodInvocation::get_object_path() const
{
  return Glib::convert_const_gchar_ptr_to_ustring(g_dbus_method_invocation_get_object_path(const_cast<GDBusMethodInvocation*>(gobj())));
}

Glib::ustring DBusMethodInvocation::get_interface_name() const
{
  return Glib::convert_const_gchar_ptr_to_ustring(g_dbus_method_invocation_get_interface_name(const_cast<GDBusMethodInvocation*>(gobj())));
}

Glib::ustring DBusMethodInvocation::get_method_name() const
{
  return Glib::convert_const_gchar_ptr_to_ustring(g_dbus_method_invocation_get_method_name(const_cast<GDBusMethodInvocation*>(gobj())));
}

Glib::RefPtr<const DBusMethodInfo> DBusMethodInvocation::get_method_info() const
{
  return Glib::wrap(const_cast<GDBusMethodInfo*>(g_dbus_method_invocation_get_method_info(const_cast<GDBusMethodInvocation*>(gobj()))));
}

Glib::RefPtr<DBusConnection> DBusMethodInvocation::get_connection()
{
  return Glib::wrap(g_dbus_method_invocation_get_connection(gobj()));
}

Glib::RefPtr<const DBusConnection> DBusMethodInvocation::get_connection() const
{
  return const_cast<DBusMethodInvocation*>(this)->get_connection();
}

Glib::RefPtr<DBusMessage> DBusMethodInvocation::get_message()
{
  return Glib::wrap(g_dbus_method_invocation_get_message(gobj()));
}

Glib::RefPtr<const DBusMessage> DBusMethodInvocation::get_message() const
{
  return const_cast<DBusMethodInvocation*>(this)->get_message();
}

void DBusMethodInvocation::return_value(const Glib::VariantBase& parameters)
{
g_dbus_method_invocation_return_value(gobj(), const_cast<GVariant*>((parameters).gobj())); 
}

void DBusMethodInvocation::return_error_literal(const Glib::ustring& domain, int code, const Glib::ustring& message)
{
g_dbus_method_invocation_return_error_literal(gobj(), Glib::QueryQuark(domain).id(), code, message.c_str()); 
}

void DBusMethodInvocation::return_gerror(const Glib::Error& error)
{
g_dbus_method_invocation_return_gerror(gobj(), error.gobj()); 
}

void DBusMethodInvocation::return_dbus_error(const Glib::ustring& error_name, const Glib::ustring& error_message)
{
g_dbus_method_invocation_return_dbus_error(gobj(), error_name.c_str(), error_message.c_str()); 
}


} // namespace Gio


