gdbusobjectmanager.h 4.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. /* GDBus - GLib D-Bus Library
  2. *
  3. * Copyright (C) 2008-2010 Red Hat, Inc.
  4. *
  5. * This library is free software; you can redistribute it and/or
  6. * modify it under the terms of the GNU Lesser General Public
  7. * License as published by the Free Software Foundation; either
  8. * version 2 of the License, or (at your option) any later version.
  9. *
  10. * This library is distributed in the hope that it will be useful,
  11. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  13. * Lesser General Public License for more details.
  14. *
  15. * You should have received a copy of the GNU Lesser General
  16. * Public License along with this library; if not, see <http://www.gnu.org/licenses/>.
  17. *
  18. * Author: David Zeuthen <[email protected]>
  19. */
  20. #ifndef __G_DBUS_OBJECT_MANAGER_H__
  21. #define __G_DBUS_OBJECT_MANAGER_H__
  22. #include <gio/giotypes.h>
  23. G_BEGIN_DECLS
  24. #define G_TYPE_DBUS_OBJECT_MANAGER (g_dbus_object_manager_get_type())
  25. #define G_DBUS_OBJECT_MANAGER(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), G_TYPE_DBUS_OBJECT_MANAGER, GDBusObjectManager))
  26. #define G_IS_DBUS_OBJECT_MANAGER(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), G_TYPE_DBUS_OBJECT_MANAGER))
  27. #define G_DBUS_OBJECT_MANAGER_GET_IFACE(o) (G_TYPE_INSTANCE_GET_INTERFACE((o), G_TYPE_DBUS_OBJECT_MANAGER, GDBusObjectManagerIface))
  28. typedef struct _GDBusObjectManagerIface GDBusObjectManagerIface;
  29. /**
  30. * GDBusObjectManagerIface:
  31. * @parent_iface: The parent interface.
  32. * @get_object_path: Virtual function for g_dbus_object_manager_get_object_path().
  33. * @get_objects: Virtual function for g_dbus_object_manager_get_objects().
  34. * @get_object: Virtual function for g_dbus_object_manager_get_object().
  35. * @get_interface: Virtual function for g_dbus_object_manager_get_interface().
  36. * @object_added: Signal handler for the #GDBusObjectManager::object-added signal.
  37. * @object_removed: Signal handler for the #GDBusObjectManager::object-removed signal.
  38. * @interface_added: Signal handler for the #GDBusObjectManager::interface-added signal.
  39. * @interface_removed: Signal handler for the #GDBusObjectManager::interface-removed signal.
  40. *
  41. * Base type for D-Bus object managers.
  42. *
  43. * Since: 2.30
  44. */
  45. struct _GDBusObjectManagerIface
  46. {
  47. GTypeInterface parent_iface;
  48. /* Virtual Functions */
  49. const gchar *(*get_object_path) (GDBusObjectManager *manager);
  50. GList *(*get_objects) (GDBusObjectManager *manager);
  51. GDBusObject *(*get_object) (GDBusObjectManager *manager,
  52. const gchar *object_path);
  53. GDBusInterface *(*get_interface) (GDBusObjectManager *manager,
  54. const gchar *object_path,
  55. const gchar *interface_name);
  56. /* Signals */
  57. void (*object_added) (GDBusObjectManager *manager,
  58. GDBusObject *object);
  59. void (*object_removed) (GDBusObjectManager *manager,
  60. GDBusObject *object);
  61. void (*interface_added) (GDBusObjectManager *manager,
  62. GDBusObject *object,
  63. GDBusInterface *interface_);
  64. void (*interface_removed) (GDBusObjectManager *manager,
  65. GDBusObject *object,
  66. GDBusInterface *interface_);
  67. };
  68. GLIB_AVAILABLE_IN_ALL
  69. GType g_dbus_object_manager_get_type (void) G_GNUC_CONST;
  70. GLIB_AVAILABLE_IN_ALL
  71. const gchar *g_dbus_object_manager_get_object_path (GDBusObjectManager *manager);
  72. GLIB_AVAILABLE_IN_ALL
  73. GList *g_dbus_object_manager_get_objects (GDBusObjectManager *manager);
  74. GLIB_AVAILABLE_IN_ALL
  75. GDBusObject *g_dbus_object_manager_get_object (GDBusObjectManager *manager,
  76. const gchar *object_path);
  77. GLIB_AVAILABLE_IN_ALL
  78. GDBusInterface *g_dbus_object_manager_get_interface (GDBusObjectManager *manager,
  79. const gchar *object_path,
  80. const gchar *interface_name);
  81. G_END_DECLS
  82. #endif /* __G_DBUS_OBJECT_MANAGER_H__ */