<?xml version="1.0"?>
<!--
 Copyright (C) 2022 Aleix Pol Gonzalez <aleixpol@kde.org>

 SPDX-License-Identifier: LGPL-2.1-or-later

 This library is free software; you can redistribute it and/or
 modify it under the terms of the GNU Lesser General Public
 License as published by the Free Software Foundation; either
 version 2.1 of the License, or (at your option) any later version.

 This library is distributed in the hope that it will be useful,
 but WITHOUT ANY WARRANTY; without even the implied warranty of
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 Lesser General Public License for more details.

 You should have received a copy of the GNU Lesser General Public
 License along with this library. If not, see <http://www.gnu.org/licenses/>.

 Author: Aleix Pol Gonzalez <aleixpol@kde.org>
-->

<node name="/" xmlns:doc="http://www.freedesktop.org/dbus/1.0/doc.dtd">
  <!--
      org.freedesktop.impl.portal.GlobalShortcuts:
      @short_description: GlobalShortcuts portal backend interface

      This portal lets applications register global shortcuts so they can
      act regardless of the system state upon an input event.

      This documentation describes version 1 of this interface.
  -->
  <interface name="org.freedesktop.impl.portal.GlobalShortcuts">
    <!--
        CreateSession:
        @handle: Object path for the :ref:`org.freedesktop.impl.portal.Request` object representing this call
        @session_handle: Object path for the ref:`org.freedesktop.impl.portal.Session` object representing the session being created
        @app_id: App id of the application
        @options: Vardict with optional further information. See :ref:`org.freedesktop.portal.GlobalShortcuts.CreateSession`
        @response: Numeric Request response
        @results: Vardict with the results of the call

        Create a global shortcuts session.

        There are currently no supported keys in the @results vardict.
    -->
    <method name="CreateSession">
      <arg type="o" name="handle" direction="in"/>
      <arg type="o" name="session_handle" direction="in"/>
      <arg type="s" name="app_id" direction="in"/>
      <annotation name="org.qtproject.QtDBus.QtTypeName.In3" value="QVariantMap"/>
      <arg type="a{sv}" name="options" direction="in"/>
      <arg type="u" name="response" direction="out"/>
      <annotation name="org.qtproject.QtDBus.QtTypeName.Out1" value="QVariantMap"/>
      <arg type="a{sv}" name="results" direction="out"/>
    </method>

    <!--
        BindShortcuts:
        @handle: Object path for the :ref:`org.freedesktop.impl.portal.Request` object representing this call
        @session_handle: Object path for the :ref:`org.freedesktop.impl.portal.Session` object representing the session
        @shortcuts: The list of shortcuts to bind. See :ref:`org.freedesktop.portal.GlobalShortcuts.BindShortcuts`
        @parent_window: Identifier for the application window, see :doc:`window-identifiers`
        @shortcuts: The identifier of the shortcuts we intend to register, empty for all shortcuts
        @results: Vardict with the results of the call

        Bind the shortcuts of this session. This will typically result the portal
        presenting a dialog letting the user configure shortcut triggers.
    -->
    <method name="BindShortcuts">
      <arg type="o" name="handle" direction="in"/>
      <arg type="o" name="session_handle" direction="in"/>
      <annotation name="org.qtproject.QtDBus.QtTypeName.In2" value="QList&lt;QPair&lt;QString,QVariantMap&gt;&gt;"/>
      <arg type="a(sa{sv})" name="shortcuts" direction="in"/>
      <arg type="s" name="parent_window" direction="in"/>
      <annotation name="org.qtproject.QtDBus.QtTypeName.In3" value="QVariantMap"/>
      <arg type="a{sv}" name="options" direction="in"/>
      <annotation name="org.qtproject.QtDBus.QtTypeName.In4" value="QVariantMap"/>
      <arg type="u" name="response" direction="out"/>
      <arg type="a{sv}" name="results" direction="out"/>
      <annotation name="org.qtproject.QtDBus.QtTypeName.Out1" value="QVariantMap"/>
    </method>

    <!--
        ListShortcuts:
        @handle: Object path for the :ref:`org.freedesktop.impl.portal.Request` object representing this call
        @session_handle: Object path for the :ref:`org.freedesktop.impl.portal.Session` object representing the session
        @results: Vardict with the results of the call

        List shortcuts registered in the global shortcuts session.

        The following results get returned in the @results vardict:

        * ``shortcuts`` (``a(sa{sv})``)

          A list of shortcuts.

          See the :ref:`org.freedesktop.portal.GlobalShortcuts.BindShortcuts` method for
          the list of supported properties of shortcuts.
    -->
    <method name="ListShortcuts">
      <arg type="o" name="handle" direction="in"/>
      <arg type="o" name="session_handle" direction="in"/>
      <arg type="u" name="response" direction="out"/>
      <annotation name="org.qtproject.QtDBus.QtTypeName.Out1" value="QVariantMap"/>
      <arg type="a{sv}" name="results" direction="out"/>
    </method>

    <!--
        Activated:
        @session_handle: Session that requested the shortcut
        @shortcut_id: the application-provided ID for the notification
        @timestamp: the time of activation with millisecond granularity, with an undefined base.
        @options: Vardict with optional further information

        Emitted when a shortcut is activated.
    -->
    <signal name="Activated">
      <arg type="o" name="session_handle" direction="out"/>
      <arg type="s" name="shortcut_id" direction="out"/>
      <arg type="t" name="timestamp" direction="out"/>
      <annotation name="org.qtproject.QtDBus.QtTypeName.Out3" value="QVariantMap"/>
      <arg type="a{sv}" name="options" direction="out"/>
    </signal>

    <!--
        Deactivated:
        @session_handle: Session that requested the shortcut
        @shortcut_id: the application-provided ID for the notification
        @timestamp: the time of deactivation with millisecond granularity, with an undefined base.
        @options: Vardict with optional further information

        Emitted when a shortcut is deactivated.
    -->
    <signal name="Deactivated">
      <arg type="o" name="session_handle" direction="out"/>
      <arg type="s" name="shortcut_id" direction="out"/>
      <arg type="t" name="timestamp" direction="out"/>
      <annotation name="org.qtproject.QtDBus.QtTypeName.Out3" value="QVariantMap"/>
      <arg type="a{sv}" name="options" direction="out"/>
    </signal>

    <!--
        ShortcutsChanged:
        @session_handle: Session that requested the shortcut
        @shortcuts: The list of changed shortcuts

        Emitted when shortcuts are changed.

        The results get returned via the :ref:`org.freedesktop.portal.Request::Response`
        signal. See :ref:`org.freedesktop.portal.GlobalShortcuts.BindShortcuts` for the
        list of supported properties of shortcuts.
    -->
    <signal name="ShortcutsChanged">
      <arg type="o" name="session_handle" direction="out"/>
      <annotation name="org.qtproject.QtDBus.QtTypeName.Out1" value="QList&lt;QPair&lt;QString,QVariantMap&gt;&gt;"/>
      <arg type="a(sa{sv})" name="shortcuts" direction="out"/>
    </signal>

    <property name="version" type="u" access="read"/>
  </interface>
</node>
