gi-gio-2.0.24: Gio bindings

CopyrightWill Thompson Iñaki García Etxebarria and Jonas Platte
LicenseLGPL-2.1
MaintainerIñaki García Etxebarria (inaki@blueleaf.cc)
Safe HaskellNone
LanguageHaskell2010

GI.Gio.Objects.DBusInterfaceSkeleton

Contents

Description

Abstract base class for D-Bus interfaces on the service side.

Since: 2.30

Synopsis

Exported types

toDBusInterfaceSkeleton :: (MonadIO m, IsDBusInterfaceSkeleton o) => o -> m DBusInterfaceSkeleton Source #

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

Methods

export

dBusInterfaceSkeletonExport Source #

Arguments

:: (HasCallStack, MonadIO m, IsDBusInterfaceSkeleton a, IsDBusConnection b) 
=> a

interface_: The D-Bus interface to export.

-> b

connection: A DBusConnection to export interface_ on.

-> Text

objectPath: The path to export the interface at.

-> m ()

(Can throw GError)

Exports interface_ at objectPath on connection.

This can be called multiple times to export the same interface_ onto multiple connections however the objectPath provided must be the same for all connections.

Use dBusInterfaceSkeletonUnexport to unexport the object.

Since: 2.30

flush

dBusInterfaceSkeletonFlush Source #

Arguments

:: (HasCallStack, MonadIO m, IsDBusInterfaceSkeleton a) 
=> a

interface_: A DBusInterfaceSkeleton.

-> m () 

If interface_ has outstanding changes, request for these changes to be emitted immediately.

For example, an exported D-Bus interface may queue up property changes and emit the org.freedesktop.DBus.Properties.PropertiesChanged signal later (e.g. in an idle handler). This technique is useful for collapsing multiple property changes into one.

Since: 2.30

getConnection

dBusInterfaceSkeletonGetConnection Source #

Arguments

:: (HasCallStack, MonadIO m, IsDBusInterfaceSkeleton a) 
=> a

interface_: A DBusInterfaceSkeleton.

-> m DBusConnection

Returns: A DBusConnection or Nothing if interface_ is not exported anywhere. Do not free, the object belongs to interface_.

Gets the first connection that interface_ is exported on, if any.

Since: 2.30

getConnections

dBusInterfaceSkeletonGetConnections Source #

Arguments

:: (HasCallStack, MonadIO m, IsDBusInterfaceSkeleton a) 
=> a

interface_: A DBusInterfaceSkeleton.

-> m [DBusConnection]

Returns: A list of all the connections that interface_ is exported on. The returned list should be freed with g_list_free() after each element has been freed with objectUnref.

Gets a list of the connections that interface_ is exported on.

Since: 2.32

getFlags

dBusInterfaceSkeletonGetFlags Source #

Arguments

:: (HasCallStack, MonadIO m, IsDBusInterfaceSkeleton a) 
=> a

interface_: A DBusInterfaceSkeleton.

-> m [DBusInterfaceSkeletonFlags]

Returns: One or more flags from the DBusInterfaceSkeletonFlags enumeration.

Gets the DBusInterfaceSkeletonFlags that describes what the behavior of interface_

Since: 2.30

getInfo

dBusInterfaceSkeletonGetInfo Source #

Arguments

:: (HasCallStack, MonadIO m, IsDBusInterfaceSkeleton a) 
=> a

interface_: A DBusInterfaceSkeleton.

-> m DBusInterfaceInfo

Returns: A DBusInterfaceInfo (never Nothing). Do not free.

Gets D-Bus introspection information for the D-Bus interface implemented by interface_.

Since: 2.30

getObjectPath

dBusInterfaceSkeletonGetObjectPath Source #

Arguments

:: (HasCallStack, MonadIO m, IsDBusInterfaceSkeleton a) 
=> a

interface_: A DBusInterfaceSkeleton.

-> m Text

Returns: A string owned by interface_ or Nothing if interface_ is not exported anywhere. Do not free, the string belongs to interface_.

Gets the object path that interface_ is exported on, if any.

Since: 2.30

getProperties

dBusInterfaceSkeletonGetProperties Source #

Arguments

:: (HasCallStack, MonadIO m, IsDBusInterfaceSkeleton a) 
=> a

interface_: A DBusInterfaceSkeleton.

-> m GVariant

Returns: A GVariant of type ['a{sv}'][G-VARIANT-TYPE-VARDICT:CAPS]. Free with variantUnref.

Gets all D-Bus properties for interface_.

Since: 2.30

hasConnection

dBusInterfaceSkeletonHasConnection Source #

Arguments

:: (HasCallStack, MonadIO m, IsDBusInterfaceSkeleton a, IsDBusConnection b) 
=> a

interface_: A DBusInterfaceSkeleton.

-> b

connection: A DBusConnection.

-> m Bool

Returns: True if interface_ is exported on connection, False otherwise.

Checks if interface_ is exported on connection.

Since: 2.32

setFlags

dBusInterfaceSkeletonSetFlags Source #

Arguments

:: (HasCallStack, MonadIO m, IsDBusInterfaceSkeleton a) 
=> a

interface_: A DBusInterfaceSkeleton.

-> [DBusInterfaceSkeletonFlags]

flags: Flags from the DBusInterfaceSkeletonFlags enumeration.

-> m () 

Sets flags describing what the behavior of skeleton should be.

Since: 2.30

unexport

dBusInterfaceSkeletonUnexport Source #

Arguments

:: (HasCallStack, MonadIO m, IsDBusInterfaceSkeleton a) 
=> a

interface_: A DBusInterfaceSkeleton.

-> m () 

Stops exporting interface_ on all connections it is exported on.

To unexport interface_ from only a single connection, use dBusInterfaceSkeletonUnexportFromConnection

Since: 2.30

unexportFromConnection

dBusInterfaceSkeletonUnexportFromConnection Source #

Arguments

:: (HasCallStack, MonadIO m, IsDBusInterfaceSkeleton a, IsDBusConnection b) 
=> a

interface_: A DBusInterfaceSkeleton.

-> b

connection: A DBusConnection.

-> m () 

Stops exporting interface_ on connection.

To stop exporting on all connections the interface is exported on, use dBusInterfaceSkeletonUnexport.

Since: 2.32

Properties

gFlags

Flags from the DBusInterfaceSkeletonFlags enumeration.

Since: 2.30

constructDBusInterfaceSkeletonGFlags :: IsDBusInterfaceSkeleton o => [DBusInterfaceSkeletonFlags] -> IO (GValueConstruct o) Source #

Construct a GValueConstruct with valid value for the “g-flags” property. This is rarely needed directly, but it is used by new.

getDBusInterfaceSkeletonGFlags :: (MonadIO m, IsDBusInterfaceSkeleton o) => o -> m [DBusInterfaceSkeletonFlags] Source #

Get the value of the “g-flags” property. When overloading is enabled, this is equivalent to

get dBusInterfaceSkeleton #gFlags

setDBusInterfaceSkeletonGFlags :: (MonadIO m, IsDBusInterfaceSkeleton o) => o -> [DBusInterfaceSkeletonFlags] -> m () Source #

Set the value of the “g-flags” property. When overloading is enabled, this is equivalent to

set dBusInterfaceSkeleton [ #gFlags := value ]

Signals

gAuthorizeMethod

type C_DBusInterfaceSkeletonGAuthorizeMethodCallback = Ptr () -> Ptr DBusMethodInvocation -> Ptr () -> IO CInt Source #

Type for the callback on the (unwrapped) C side.

type DBusInterfaceSkeletonGAuthorizeMethodCallback Source #

Arguments

 = DBusMethodInvocation

invocation: A DBusMethodInvocation.

-> IO Bool

Returns: True if the call is authorized, False otherwise.

Emitted when a method is invoked by a remote caller and used to determine if the method call is authorized.

Note that this signal is emitted in a thread dedicated to handling the method call so handlers are allowed to perform blocking IO. This means that it is appropriate to call e.g. polkit_authority_check_authorization_sync() with the POLKIT_CHECK_AUTHORIZATION_FLAGS_ALLOW_USER_INTERACTION flag set.

If False is returned then no further handlers are run and the signal handler must take a reference to invocation and finish handling the call (e.g. return an error via g_dbus_method_invocation_return_error()).

Otherwise, if True is returned, signal emission continues. If no handlers return False, then the method is dispatched. If interface has an enclosing DBusObjectSkeleton, then the DBusObjectSkeleton::authorize-method signal handlers run before the handlers for this signal.

The default class handler just returns True.

Please note that the common case is optimized: if no signals handlers are connected and the default class handler isn't overridden (for both interface and the enclosing DBusObjectSkeleton, if any) and DBusInterfaceSkeleton:g-flags does not have the DBusInterfaceSkeletonFlagsHandleMethodInvocationsInThread flags set, no dedicated thread is ever used and the call will be handled in the same thread as the object that interface belongs to was exported in.

Since: 2.30

afterDBusInterfaceSkeletonGAuthorizeMethod :: (IsDBusInterfaceSkeleton a, MonadIO m) => a -> DBusInterfaceSkeletonGAuthorizeMethodCallback -> m SignalHandlerId Source #

Connect a signal handler for the “g-authorize-method” signal, to be run after the default handler. When overloading is enabled, this is equivalent to

after dBusInterfaceSkeleton #gAuthorizeMethod callback

onDBusInterfaceSkeletonGAuthorizeMethod :: (IsDBusInterfaceSkeleton a, MonadIO m) => a -> DBusInterfaceSkeletonGAuthorizeMethodCallback -> m SignalHandlerId Source #

Connect a signal handler for the “g-authorize-method” signal, to be run before the default handler. When overloading is enabled, this is equivalent to

on dBusInterfaceSkeleton #gAuthorizeMethod callback