gdbusobjectmanager.h 4.4 KB

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