Xdp.Portal
Description: Reference for Xdp.Portal

### Class

# XdpPortal

#### Description [src]

    final class Xdp.Portal : GObject.Object
      implements Gio.Initable {
      /* No available fields */
    }

Context for portal calls.

The XdpPortal object provides the main context object for the portal operations of libportal.

Typically, an application will create a single XdpPortal object with `xdp_portal_new()` and use it throughout its lifetime.

#### Hierarchy

#### Ancestors

- GObject

#### Implements

- GInitable

#### Constructors

###### xdp_portal_initable_new

Creates a new `XdpPortal` object.

since: 0.7

###### xdp_portal_new

Creates a new `XdpPortal` object. If D-Bus is unavailable this API will abort. We recommend using `xdp_portal_initable_new()` to safely handle this failure.

#### Functions

###### xdp_portal_running_under_flatpak

Detects if running inside of a Flatpak or WebKit sandbox.

###### xdp_portal_running_under_sandbox

This function tries to determine if the current process is running under a sandbox that requires the use of portals.

###### xdp_portal_running_under_snap

Detects if you are running inside of a Snap sandbox.

#### Instance methods

###### xdp_portal_access_camera

Request access to a camera.

###### xdp_portal_access_camera_finish

Finishes a camera acess request.

###### xdp_portal_add_notification

Sends a desktop notification.

###### xdp_portal_add_notification_finish

Finishes the notification request.

###### xdp_portal_compose_email

Presents a window that lets the user compose an email, with some pre-filled information.

###### xdp_portal_compose_email_finish

Finishes the compose-email request.

###### xdp_portal_create_input_capture_session

Creates a session for input capture.

###### xdp_portal_create_input_capture_session2

Creates an inactive session for input capture.

###### xdp_portal_create_input_capture_session2_finish

Finishes the InputCapture CreateSession2 method call, and returns a `XdpInputCaptureSession`. To get to the `XdpSession` within use xdp_input_capture_session_get_session().

###### xdp_portal_create_input_capture_session2_sync

Creates an inactive session for input capture.

###### xdp_portal_create_input_capture_session_finish

Finishes the InputCapture CreateSession request, and returns a `XdpInputCaptureSession`. To get to the `XdpSession` within use xdp_input_capture_session_get_session().

###### xdp_portal_create_remote_desktop_session

Creates a session for remote desktop.

###### xdp_portal_create_remote_desktop_session_finish

Finishes the create-remote-desktop request, and returns a `XdpSession`.

###### xdp_portal_create_remote_desktop_session_full

Creates a session for remote desktop.

###### xdp_portal_create_screencast_session

Creates a session for a screencast.

###### xdp_portal_create_screencast_session_finish

Finishes the create-screencast request, and returns a `XdpSession`.

###### xdp_portal_dynamic_launcher_get_desktop_entry

This function gets the contents of a .desktop file that was previously installed by the dynamic launcher portal.

###### xdp_portal_dynamic_launcher_get_icon

This function gets the icon associated with a .desktop file that was previously installed by the dynamic launcher portal.

###### xdp_portal_dynamic_launcher_install

This function completes installation of a launcher so that the icon and name given in previous method calls will show up in the desktop environment’s menu.

###### xdp_portal_dynamic_launcher_launch

No description available.

###### xdp_portal_dynamic_launcher_prepare_install

Presents a dialog to the user so they can confirm they want to install a launcher to their desktop.

###### xdp_portal_dynamic_launcher_prepare_install_finish

Finishes the prepare-install-launcher request, and returns `GVariant` dictionary with the following information:.

###### xdp_portal_dynamic_launcher_request_install_token

Requests a token which can be passed to `xdp_portal_dynamic_launcher_install()` to complete installation of the launcher without user interaction.

###### xdp_portal_dynamic_launcher_uninstall

This function uninstalls a launcher that was previously installed using the dynamic launcher portal, resulting in the .desktop file and icon being deleted.

###### xdp_portal_get_input_capture_version

Retrieving the input portal API version.

###### xdp_portal_get_input_capture_version_finish

Finishes retrieving the input portal API version.

###### xdp_portal_get_input_capture_version_sync

Retrieving the input portal API version.

###### xdp_portal_get_settings

This function returns an object to access settings exposed through the portal.

###### xdp_portal_get_supported_notification_options

No description available.

since: 0.9.0

###### xdp_portal_get_user_information

Gets information about the user.

###### xdp_portal_get_user_information_finish

Finishes the get-user-information request.

###### xdp_portal_is_camera_present

Returns whether any camera are present.

###### xdp_portal_location_monitor_start

Makes `XdpPortal` start monitoring location changes.

###### xdp_portal_location_monitor_start_finish

Finishes a location-monitor request.

###### xdp_portal_location_monitor_stop

Stops location monitoring that was started with `xdp_portal_location_monitor_start()`.

###### xdp_portal_open_directory

Opens the directory containing the file specified by the `uri`.

###### xdp_portal_open_directory_finish

Finishes the open-directory request.

###### xdp_portal_open_file

Asks the user to open one or more files.

###### xdp_portal_open_file_finish

Finishes the open-file request.

###### xdp_portal_open_pipewire_remote_for_camera

Opens a file descriptor to the pipewire remote where the camera nodes are available.

###### xdp_portal_open_uri

Opens `uri` with an external handler.

###### xdp_portal_open_uri_finish

Finishes the open-uri request.

###### xdp_portal_pick_color

Lets the user pick a color from the screen.

###### xdp_portal_pick_color_finish

Finishes a pick-color request.

###### xdp_portal_prepare_print

Presents a print dialog to the user and returns print settings and page setup.

###### xdp_portal_prepare_print_finish

Finishes the prepare-print request.

###### xdp_portal_print_file

Prints a file.

###### xdp_portal_print_file_finish

Finishes the print request.

###### xdp_portal_remove_notification

Withdraws a desktop notification.

###### xdp_portal_request_background

Requests background permissions.

###### xdp_portal_request_background_finish

Finishes the request.

###### xdp_portal_save_file

Asks the user for a location to save a file.

###### xdp_portal_save_file_finish

Finishes the save-file request.

###### xdp_portal_save_files

Asks for a folder as a location to save one or more files.

###### xdp_portal_save_files_finish

Finishes the save-files request.

###### xdp_portal_session_inhibit

Inhibits various session status changes.

###### xdp_portal_session_inhibit_finish

Finishes the inhbit request.

###### xdp_portal_session_monitor_query_end_response

This method should be called within one second of receiving a `XdpPortal::session-state-changed` signal with the ‘Query End’ state, to acknowledge that they have handled the state change.

###### xdp_portal_session_monitor_start

Makes `XdpPortal` start monitoring the login session state.

###### xdp_portal_session_monitor_start_finish

Finishes a session-monitor request.

###### xdp_portal_session_monitor_stop

Stops session state monitoring that was started with `xdp_portal_session_monitor_start()`.

###### xdp_portal_session_uninhibit

Removes an inhibitor that was created by a call to `xdp_portal_session_inhibit()`.

###### xdp_portal_set_background_status

Sets the status information of the application, for when it’s running in background.

###### xdp_portal_set_background_status_finish

Finishes setting the background status of the application.

###### xdp_portal_set_wallpaper

Sets a desktop background image, given by a uri.

###### xdp_portal_set_wallpaper_finish

Finishes the open-uri request.

###### xdp_portal_spawn

Creates a new copy of the applications sandbox, and runs a process in, with the given arguments.

###### xdp_portal_spawn_finish

Finishes the spawn request.

###### xdp_portal_spawn_signal

Sends a Unix signal to a process that has been spawned by `xdp_portal_spawn()`.

###### xdp_portal_take_screenshot

Takes a screenshot.

###### xdp_portal_take_screenshot_finish

Finishes a screenshot request.

###### xdp_portal_trash_file

Sends the file at `path` to the trash can.

###### xdp_portal_trash_file_finish

Finishes the trash-file request.

###### xdp_portal_update_install

Installs an available software update.

###### xdp_portal_update_install_finish

Finishes an update-installation request.

###### xdp_portal_update_monitor_start

Makes `XdpPortal` start monitoring for available software updates.

###### xdp_portal_update_monitor_start_finish

Finishes an update-monitor request.

###### xdp_portal_update_monitor_stop

Stops update monitoring that was started with `xdp_portal_update_monitor_start()`.

##### Methods inherited from GObject (43)

Please see GObject for a full list of methods.

##### Methods inherited from GInitable (1)

###### g_initable_init

Initializes the object implementing the interface.

#### Signals

###### Xdp.Portal::location-updated

Emitted when location monitoring is enabled and the location changes.

###### Xdp.Portal::notification-action-invoked

Emitted when a non-exported action is activated on a notification.

###### Xdp.Portal::session-state-changed

Emitted when session state monitoring is enabled and the state of the login session changes or the screensaver is activated or deactivated.

###### Xdp.Portal::spawn-exited

Emitted when a process that was spawned with `xdp_portal_spawn()` exits.

###### Xdp.Portal::update-available

Emitted when updates monitoring is enabled and a new update is available.

###### Xdp.Portal::update-progress

Emitted to indicate progress of an update installation.

##### Signals inherited from GObject (1)

###### GObject::notify

The notify signal is emitted on an object when one of its properties has its value set through g_object_set_property(), g_object_set(), et al.

#### Class structure

    struct XdpPortalClass {
      GObjectClass parent_class;

    }

No description available.

###### Class members

`parent_class: GObjectClass`

  No description available.