-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/
-- | D-Bus client libraries
--
-- D-Bus client libraries
@package dbus-client
@version 0.3
module DBus.Client
-- | Clients are opaque handles to an open connection and other
-- internal state.
data Client
clientName :: Client -> BusName
-- | Create a new Client from an open connection and bus name. The
-- weird
mkClient :: (Connection, BusName) -> IO Client
-- | Perform an asynchronous method call. One of the provided computations
-- will be performed depending on what message type the destination sends
-- back.
call :: Client -> MethodCall -> (Error -> IO ()) -> (MethodReturn -> IO ()) -> IO ()
-- | Similar to call, except that it waits for the reply and returns
-- it in the current IO thread.
callBlocking :: Client -> MethodCall -> IO (Either Error MethodReturn)
-- | Similar to callBlocking, except that an exception is raised if
-- the destination sends back an error.
callBlocking_ :: Client -> MethodCall -> IO MethodReturn
emitSignal :: Client -> Signal -> IO ()
-- | A client can request a "well-known" name from the bus. This allows
-- messages sent to that name to be received by the client, without
-- senders being aware of which application is actually handling
-- requests.
--
-- A name may be requested for any client, using the given flags. The
-- bus's reply will be returned, or an exception raised if the reply was
-- invalid.
requestName :: Client -> BusName -> [RequestNameFlag] -> IO RequestNameReply
-- | Clients may also release names they've requested.
releaseName :: Client -> BusName -> IO ReleaseNameReply
-- | Perform some computation every time this client receives a matching
-- signal.
onSignal :: Client -> MatchRule -> (BusName -> Signal -> IO ()) -> IO ()
data RemoteObject
RemoteObject :: BusName -> ObjectPath -> RemoteObject
data Proxy
Proxy :: RemoteObject -> InterfaceName -> Proxy
-- | As call, except that the proxy's information is used to build
-- the message.
callProxy :: Client -> Proxy -> MemberName -> [Flag] -> [Variant] -> (Error -> IO ()) -> (MethodReturn -> IO ()) -> IO ()
-- | As callBlocking, except that the proxy's information is used to
-- build the message.
callProxyBlocking :: Client -> Proxy -> MemberName -> [Flag] -> [Variant] -> IO (Either Error MethodReturn)
-- | As callBlocking_, except that the proxy's information is used
-- to build the message.
callProxyBlocking_ :: Client -> Proxy -> MemberName -> [Flag] -> [Variant] -> IO MethodReturn
onSignalFrom :: Client -> Proxy -> MemberName -> (Signal -> IO ()) -> IO ()
newtype LocalObject
LocalObject :: (Map InterfaceName Interface) -> LocalObject
newtype Interface
Interface :: (Map MemberName Member) -> Interface
data Member
Method :: Signature -> Signature -> (MethodCall -> IO ()) -> Member
Signal :: Signature -> Member
-- | Export a set of interfaces on the bus. Whenever a method call is
-- received which matches the object's path, interface, and member name,
-- one of its members will be called.
--
-- Exported objects automatically implement the
-- org.freedesktop.DBus.Introspectable interface.
export :: Client -> ObjectPath -> LocalObject -> IO ()
data MethodCall
MethodCall :: LocalObject -> Client -> Member -> Serial -> Maybe BusName -> Set Flag -> [Variant] -> MethodCall
methodCallObject :: MethodCall -> LocalObject
methodCallClient :: MethodCall -> Client
methodCallMethod :: MethodCall -> Member
methodCallSerial :: MethodCall -> Serial
methodCallSender :: MethodCall -> Maybe BusName
methodCallFlags :: MethodCall -> Set Flag
methodCallBody :: MethodCall -> [Variant]
-- | Send a successful return reply for a method call.
replyReturn :: MethodCall -> [Variant] -> IO ()
-- | Send an error reply for a method call.
replyError :: MethodCall -> ErrorName -> [Variant] -> IO ()