Backend interface of the Access Portal More...
Header: | #include <AccessPortal> |
enum | DialogResponse { Accepted, Cancelled, Other } |
AccessPortal(QObject *parent) |
uint | AccessDialog(const QDBusObjectPath &handle, const QString &app_id, const QString &parent_window, const QString &title, const QString &subtitle, const QString &body, const QVariantMap &options, QVariantMap &results) |
void | handleDialogError() |
void | handleDialogResponse(const int &code) |
void | setupDialogResponse() |
void | waitForDialogResponse() |
Backend interface of the Access Portal
See XDG Desktop Portal Backend Specification for details.
Possible return values of a dialog interaction. The values correspond to the response poperties of the calls in this class.
Constant | Value | Description |
---|---|---|
Sailfish::XDP::AccessPortal::Accepted | 0 | The dialog has been accepted |
Sailfish::XDP::AccessPortal::Cancelled | 1 | The dialog has been cancelled |
Sailfish::XDP::AccessPortal::Other | 2 | Something else has happened (e.g. a timeout) |
Default constructs an instance of AccessPortal.
[slot]
uint AccessPortal::AccessDialog(const QDBusObjectPath &handle, const QString &app_id, const QString &parent_window, const QString &title, const QString &subtitle, const QString &body, const QVariantMap &options, QVariantMap &results)Presents the user with a prompt they can accept or deny, and several other options.
title, subtitle, and body can be used to configure the dialog appearance.
See the XDG Desktop Portal Specification for possible values of options. See the XDG Desktop Portal Backend Specification for the meaning of handle, app_id, parent_window, results.
Warning: The implementation of triggering the UI is incomplete. It serves as proof-of-concept only. Specifically, some options like modal
, or choices
are not handled.
[slot]
void AccessPortal::handleDialogError()Receives the results from the Dialog.
[slot]
void AccessPortal::handleDialogResponse(const int &code)Receives the results from the Dialog. code corresponds to the dialog response options.
See also Sailfish::XDP::AccessPortal::DialogResponse and [nemo-qml-plugin-dbus]{Nemo QML Plugin DBus}.
[slot]
void AccessPortal::setupDialogResponse()After the GUI has been launched, listens for the dialog's Done
signal, and calls AccessPortal::handleDialogResponse with the response.
See also handleDialogResponse.
[slot]
void AccessPortal::waitForDialogResponse()Since launching the GUI via D-Bus is asynchronous (or rather, returns immediately), we have to wait for a Done signal to arrive from the application.