:right-sidebar: True DBusInterfaceSkeleton =================================================================== .. currentmodule:: gi.repository.Gio .. versionadded:: 2.30 .. class:: DBusInterfaceSkeleton(**properties: ~typing.Any) :no-contents-entry: Superclasses: :class:`~gi.repository.GObject.Object` Implemented Interfaces: :class:`~gi.repository.Gio.DBusInterface` :Constructors: :: DBusInterfaceSkeleton(**properties) Methods ------- .. rst-class:: interim-class .. class:: DBusInterfaceSkeleton :no-index: .. method:: export(connection: ~gi.repository.Gio.DBusConnection, object_path: str) -> bool Exports @``interface_`` at ``object_path`` on ``connection``. This can be called multiple times to export the same @``interface_`` onto multiple connections however the ``object_path`` provided must be the same for all connections. Use :func:`~gi.repository.Gio.DBusInterfaceSkeleton.unexport` to unexport the object. .. versionadded:: 2.30 :param connection: A :obj:`~gi.repository.Gio.DBusConnection` to export @``interface_`` on. :param object_path: The path to export the interface at. .. method:: flush() -> None If @``interface_`` has outstanding changes, request for these changes to be emitted immediately. For example, an exported D-Bus interface may queue up property changes and emit the ``org.freedesktop.DBus.Properties.PropertiesChanged`` signal later (e.g. in an idle handler). This technique is useful for collapsing multiple property changes into one. .. versionadded:: 2.30 .. method:: get_connection() -> ~gi.repository.Gio.DBusConnection | None Gets the first connection that @``interface_`` is exported on, if any. .. versionadded:: 2.30 .. method:: get_connections() -> list[~gi.repository.Gio.DBusConnection] Gets a list of the connections that @``interface_`` is exported on. .. versionadded:: 2.32 .. method:: get_flags() -> ~gi.repository.Gio.DBusInterfaceSkeletonFlags Gets the :obj:`~gi.repository.Gio.DBusInterfaceSkeletonFlags` that describes what the behavior of @``interface_`` .. versionadded:: 2.30 .. method:: get_info() -> ~gi.repository.Gio.DBusInterfaceInfo Gets D-Bus introspection information for the D-Bus interface implemented by @``interface_.`` .. versionadded:: 2.30 .. method:: get_object_path() -> str | None Gets the object path that @``interface_`` is exported on, if any. .. versionadded:: 2.30 .. method:: get_properties() -> ~gi.repository.GLib.Variant Gets all D-Bus properties for @``interface_.`` .. versionadded:: 2.30 .. method:: get_vtable() -> ~gi.repository.Gio.DBusInterfaceVTable Gets the interface vtable for the D-Bus interface implemented by @``interface_.`` The returned function pointers should expect @``interface_`` itself to be passed as ``user_data``. .. versionadded:: 2.30 .. method:: has_connection(connection: ~gi.repository.Gio.DBusConnection) -> bool Checks if @``interface_`` is exported on ``connection``. .. versionadded:: 2.32 :param connection: A :obj:`~gi.repository.Gio.DBusConnection`. .. method:: set_flags(flags: ~gi.repository.Gio.DBusInterfaceSkeletonFlags) -> None Sets flags describing what the behavior of ``skeleton`` should be. .. versionadded:: 2.30 :param flags: Flags from the :obj:`~gi.repository.Gio.DBusInterfaceSkeletonFlags` enumeration. .. method:: unexport() -> None Stops exporting @``interface_`` on all connections it is exported on. To unexport @``interface_`` from only a single connection, use :func:`~gi.repository.Gio.DBusInterfaceSkeleton.unexport_from_connection` .. versionadded:: 2.30 .. method:: unexport_from_connection(connection: ~gi.repository.Gio.DBusConnection) -> None Stops exporting @``interface_`` on ``connection``. To stop exporting on all connections the interface is exported on, use :func:`~gi.repository.Gio.DBusInterfaceSkeleton.unexport`. .. versionadded:: 2.32 :param connection: A :obj:`~gi.repository.Gio.DBusConnection`. Properties ---------- .. rst-class:: interim-class .. class:: DBusInterfaceSkeleton :no-index: .. attribute:: props.g_flags :type: ~gi.repository.Gio.DBusInterfaceSkeletonFlags Flags from the :obj:`~gi.repository.Gio.DBusInterfaceSkeletonFlags` enumeration. .. versionadded:: 2.30 Signals ------- .. rst-class:: interim-class .. class:: DBusInterfaceSkeleton.signals :no-index: .. method:: g_authorize_method(invocation: ~gi.repository.Gio.DBusMethodInvocation) -> bool Emitted when a method is invoked by a remote caller and used to determine if the method call is authorized. Note that this signal is emitted in a thread dedicated to handling the method call so handlers are allowed to perform blocking IO. This means that it is appropriate to call e.g. `polkit_authority_check_authorization_sync() `_ with the `POLKIT_CHECK_AUTHORIZATION_FLAGS_ALLOW_USER_INTERACTION `_ flag set. If :const:`False` is returned then no further handlers are run and the signal handler must take a reference to ``invocation`` and finish handling the call (e.g. return an error via :func:`~gi.repository.Gio.DBusMethodInvocation.return_error`). Otherwise, if :const:`True` is returned, signal emission continues. If no handlers return :const:`False`, then the method is dispatched. If ``interface`` has an enclosing :obj:`~gi.repository.Gio.DBusObjectSkeleton`, then the :obj:`~gi.repository.Gio.DBusObjectSkeleton`::authorize-method signal handlers run before the handlers for this signal. The default class handler just returns :const:`True`. Please note that the common case is optimized: if no signals handlers are connected and the default class handler isn't overridden (for both ``interface`` and the enclosing :obj:`~gi.repository.Gio.DBusObjectSkeleton`, if any) and :obj:`~gi.repository.Gio.DBusInterfaceSkeleton`:g-flags does not have the :const:`~gi.repository.Gio.DBusInterfaceSkeletonFlags.HANDLE_METHOD_INVOCATIONS_IN_THREAD` flags set, no dedicated thread is ever used and the call will be handled in the same thread as the object that ``interface`` belongs to was exported in. .. versionadded:: 2.30 :param invocation: A :obj:`~gi.repository.Gio.DBusMethodInvocation`. Virtual Methods --------------- .. rst-class:: interim-class .. class:: DBusInterfaceSkeleton :no-index: .. method:: do_flush() -> None If @``interface_`` has outstanding changes, request for these changes to be emitted immediately. For example, an exported D-Bus interface may queue up property changes and emit the ``org.freedesktop.DBus.Properties.PropertiesChanged`` signal later (e.g. in an idle handler). This technique is useful for collapsing multiple property changes into one. .. versionadded:: 2.30 .. method:: do_g_authorize_method(invocation: ~gi.repository.Gio.DBusMethodInvocation) -> bool Signal class handler for the :obj:`~gi.repository.Gio.DBusInterfaceSkeleton`::g-authorize-method signal. :param invocation: .. method:: do_get_info() -> ~gi.repository.Gio.DBusInterfaceInfo Gets D-Bus introspection information for the D-Bus interface implemented by @``interface_.`` .. versionadded:: 2.30 .. method:: do_get_properties() -> ~gi.repository.GLib.Variant Gets all D-Bus properties for @``interface_.`` .. versionadded:: 2.30 .. method:: do_get_vtable() -> ~gi.repository.Gio.DBusInterfaceVTable Gets the interface vtable for the D-Bus interface implemented by @``interface_.`` The returned function pointers should expect @``interface_`` itself to be passed as ``user_data``. .. versionadded:: 2.30 Fields ------ .. rst-class:: interim-class .. class:: DBusInterfaceSkeleton :no-index: .. attribute:: parent_instance .. attribute:: priv