dbus-1.3.6: A client library for the D-Bus IPC system.
Safe HaskellSafe-Inferred
LanguageHaskell2010

DBus

Description

Basic types, useful to every D-Bus application.

Authors of client applications should import DBus.Client, which provides an easy RPC-oriented interface to D-Bus methods and signals.

Synopsis

Messages

Method calls

data MethodCall Source #

A method call is a request to run some procedure exported by the remote process. Procedures are identified by an (object_path, interface_name, method_name) tuple.

methodCall :: ObjectPath -> InterfaceName -> MemberName -> MethodCall Source #

Construct a new MethodCall for the given object, interface, and method.

Use fields such as methodCallDestination and methodCallBody to populate a MethodCall.

{-# LANGUAGE OverloadedStrings #-}

methodCall "/" "org.example.Math" "Add"
    { methodCallDestination = Just "org.example.Calculator"
    , methodCallBody = [toVariant (1 :: Int32), toVariant (2 :: Int32)]
    }
 

methodCallPath :: MethodCall -> ObjectPath Source #

The object path of the method call. Conceptually, object paths act like a procedural language's pointers. Each object referenced by a path is a collection of procedures.

methodCallInterface :: MethodCall -> Maybe InterfaceName Source #

The interface of the method call. Each object may implement any number of interfaces. Each method is part of at least one interface.

In certain cases, this may be Nothing, but most users should set it to a value.

methodCallMember :: MethodCall -> MemberName Source #

The method name of the method call. Method names are unique within an interface, but might not be unique within an object.

methodCallSender :: MethodCall -> Maybe BusName Source #

The name of the application that sent this call.

Most users will just leave this empty, because the bus overwrites the sender for security reasons. Setting the sender manually is used for peer-peer connections.

Defaults to Nothing.

methodCallDestination :: MethodCall -> Maybe BusName Source #

The name of the application to send the call to.

Most users should set this. If a message with no destination is sent to the bus, the bus will behave as if the destination was set to org.freedesktop.DBus. For peer-peer connections, the destination can be empty because there is only one peer.

Defaults to Nothing.

methodCallAutoStart :: MethodCall -> Bool Source #

Set whether the bus should auto-start the remote

Defaults to True.

methodCallReplyExpected :: MethodCall -> Bool Source #

Set whether a reply is expected. This can save network and cpu resources by inhibiting unnecessary replies.

Defaults to True.

methodCallBody :: MethodCall -> [Variant] Source #

The arguments to the method call. See toVariant.

Defaults to [].

Method returns

data MethodReturn Source #

A method return is a reply to a method call, indicating that the call succeeded.

methodReturn :: Serial -> MethodReturn Source #

Construct a new MethodReturn, in reply to a method call with the given serial.

Use fields such as methodReturnBody to populate a MethodReturn.

methodReturnSerial :: MethodReturn -> Serial Source #

The serial of the original method call. This lets the original caller match up this reply to the pending call.

methodReturnSender :: MethodReturn -> Maybe BusName Source #

The name of the application that is returning from a call.

Most users will just leave this empty, because the bus overwrites the sender for security reasons. Setting the sender manually is used for peer-peer connections.

Defaults to Nothing.

methodReturnDestination :: MethodReturn -> Maybe BusName Source #

The name of the application that initiated the call.

Most users should set this. If a message with no destination is sent to the bus, the bus will behave as if the destination was set to org.freedesktop.DBus. For peer-peer connections, the destination can be empty because there is only one peer.

Defaults to Nothing.

methodReturnBody :: MethodReturn -> [Variant] Source #

Values returned from the method call. See toVariant.

Defaults to [].

Method errors

data MethodError Source #

A method error is a reply to a method call, indicating that the call received an error and did not succeed.

methodError :: Serial -> ErrorName -> MethodError Source #

Construct a new MethodError, in reply to a method call with the given serial.

Use fields such as methodErrorBody to populate a MethodError.

methodErrorName :: MethodError -> ErrorName Source #

The name of the error type. Names are used so clients can handle certain classes of error differently from others.

methodErrorSerial :: MethodError -> Serial Source #

The serial of the original method call. This lets the original caller match up this reply to the pending call.

methodErrorSender :: MethodError -> Maybe BusName Source #

The name of the application that is returning from a call.

Most users will just leave this empty, because the bus overwrites the sender for security reasons. Setting the sender manually is used for peer-peer connections.

Defaults to Nothing.

methodErrorDestination :: MethodError -> Maybe BusName Source #

The name of the application that initiated the call.

Most users should set this. If a message with no destination is sent to the bus, the bus will behave as if the destination was set to org.freedesktop.DBus. For peer-peer connections, the destination can be empty because there is only one peer.

Defaults to Nothing.

methodErrorBody :: MethodError -> [Variant] Source #

Additional information about the error. By convention, if the error body contains any items, the first item should be a string describing the error.

methodErrorMessage :: MethodError -> String Source #

Get a human-readable description of the error, by returning the first item in the error body if it's a string.

Signals

data Signal Source #

Signals are broadcast by applications to notify other clients of some event.

Instances

Instances details
Show Signal Source # 
Instance details

Defined in DBus.Internal.Message

Message Signal Source # 
Instance details

Defined in DBus.Internal.Message

Eq Signal Source # 
Instance details

Defined in DBus.Internal.Message

Methods

(==) :: Signal -> Signal -> Bool #

(/=) :: Signal -> Signal -> Bool #

signal :: ObjectPath -> InterfaceName -> MemberName -> Signal Source #

Construct a new Signal for the given object, interface, and signal name.

Use fields such as signalBody to populate a Signal.

signalPath :: Signal -> ObjectPath Source #

The path of the object that emitted this signal.

signalMember :: Signal -> MemberName Source #

The name of this signal.

signalInterface :: Signal -> InterfaceName Source #

The interface that this signal belongs to.

signalSender :: Signal -> Maybe BusName Source #

The name of the application that emitted this signal.

Most users will just leave this empty, because the bus overwrites the sender for security reasons. Setting the sender manually is used for peer-peer connections.

Defaults to Nothing.

signalDestination :: Signal -> Maybe BusName Source #

The name of the application to emit the signal to. If Nothing, the signal is sent to any application that has registered an appropriate match rule.

Defaults to Nothing.

signalBody :: Signal -> [Variant] Source #

Additional information about the signal, such as the new value or the time.

Defaults to [].

Received messages

data ReceivedMessage Source #

Not an actual message type, but a wrapper around messages received from the bus. Each value contains the message's Serial.

If casing against these constructors, always include a default case to handle messages of an unknown type. New message types may be added to the D-Bus specification, and applications should handle them gracefully by either ignoring or logging them.

receivedMessageSerial :: ReceivedMessage -> Serial Source #

No matter what sort of message was received, get its serial.

receivedMessageSender :: ReceivedMessage -> Maybe BusName Source #

No matter what sort of message was received, get its sender (if provided).

receivedMessageBody :: ReceivedMessage -> [Variant] Source #

No matter what sort of message was received, get its body (if provided).

Variants

data Variant Source #

Variants may contain any other built-in D-Bus value. Besides representing native VARIANT values, they allow type-safe storage and inspection of D-Bus collections.

Instances

Instances details
Show Variant Source # 
Instance details

Defined in DBus.Internal.Types

IsValue Variant Source # 
Instance details

Defined in DBus.Internal.Types

IsVariant Variant Source # 
Instance details

Defined in DBus.Internal.Types

Eq Variant Source # 
Instance details

Defined in DBus.Internal.Types

Methods

(==) :: Variant -> Variant -> Bool #

(/=) :: Variant -> Variant -> Bool #

class IsVariant a where Source #

Instances

Instances details
IsVariant Int16 Source # 
Instance details

Defined in DBus.Internal.Types

IsVariant Int32 Source # 
Instance details

Defined in DBus.Internal.Types

IsVariant Int64 Source # 
Instance details

Defined in DBus.Internal.Types

IsVariant Word16 Source # 
Instance details

Defined in DBus.Internal.Types

IsVariant Word32 Source # 
Instance details

Defined in DBus.Internal.Types

IsVariant Word64 Source # 
Instance details

Defined in DBus.Internal.Types

IsVariant Word8 Source # 
Instance details

Defined in DBus.Internal.Types

IsVariant Fd Source # 
Instance details

Defined in DBus.Internal.Types

IsVariant ByteString Source # 
Instance details

Defined in DBus.Internal.Types

IsVariant ByteString Source # 
Instance details

Defined in DBus.Internal.Types

IsVariant Array Source # 
Instance details

Defined in DBus.Internal.Types

IsVariant BusName Source # 
Instance details

Defined in DBus.Internal.Types

IsVariant Dictionary Source # 
Instance details

Defined in DBus.Internal.Types

IsVariant ErrorName Source # 
Instance details

Defined in DBus.Internal.Types

IsVariant InterfaceName Source # 
Instance details

Defined in DBus.Internal.Types

IsVariant MemberName Source # 
Instance details

Defined in DBus.Internal.Types

IsVariant ObjectPath Source # 
Instance details

Defined in DBus.Internal.Types

IsVariant Serial Source # 
Instance details

Defined in DBus.Internal.Types

IsVariant Signature Source # 
Instance details

Defined in DBus.Internal.Types

IsVariant Structure Source # 
Instance details

Defined in DBus.Internal.Types

IsVariant Variant Source # 
Instance details

Defined in DBus.Internal.Types

IsVariant Text Source # 
Instance details

Defined in DBus.Internal.Types

IsVariant Text Source # 
Instance details

Defined in DBus.Internal.Types

IsVariant String Source # 
Instance details

Defined in DBus.Internal.Types

IsVariant () Source # 
Instance details

Defined in DBus.Internal.Types

IsVariant Bool Source # 
Instance details

Defined in DBus.Internal.Types

IsVariant Double Source # 
Instance details

Defined in DBus.Internal.Types

IsValue a => IsVariant (Vector a) Source # 
Instance details

Defined in DBus.Internal.Types

IsValue a => IsVariant [a] Source # 
Instance details

Defined in DBus.Internal.Types

(Ord k, IsAtom k, IsValue v) => IsVariant (Map k v) Source # 
Instance details

Defined in DBus.Internal.Types

(IsVariant a1, IsVariant a2) => IsVariant (a1, a2) Source # 
Instance details

Defined in DBus.Internal.Types

Methods

toVariant :: (a1, a2) -> Variant Source #

fromVariant :: Variant -> Maybe (a1, a2) Source #

(IsVariant a1, IsVariant a2, IsVariant a3) => IsVariant (a1, a2, a3) Source # 
Instance details

Defined in DBus.Internal.Types

Methods

toVariant :: (a1, a2, a3) -> Variant Source #

fromVariant :: Variant -> Maybe (a1, a2, a3) Source #

(IsVariant a1, IsVariant a2, IsVariant a3, IsVariant a4) => IsVariant (a1, a2, a3, a4) Source # 
Instance details

Defined in DBus.Internal.Types

Methods

toVariant :: (a1, a2, a3, a4) -> Variant Source #

fromVariant :: Variant -> Maybe (a1, a2, a3, a4) Source #

(IsVariant a1, IsVariant a2, IsVariant a3, IsVariant a4, IsVariant a5) => IsVariant (a1, a2, a3, a4, a5) Source # 
Instance details

Defined in DBus.Internal.Types

Methods

toVariant :: (a1, a2, a3, a4, a5) -> Variant Source #

fromVariant :: Variant -> Maybe (a1, a2, a3, a4, a5) Source #

(IsVariant a1, IsVariant a2, IsVariant a3, IsVariant a4, IsVariant a5, IsVariant a6) => IsVariant (a1, a2, a3, a4, a5, a6) Source # 
Instance details

Defined in DBus.Internal.Types

Methods

toVariant :: (a1, a2, a3, a4, a5, a6) -> Variant Source #

fromVariant :: Variant -> Maybe (a1, a2, a3, a4, a5, a6) Source #

(IsVariant a1, IsVariant a2, IsVariant a3, IsVariant a4, IsVariant a5, IsVariant a6, IsVariant a7) => IsVariant (a1, a2, a3, a4, a5, a6, a7) Source # 
Instance details

Defined in DBus.Internal.Types

Methods

toVariant :: (a1, a2, a3, a4, a5, a6, a7) -> Variant Source #

fromVariant :: Variant -> Maybe (a1, a2, a3, a4, a5, a6, a7) Source #

(IsVariant a1, IsVariant a2, IsVariant a3, IsVariant a4, IsVariant a5, IsVariant a6, IsVariant a7, IsVariant a8) => IsVariant (a1, a2, a3, a4, a5, a6, a7, a8) Source # 
Instance details

Defined in DBus.Internal.Types

Methods

toVariant :: (a1, a2, a3, a4, a5, a6, a7, a8) -> Variant Source #

fromVariant :: Variant -> Maybe (a1, a2, a3, a4, a5, a6, a7, a8) Source #

(IsVariant a1, IsVariant a2, IsVariant a3, IsVariant a4, IsVariant a5, IsVariant a6, IsVariant a7, IsVariant a8, IsVariant a9) => IsVariant (a1, a2, a3, a4, a5, a6, a7, a8, a9) Source # 
Instance details

Defined in DBus.Internal.Types

Methods

toVariant :: (a1, a2, a3, a4, a5, a6, a7, a8, a9) -> Variant Source #

fromVariant :: Variant -> Maybe (a1, a2, a3, a4, a5, a6, a7, a8, a9) Source #

(IsVariant a1, IsVariant a2, IsVariant a3, IsVariant a4, IsVariant a5, IsVariant a6, IsVariant a7, IsVariant a8, IsVariant a9, IsVariant a10) => IsVariant (a1, a2, a3, a4, a5, a6, a7, a8, a9, a10) Source # 
Instance details

Defined in DBus.Internal.Types

Methods

toVariant :: (a1, a2, a3, a4, a5, a6, a7, a8, a9, a10) -> Variant Source #

fromVariant :: Variant -> Maybe (a1, a2, a3, a4, a5, a6, a7, a8, a9, a10) Source #

(IsVariant a1, IsVariant a2, IsVariant a3, IsVariant a4, IsVariant a5, IsVariant a6, IsVariant a7, IsVariant a8, IsVariant a9, IsVariant a10, IsVariant a11) => IsVariant (a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11) Source # 
Instance details

Defined in DBus.Internal.Types

Methods

toVariant :: (a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11) -> Variant Source #

fromVariant :: Variant -> Maybe (a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11) Source #

(IsVariant a1, IsVariant a2, IsVariant a3, IsVariant a4, IsVariant a5, IsVariant a6, IsVariant a7, IsVariant a8, IsVariant a9, IsVariant a10, IsVariant a11, IsVariant a12) => IsVariant (a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12) Source # 
Instance details

Defined in DBus.Internal.Types

Methods

toVariant :: (a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12) -> Variant Source #

fromVariant :: Variant -> Maybe (a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12) Source #

(IsVariant a1, IsVariant a2, IsVariant a3, IsVariant a4, IsVariant a5, IsVariant a6, IsVariant a7, IsVariant a8, IsVariant a9, IsVariant a10, IsVariant a11, IsVariant a12, IsVariant a13) => IsVariant (a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13) Source # 
Instance details

Defined in DBus.Internal.Types

Methods

toVariant :: (a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13) -> Variant Source #

fromVariant :: Variant -> Maybe (a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13) Source #

(IsVariant a1, IsVariant a2, IsVariant a3, IsVariant a4, IsVariant a5, IsVariant a6, IsVariant a7, IsVariant a8, IsVariant a9, IsVariant a10, IsVariant a11, IsVariant a12, IsVariant a13, IsVariant a14) => IsVariant (a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14) Source # 
Instance details

Defined in DBus.Internal.Types

Methods

toVariant :: (a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14) -> Variant Source #

fromVariant :: Variant -> Maybe (a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14) Source #

(IsVariant a1, IsVariant a2, IsVariant a3, IsVariant a4, IsVariant a5, IsVariant a6, IsVariant a7, IsVariant a8, IsVariant a9, IsVariant a10, IsVariant a11, IsVariant a12, IsVariant a13, IsVariant a14, IsVariant a15) => IsVariant (a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15) Source # 
Instance details

Defined in DBus.Internal.Types

Methods

toVariant :: (a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15) -> Variant Source #

fromVariant :: Variant -> Maybe (a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15) Source #

variantType :: Variant -> Type Source #

Every variant is strongly-typed; that is, the type of its contained value is known at all times. This function retrieves that type, so that the correct cast can be used to retrieve the value.

class IsValue a => IsAtom a Source #

Atomic types can be used as keys to dictionaries.

Users may not provide new instances of IsAtom because this could allow dictionaries to be created with invalid keys.

Minimal complete definition

toAtom, fromAtom

Instances

Instances details
IsAtom Int16 Source # 
Instance details

Defined in DBus.Internal.Types

IsAtom Int32 Source # 
Instance details

Defined in DBus.Internal.Types

IsAtom Int64 Source # 
Instance details

Defined in DBus.Internal.Types

IsAtom Word16 Source # 
Instance details

Defined in DBus.Internal.Types

IsAtom Word32 Source # 
Instance details

Defined in DBus.Internal.Types

IsAtom Word64 Source # 
Instance details

Defined in DBus.Internal.Types

IsAtom Word8 Source # 
Instance details

Defined in DBus.Internal.Types

IsAtom Fd Source # 
Instance details

Defined in DBus.Internal.Types

IsAtom ObjectPath Source # 
Instance details

Defined in DBus.Internal.Types

IsAtom Signature Source # 
Instance details

Defined in DBus.Internal.Types

IsAtom Text Source # 
Instance details

Defined in DBus.Internal.Types

IsAtom Text Source # 
Instance details

Defined in DBus.Internal.Types

IsAtom String Source # 
Instance details

Defined in DBus.Internal.Types

IsAtom Bool Source # 
Instance details

Defined in DBus.Internal.Types

IsAtom Double Source # 
Instance details

Defined in DBus.Internal.Types

class IsVariant a => IsValue a Source #

Value types can be used as items in containers, such as lists or dictionaries.

Users may not provide new instances of IsValue because this could allow containers to be created with items of heterogenous types.

Minimal complete definition

typeOf_, toValue, fromValue

Instances

Instances details
IsValue Int16 Source # 
Instance details

Defined in DBus.Internal.Types

IsValue Int32 Source # 
Instance details

Defined in DBus.Internal.Types

IsValue Int64 Source # 
Instance details

Defined in DBus.Internal.Types

IsValue Word16 Source # 
Instance details

Defined in DBus.Internal.Types

IsValue Word32 Source # 
Instance details

Defined in DBus.Internal.Types

IsValue Word64 Source # 
Instance details

Defined in DBus.Internal.Types

IsValue Word8 Source # 
Instance details

Defined in DBus.Internal.Types

IsValue Fd Source # 
Instance details

Defined in DBus.Internal.Types

IsValue ByteString Source # 
Instance details

Defined in DBus.Internal.Types

IsValue ByteString Source # 
Instance details

Defined in DBus.Internal.Types

IsValue ObjectPath Source # 
Instance details

Defined in DBus.Internal.Types

IsValue Signature Source # 
Instance details

Defined in DBus.Internal.Types

IsValue Variant Source # 
Instance details

Defined in DBus.Internal.Types

IsValue Text Source # 
Instance details

Defined in DBus.Internal.Types

IsValue Text Source # 
Instance details

Defined in DBus.Internal.Types

IsValue String Source # 
Instance details

Defined in DBus.Internal.Types

IsValue () Source # 
Instance details

Defined in DBus.Internal.Types

IsValue Bool Source # 
Instance details

Defined in DBus.Internal.Types

IsValue Double Source # 
Instance details

Defined in DBus.Internal.Types

IsValue a => IsValue (Vector a) Source # 
Instance details

Defined in DBus.Internal.Types

IsValue a => IsValue [a] Source # 
Instance details

Defined in DBus.Internal.Types

Methods

typeOf_ :: Proxy [a] -> Type Source #

toValue :: [a] -> Value Source #

fromValue :: Value -> Maybe [a] Source #

(Ord k, IsAtom k, IsValue v) => IsValue (Map k v) Source # 
Instance details

Defined in DBus.Internal.Types

Methods

typeOf_ :: Proxy (Map k v) -> Type Source #

toValue :: Map k v -> Value Source #

fromValue :: Value -> Maybe (Map k v) Source #

(IsValue a1, IsValue a2) => IsValue (a1, a2) Source # 
Instance details

Defined in DBus.Internal.Types

Methods

typeOf_ :: Proxy (a1, a2) -> Type Source #

toValue :: (a1, a2) -> Value Source #

fromValue :: Value -> Maybe (a1, a2) Source #

(IsValue a1, IsValue a2, IsValue a3) => IsValue (a1, a2, a3) Source # 
Instance details

Defined in DBus.Internal.Types

Methods

typeOf_ :: Proxy (a1, a2, a3) -> Type Source #

toValue :: (a1, a2, a3) -> Value Source #

fromValue :: Value -> Maybe (a1, a2, a3) Source #

(IsValue a1, IsValue a2, IsValue a3, IsValue a4) => IsValue (a1, a2, a3, a4) Source # 
Instance details

Defined in DBus.Internal.Types

Methods

typeOf_ :: Proxy (a1, a2, a3, a4) -> Type Source #

toValue :: (a1, a2, a3, a4) -> Value Source #

fromValue :: Value -> Maybe (a1, a2, a3, a4) Source #

(IsValue a1, IsValue a2, IsValue a3, IsValue a4, IsValue a5) => IsValue (a1, a2, a3, a4, a5) Source # 
Instance details

Defined in DBus.Internal.Types

Methods

typeOf_ :: Proxy (a1, a2, a3, a4, a5) -> Type Source #

toValue :: (a1, a2, a3, a4, a5) -> Value Source #

fromValue :: Value -> Maybe (a1, a2, a3, a4, a5) Source #

(IsValue a1, IsValue a2, IsValue a3, IsValue a4, IsValue a5, IsValue a6) => IsValue (a1, a2, a3, a4, a5, a6) Source # 
Instance details

Defined in DBus.Internal.Types

Methods

typeOf_ :: Proxy (a1, a2, a3, a4, a5, a6) -> Type Source #

toValue :: (a1, a2, a3, a4, a5, a6) -> Value Source #

fromValue :: Value -> Maybe (a1, a2, a3, a4, a5, a6) Source #

(IsValue a1, IsValue a2, IsValue a3, IsValue a4, IsValue a5, IsValue a6, IsValue a7) => IsValue (a1, a2, a3, a4, a5, a6, a7) Source # 
Instance details

Defined in DBus.Internal.Types

Methods

typeOf_ :: Proxy (a1, a2, a3, a4, a5, a6, a7) -> Type Source #

toValue :: (a1, a2, a3, a4, a5, a6, a7) -> Value Source #

fromValue :: Value -> Maybe (a1, a2, a3, a4, a5, a6, a7) Source #

(IsValue a1, IsValue a2, IsValue a3, IsValue a4, IsValue a5, IsValue a6, IsValue a7, IsValue a8) => IsValue (a1, a2, a3, a4, a5, a6, a7, a8) Source # 
Instance details

Defined in DBus.Internal.Types

Methods

typeOf_ :: Proxy (a1, a2, a3, a4, a5, a6, a7, a8) -> Type Source #

toValue :: (a1, a2, a3, a4, a5, a6, a7, a8) -> Value Source #

fromValue :: Value -> Maybe (a1, a2, a3, a4, a5, a6, a7, a8) Source #

(IsValue a1, IsValue a2, IsValue a3, IsValue a4, IsValue a5, IsValue a6, IsValue a7, IsValue a8, IsValue a9) => IsValue (a1, a2, a3, a4, a5, a6, a7, a8, a9) Source # 
Instance details

Defined in DBus.Internal.Types

Methods

typeOf_ :: Proxy (a1, a2, a3, a4, a5, a6, a7, a8, a9) -> Type Source #

toValue :: (a1, a2, a3, a4, a5, a6, a7, a8, a9) -> Value Source #

fromValue :: Value -> Maybe (a1, a2, a3, a4, a5, a6, a7, a8, a9) Source #

(IsValue a1, IsValue a2, IsValue a3, IsValue a4, IsValue a5, IsValue a6, IsValue a7, IsValue a8, IsValue a9, IsValue a10) => IsValue (a1, a2, a3, a4, a5, a6, a7, a8, a9, a10) Source # 
Instance details

Defined in DBus.Internal.Types

Methods

typeOf_ :: Proxy (a1, a2, a3, a4, a5, a6, a7, a8, a9, a10) -> Type Source #

toValue :: (a1, a2, a3, a4, a5, a6, a7, a8, a9, a10) -> Value Source #

fromValue :: Value -> Maybe (a1, a2, a3, a4, a5, a6, a7, a8, a9, a10) Source #

(IsValue a1, IsValue a2, IsValue a3, IsValue a4, IsValue a5, IsValue a6, IsValue a7, IsValue a8, IsValue a9, IsValue a10, IsValue a11) => IsValue (a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11) Source # 
Instance details

Defined in DBus.Internal.Types

Methods

typeOf_ :: Proxy (a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11) -> Type Source #

toValue :: (a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11) -> Value Source #

fromValue :: Value -> Maybe (a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11) Source #

(IsValue a1, IsValue a2, IsValue a3, IsValue a4, IsValue a5, IsValue a6, IsValue a7, IsValue a8, IsValue a9, IsValue a10, IsValue a11, IsValue a12) => IsValue (a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12) Source # 
Instance details

Defined in DBus.Internal.Types

Methods

typeOf_ :: Proxy (a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12) -> Type Source #

toValue :: (a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12) -> Value Source #

fromValue :: Value -> Maybe (a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12) Source #

(IsValue a1, IsValue a2, IsValue a3, IsValue a4, IsValue a5, IsValue a6, IsValue a7, IsValue a8, IsValue a9, IsValue a10, IsValue a11, IsValue a12, IsValue a13) => IsValue (a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13) Source # 
Instance details

Defined in DBus.Internal.Types

Methods

typeOf_ :: Proxy (a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13) -> Type Source #

toValue :: (a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13) -> Value Source #

fromValue :: Value -> Maybe (a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13) Source #

(IsValue a1, IsValue a2, IsValue a3, IsValue a4, IsValue a5, IsValue a6, IsValue a7, IsValue a8, IsValue a9, IsValue a10, IsValue a11, IsValue a12, IsValue a13, IsValue a14) => IsValue (a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14) Source # 
Instance details

Defined in DBus.Internal.Types

Methods

typeOf_ :: Proxy (a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14) -> Type Source #

toValue :: (a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14) -> Value Source #

fromValue :: Value -> Maybe (a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14) Source #

(IsValue a1, IsValue a2, IsValue a3, IsValue a4, IsValue a5, IsValue a6, IsValue a7, IsValue a8, IsValue a9, IsValue a10, IsValue a11, IsValue a12, IsValue a13, IsValue a14, IsValue a15) => IsValue (a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15) Source # 
Instance details

Defined in DBus.Internal.Types

Methods

typeOf_ :: Proxy (a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15) -> Type Source #

toValue :: (a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15) -> Value Source #

fromValue :: Value -> Maybe (a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15) Source #

typeOf :: IsValue a => a -> Type Source #

Deprecated. Get the D-Bus type corresponding to the given Haskell value. The value may be undefined.

typeOf' :: IsValue a => Proxy a -> Type Source #

Get the D-Bus type corresponding to the given Haskell type a.

Signatures

data Signature Source #

A signature is a list of D-Bus types, obeying some basic rules of validity.

The rules of signature validity are complex: see http://dbus.freedesktop.org/doc/dbus-specification.html#message-protocol-signatures for details.

Instances

Instances details
IsString Signature Source # 
Instance details

Defined in DBus.Internal.Types

Show Signature Source # 
Instance details

Defined in DBus.Internal.Types

IsAtom Signature Source # 
Instance details

Defined in DBus.Internal.Types

IsValue Signature Source # 
Instance details

Defined in DBus.Internal.Types

IsVariant Signature Source # 
Instance details

Defined in DBus.Internal.Types

NFData Signature Source # 
Instance details

Defined in DBus.Internal.Types

Methods

rnf :: Signature -> () #

Eq Signature Source # 
Instance details

Defined in DBus.Internal.Types

Ord Signature Source # 
Instance details

Defined in DBus.Internal.Types

data Type Source #

Instances

Instances details
Generic Type Source # 
Instance details

Defined in DBus.Internal.Types

Associated Types

type Rep Type :: Type -> Type #

Methods

from :: Type -> Rep Type x #

to :: Rep Type x -> Type #

Show Type Source # 
Instance details

Defined in DBus.Internal.Types

Methods

showsPrec :: Int -> Type -> ShowS #

show :: Type -> String #

showList :: [Type] -> ShowS #

NFData Type Source # 
Instance details

Defined in DBus.Internal.Types

Methods

rnf :: Type -> () #

Eq Type Source # 
Instance details

Defined in DBus.Internal.Types

Methods

(==) :: Type -> Type -> Bool #

(/=) :: Type -> Type -> Bool #

Ord Type Source # 
Instance details

Defined in DBus.Internal.Types

Methods

compare :: Type -> Type -> Ordering #

(<) :: Type -> Type -> Bool #

(<=) :: Type -> Type -> Bool #

(>) :: Type -> Type -> Bool #

(>=) :: Type -> Type -> Bool #

max :: Type -> Type -> Type #

min :: Type -> Type -> Type #

type Rep Type Source # 
Instance details

Defined in DBus.Internal.Types

type Rep Type = D1 ('MetaData "Type" "DBus.Internal.Types" "dbus-1.3.6-8uGwP7eAzHUIQi1da62tC" 'False) ((((C1 ('MetaCons "TypeBoolean" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "TypeWord8" 'PrefixI 'False) (U1 :: Type -> Type)) :+: (C1 ('MetaCons "TypeWord16" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "TypeWord32" 'PrefixI 'False) (U1 :: Type -> Type))) :+: ((C1 ('MetaCons "TypeWord64" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "TypeInt16" 'PrefixI 'False) (U1 :: Type -> Type)) :+: (C1 ('MetaCons "TypeInt32" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "TypeInt64" 'PrefixI 'False) (U1 :: Type -> Type)))) :+: (((C1 ('MetaCons "TypeDouble" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "TypeUnixFd" 'PrefixI 'False) (U1 :: Type -> Type)) :+: (C1 ('MetaCons "TypeString" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "TypeSignature" 'PrefixI 'False) (U1 :: Type -> Type))) :+: ((C1 ('MetaCons "TypeObjectPath" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "TypeVariant" 'PrefixI 'False) (U1 :: Type -> Type)) :+: (C1 ('MetaCons "TypeArray" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Type)) :+: (C1 ('MetaCons "TypeDictionary" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Type) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Type)) :+: C1 ('MetaCons "TypeStructure" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [Type])))))))

signature :: MonadThrow m => [Type] -> m Signature Source #

Convert a list of types into a valid signature.

Throws if the given types are not a valid signature.

signature_ :: [Type] -> Signature Source #

Convert a list of types into a valid signature.

Throws an exception if the given types are not a valid signature.

signatureTypes :: Signature -> [Type] Source #

Get the list of types in a signature. The inverse of signature.

formatSignature :: Signature -> String Source #

Convert a signature into a signature string. The inverse of parseSignature.

parseSignature :: MonadThrow m => String -> m Signature Source #

Parse a signature string into a valid signature.

Throws if the given string is not a valid signature.

Object paths

data ObjectPath Source #

Object paths are special strings, used to identify a particular object exported from a D-Bus application.

Object paths must begin with a slash, and consist of alphanumeric characters separated by slashes.

See http://dbus.freedesktop.org/doc/dbus-specification.html#message-protocol-marshaling-object-path for details.

Instances

Instances details
IsString ObjectPath Source # 
Instance details

Defined in DBus.Internal.Types

Show ObjectPath Source # 
Instance details

Defined in DBus.Internal.Types

IsAtom ObjectPath Source # 
Instance details

Defined in DBus.Internal.Types

IsValue ObjectPath Source # 
Instance details

Defined in DBus.Internal.Types

IsVariant ObjectPath Source # 
Instance details

Defined in DBus.Internal.Types

NFData ObjectPath Source # 
Instance details

Defined in DBus.Internal.Types

Methods

rnf :: ObjectPath -> () #

Eq ObjectPath Source # 
Instance details

Defined in DBus.Internal.Types

Ord ObjectPath Source # 
Instance details

Defined in DBus.Internal.Types

Lift ObjectPath Source # 
Instance details

Defined in DBus.Internal.Types

Methods

lift :: Quote m => ObjectPath -> m Exp #

liftTyped :: forall (m :: Type -> Type). Quote m => ObjectPath -> Code m ObjectPath #

Names

Interface names

data InterfaceName Source #

Interfaces are used to group a set of methods and signals within an exported object. Interface names consist of alphanumeric characters separated by periods.

See http://dbus.freedesktop.org/doc/dbus-specification.html#message-protocol-names-interface for details.

Member names

data MemberName Source #

Member names are used to identify a single method or signal within an interface. Method names consist of alphanumeric characters.

See http://dbus.freedesktop.org/doc/dbus-specification.html#message-protocol-names-member for details.

Instances

Instances details
IsString MemberName Source # 
Instance details

Defined in DBus.Internal.Types

Show MemberName Source # 
Instance details

Defined in DBus.Internal.Types

IsVariant MemberName Source # 
Instance details

Defined in DBus.Internal.Types

NFData MemberName Source # 
Instance details

Defined in DBus.Internal.Types

Methods

rnf :: MemberName -> () #

Eq MemberName Source # 
Instance details

Defined in DBus.Internal.Types

Ord MemberName Source # 
Instance details

Defined in DBus.Internal.Types

Lift MemberName Source # 
Instance details

Defined in DBus.Internal.Types

Methods

lift :: Quote m => MemberName -> m Exp #

liftTyped :: forall (m :: Type -> Type). Quote m => MemberName -> Code m MemberName #

Error names

data ErrorName Source #

Error names are used to identify which type of error was returned from a method call. Error names consist of alphanumeric characters separated by periods.

See http://dbus.freedesktop.org/doc/dbus-specification.html#message-protocol-names-error for details.

Instances

Instances details
IsString ErrorName Source # 
Instance details

Defined in DBus.Internal.Types

Show ErrorName Source # 
Instance details

Defined in DBus.Internal.Types

IsVariant ErrorName Source # 
Instance details

Defined in DBus.Internal.Types

NFData ErrorName Source # 
Instance details

Defined in DBus.Internal.Types

Methods

rnf :: ErrorName -> () #

Eq ErrorName Source # 
Instance details

Defined in DBus.Internal.Types

Ord ErrorName Source # 
Instance details

Defined in DBus.Internal.Types

Bus names

data BusName Source #

Bus names are used to identify particular clients on the message bus. A bus name may be either unique or well-known, where unique names start with a colon. Bus names consist of alphanumeric characters separated by periods.

See http://dbus.freedesktop.org/doc/dbus-specification.html#message-protocol-names-bus for details.

Instances

Instances details
IsString BusName Source # 
Instance details

Defined in DBus.Internal.Types

Methods

fromString :: String -> BusName #

Show BusName Source # 
Instance details

Defined in DBus.Internal.Types

IsVariant BusName Source # 
Instance details

Defined in DBus.Internal.Types

NFData BusName Source # 
Instance details

Defined in DBus.Internal.Types

Methods

rnf :: BusName -> () #

Eq BusName Source # 
Instance details

Defined in DBus.Internal.Types

Methods

(==) :: BusName -> BusName -> Bool #

(/=) :: BusName -> BusName -> Bool #

Ord BusName Source # 
Instance details

Defined in DBus.Internal.Types

Lift BusName Source # 
Instance details

Defined in DBus.Internal.Types

Methods

lift :: Quote m => BusName -> m Exp #

liftTyped :: forall (m :: Type -> Type). Quote m => BusName -> Code m BusName #

Non-native containers

Structures

data Structure Source #

A D-Bus Structure is a container type similar to Haskell tuples, storing values of any type that is convertable to IsVariant. A Structure may contain up to 255 values.

Most users can use the IsVariant instance for tuples to extract the values of a structure. This type is for very large structures, which may be awkward to work with as tuples.

Instances

Instances details
Show Structure Source # 
Instance details

Defined in DBus.Internal.Types

IsVariant Structure Source # 
Instance details

Defined in DBus.Internal.Types

Eq Structure Source # 
Instance details

Defined in DBus.Internal.Types

Arrays

data Array Source #

A D-Bus Array is a container type similar to Haskell lists, storing zero or more values of a single D-Bus type.

Most users can use the IsVariant instance for lists or vectors to extract the values of an array. This type is for advanced use cases, where the user wants to convert array values to Haskell types that are not instances of IsValue.

Instances

Instances details
Show Array Source # 
Instance details

Defined in DBus.Internal.Types

Methods

showsPrec :: Int -> Array -> ShowS #

show :: Array -> String #

showList :: [Array] -> ShowS #

IsVariant Array Source # 
Instance details

Defined in DBus.Internal.Types

Eq Array Source # 
Instance details

Defined in DBus.Internal.Types

Methods

(==) :: Array -> Array -> Bool #

(/=) :: Array -> Array -> Bool #

Dictionaries

data Dictionary Source #

A D-Bus Dictionary is a container type similar to Haskell maps, storing zero or more associations between keys and values.

Most users can use the IsVariant instance for maps to extract the values of a dictionary. This type is for advanced use cases, where the user wants to convert dictionary items to Haskell types that are not instances of IsValue.

Instances

Instances details
Show Dictionary Source # 
Instance details

Defined in DBus.Internal.Types

IsVariant Dictionary Source # 
Instance details

Defined in DBus.Internal.Types

Eq Dictionary Source # 
Instance details

Defined in DBus.Internal.Types

Addresses

data Address Source #

When a D-Bus server must listen for connections, or a client must connect to a server, the listening socket's configuration is specified with an address. An address contains the method, which determines the protocol and transport mechanism, and parameters, which provide additional method-specific information about the address.

Instances

Instances details
Show Address Source # 
Instance details

Defined in DBus.Internal.Address

Eq Address Source # 
Instance details

Defined in DBus.Internal.Address

Methods

(==) :: Address -> Address -> Bool #

(/=) :: Address -> Address -> Bool #

address :: String -> Map String String -> Maybe Address Source #

Try to convert a method string and parameter map to an Address.

Returns Nothing if the method or parameters are invalid.

formatAddress :: Address -> String Source #

Convert an address to a string in the format expected by parseAddress.

formatAddresses :: [Address] -> String Source #

Convert a list of addresses to a string in the format expected by parseAddresses.

parseAddress :: String -> Maybe Address Source #

Try to parse a string containing one valid address.

An address string is in the format method:key1=val1,key2=val2. There are some limitations on the characters allowed within methods and parameters; see the D-Bus specification for full details.

parseAddresses :: String -> Maybe [Address] Source #

Try to parse a string containing one or more valid addresses.

Addresses are separated by semicolons. See parseAddress for the format of addresses.

getSystemAddress :: IO (Maybe Address) Source #

Returns the address in the environment variable DBUS_SYSTEM_BUS_ADDRESS, or unix:path=/var/run/dbus/system_bus_socket if DBUS_SYSTEM_BUS_ADDRESS is not set.

Returns Nothing if DBUS_SYSTEM_BUS_ADDRESS contains an invalid address.

getSessionAddress :: IO (Maybe Address) Source #

Returns the first address in the environment variable DBUS_SESSION_BUS_ADDRESS, which must be set.

Returns Nothing if DBUS_SYSTEM_BUS_ADDRESS contains an invalid address or DBUS_SESSION_BUS_ADDRESS is unset XDG_RUNTIME_DIR doesn't have /bus.

getStarterAddress :: IO (Maybe Address) Source #

Returns the address in the environment variable DBUS_STARTER_ADDRESS, which must be set.

Returns Nothing if DBUS_STARTER_ADDRESS is unset or contains an invalid address.

Message marshaling

data Endianness Source #

Constructors

LittleEndian 
BigEndian 

Instances

Instances details
Show Endianness Source # 
Instance details

Defined in DBus.Internal.Wire

Eq Endianness Source # 
Instance details

Defined in DBus.Internal.Wire

Marshal

marshal :: Message msg => Endianness -> Serial -> msg -> Either MarshalError ByteString Source #

Convert a Message into a ByteString. Although unusual, it is possible for marshaling to fail; if this occurs, an error will be returned instead.

marshalWithFds :: Message msg => Endianness -> Serial -> msg -> Either MarshalError (ByteString, [Fd]) Source #

Convert a Message into a ByteString along with all Fd values mentioned in the message (the marshaled bytes will contain indices into this list). Although unusual, it is possible for marshaling to fail; if this occurs, an error will be returned instead.

data MarshalError Source #

Instances

Instances details
Show MarshalError Source # 
Instance details

Defined in DBus.Internal.Wire

Eq MarshalError Source # 
Instance details

Defined in DBus.Internal.Wire

Unmarshal

unmarshal :: ByteString -> Either UnmarshalError ReceivedMessage Source #

Parse a ByteString into a ReceivedMessage. The result can be inspected to see what type of message was parsed. Unknown message types can still be parsed successfully, as long as they otherwise conform to the D-Bus standard.

Unmarshaling will fail if the message contains file descriptors. If you need file descriptor support then use unmarshalWithFds instead.

unmarshalWithFds :: ByteString -> [Fd] -> Either UnmarshalError ReceivedMessage Source #

Parse a ByteString into a ReceivedMessage. The Fd values are needed because the marshaled message contains indices into the Fd list rather then Fd values directly. The result can be inspected to see what type of message was parsed. Unknown message types can still be parsed successfully, as long as they otherwise conform to the D-Bus standard.

Message serials

data Serial Source #

A value used to uniquely identify a particular message within a session. Serials are 32-bit unsigned integers, and eventually wrap.

Instances

Instances details
Show Serial Source # 
Instance details

Defined in DBus.Internal.Types

IsVariant Serial Source # 
Instance details

Defined in DBus.Internal.Types

Eq Serial Source # 
Instance details

Defined in DBus.Internal.Types

Methods

(==) :: Serial -> Serial -> Bool #

(/=) :: Serial -> Serial -> Bool #

Ord Serial Source # 
Instance details

Defined in DBus.Internal.Types

firstSerial :: Serial Source #

Get the first serial in the sequence.

nextSerial :: Serial -> Serial Source #

Get the next serial in the sequence. This may wrap around to firstSerial.

D-Bus UUIDs

data UUID Source #

A D-Bus UUID is 128 bits of data, usually randomly generated. They are used for identifying unique server instances to clients.

Older versions of the D-Bus spec also called these values GUIDs.

D-Bus UUIDs are not the same as the RFC-standardized UUIDs or GUIDs.

Instances

Instances details
Show UUID Source # 
Instance details

Defined in DBus

Methods

showsPrec :: Int -> UUID -> ShowS #

show :: UUID -> String #

showList :: [UUID] -> ShowS #

Eq UUID Source # 
Instance details

Defined in DBus

Methods

(==) :: UUID -> UUID -> Bool #

(/=) :: UUID -> UUID -> Bool #

Ord UUID Source # 
Instance details

Defined in DBus

Methods

compare :: UUID -> UUID -> Ordering #

(<) :: UUID -> UUID -> Bool #

(<=) :: UUID -> UUID -> Bool #

(>) :: UUID -> UUID -> Bool #

(>=) :: UUID -> UUID -> Bool #

max :: UUID -> UUID -> UUID #

min :: UUID -> UUID -> UUID #

formatUUID :: UUID -> String Source #

Format a D-Bus UUID as hex-encoded ASCII.

randomUUID :: IO UUID Source #

Generate a random D-Bus UUID. This value is suitable for use in a randomly-allocated address, or as a listener's socket address "guid" parameter.