// Generated by gtkmmproc -- DO NOT MODIFY!


#include <giomm/dbusproxy.h>
#include <giomm/private/dbusproxy_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/asyncresult.h>
#include <giomm/dbusconnection.h>
#include <giomm/dbusintrospection.h>

namespace Gio
{

DBusProxy::DBusProxy(const Glib::RefPtr<DBusConnection>& connection,
  DBusProxyFlags flags, const Glib::RefPtr<DBusInterfaceInfo>& info,
  const Glib::ustring& name, const Glib::ustring& object_path,
  const Glib::ustring& interface_name, const SlotAsyncReady& slot,
  const Glib::RefPtr<Cancellable>& cancellable)
:
// Mark this class as non-derived to allow C++ vfuncs to be skipped.
  Glib::ObjectBase(0),
  Glib::Object(Glib::ConstructParams(dbusproxy_class_.init(), "g-connection",Glib::unwrap(connection),"g-flags",static_cast<GDBusProxyFlags>(flags),"g-interface-info",Glib::unwrap(info),"name",(name.empty() ? 0 : name.c_str()),"g-object-path",(object_path.empty() ? 0 : object_path.c_str()),"g-interface-name",(interface_name.empty() ? 0 : interface_name.c_str()), static_cast<char*>(0)))
{
  init_async(slot, cancellable);
}

DBusProxy::DBusProxy(const Glib::RefPtr<DBusConnection>& connection,
  DBusProxyFlags flags, const Glib::RefPtr<DBusInterfaceInfo>& info,
  const Glib::ustring& name, const Glib::ustring& object_path,
  const Glib::ustring& interface_name,
  const Glib::RefPtr<Cancellable>& cancellable)
:
// Mark this class as non-derived to allow C++ vfuncs to be skipped.
  Glib::ObjectBase(0),
  Glib::Object(Glib::ConstructParams(dbusproxy_class_.init(), "g-connection",Glib::unwrap(connection),"g-flags",static_cast<GDBusProxyFlags>(flags),"g-interface-info",Glib::unwrap(info),"name",(name.empty() ? 0 : name.c_str()),"g-object-path",(object_path.empty() ? 0 : object_path.c_str()),"g-interface-name",(interface_name.empty() ? 0 : interface_name.c_str()), static_cast<char*>(0)))
{
  init(cancellable);
}

DBusProxy::DBusProxy(BusType bus_type, DBusProxyFlags flags,
  const Glib::RefPtr<DBusInterfaceInfo>& info, const Glib::ustring& name,
  const Glib::ustring& object_path, const Glib::ustring& interface_name,
  const SlotAsyncReady& slot, const Glib::RefPtr<Cancellable>& cancellable)
:
// Mark this class as non-derived to allow C++ vfuncs to be skipped.
  Glib::ObjectBase(0),
  Glib::Object(Glib::ConstructParams(dbusproxy_class_.init(), "g-bus-type",static_cast<GBusType>(bus_type),"g-flags",static_cast<GDBusProxyFlags>(flags),"g-interface-info",Glib::unwrap(info),"name",(name.empty() ? 0 : name.c_str()),"g-object-path",(object_path.empty() ? 0 : object_path.c_str()),"g-interface-name",(interface_name.empty() ? 0 : interface_name.c_str()), static_cast<char*>(0)))
{
  init_async(slot, cancellable);
}

DBusProxy::DBusProxy(BusType bus_type, DBusProxyFlags flags,
  const Glib::RefPtr<DBusInterfaceInfo>& info, const Glib::ustring& name,
  const Glib::ustring& object_path, const Glib::ustring& interface_name,
  const Glib::RefPtr<Cancellable>& cancellable)
:
// Mark this class as non-derived to allow C++ vfuncs to be skipped.
  Glib::ObjectBase(0),
  Glib::Object(Glib::ConstructParams(dbusproxy_class_.init(), "g-bus-type",static_cast<GBusType>(bus_type),"g-flags",static_cast<GDBusProxyFlags>(flags),"g-interface-info",Glib::unwrap(info),"name",(name.empty() ? 0 : name.c_str()),"g-object-path",(object_path.empty() ? 0 : object_path.c_str()),"g-interface-name",(interface_name.empty() ? 0 : interface_name.c_str()), static_cast<char*>(0)))
{
  init(cancellable);
}

void DBusProxy::create(const Glib::RefPtr<DBusConnection>& connection,
  DBusProxyFlags flags, const Glib::RefPtr<DBusInterfaceInfo>& info,
  const Glib::ustring& name, const Glib::ustring& object_path,
  const Glib::ustring& interface_name,
  const SlotAsyncReady& slot, const Glib::RefPtr<Cancellable>& cancellable)
{
  // Create the proxy, taking an extra reference without returning it.  The
  // extra reference is taken so the proxy is not destroyed when it goes out
  // of scope.  The finished proxy will be returned in the slot by calling
  // create_finish().
  Glib::RefPtr<DBusProxy>(new DBusProxy(connection, flags, info, name,
    object_path, interface_name, slot, cancellable))->reference();
}

Glib::RefPtr<DBusProxy>
DBusProxy::create(const Glib::RefPtr<DBusConnection>& connection,
  DBusProxyFlags flags, const Glib::RefPtr<DBusInterfaceInfo>& info,
  const Glib::ustring& name, const Glib::ustring& object_path,
  const Glib::ustring& interface_name,
  const Glib::RefPtr<Cancellable>& cancellable)
{
  return Glib::RefPtr<DBusProxy>(new DBusProxy(connection, flags, info, name,
    object_path, interface_name, cancellable));
}

void DBusProxy::create_for_bus(BusType bus_type, DBusProxyFlags flags,
  const Glib::RefPtr<DBusInterfaceInfo>& info, const Glib::ustring& name,
  const Glib::ustring& object_path, const Glib::ustring& interface_name,
  const SlotAsyncReady& slot, const Glib::RefPtr<Cancellable>& cancellable)
{
  // Create the proxy, taking an extra reference without returning it.  The
  // extra reference is taken so the proxy is not destroyed when it goes out
  // of scope.  The finished proxy will be returned in the slot by calling
  // create_finish().
  Glib::RefPtr<DBusProxy>(new DBusProxy(bus_type, flags, info, name,
    object_path, interface_name, slot, cancellable))->reference();
}

Glib::RefPtr<DBusProxy> DBusProxy::create_for_bus(BusType bus_type,
  DBusProxyFlags flags, const Glib::RefPtr<DBusInterfaceInfo>& info,
  const Glib::ustring& name, const Glib::ustring& object_path,
  const Glib::ustring& interface_name,
  const Glib::RefPtr<Cancellable>& cancellable)
{
  return Glib::RefPtr<DBusProxy>(new DBusProxy(bus_type, flags, info, name,
    object_path, interface_name, cancellable));
}

} // namespace Gio

namespace
{
} // anonymous namespace


namespace Glib
{

Glib::RefPtr<Gio::DBusProxy> wrap(GDBusProxy* object, bool take_copy)
{
  return Glib::RefPtr<Gio::DBusProxy>( dynamic_cast<Gio::DBusProxy*> (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& DBusProxy_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_ = &DBusProxy_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_proxy_get_type());

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

  }

  return *this;
}


void DBusProxy_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* DBusProxy_Class::wrap_new(GObject* object)
{
  return new DBusProxy((GDBusProxy*)object);
}


/* The implementation: */

GDBusProxy* DBusProxy::gobj_copy()
{
  reference();
  return gobj();
}

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

}

DBusProxy::DBusProxy(GDBusProxy* castitem)
:
  Glib::Object((GObject*)(castitem))
{}


DBusProxy::~DBusProxy()
{}


DBusProxy::CppClassType DBusProxy::dbusproxy_class_; // initialize static member

GType DBusProxy::get_type()
{
  return dbusproxy_class_.init().get_type();
}


GType DBusProxy::get_base_type()
{
  return g_dbus_proxy_get_type();
}


Glib::RefPtr<DBusProxy> DBusProxy::create_finish(const Glib::RefPtr<AsyncResult>& result)
{
  GError* gerror = 0;
  Glib::RefPtr<DBusProxy> retvalue = Glib::wrap(g_dbus_proxy_new_finish(Glib::unwrap(result), &(gerror)));

  if(gerror)
    ::Glib::Error::throw_exception(gerror);

  return retvalue;
}


Glib::RefPtr<DBusProxy> DBusProxy::create_for_bus_finish(const Glib::RefPtr<AsyncResult>& result)
{
  GError* gerror = 0;
  Glib::RefPtr<DBusProxy> retvalue = Glib::wrap(g_dbus_proxy_new_for_bus_finish(Glib::unwrap(result), &(gerror)));

  if(gerror)
    ::Glib::Error::throw_exception(gerror);

  return retvalue;
}


DBusProxyFlags DBusProxy::get_flags() const
{
  return ((DBusProxyFlags)(g_dbus_proxy_get_flags(const_cast<GDBusProxy*>(gobj()))));
}

Glib::RefPtr<DBusConnection> DBusProxy::get_connection()
{
  return Glib::wrap(g_dbus_proxy_get_connection(gobj()));
}

Glib::RefPtr<const DBusConnection> DBusProxy::get_connection() const
{
  return Glib::wrap(g_dbus_proxy_get_connection(const_cast<GDBusProxy*>(gobj())));
}

Glib::ustring DBusProxy::get_name() const
{
  return Glib::convert_const_gchar_ptr_to_ustring(g_dbus_proxy_get_name(const_cast<GDBusProxy*>(gobj())));
}

Glib::ustring DBusProxy::get_name_owner() const
{
  return Glib::convert_return_gchar_ptr_to_ustring(g_dbus_proxy_get_name_owner(const_cast<GDBusProxy*>(gobj())));
}

Glib::ustring DBusProxy::get_object_path() const
{
  return Glib::convert_const_gchar_ptr_to_ustring(g_dbus_proxy_get_object_path(const_cast<GDBusProxy*>(gobj())));
}

Glib::ustring DBusProxy::get_interface_name() const
{
  return Glib::convert_const_gchar_ptr_to_ustring(g_dbus_proxy_get_interface_name(const_cast<GDBusProxy*>(gobj())));
}

int DBusProxy::get_default_timeout() const
{
  return g_dbus_proxy_get_default_timeout(const_cast<GDBusProxy*>(gobj()));
}

void DBusProxy::set_default_timeout(int timeout_msec)
{
g_dbus_proxy_set_default_timeout(gobj(), timeout_msec); 
}

void DBusProxy::set_cached_property(const Glib::ustring& property_name, const Glib::VariantBase& value)
{
g_dbus_proxy_set_cached_property(gobj(), property_name.c_str(), const_cast<GVariant*>((value).gobj())); 
}

Glib::StringArrayHandle DBusProxy::get_cached_property_names() const
{
  return Glib::StringArrayHandle(g_dbus_proxy_get_cached_property_names(const_cast<GDBusProxy*>(gobj())));
}

void DBusProxy::set_interface_info(const Glib::RefPtr<DBusInterfaceInfo>& info)
{
g_dbus_proxy_set_interface_info(gobj(), Glib::unwrap(info)); 
}

Glib::RefPtr<DBusInterfaceInfo> DBusProxy::get_interface_info()
{
  return Glib::wrap(g_dbus_proxy_get_interface_info(gobj()));
}

Glib::RefPtr<const DBusInterfaceInfo> DBusProxy::get_interface_info() const
{
  return const_cast<DBusProxy*>(this)->get_interface_info();
}


} // namespace Gio


