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 |
DBusObjectManagerServer
is used to export DBusObject
instances using
the standardized
org.freedesktop.DBus.ObjectManager
interface. For example, remote D-Bus clients can get all objects
and properties in a single call. Additionally, any change in the
object hierarchy is broadcast using signals. This means that D-Bus
clients can keep caches up to date by only listening to D-Bus
signals.
The recommended path to export an object manager at is the path form of the
well-known name of a D-Bus service, or below. For example, if a D-Bus service
is available at the well-known name net.example.ExampleService1
, the object
manager should typically be exported at /net/example/ExampleService1
, or
below (to allow for multiple object managers in a service).
It is supported, but not recommended, to export an object manager at the root
path, /
.
See DBusObjectManagerClient
for the client-side code that is
intended to be used with DBusObjectManagerServer
or any D-Bus
object implementing the org.freedesktop.DBus.ObjectManager
interface.
- newtype DBusObjectManagerServer = DBusObjectManagerServer (ManagedPtr DBusObjectManagerServer)
- class GObject o => IsDBusObjectManagerServer o
- toDBusObjectManagerServer :: IsDBusObjectManagerServer o => o -> IO DBusObjectManagerServer
- noDBusObjectManagerServer :: Maybe DBusObjectManagerServer
- data DBusObjectManagerServerExportMethodInfo
- dBusObjectManagerServerExport :: (HasCallStack, MonadIO m, IsDBusObjectManagerServer a, IsDBusObjectSkeleton b) => a -> b -> m ()
- data DBusObjectManagerServerExportUniquelyMethodInfo
- dBusObjectManagerServerExportUniquely :: (HasCallStack, MonadIO m, IsDBusObjectManagerServer a, IsDBusObjectSkeleton b) => a -> b -> m ()
- data DBusObjectManagerServerGetConnectionMethodInfo
- dBusObjectManagerServerGetConnection :: (HasCallStack, MonadIO m, IsDBusObjectManagerServer a) => a -> m DBusConnection
- data DBusObjectManagerServerIsExportedMethodInfo
- dBusObjectManagerServerIsExported :: (HasCallStack, MonadIO m, IsDBusObjectManagerServer a, IsDBusObjectSkeleton b) => a -> b -> m Bool
- dBusObjectManagerServerNew :: (HasCallStack, MonadIO m) => Text -> m DBusObjectManagerServer
- data DBusObjectManagerServerSetConnectionMethodInfo
- dBusObjectManagerServerSetConnection :: (HasCallStack, MonadIO m, IsDBusObjectManagerServer a, IsDBusConnection b) => a -> Maybe b -> m ()
- data DBusObjectManagerServerUnexportMethodInfo
- dBusObjectManagerServerUnexport :: (HasCallStack, MonadIO m, IsDBusObjectManagerServer a) => a -> Text -> m Bool
- data DBusObjectManagerServerConnectionPropertyInfo
- clearDBusObjectManagerServerConnection :: (MonadIO m, IsDBusObjectManagerServer o) => o -> m ()
- constructDBusObjectManagerServerConnection :: (IsDBusObjectManagerServer o, IsDBusConnection a) => a -> IO (GValueConstruct o)
- dBusObjectManagerServerConnection :: AttrLabelProxy "connection"
- getDBusObjectManagerServerConnection :: (MonadIO m, IsDBusObjectManagerServer o) => o -> m (Maybe DBusConnection)
- setDBusObjectManagerServerConnection :: (MonadIO m, IsDBusObjectManagerServer o, IsDBusConnection a) => o -> a -> m ()
- data DBusObjectManagerServerObjectPathPropertyInfo
- constructDBusObjectManagerServerObjectPath :: IsDBusObjectManagerServer o => Text -> IO (GValueConstruct o)
- dBusObjectManagerServerObjectPath :: AttrLabelProxy "objectPath"
- getDBusObjectManagerServerObjectPath :: (MonadIO m, IsDBusObjectManagerServer o) => o -> m (Maybe Text)
Exported types
newtype DBusObjectManagerServer Source #
GObject DBusObjectManagerServer Source # | |
IsObject DBusObjectManagerServer Source # | |
IsDBusObjectManager DBusObjectManagerServer Source # | |
IsDBusObjectManagerServer DBusObjectManagerServer Source # | |
((~) * info (ResolveDBusObjectManagerServerMethod t DBusObjectManagerServer), MethodInfo * info DBusObjectManagerServer p) => IsLabel t (DBusObjectManagerServer -> p) Source # | |
((~) * info (ResolveDBusObjectManagerServerMethod t DBusObjectManagerServer), MethodInfo * info DBusObjectManagerServer p) => IsLabelProxy t (DBusObjectManagerServer -> p) Source # | |
HasAttributeList * DBusObjectManagerServer Source # | |
type AttributeList DBusObjectManagerServer Source # | |
type SignalList DBusObjectManagerServer Source # | |
class GObject o => IsDBusObjectManagerServer o Source #
toDBusObjectManagerServer :: IsDBusObjectManagerServer o => o -> IO DBusObjectManagerServer Source #
Methods
export
data DBusObjectManagerServerExportMethodInfo Source #
((~) * signature (b -> m ()), MonadIO m, IsDBusObjectManagerServer a, IsDBusObjectSkeleton b) => MethodInfo * DBusObjectManagerServerExportMethodInfo a signature Source # | |
dBusObjectManagerServerExport Source #
:: (HasCallStack, MonadIO m, IsDBusObjectManagerServer a, IsDBusObjectSkeleton b) | |
=> a |
|
-> b |
|
-> m () |
Exports object
on manager
.
If there is already a DBusObject
exported at the object path,
then the old object is removed.
The object path for object
must be in the hierarchy rooted by the
object path for manager
.
Note that manager
will take a reference on object
for as long as
it is exported.
Since: 2.30
exportUniquely
data DBusObjectManagerServerExportUniquelyMethodInfo Source #
((~) * signature (b -> m ()), MonadIO m, IsDBusObjectManagerServer a, IsDBusObjectSkeleton b) => MethodInfo * DBusObjectManagerServerExportUniquelyMethodInfo a signature Source # | |
dBusObjectManagerServerExportUniquely Source #
:: (HasCallStack, MonadIO m, IsDBusObjectManagerServer a, IsDBusObjectSkeleton b) | |
=> a |
|
-> b |
|
-> m () |
Like dBusObjectManagerServerExport
but appends a string of
the form _N (with N being a natural number) to object
's object path
if an object with the given path already exists. As such, the
DBusObjectProxy
:g-object-path
property of object
may be modified.
Since: 2.30
getConnection
data DBusObjectManagerServerGetConnectionMethodInfo Source #
((~) * signature (m DBusConnection), MonadIO m, IsDBusObjectManagerServer a) => MethodInfo * DBusObjectManagerServerGetConnectionMethodInfo a signature Source # | |
dBusObjectManagerServerGetConnection Source #
:: (HasCallStack, MonadIO m, IsDBusObjectManagerServer a) | |
=> a |
|
-> m DBusConnection | Returns: A |
Gets the DBusConnection
used by manager
.
Since: 2.30
isExported
data DBusObjectManagerServerIsExportedMethodInfo Source #
((~) * signature (b -> m Bool), MonadIO m, IsDBusObjectManagerServer a, IsDBusObjectSkeleton b) => MethodInfo * DBusObjectManagerServerIsExportedMethodInfo a signature Source # | |
dBusObjectManagerServerIsExported Source #
:: (HasCallStack, MonadIO m, IsDBusObjectManagerServer a, IsDBusObjectSkeleton b) | |
=> a |
|
-> b |
|
-> m Bool | Returns: |
Returns whether object
is currently exported on manager
.
Since: 2.34
new
dBusObjectManagerServerNew Source #
:: (HasCallStack, MonadIO m) | |
=> Text |
|
-> m DBusObjectManagerServer | Returns: A |
Creates a new DBusObjectManagerServer
object.
The returned server isn't yet exported on any connection. To do so,
use dBusObjectManagerServerSetConnection
. Normally you
want to export all of your objects before doing so to avoid
InterfacesAdded
signals being emitted.
Since: 2.30
setConnection
data DBusObjectManagerServerSetConnectionMethodInfo Source #
((~) * signature (Maybe b -> m ()), MonadIO m, IsDBusObjectManagerServer a, IsDBusConnection b) => MethodInfo * DBusObjectManagerServerSetConnectionMethodInfo a signature Source # | |
dBusObjectManagerServerSetConnection Source #
:: (HasCallStack, MonadIO m, IsDBusObjectManagerServer a, IsDBusConnection b) | |
=> a |
|
-> Maybe b |
|
-> m () |
Exports all objects managed by manager
on connection
. If
connection
is Nothing
, stops exporting objects.
unexport
data DBusObjectManagerServerUnexportMethodInfo Source #
((~) * signature (Text -> m Bool), MonadIO m, IsDBusObjectManagerServer a) => MethodInfo * DBusObjectManagerServerUnexportMethodInfo a signature Source # | |
dBusObjectManagerServerUnexport Source #
:: (HasCallStack, MonadIO m, IsDBusObjectManagerServer a) | |
=> a |
|
-> Text |
|
-> m Bool | Returns: |
If manager
has an object at path
, removes the object. Otherwise
does nothing.
Note that objectPath
must be in the hierarchy rooted by the
object path for manager
.
Since: 2.30
Properties
connection
data DBusObjectManagerServerConnectionPropertyInfo Source #
clearDBusObjectManagerServerConnection :: (MonadIO m, IsDBusObjectManagerServer o) => o -> m () Source #
constructDBusObjectManagerServerConnection :: (IsDBusObjectManagerServer o, IsDBusConnection a) => a -> IO (GValueConstruct o) Source #
dBusObjectManagerServerConnection :: AttrLabelProxy "connection" Source #
getDBusObjectManagerServerConnection :: (MonadIO m, IsDBusObjectManagerServer o) => o -> m (Maybe DBusConnection) Source #
setDBusObjectManagerServerConnection :: (MonadIO m, IsDBusObjectManagerServer o, IsDBusConnection a) => o -> a -> m () Source #
objectPath
data DBusObjectManagerServerObjectPathPropertyInfo Source #
constructDBusObjectManagerServerObjectPath :: IsDBusObjectManagerServer o => Text -> IO (GValueConstruct o) Source #
dBusObjectManagerServerObjectPath :: AttrLabelProxy "objectPath" Source #
getDBusObjectManagerServerObjectPath :: (MonadIO m, IsDBusObjectManagerServer o) => o -> m (Maybe Text) Source #