Copyright | Will Thompson, Iñaki García Etxebarria and Jonas Platte |
---|---|
License | LGPL-2.1 |
Maintainer | Iñaki García Etxebarria (garetxe@gmail.com) |
Safe Haskell | None |
Language | Haskell2010 |
Instances of the DBusMethodInvocation
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 DBusMethodInvocation
object is to receive
it as an argument to the handle_method_call()
function in a
DBusInterfaceVTable
that was passed to g_dbus_connection_register_object()
.
- newtype DBusMethodInvocation = DBusMethodInvocation (ManagedPtr DBusMethodInvocation)
- class GObject o => IsDBusMethodInvocation o
- toDBusMethodInvocation :: IsDBusMethodInvocation o => o -> IO DBusMethodInvocation
- noDBusMethodInvocation :: Maybe DBusMethodInvocation
- data DBusMethodInvocationGetConnectionMethodInfo
- dBusMethodInvocationGetConnection :: (HasCallStack, MonadIO m, IsDBusMethodInvocation a) => a -> m DBusConnection
- data DBusMethodInvocationGetInterfaceNameMethodInfo
- dBusMethodInvocationGetInterfaceName :: (HasCallStack, MonadIO m, IsDBusMethodInvocation a) => a -> m Text
- data DBusMethodInvocationGetMessageMethodInfo
- dBusMethodInvocationGetMessage :: (HasCallStack, MonadIO m, IsDBusMethodInvocation a) => a -> m DBusMessage
- data DBusMethodInvocationGetMethodInfoMethodInfo
- dBusMethodInvocationGetMethodInfo :: (HasCallStack, MonadIO m, IsDBusMethodInvocation a) => a -> m DBusMethodInfo
- data DBusMethodInvocationGetMethodNameMethodInfo
- dBusMethodInvocationGetMethodName :: (HasCallStack, MonadIO m, IsDBusMethodInvocation a) => a -> m Text
- data DBusMethodInvocationGetObjectPathMethodInfo
- dBusMethodInvocationGetObjectPath :: (HasCallStack, MonadIO m, IsDBusMethodInvocation a) => a -> m Text
- data DBusMethodInvocationGetParametersMethodInfo
- dBusMethodInvocationGetParameters :: (HasCallStack, MonadIO m, IsDBusMethodInvocation a) => a -> m GVariant
- data DBusMethodInvocationGetPropertyInfoMethodInfo
- dBusMethodInvocationGetPropertyInfo :: (HasCallStack, MonadIO m, IsDBusMethodInvocation a) => a -> m DBusPropertyInfo
- data DBusMethodInvocationGetSenderMethodInfo
- dBusMethodInvocationGetSender :: (HasCallStack, MonadIO m, IsDBusMethodInvocation a) => a -> m Text
- data DBusMethodInvocationReturnDbusErrorMethodInfo
- dBusMethodInvocationReturnDbusError :: (HasCallStack, MonadIO m, IsDBusMethodInvocation a) => a -> Text -> Text -> m ()
- data DBusMethodInvocationReturnErrorLiteralMethodInfo
- dBusMethodInvocationReturnErrorLiteral :: (HasCallStack, MonadIO m, IsDBusMethodInvocation a) => a -> Word32 -> Int32 -> Text -> m ()
- data DBusMethodInvocationReturnGerrorMethodInfo
- dBusMethodInvocationReturnGerror :: (HasCallStack, MonadIO m, IsDBusMethodInvocation a) => a -> GError -> m ()
- data DBusMethodInvocationReturnValueMethodInfo
- dBusMethodInvocationReturnValue :: (HasCallStack, MonadIO m, IsDBusMethodInvocation a) => a -> Maybe GVariant -> m ()
- data DBusMethodInvocationReturnValueWithUnixFdListMethodInfo
- dBusMethodInvocationReturnValueWithUnixFdList :: (HasCallStack, MonadIO m, IsDBusMethodInvocation a, IsUnixFDList b) => a -> Maybe GVariant -> Maybe b -> m ()
Exported types
newtype DBusMethodInvocation Source #
GObject DBusMethodInvocation Source # | |
IsObject DBusMethodInvocation Source # | |
IsDBusMethodInvocation DBusMethodInvocation Source # | |
((~) * info (ResolveDBusMethodInvocationMethod t DBusMethodInvocation), MethodInfo * info DBusMethodInvocation p) => IsLabel t (DBusMethodInvocation -> p) Source # | |
((~) * info (ResolveDBusMethodInvocationMethod t DBusMethodInvocation), MethodInfo * info DBusMethodInvocation p) => IsLabelProxy t (DBusMethodInvocation -> p) Source # | |
HasAttributeList * DBusMethodInvocation Source # | |
type AttributeList DBusMethodInvocation Source # | |
type SignalList DBusMethodInvocation Source # | |
class GObject o => IsDBusMethodInvocation o Source #
Methods
getConnection
data DBusMethodInvocationGetConnectionMethodInfo Source #
((~) * signature (m DBusConnection), MonadIO m, IsDBusMethodInvocation a) => MethodInfo * DBusMethodInvocationGetConnectionMethodInfo a signature Source # | |
dBusMethodInvocationGetConnection Source #
:: (HasCallStack, MonadIO m, IsDBusMethodInvocation a) | |
=> a |
|
-> m DBusConnection | Returns: A |
Gets the DBusConnection
the method was invoked on.
Since: 2.26
getInterfaceName
data DBusMethodInvocationGetInterfaceNameMethodInfo Source #
((~) * signature (m Text), MonadIO m, IsDBusMethodInvocation a) => MethodInfo * DBusMethodInvocationGetInterfaceNameMethodInfo a signature Source # | |
dBusMethodInvocationGetInterfaceName Source #
:: (HasCallStack, MonadIO m, IsDBusMethodInvocation a) | |
=> a |
|
-> m Text | Returns: A string. Do not free, it is owned by |
Gets the name of the D-Bus interface the method was invoked on.
If this method call is a property Get, Set or GetAll call that has
been redirected to the method call handler then
"org.freedesktop.DBus.Properties" will be returned. See
DBusInterfaceVTable
for more information.
Since: 2.26
getMessage
data DBusMethodInvocationGetMessageMethodInfo Source #
((~) * signature (m DBusMessage), MonadIO m, IsDBusMethodInvocation a) => MethodInfo * DBusMethodInvocationGetMessageMethodInfo a signature Source # | |
dBusMethodInvocationGetMessage Source #
:: (HasCallStack, MonadIO m, IsDBusMethodInvocation a) | |
=> a |
|
-> m DBusMessage | Returns: |
Gets the DBusMessage
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.
See this [server][gdbus-server] and [client][gdbus-unix-fd-client] for an example of how to use this low-level API to send and receive UNIX file descriptors.
Since: 2.26
getMethodInfo
data DBusMethodInvocationGetMethodInfoMethodInfo Source #
((~) * signature (m DBusMethodInfo), MonadIO m, IsDBusMethodInvocation a) => MethodInfo * DBusMethodInvocationGetMethodInfoMethodInfo a signature Source # | |
dBusMethodInvocationGetMethodInfo Source #
:: (HasCallStack, MonadIO m, IsDBusMethodInvocation a) | |
=> a |
|
-> m DBusMethodInfo | Returns: A |
Gets information about the method call, if any.
If this method invocation is a property Get, Set or GetAll call that
has been redirected to the method call handler then Nothing
will be
returned. See dBusMethodInvocationGetPropertyInfo
and
DBusInterfaceVTable
for more information.
Since: 2.26
getMethodName
data DBusMethodInvocationGetMethodNameMethodInfo Source #
((~) * signature (m Text), MonadIO m, IsDBusMethodInvocation a) => MethodInfo * DBusMethodInvocationGetMethodNameMethodInfo a signature Source # | |
dBusMethodInvocationGetMethodName Source #
:: (HasCallStack, MonadIO m, IsDBusMethodInvocation a) | |
=> a |
|
-> m Text | Returns: A string. Do not free, it is owned by |
Gets the name of the method that was invoked.
Since: 2.26
getObjectPath
data DBusMethodInvocationGetObjectPathMethodInfo Source #
((~) * signature (m Text), MonadIO m, IsDBusMethodInvocation a) => MethodInfo * DBusMethodInvocationGetObjectPathMethodInfo a signature Source # | |
dBusMethodInvocationGetObjectPath Source #
:: (HasCallStack, MonadIO m, IsDBusMethodInvocation a) | |
=> a |
|
-> m Text | Returns: A string. Do not free, it is owned by |
Gets the object path the method was invoked on.
Since: 2.26
getParameters
data DBusMethodInvocationGetParametersMethodInfo Source #
((~) * signature (m GVariant), MonadIO m, IsDBusMethodInvocation a) => MethodInfo * DBusMethodInvocationGetParametersMethodInfo a signature Source # | |
dBusMethodInvocationGetParameters Source #
:: (HasCallStack, MonadIO m, IsDBusMethodInvocation a) | |
=> a |
|
-> m GVariant | Returns: A |
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.
Since: 2.26
getPropertyInfo
data DBusMethodInvocationGetPropertyInfoMethodInfo Source #
((~) * signature (m DBusPropertyInfo), MonadIO m, IsDBusMethodInvocation a) => MethodInfo * DBusMethodInvocationGetPropertyInfoMethodInfo a signature Source # | |
dBusMethodInvocationGetPropertyInfo Source #
:: (HasCallStack, MonadIO m, IsDBusMethodInvocation a) | |
=> a |
|
-> m DBusPropertyInfo | Returns: a |
Gets information about the property that this method call is for, if any.
This will only be set in the case of an invocation in response to a
property Get or Set call that has been directed to the method call
handler for an object on account of its property_get()
or
property_set()
vtable pointers being unset.
See DBusInterfaceVTable
for more information.
If the call was GetAll, Nothing
will be returned.
Since: 2.38
getSender
data DBusMethodInvocationGetSenderMethodInfo Source #
((~) * signature (m Text), MonadIO m, IsDBusMethodInvocation a) => MethodInfo * DBusMethodInvocationGetSenderMethodInfo a signature Source # | |
dBusMethodInvocationGetSender Source #
:: (HasCallStack, MonadIO m, IsDBusMethodInvocation a) | |
=> a |
|
-> m Text | Returns: A string. Do not free, it is owned by |
Gets the bus name that invoked the method.
Since: 2.26
returnDbusError
data DBusMethodInvocationReturnDbusErrorMethodInfo Source #
((~) * signature (Text -> Text -> m ()), MonadIO m, IsDBusMethodInvocation a) => MethodInfo * DBusMethodInvocationReturnDbusErrorMethodInfo a signature Source # | |
dBusMethodInvocationReturnDbusError Source #
:: (HasCallStack, MonadIO m, IsDBusMethodInvocation a) | |
=> a |
|
-> Text |
|
-> Text |
|
-> m () |
Finishes handling a D-Bus method call by returning an error.
This method will free invocation
, you cannot use it afterwards.
Since: 2.26
returnErrorLiteral
data DBusMethodInvocationReturnErrorLiteralMethodInfo Source #
((~) * signature (Word32 -> Int32 -> Text -> m ()), MonadIO m, IsDBusMethodInvocation a) => MethodInfo * DBusMethodInvocationReturnErrorLiteralMethodInfo a signature Source # | |
dBusMethodInvocationReturnErrorLiteral Source #
:: (HasCallStack, MonadIO m, IsDBusMethodInvocation a) | |
=> a |
|
-> Word32 |
|
-> Int32 |
|
-> Text |
|
-> m () |
Like g_dbus_method_invocation_return_error()
but without printf()
-style formatting.
This method will free invocation
, you cannot use it afterwards.
Since: 2.26
returnGerror
data DBusMethodInvocationReturnGerrorMethodInfo Source #
((~) * signature (GError -> m ()), MonadIO m, IsDBusMethodInvocation a) => MethodInfo * DBusMethodInvocationReturnGerrorMethodInfo a signature Source # | |
dBusMethodInvocationReturnGerror Source #
:: (HasCallStack, MonadIO m, IsDBusMethodInvocation a) | |
=> a |
|
-> GError |
|
-> m () |
Like g_dbus_method_invocation_return_error()
but takes a GError
instead of the error domain, error code and message.
This method will free invocation
, you cannot use it afterwards.
Since: 2.26
returnValue
data DBusMethodInvocationReturnValueMethodInfo Source #
((~) * signature (Maybe GVariant -> m ()), MonadIO m, IsDBusMethodInvocation a) => MethodInfo * DBusMethodInvocationReturnValueMethodInfo a signature Source # | |
dBusMethodInvocationReturnValue Source #
:: (HasCallStack, MonadIO m, IsDBusMethodInvocation a) | |
=> a |
|
-> Maybe GVariant |
|
-> m () |
Finishes handling a D-Bus method call by returning parameters
.
If the parameters
GVariant is floating, it is consumed.
It is an error if parameters
is not of the right format.
This method will free invocation
, you cannot use it afterwards.
Since 2.48, if the method call requested for a reply not to be sent
then this call will sink parameters
and free invocation
, but
otherwise do nothing (as per the recommendations of the D-Bus
specification).
Since: 2.26
returnValueWithUnixFdList
data DBusMethodInvocationReturnValueWithUnixFdListMethodInfo Source #
((~) * signature (Maybe GVariant -> Maybe b -> m ()), MonadIO m, IsDBusMethodInvocation a, IsUnixFDList b) => MethodInfo * DBusMethodInvocationReturnValueWithUnixFdListMethodInfo a signature Source # | |
dBusMethodInvocationReturnValueWithUnixFdList Source #
:: (HasCallStack, MonadIO m, IsDBusMethodInvocation a, IsUnixFDList b) | |
=> a |
|
-> Maybe GVariant |
|
-> Maybe b |
|
-> m () |
Like dBusMethodInvocationReturnValue
but also takes a UnixFDList
.
This method is only available on UNIX.
This method will free invocation
, you cannot use it afterwards.
Since: 2.30