gi-gio-2.0.35: Gio bindings

Copyright | Will Thompson and Iñaki García Etxebarria
License | LGPL-2.1
Maintainer | Iñaki García Etxebarria
Safe Haskell | Safe-Inferred
Language | Haskell2010

GI.Gio.Interfaces.DBusObject

Contents

- Exported types
- Methods
  - getInterface
  - getInterfaces
  - getObjectPath
- Signals
  - interfaceAdded
  - interfaceRemoved

Description

The `GDBusObject` type is the base type for D-Bus objects on both the service side (see `DBusObjectSkeleton`) and the client side (see `DBusObjectProxy`). It is essentially just a container of interfaces.

Synopsis

- newtype DBusObject = DBusObject (ManagedPtr DBusObject)
- class (GObject o, IsDescendantOf DBusObject o) => IsDBusObject o
- toDBusObject :: (MonadIO m, IsDBusObject o) => o -> m DBusObject
- dBusObjectGetInterface :: (HasCallStack, MonadIO m, IsDBusObject a) => a -> Text -> m (Maybe DBusInterface)
- dBusObjectGetInterfaces :: (HasCallStack, MonadIO m, IsDBusObject a) => a -> m [DBusInterface]
- dBusObjectGetObjectPath :: (HasCallStack, MonadIO m, IsDBusObject a) => a -> m Text
- type DBusObjectInterfaceAddedCallback = DBusInterface -> IO ()
- afterDBusObjectInterfaceAdded :: (IsDBusObject a, MonadIO m) => a -> ((?self :: a) => DBusObjectInterfaceAddedCallback) -> m SignalHandlerId
- onDBusObjectInterfaceAdded :: (IsDBusObject a, MonadIO m) => a -> ((?self :: a) => DBusObjectInterfaceAddedCallback) -> m SignalHandlerId
- type DBusObjectInterfaceRemovedCallback = DBusInterface -> IO ()
- afterDBusObjectInterfaceRemoved :: (IsDBusObject a, MonadIO m) => a -> ((?self :: a) => DBusObjectInterfaceRemovedCallback) -> m SignalHandlerId
- onDBusObjectInterfaceRemoved :: (IsDBusObject a, MonadIO m) => a -> ((?self :: a) => DBusObjectInterfaceRemovedCallback) -> m SignalHandlerId

# Exported types

newtype DBusObject Source #

Memory-managed wrapper type.

Constructors

DBusObject (ManagedPtr DBusObject) |

#### Instances

Instances details

Eq DBusObject Source # |
Instance details Defined in GI.Gio.Interfaces.DBusObject Methods (==) :: DBusObject -> DBusObject -> Bool Source # (/=) :: DBusObject -> DBusObject -> Bool Source #
GObject DBusObject Source # |
Instance details Defined in GI.Gio.Interfaces.DBusObject
ManagedPtrNewtype DBusObject Source # |
Instance details Defined in GI.Gio.Interfaces.DBusObject Methods toManagedPtr :: DBusObject -> ManagedPtr DBusObject Source #
TypedObject DBusObject Source # |
Instance details Defined in GI.Gio.Interfaces.DBusObject Methods glibType :: IO GType Source #
HasParentTypes DBusObject Source # |
Instance details Defined in GI.Gio.Interfaces.DBusObject
IsGValue (Maybe DBusObject) Source # | Convert `DBusObject` to and from `GValue`. See `toGValue` and `fromGValue`.
Instance details Defined in GI.Gio.Interfaces.DBusObject Methods gvalueGType_ :: IO GType Source # gvalueSet_ :: Ptr GValue -> Maybe DBusObject -> IO () Source # gvalueGet_ :: Ptr GValue -> IO (Maybe DBusObject) Source #
type ParentTypes DBusObject Source # |
Instance details Defined in GI.Gio.Interfaces.DBusObject type ParentTypes DBusObject = '[Object]

class (GObject o, IsDescendantOf DBusObject o) => IsDBusObject o Source #

Type class for types which can be safely cast to `DBusObject`, for instance with `toDBusObject`.

#### Instances

Instances details

(GObject o, IsDescendantOf DBusObject o) => IsDBusObject o Source # |
Instance details Defined in GI.Gio.Interfaces.DBusObject

toDBusObject :: (MonadIO m, IsDBusObject o) => o -> m DBusObject Source #

Cast to `DBusObject`, for types for which this is known to be safe. For general casts, use `castTo`.

# Methods

### Click to display all available methods, including inherited ones

Expand

#### Methods

bindProperty, bindPropertyFull, forceFloating, freezeNotify, getv, isFloating, notify, notifyByPspec, ref, refSink, runDispose, stealData, stealQdata, thawNotify, unref, watchClosure.

#### Getters

getData, getInterface, getInterfaces, getObjectPath, getProperty, getQdata.

#### Setters

setData, setDataFull, setProperty.

## getInterface

dBusObjectGetInterface Source #

Arguments

:: (HasCallStack, MonadIO m, IsDBusObject a) |
=> a | `object`: A `DBusObject`.
-> Text | `interfaceName`: A D-Bus interface name.
-> m (Maybe DBusInterface) | Returns: `Nothing` if not found, otherwise a `DBusInterface` that must be freed with `objectUnref`.

Gets the D-Bus interface with name `interfaceName` associated with `object`, if any.

Since: 2.30

## getInterfaces

dBusObjectGetInterfaces Source #

Arguments

:: (HasCallStack, MonadIO m, IsDBusObject a) |
=> a | `object`: A `DBusObject`.
-> m [DBusInterface] | Returns: A list of `DBusInterface` instances. The returned list must be freed by `g_list_free()` after each element has been freed with `objectUnref`.

Gets the D-Bus interfaces associated with `object`.

Since: 2.30

## getObjectPath

dBusObjectGetObjectPath Source #

Arguments

:: (HasCallStack, MonadIO m, IsDBusObject a) |
=> a | `object`: A `DBusObject`.
-> m Text | Returns: A string owned by `object`. Do not free.

Gets the object path for `object`.

Since: 2.30

# Signals

## interfaceAdded

type DBusObjectInterfaceAddedCallback Source #

Arguments

= DBusInterface | `interface`: The `DBusInterface` that was added.
-> IO () |

Emitted when `interface` is added to `object`.

Since: 2.30

afterDBusObjectInterfaceAdded :: (IsDBusObject a, MonadIO m) => a -> ((?self :: a) => DBusObjectInterfaceAddedCallback) -> m SignalHandlerId Source #

Connect a signal handler for the interfaceAdded signal, to be run after the default handler. When overloading is enabled, this is equivalent to

    after dBusObject #interfaceAdded callback

By default the object invoking the signal is not passed to the callback. If you need to access it, you can use the implit `?self` parameter. Note that this requires activating the `ImplicitParams` GHC extension.

onDBusObjectInterfaceAdded :: (IsDBusObject a, MonadIO m) => a -> ((?self :: a) => DBusObjectInterfaceAddedCallback) -> m SignalHandlerId Source #

Connect a signal handler for the interfaceAdded signal, to be run before the default handler. When overloading is enabled, this is equivalent to

    on dBusObject #interfaceAdded callback

## interfaceRemoved

type DBusObjectInterfaceRemovedCallback Source #

Arguments

= DBusInterface | `interface`: The `DBusInterface` that was removed.
-> IO () |

Emitted when `interface` is removed from `object`.

Since: 2.30

afterDBusObjectInterfaceRemoved :: (IsDBusObject a, MonadIO m) => a -> ((?self :: a) => DBusObjectInterfaceRemovedCallback) -> m SignalHandlerId Source #

Connect a signal handler for the interfaceRemoved signal, to be run after the default handler. When overloading is enabled, this is equivalent to

    after dBusObject #interfaceRemoved callback

By default the object invoking the signal is not passed to the callback. If you need to access it, you can use the implit `?self` parameter. Note that this requires activating the `ImplicitParams` GHC extension.

onDBusObjectInterfaceRemoved :: (IsDBusObject a, MonadIO m) => a -> ((?self :: a) => DBusObjectInterfaceRemovedCallback) -> m SignalHandlerId Source #

Connect a signal handler for the interfaceRemoved signal, to be run before the default handler. When overloading is enabled, this is equivalent to

    on dBusObject #interfaceRemoved callback