dbus-0.10.13: A client library for the D-Bus IPC system.

Safe HaskellNone
LanguageHaskell98

DBus.Internal.Types

Synopsis

Documentation

newtype Signature

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.

Constructors

Signature [Type] 

signatureTypes :: Signature -> [Type]

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

formatSignature :: Signature -> String

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

signature :: [Type] -> Maybe Signature

Convert a list of types into a valid signature.

Returns Nothing if the given types are not a valid signature.

signature_ :: [Type] -> Signature

Convert a list of types into a valid signature.

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

parseSignature :: String -> Maybe Signature

Parse a signature string into a valid signature.

Returns Nothing if the given string is not a valid signature.

parseAtom :: Int -> (Type -> a) -> a -> a

class IsVariant a where

Methods

toVariant :: a -> Variant

fromVariant :: Variant -> Maybe a

Instances

IsVariant Bool 
IsVariant Double 
IsVariant Int16 
IsVariant Int32 
IsVariant Int64 
IsVariant Word8 
IsVariant Word16 
IsVariant Word32 
IsVariant Word64 
IsVariant String 
IsVariant Fd 
IsVariant ByteString 
IsVariant ByteString 
IsVariant Text 
IsVariant Text 
IsVariant Serial 
IsVariant Dictionary 
IsVariant Array 
IsVariant Structure 
IsVariant BusName 
IsVariant ErrorName 
IsVariant MemberName 
IsVariant InterfaceName 
IsVariant ObjectPath 
IsVariant Variant 
IsVariant Signature 
IsValue a => IsVariant [a] 
IsValue a => IsVariant (Vector a) 
(IsVariant a1, IsVariant a2) => IsVariant (a1, a2) 
(Ord k, IsAtom k, IsValue v) => IsVariant (Map k v) 
(IsVariant a1, IsVariant a2, IsVariant a3) => IsVariant (a1, a2, a3) 
(IsVariant a1, IsVariant a2, IsVariant a3, IsVariant a4) => IsVariant (a1, a2, a3, a4) 
(IsVariant a1, IsVariant a2, IsVariant a3, IsVariant a4, IsVariant a5) => IsVariant (a1, a2, a3, a4, a5) 
(IsVariant a1, IsVariant a2, IsVariant a3, IsVariant a4, IsVariant a5, IsVariant a6) => IsVariant (a1, a2, a3, a4, a5, a6) 
(IsVariant a1, IsVariant a2, IsVariant a3, IsVariant a4, IsVariant a5, IsVariant a6, IsVariant a7) => IsVariant (a1, a2, a3, a4, a5, a6, a7) 
(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) 
(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) 
(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) 
(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) 
(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) 
(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) 
(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) 
(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) 

class IsVariant a => IsValue a where

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.

Methods

typeOf :: a -> Type

toValue :: a -> Value

fromValue :: Value -> Maybe a

Instances

IsValue Bool 
IsValue Double 
IsValue Int16 
IsValue Int32 
IsValue Int64 
IsValue Word8 
IsValue Word16 
IsValue Word32 
IsValue Word64 
IsValue String 
IsValue Fd 
IsValue ByteString 
IsValue ByteString 
IsValue Text 
IsValue Text 
IsValue ObjectPath 
IsValue Variant 
IsValue Signature 
IsValue a => IsValue [a] 
IsValue a => IsValue (Vector a) 
(IsValue a1, IsValue a2) => IsValue (a1, a2) 
(Ord k, IsAtom k, IsValue v) => IsValue (Map k v) 
(IsValue a1, IsValue a2, IsValue a3) => IsValue (a1, a2, a3) 
(IsValue a1, IsValue a2, IsValue a3, IsValue a4) => IsValue (a1, a2, a3, a4) 
(IsValue a1, IsValue a2, IsValue a3, IsValue a4, IsValue a5) => IsValue (a1, a2, a3, a4, a5) 
(IsValue a1, IsValue a2, IsValue a3, IsValue a4, IsValue a5, IsValue a6) => IsValue (a1, a2, a3, a4, a5, a6) 
(IsValue a1, IsValue a2, IsValue a3, IsValue a4, IsValue a5, IsValue a6, IsValue a7) => IsValue (a1, a2, a3, a4, a5, a6, a7) 
(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) 
(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) 
(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) 
(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) 
(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) 
(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) 
(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) 
(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) 

class IsValue a => IsAtom a where

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.

Methods

toAtom :: a -> Atom

fromAtom :: Atom -> Maybe a

newtype Variant

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.

Constructors

Variant Value 

showThings :: String -> (a -> String) -> String -> [a] -> String

variantType :: Variant -> Type

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.

bimap :: Ord k' => (k -> v -> (k', v')) -> Map k v -> Map k' v'

bimapM :: (Monad m, Ord k') => (k -> v -> m (k', v')) -> Map k v -> m (Map k' v')

mapItemType :: (IsValue k, IsValue v) => Map k v -> (Type, Type)

varToVal :: IsVariant a => a -> Value

newtype ObjectPath

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.

Constructors

ObjectPath String 

newtype InterfaceName

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.

Constructors

InterfaceName String 

newtype MemberName

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.

Constructors

MemberName String 

newtype ErrorName

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.

Constructors

ErrorName String 

newtype BusName

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.

Constructors

BusName String 

newtype Structure

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.

Constructors

Structure [Value] 

data Array

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.

data Dictionary

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.

Constructors

Dictionary Type Type (Map Atom Value) 

newtype Serial

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

Constructors

Serial Word32 

firstSerial :: Serial

Get the first serial in the sequence.

nextSerial :: Serial -> Serial

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

skipSepBy1 :: Parser a -> Parser b -> Parser ()

forceParse :: String -> (String -> Maybe a) -> String -> a