Open

Open — handle URIs

Functions

Description

These functions let applications open URIs in external handlers. A typical example is to open a pdf file in a document viewer.

The underlying portal is org.freedesktop.portal.OpenURI.

Functions

xdp_portal_open_uri ()

void
xdp_portal_open_uri (XdpPortal *portal,
                     XdpParent *parent,
                     const char *uri,
                     gboolean writable,
                     GCancellable *cancellable,
                     GAsyncReadyCallback callback,
                     gpointer data);

Opens uri with an external hamdler.

Parameters

portal

a XdpPortal

 

parent

parent window information

 

uri

the URI to open

 

writable

whether to make the file writable

 

cancellable

optional GCancellable.

[nullable]

callback

a callback to call when the request is done.

[scope async]

data

data to pass to callback .

[closure]

xdp_portal_open_uri_finish ()

gboolean
xdp_portal_open_uri_finish (XdpPortal *portal,
                            GAsyncResult *result,
                            GError **error);

Finishes the open-uri request, and returns the result in the form of a boolean.

Parameters

portal

a XdpPortal

 

result

a GAsyncResult

 

error

return location for an error

 

Returns

TRUE if the call succeeded