## GDBusObjectManager

GDBusObjectManager — Base type for D-Bus object managers

## Functions

const gchar * | g_dbus_object_manager_get_object_path ()
GList * | g_dbus_object_manager_get_objects ()
GDBusObject * | g_dbus_object_manager_get_object ()
GDBusInterface * | g_dbus_object_manager_get_interface ()

## Signals

void | interface-added | Run Last
void | interface-removed | Run Last
void | object-added | Run Last
void | object-removed | Run Last

## Types and Values

| GDBusObjectManager
struct | GDBusObjectManagerIface

## Object Hierarchy

        GInterface
        ╰── GDBusObjectManager

## Prerequisites

GDBusObjectManager requires GObject.

## Known Implementations

GDBusObjectManager is implemented by GDBusObjectManagerClient and GDBusObjectManagerServer.

## Includes

    #include <gio/gio.h>

## Description

The GDBusObjectManager type is the base type for service- and client-side implementations of the standardized org.freedesktop.DBus.ObjectManager interface.

See GDBusObjectManagerClient for the client-side implementation and GDBusObjectManagerServer for the service-side implementation.

## Functions

### g_dbus_object_manager_get_object_path ()

    const gchar *
    g_dbus_object_manager_get_object_path (GDBusObjectManager *manager);

Gets the object path that `manager` is for.

#### Parameters

manager | A GDBusObjectManager. |

#### Returns

A string owned by `manager` . Do not free.

Since: 2.30

### g_dbus_object_manager_get_objects ()

    GList *
    g_dbus_object_manager_get_objects (GDBusObjectManager *manager);

Gets all GDBusObject objects known to `manager` .

#### Parameters

manager | A GDBusObjectManager. |

#### Returns

A list of GDBusObject objects. The returned list should be freed with `g_list_free()` after each element has been freed with `g_object_unref()`.

[transfer full][element-type GDBusObject]

Since: 2.30

### g_dbus_object_manager_get_object ()

    GDBusObject *
    g_dbus_object_manager_get_object (GDBusObjectManager *manager,
                                      const gchar *object_path);

Gets the GDBusObjectProxy at `object_path` , if any.

#### Parameters

manager | A GDBusObjectManager. |
object_path | Object path to lookup. |

#### Returns

A GDBusObject or `NULL`. Free with `g_object_unref()`.

[transfer full]

Since: 2.30

### g_dbus_object_manager_get_interface ()

    GDBusInterface *
    g_dbus_object_manager_get_interface (GDBusObjectManager *manager,
                                         const gchar *object_path,
                                         const gchar *interface_name);

Gets the interface proxy for `interface_name` at `object_path` , if any.

#### Parameters

manager | A GDBusObjectManager. |
object_path | Object path to lookup. |
interface_name | D-Bus interface name to lookup. |

#### Returns

A GDBusInterface instance or `NULL`. Free with `g_object_unref()`.

[transfer full]

Since: 2.30

## Types and Values

### GDBusObjectManager

    typedef struct _GDBusObjectManager GDBusObjectManager;

GDBusObjectManager is an opaque data structure and can only be accessed using the following functions.

### struct GDBusObjectManagerIface

    struct GDBusObjectManagerIface {
      GTypeInterface parent_iface;

      /* Virtual Functions */
      const gchar     *(*get_object_path) (GDBusObjectManager    *manager);
      GList           *(*get_objects)     (GDBusObjectManager    *manager);
      GDBusObject     *(*get_object)      (GDBusObjectManager    *manager,
                                           const gchar           *object_path);
      GDBusInterface  *(*get_interface)   (GDBusObjectManager    *manager,
                                           const gchar           *object_path,
                                           const gchar           *interface_name);

      /* Signals */
      void    (*object_added)                 (GDBusObjectManager   *manager,
                                               GDBusObject          *object);
      void    (*object_removed)               (GDBusObjectManager   *manager,
                                               GDBusObject          *object);

      void    (*interface_added)              (GDBusObjectManager   *manager,
                                               GDBusObject          *object,
                                               GDBusInterface       *interface_);
      void    (*interface_removed)            (GDBusObjectManager   *manager,
                                               GDBusObject          *object,
                                               GDBusInterface       *interface_);
    };

Base type for D-Bus object managers.

#### Members

GTypeInterface `parent_iface`; | The parent interface. |
`get_object_path` () | Virtual function for `g_dbus_object_manager_get_object_path()`. |
`get_objects` () | Virtual function for `g_dbus_object_manager_get_objects()`. |
`get_object` () | Virtual function for `g_dbus_object_manager_get_object()`. |
`get_interface` () | Virtual function for `g_dbus_object_manager_get_interface()`. |
`object_added` () | Signal handler for the “object-added” signal. |
`object_removed` () | Signal handler for the “object-removed” signal. |
`interface_added` () | Signal handler for the “interface-added” signal. |
`interface_removed` () | Signal handler for the “interface-removed” signal. |

Since: 2.30

## Signal Details

### The `“interface-added”` signal

    void
    user_function (GDBusObjectManager *manager,
                   GDBusObject        *object,
                   GDBusInterface     *interface,
                   gpointer            user_data)

Emitted when `interface` is added to `object` .

This signal exists purely as a convenience to avoid having to connect signals to all objects managed by `manager` .

#### Parameters

manager | The GDBusObjectManager emitting the signal. |
object | The GDBusObject on which an interface was added. |
interface | The GDBusInterface that was added. |
user_data | user data set when the signal handler was connected. |

Flags: Run Last

Since: 2.30

### The `“interface-removed”` signal

    void
    user_function (GDBusObjectManager *manager,
                   GDBusObject        *object,
                   GDBusInterface     *interface,
                   gpointer            user_data)

Emitted when `interface` has been removed from `object` .

This signal exists purely as a convenience to avoid having to connect signals to all objects managed by `manager` .

#### Parameters

manager | The GDBusObjectManager emitting the signal. |
object | The GDBusObject on which an interface was removed. |
interface | The GDBusInterface that was removed. |
user_data | user data set when the signal handler was connected. |

Flags: Run Last

Since: 2.30

### The `“object-added”` signal

    void
    user_function (GDBusObjectManager *manager,
                   GDBusObject        *object,
                   gpointer            user_data)

Emitted when `object` is added to `manager` .

#### Parameters

manager | The GDBusObjectManager emitting the signal. |
object | The GDBusObject that was added. |
user_data | user data set when the signal handler was connected. |

Flags: Run Last

Since: 2.30

### The `“object-removed”` signal

    void
    user_function (GDBusObjectManager *manager,
                   GDBusObject        *object,
                   gpointer            user_data)

Emitted when `object` is removed from `manager` .

#### Parameters

manager | The GDBusObjectManager emitting the signal. |
object | The GDBusObject that was removed. |
user_data | user data set when the signal handler was connected. |

Flags: Run Last

Since: 2.30