// -*- 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>

_DEFS(giomm,gio)
_PINCLUDE(glibmm/private/object_p.h)

namespace Gio
{

namespace DBus
{

_WRAP_ENUM(PropertyInfoFlags, GDBusPropertyInfoFlags, s#^DBUS_##, NO_GTYPE)

/** Stores information about an annotation.
 *
 * @newin{2,28}
 * @ingroup DBus
 */
class AnnotationInfo
{
  _CLASS_OPAQUE_REFCOUNTED(AnnotationInfo, GDBusAnnotationInfo, NONE, g_dbus_annotation_info_ref, g_dbus_annotation_info_unref)

public:
#m4 _CONVERSION(`const Glib::ArrayHandle< Glib::RefPtr<AnnotationInfo> >&', `GDBusAnnotationInfo**', `const_cast<GDBusAnnotationInfo**>($3.data())')
  _WRAP_METHOD(static Glib::ustring info_lookup(const Glib::ArrayHandle< Glib::RefPtr<AnnotationInfo> >& annotations, const Glib::ustring& name), g_dbus_annotation_info_lookup)
};

/** ArgInfo - Stores information about an argument for a method or a
 * signal.
 *
 * @newin{2,28}
 * @ingroup DBus
 */
class ArgInfo
{
  _CLASS_OPAQUE_REFCOUNTED(ArgInfo, GDBusArgInfo, NONE, g_dbus_arg_info_ref, g_dbus_arg_info_unref)

public:
};

/** Stores information about a method on an D-Bus interface.
 *
 * @newin{2,28}
 * @ingroup DBus
 */
class MethodInfo
{
  _CLASS_OPAQUE_REFCOUNTED(MethodInfo, GDBusMethodInfo, NONE, g_dbus_method_info_ref, g_dbus_method_info_unref)

public:
};

/** Stores information about a signal on a D-Bus interface.
 *
 * @newin{2,28}
 * @ingroup DBus
 */
class SignalInfo
{
  _CLASS_OPAQUE_REFCOUNTED(SignalInfo, GDBusSignalInfo, NONE, g_dbus_signal_info_ref, g_dbus_signal_info_unref)

public:
};

/** Stores information about a property on a D-Bus interface.
 *
 * @newin{2,28}
 * @ingroup DBus
 */
class PropertyInfo
{
  _CLASS_OPAQUE_REFCOUNTED(PropertyInfo, GDBusPropertyInfo, NONE, g_dbus_property_info_ref, g_dbus_property_info_unref)

public:
};

/** Stores information about a D-Bus interface.
 *
 * @newin{2,28}
 * @ingroup DBus
 */
class InterfaceInfo
{
  _CLASS_OPAQUE_REFCOUNTED(InterfaceInfo, GDBusInterfaceInfo, NONE, g_dbus_interface_info_ref, g_dbus_interface_info_unref)

public:
  _WRAP_METHOD(Glib::RefPtr<MethodInfo> lookup_method(const Glib::ustring& name), g_dbus_interface_info_lookup_method, refreturn)
  _WRAP_METHOD(Glib::RefPtr<const MethodInfo> lookup_method(const Glib::ustring& name) const, g_dbus_interface_info_lookup_method, constversion, refreturn)

  _WRAP_METHOD(Glib::RefPtr<SignalInfo> lookup_signal(const Glib::ustring& name), g_dbus_interface_info_lookup_signal, refreturn)
  _WRAP_METHOD(Glib::RefPtr<const SignalInfo> lookup_signal(const Glib::ustring& name) const, g_dbus_interface_info_lookup_signal, constversion, refreturn)

  _WRAP_METHOD(Glib::RefPtr<PropertyInfo> lookup_property(const Glib::ustring& name), g_dbus_interface_info_lookup_property, refreturn)
  _WRAP_METHOD(Glib::RefPtr<const PropertyInfo> lookup_property(const Glib::ustring& name) const, g_dbus_interface_info_lookup_property, constversion, refreturn)

  //TODO: _WRAP_METHOD(void generate_xml(guint indent, GString* string_builder), g_dbus_interface_info_generate_xml)
};

/** NodeInfo - Stores information about nodes in a remote object
 * hierarchy.
 *
 * @newin{2,28}
 * @ingroup DBus
 */
class NodeInfo
{
  _CLASS_OPAQUE_REFCOUNTED(NodeInfo, GDBusNodeInfo, NONE, g_dbus_node_info_ref, g_dbus_node_info_unref)

public:
  _WRAP_METHOD_DOCS_ONLY(g_dbus_node_info_new_for_xml)
  /// @throw Glib::Error.
  _WRAP_METHOD(static Glib::RefPtr<NodeInfo> create_for_xml(const Glib::ustring& xml_data), g_dbus_node_info_new_for_xml, errthrow)

  _WRAP_METHOD(Glib::RefPtr<InterfaceInfo> lookup_interface(const Glib::ustring& name), g_dbus_node_info_lookup_interface, refreturn)
  _WRAP_METHOD(Glib::RefPtr<const InterfaceInfo> lookup_interface(const Glib::ustring& name) const, g_dbus_node_info_lookup_interface, constversion, refreturn)
 
  //TODO: Documentation: 
  Glib::RefPtr<InterfaceInfo> lookup_interface();

  //TODO: Documentation:
  Glib::RefPtr<const InterfaceInfo> lookup_interface() const;
  
  //TODO: _WRAP_METHOD(void generate_xml(guint indent, GString* string_builder), g_dbus_node_info_generate_xml)
};

} //namespace DBus

} // namespace Gio
