desktop-portal-0.6.0.0: Desktop Portal.
Safe HaskellSafe-Inferred
LanguageHaskell2010

Desktop.Portal

Description

Wrappers around the XDG Desktop Portal D-BUS API.

See the documentation for the underlying API: https://flatpak.github.io/xdg-desktop-portal

Synopsis

Connection Management

data Client Source #

A handle for an active desktop portal session. Can send requests and listen for signals.

Instances

Instances details
Show Client Source # 
Instance details

Defined in Desktop.Portal.Internal

Eq Client Source # 
Instance details

Defined in Desktop.Portal.Internal

Methods

(==) :: Client -> Client -> Bool #

(/=) :: Client -> Client -> Bool #

connect :: IO Client Source #

Open a new client connection. This can be used to send requests and listen for signals and finally can be closed using disconnect.

clientName :: Client -> BusName Source #

Get the unique name given to the client by D-BUS.

Request Management

data Request a Source #

A portal request that may be in-progress, finished, or cancelled.

Instances

Instances details
Show (Request a) Source # 
Instance details

Defined in Desktop.Portal.Internal

Methods

showsPrec :: Int -> Request a -> ShowS #

show :: Request a -> String #

showList :: [Request a] -> ShowS #

Eq (Request a) Source # 
Instance details

Defined in Desktop.Portal.Internal

Methods

(==) :: Request a -> Request a -> Bool #

(/=) :: Request a -> Request a -> Bool #

await :: Request a -> IO (Maybe a) Source #

Wait for a request to be finished, and return the result if it succeeded. If the request is cancelled, either by the user interface or by calling cancel, then Nothing will be returned.

cancel :: Request a -> IO () Source #

Cancel a request. This will cause any threads blocked on await to receive Nothing. Has no effect if the client is already cancelled or finished successfully.

Signal Management

data SignalHandler Source #

A listener for a particular signal. Can be cancelled with cancelSignalHandler.

cancelSignalHandler :: SignalHandler -> IO () Source #

Prevent any future invocations of the given signal handler.

Common Types

data FileSpec Source #

Specifies a file, either with a file descriptor or a path (which will be resolved to a file descriptor before passing it to the portals API, since the API typically requires file descriptors).

Instances

Instances details
Show FileSpec Source # 
Instance details

Defined in Desktop.Portal.Internal

Eq FileSpec Source # 
Instance details

Defined in Desktop.Portal.Internal

Portal Interfaces

openURIOptions Source #

Arguments

:: URI

The URI to open.

-> OpenURIOptions 

openDirectoryOptions Source #

Arguments

:: FileSpec

The directory to open.

-> OpenDirectoryOptions