-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/
-- | Small DBus implementation
--
-- Small and flexible implementation of the dbus protocol.
@package udbus
@version 0.2.0
module Network.DBus.Actions
data DBusContext
data DBusTransport
DBusTransport :: (Int -> IO ByteString) -> (ByteString -> IO ()) -> IO () -> DBusTransport
transportGet :: DBusTransport -> Int -> IO ByteString
transportPut :: DBusTransport -> ByteString -> IO ()
transportClose :: DBusTransport -> IO ()
-- | authenticate to DBus using a raw bytestring.
authenticate :: DBusContext -> ByteString -> IO ()
-- | authenticate to DBus using a UID.
authenticateUID :: DBusContext -> Int -> IO ()
-- | connect to the dbus session bus define by the environment variable
-- DBUS_SESSION_BUS_ADDRESS
connectSession :: IO Handle
-- | connect to the dbus system bus
connectSystem :: IO Handle
-- | create a new DBus context from an handle
contextNew :: Handle -> IO DBusContext
-- | create a new DBus context from a transport
contextNewWith :: DBusTransport -> IO DBusContext
-- | create a new DBus context on session bus
busGetSession :: IO DBusContext
-- | create a new DBus context on system bus
busGetSystem :: IO DBusContext
-- | get the next serial usable, and increment the serial state.
busGetNextSerial :: DBusContext -> IO Serial
-- | close this DBus context
busClose :: DBusContext -> IO ()
-- | send one message to the bus note that the serial of the message sent
-- is allocated here.
messageSend :: DBusContext -> DBusMessage -> IO Serial
-- | send one message to the bus with a predefined serial number.
messageSendWithSerial :: DBusContext -> Serial -> DBusMessage -> IO ()
-- | receive one single message from the bus it is not necessarily the
-- reply from a previous sent message.
messageRecv :: DBusContext -> IO DBusMessage
-- | dbus message types
data MessageType
TypeInvalid :: MessageType
TypeMethodCall :: MessageType
TypeMethodReturn :: MessageType
TypeError :: MessageType
TypeSignal :: MessageType
-- | dbus message flags
data MessageFlag
FlagNoReplyExpected :: MessageFlag
FlagNoAutoStart :: MessageFlag
data DBusFields
DBusFields :: Maybe ObjectPath -> Maybe Interface -> Maybe Member -> Maybe ErrorName -> Maybe Serial -> Maybe BusName -> Maybe BusName -> Signature -> Maybe UnixFD -> DBusFields
fieldsPath :: DBusFields -> Maybe ObjectPath
fieldsInterface :: DBusFields -> Maybe Interface
fieldsMember :: DBusFields -> Maybe Member
fieldsErrorName :: DBusFields -> Maybe ErrorName
fieldsReplySerial :: DBusFields -> Maybe Serial
fieldsDestination :: DBusFields -> Maybe BusName
fieldsSender :: DBusFields -> Maybe BusName
fieldsSignature :: DBusFields -> Signature
fieldsUnixFD :: DBusFields -> Maybe UnixFD
data DBusMessage
DBusMessage :: DBusEndian -> !MessageType -> !Int -> !Int -> !Serial -> DBusFields -> ByteString -> DBusMessage
msgEndian :: DBusMessage -> DBusEndian
msgType :: DBusMessage -> !MessageType
msgVersion :: DBusMessage -> !Int
msgFlags :: DBusMessage -> !Int
msgSerial :: DBusMessage -> !Serial
msgFields :: DBusMessage -> DBusFields
msgBodyRaw :: DBusMessage -> ByteString
-- | dbus serial number
type Serial = Word32
-- | read message's body using the signature field as reference
readBody :: DBusMessage -> Body
-- | read message's body with a defined signature
readBodyWith :: DBusMessage -> Signature -> Body
-- | One possible signature element
data Type
SigByte :: Type
SigBool :: Type
SigInt16 :: Type
SigUInt16 :: Type
SigInt32 :: Type
SigUInt32 :: Type
SigInt64 :: Type
SigUInt64 :: Type
SigDouble :: Type
SigString :: Type
SigObjectPath :: Type
SigSignature :: Type
SigArray :: Type -> Type
SigStruct :: [Type] -> Type
SigVariant :: Type
SigDict :: Type -> Type -> Type
SigUnixFD :: Type
-- | Deprecated: use Type instead
type SignatureElem = Type
-- | A list of signature element
type Signature = [Type]
-- | serialize a signature
serializeSignature :: Signature -> ByteString
-- | unserialize a signature
unserializeSignature :: ByteString -> Either String Signature
newtype ObjectPath
ObjectPath :: String -> ObjectPath
unObjectPath :: ObjectPath -> String
newtype PackedString
PackedString :: ByteString -> PackedString
ustringToBS :: PackedString -> ByteString
packedStringToString :: PackedString -> String
-- | DBus Types
data DBusValue
DBusByte :: Word8 -> DBusValue
DBusBoolean :: Bool -> DBusValue
DBusInt16 :: Int16 -> DBusValue
DBusUInt16 :: Word16 -> DBusValue
DBusInt32 :: Int32 -> DBusValue
DBusUInt32 :: Word32 -> DBusValue
DBusInt64 :: Int64 -> DBusValue
DBusUInt64 :: Word64 -> DBusValue
DBusDouble :: Double -> DBusValue
DBusString :: PackedString -> DBusValue
DBusObjectPath :: ObjectPath -> DBusValue
DBusSignature :: Signature -> DBusValue
DBusByteArray :: ByteString -> DBusValue
DBusArray :: Type -> [DBusValue] -> DBusValue
DBusStruct :: Signature -> [DBusValue] -> DBusValue
DBusDict :: DBusValue -> DBusValue -> DBusValue
DBusVariant :: DBusValue -> DBusValue
DBusUnixFD :: Word32 -> DBusValue
class DBusTypeable a
toSignature :: DBusTypeable a => a -> Type
toDBusValue :: DBusTypeable a => a -> DBusValue
fromDBusValue :: DBusTypeable a => DBusValue -> Maybe a
module Network.DBus
-- | Establish a new connection to dbus, using the two functions to first
-- establish a new context, and second to authenticate to the bus. this
-- will automatically create a mainloop thread.
establish :: IO DBusContext -> (DBusContext -> IO ()) -> IO DBusConnection
establishWithCatchall :: (DBusMessage -> IO ()) -> IO DBusContext -> (DBusContext -> IO t) -> IO DBusConnection
-- | opaque type representing a connection to DBus and a receiving
-- dispatcher thread. maintain table to route message between handlers.
data DBusConnection
class DBusMessageable a
toDBusMessage :: DBusMessageable a => a -> DBusMessage
fromDBusMessage :: DBusMessageable a => DBusMessage -> Maybe a
data DBusCall
DBusCall :: ObjectPath -> Member -> Maybe Interface -> Body -> DBusCall
callPath :: DBusCall -> ObjectPath
callMember :: DBusCall -> Member
callInterface :: DBusCall -> Maybe Interface
callBody :: DBusCall -> Body
data DBusReturn
DBusReturn :: Serial -> Body -> DBusReturn
returnReplySerial :: DBusReturn -> Serial
returnBody :: DBusReturn -> Body
data DBusError
DBusError :: Serial -> ErrorName -> Body -> DBusError
errorReplySerial :: DBusError -> Serial
errorName :: DBusError -> ErrorName
errorBody :: DBusError -> Body
data DBusSignal
DBusSignal :: ObjectPath -> Member -> Interface -> Body -> DBusSignal
signalPath :: DBusSignal -> ObjectPath
signalMember :: DBusSignal -> Member
signalInterface :: DBusSignal -> Interface
signalBody :: DBusSignal -> Body
-- | DBus Types
data DBusValue
DBusByte :: Word8 -> DBusValue
DBusBoolean :: Bool -> DBusValue
DBusInt16 :: Int16 -> DBusValue
DBusUInt16 :: Word16 -> DBusValue
DBusInt32 :: Int32 -> DBusValue
DBusUInt32 :: Word32 -> DBusValue
DBusInt64 :: Int64 -> DBusValue
DBusUInt64 :: Word64 -> DBusValue
DBusDouble :: Double -> DBusValue
DBusString :: PackedString -> DBusValue
DBusObjectPath :: ObjectPath -> DBusValue
DBusSignature :: Signature -> DBusValue
DBusByteArray :: ByteString -> DBusValue
DBusArray :: Type -> [DBusValue] -> DBusValue
DBusStruct :: Signature -> [DBusValue] -> DBusValue
DBusDict :: DBusValue -> DBusValue -> DBusValue
DBusVariant :: DBusValue -> DBusValue
DBusUnixFD :: Word32 -> DBusValue
class DBusTypeable a
toSignature :: DBusTypeable a => a -> Type
toDBusValue :: DBusTypeable a => a -> DBusValue
fromDBusValue :: DBusTypeable a => DBusValue -> Maybe a
newtype ObjectPath
ObjectPath :: String -> ObjectPath
unObjectPath :: ObjectPath -> String
newtype PackedString
PackedString :: ByteString -> PackedString
ustringToBS :: PackedString -> ByteString
packedStringToString :: PackedString -> String
-- | One possible signature element
data Type
SigByte :: Type
SigBool :: Type
SigInt16 :: Type
SigUInt16 :: Type
SigInt32 :: Type
SigUInt32 :: Type
SigInt64 :: Type
SigUInt64 :: Type
SigDouble :: Type
SigString :: Type
SigObjectPath :: Type
SigSignature :: Type
SigArray :: Type -> Type
SigStruct :: [Type] -> Type
SigVariant :: Type
SigDict :: Type -> Type -> Type
SigUnixFD :: Type
-- | A list of signature element
type Signature = [Type]
-- | Deprecated: use Type instead
type SignatureElem = Type
data DBusMatchRules
DBusMatchRules :: Maybe MessageType -> Maybe BusName -> Maybe Interface -> Maybe Member -> Maybe ObjectPath -> Maybe BusName -> DBusMatchRules
matchType :: DBusMatchRules -> Maybe MessageType
matchSender :: DBusMatchRules -> Maybe BusName
matchInterface :: DBusMatchRules -> Maybe Interface
matchMember :: DBusMatchRules -> Maybe Member
matchPath :: DBusMatchRules -> Maybe ObjectPath
matchDestination :: DBusMatchRules -> Maybe BusName
defaultDBusMatchRules :: DBusMatchRules
-- | dbus message types
data MessageType
TypeInvalid :: MessageType
TypeMethodCall :: MessageType
TypeMethodReturn :: MessageType
TypeError :: MessageType
TypeSignal :: MessageType
newtype BusName
BusName :: String -> BusName
unBusName :: BusName -> String
newtype ErrorName
ErrorName :: String -> ErrorName
unErrorName :: ErrorName -> String
newtype Member
Member :: String -> Member
unMember :: Member -> String
newtype Interface
Interface :: String -> Interface
unInterface :: Interface -> String
addMatch :: DBusConnection -> DBusMatchRules -> IO ()
runMainLoop :: DBusContext -> IO DBusConnection
runMainLoopCatchall :: (DBusMessage -> IO ()) -> DBusContext -> IO DBusConnection
call :: DBusConnection -> BusName -> DBusCall -> IO DBusReturn
reply :: DBusMessageable a => DBusConnection -> a -> IO Serial
calltableFromList :: [(Member, Interface, a)] -> DispatchTable a
-- | Deprecated: use registerCall
registerPath :: DBusConnection -> ObjectPath -> DispatchTable Callback -> IO ()
-- | Deprecated: use unregisterCall
unregisterPath :: DBusConnection -> ObjectPath -> IO ()
registerCall :: DBusConnection -> ObjectPath -> DispatchTable Callback -> IO ()
unregisterCall :: DBusConnection -> ObjectPath -> IO ()
registerSignal :: DBusConnection -> ObjectPath -> DispatchTable Signalback -> IO ()
unregisterSignal :: DBusConnection -> ObjectPath -> IO ()
-- | create a new DBus context on system bus
busGetSystem :: IO DBusContext
-- | create a new DBus context on session bus
busGetSession :: IO DBusContext
-- | authenticate to DBus using a raw bytestring.
authenticate :: DBusContext -> ByteString -> IO ()
-- | authenticate to DBus using a UID.
authenticateUID :: DBusContext -> Int -> IO ()
-- | use the real user UID to authenticate to DBus.
authenticateWithRealUID :: DBusContext -> IO ()