DBusMethodInvocation

open class DBusMethodInvocation(pointer: <Error class: unknown class><<Error class: unknown class>>)

Instances of the GDBusMethodInvocation class are used when handling D-Bus method calls. It provides a way to asynchronously return results and errors.

The normal way to obtain a GDBusMethodInvocation object is to receive it as an argument to the handle_method_call() function in a type@Gio.DBusInterfaceVTable that was passed to method@Gio.DBusConnection.register_object.

Since

2.26

Constructors

Link copied to clipboard
constructor(pointer: <Error class: unknown class><<Error class: unknown class>>)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
val gioDBusMethodInvocationPointer: <Error class: unknown class><<Error class: unknown class>>

Functions

Link copied to clipboard

Gets the #GDBusConnection the method was invoked on.

Link copied to clipboard

Gets the name of the D-Bus interface the method was invoked on.

Link copied to clipboard

Gets the #GDBusMessage for the method invocation. This is useful if you need to use low-level protocol features, such as UNIX file descriptor passing, that cannot be properly expressed in the #GVariant API.

Link copied to clipboard

Gets information about the method call, if any.

Link copied to clipboard
open fun getMethodName(): String

Gets the name of the method that was invoked.

Link copied to clipboard
open fun getObjectPath(): String

Gets the object path the method was invoked on.

Link copied to clipboard
open fun getParameters(): <Error class: unknown class>

Gets the parameters of the method invocation. If there are no input parameters then this will return a GVariant with 0 children rather than NULL.

Link copied to clipboard

Gets information about the property that this method call is for, if any.

Link copied to clipboard
open fun getSender(): String

Gets the bus name that invoked the method.

Link copied to clipboard
open fun returnDbusError(errorName: String, errorMessage: String)

Finishes handling a D-Bus method call by returning an error.

Link copied to clipboard
open fun returnErrorLiteral(domain: <Error class: unknown class>, code: Int, message: String)

Like g_dbus_method_invocation_return_error() but without printf()-style formatting.

Link copied to clipboard
open fun returnGerror(error: <Error class: unknown class>)

Like g_dbus_method_invocation_return_error() but takes a #GError instead of the error domain, error code and message.

Link copied to clipboard
open fun returnValue(parameters: <Error class: unknown class>? = null)

Finishes handling a D-Bus method call by returning @parameters. If the @parameters GVariant is floating, it is consumed.

Link copied to clipboard
open fun returnValueWithUnixFdList(parameters: <Error class: unknown class>? = null, fdList: UnixFDList? = null)

Like g_dbus_method_invocation_return_value() but also takes a #GUnixFDList.