| 1 |
<?xml version="1.0"?> |
| 2 |
<!-- |
| 3 |
Copyright (C) 2022 Aleix Pol Gonzalez <[email protected]> |
| 4 |
|
| 5 |
SPDX-License-Identifier: LGPL-2.1-or-later |
| 6 |
|
| 7 |
This library is free software; you can redistribute it and/or |
| 8 |
modify it under the terms of the GNU Lesser General Public |
| 9 |
License as published by the Free Software Foundation; either |
| 10 |
version 2.1 of the License, or (at your option) any later version. |
| 11 |
|
| 12 |
This library is distributed in the hope that it will be useful, |
| 13 |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 14 |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 15 |
Lesser General Public License for more details. |
| 16 |
|
| 17 |
You should have received a copy of the GNU Lesser General Public |
| 18 |
License along with this library. If not, see <http://www.gnu.org/licenses/>. |
| 19 |
|
| 20 |
Author: Aleix Pol Gonzalez <[email protected]> |
| 21 |
--> |
| 22 |
|
| 23 |
<node name="/" xmlns:doc="http://www.freedesktop.org/dbus/1.0/doc.dtd"> |
| 24 |
<!-- |
| 25 |
org.freedesktop.portal.GlobalShortcuts: |
| 26 |
@short_description: Portal for managing global shortcuts |
| 27 |
|
| 28 |
This portal lets applications create global shortcuts sessions, and |
| 29 |
register shortcuts to them. These shortcuts are activated regardless of |
| 30 |
the focused state of the application window. |
| 31 |
|
| 32 |
To use this portal, applications have to create a session under which its |
| 33 |
actions will be collected. Then shortcuts can be bound (see |
| 34 |
org.freedesktop.portal.GlobalShortcuts.Bind), and listed (see |
| 35 |
org.freedesktop.portal.GlobalShortcuts.ListShortcuts). |
| 36 |
|
| 37 |
All global shortcuts are bound to a session, and all sessions are bound to |
| 38 |
the application that created them. |
| 39 |
|
| 40 |
The #org.freedesktop.portal.GlobalShortcuts::Activated and |
| 41 |
#org.freedesktop.portal.GlobalShortcuts::Deactivated signals are emitted, |
| 42 |
respectively, whenever a shortcut is activated and deactivated. |
| 43 |
|
| 44 |
This documentation describes version 2 of this interface. |
| 45 |
--> |
| 46 |
<interface name="org.freedesktop.portal.GlobalShortcuts"> |
| 47 |
<!-- |
| 48 |
CreateSession: |
| 49 |
@options: Vardict with optional further information |
| 50 |
@handle: Object path for the :ref:`org.freedesktop.portal.Request` object representing this call |
| 51 |
|
| 52 |
Creates a global shortcuts session. |
| 53 |
|
| 54 |
Supported keys in the @options vardict include: |
| 55 |
|
| 56 |
* ``handle_token`` (``s``) |
| 57 |
|
| 58 |
A string that will be used as the last element of the @handle. Must be a valid |
| 59 |
object path element. See the org.freedesktop.portal.Request documentation for |
| 60 |
more information about the @handle. |
| 61 |
|
| 62 |
* ``session_handle_token`` (``s``) |
| 63 |
|
| 64 |
A string that will be used as the last element of the session handle. Must be a valid |
| 65 |
object path element. See the org.freedesktop.portal.Session documentation for |
| 66 |
more information about the session handle. |
| 67 |
|
| 68 |
The following results get returned via the :ref:`org.freedesktop.portal.Request::Response` signal: |
| 69 |
|
| 70 |
* ``session_handle`` (``s``) |
| 71 |
|
| 72 |
The session handle. An object path for the |
| 73 |
org.freedesktop.portal.Session object representing the created |
| 74 |
session. |
| 75 |
|
| 76 |
.. note:: |
| 77 |
The ``session_handle`` is an object path that was erroneously implemented |
| 78 |
as ``s``. For backwards compatibility it will remain this type. |
| 79 |
--> |
| 80 |
<method name="CreateSession"> |
| 81 |
<annotation name="org.qtproject.QtDBus.QtTypeName.In0" value="QVariantMap"/> |
| 82 |
<arg type="a{sv}" name="options" direction="in"/> |
| 83 |
<arg type="o" name="handle" direction="out"/> |
| 84 |
</method> |
| 85 |
|
| 86 |
<!-- |
| 87 |
BindShortcuts: |
| 88 |
@session_handle: Object path for the :ref:`org.freedesktop.portal.Session` object representing the session |
| 89 |
@shortcuts: The list of shortcuts to bind |
| 90 |
@parent_window: Identifier for the application window, see :doc:`window-identifiers` |
| 91 |
@options: Vardict with optional further information |
| 92 |
@request_handle: Object path for the :ref:`org.freedesktop.portal.Request` object representing this call |
| 93 |
|
| 94 |
Bind the shortcuts. This will typically result the portal presenting a |
| 95 |
dialog showing the shortcuts and allowing users to configure the shortcuts. |
| 96 |
An application can only attempt bind shortcuts of a session once. |
| 97 |
|
| 98 |
Each element of the @shortcuts array is a tuple composed of a shortcut id, |
| 99 |
and a vardict with the following keys: |
| 100 |
|
| 101 |
* ``description`` (``s``) |
| 102 |
|
| 103 |
User-readable text describing what the shortcut does. |
| 104 |
|
| 105 |
* ``preferred_trigger`` (``s``) |
| 106 |
|
| 107 |
The preferred shortcut trigger, defined as described by the |
| 108 |
`shortcuts XDG specification <https://specifications.freedesktop.org/shortcuts-spec/latest/>`__. |
| 109 |
Optional. |
| 110 |
|
| 111 |
Supported keys in the @options vardict include: |
| 112 |
|
| 113 |
* ``handle_token`` (``s``) |
| 114 |
|
| 115 |
A string that will be used as the last element of the |
| 116 |
@handle. Must be a valid object path element. See the |
| 117 |
:ref:`org.freedesktop.portal.Request` documentation for more |
| 118 |
information about the @handle. |
| 119 |
|
| 120 |
The following results get returned via the ref::`org.freedesktop.portal.Request::Response` signal: |
| 121 |
|
| 122 |
* ``shortcuts`` (``a(sa{sv})``) |
| 123 |
|
| 124 |
The list of shortcuts which were bound. This is a subset of the |
| 125 |
shortcuts which were passed in from the @shortcuts variable of this |
| 126 |
method (this includes the set of all shortcuts and the empty set). |
| 127 |
The keys they may contain are described below, and are different from |
| 128 |
the keys in the @shortcuts variable of this method. |
| 129 |
|
| 130 |
Each element of the @shortcuts array returned by the |
| 131 |
:ref:`org.freedesktop.portal.Request::Response` signal is a tuple composed of |
| 132 |
a shortcut id, and a vardict with the following keys: |
| 133 |
|
| 134 |
* ``description`` (``s``) |
| 135 |
|
| 136 |
User-readable text describing what the shortcut does. |
| 137 |
|
| 138 |
* ``trigger_description`` (``s``) |
| 139 |
|
| 140 |
User-readable text describing how to trigger the shortcut for the |
| 141 |
client to render. |
| 142 |
--> |
| 143 |
<method name="BindShortcuts"> |
| 144 |
<arg type="o" name="session_handle" direction="in"/> |
| 145 |
<annotation name="org.qtproject.QtDBus.QtTypeName.In1" value="QList<QPair<QString,QVariantMap>>"/> |
| 146 |
<arg type="a(sa{sv})" name="shortcuts" direction="in"/> |
| 147 |
<arg type="s" name="parent_window" direction="in"/> |
| 148 |
<annotation name="org.qtproject.QtDBus.QtTypeName.In3" value="QVariantMap"/> |
| 149 |
<arg type="a{sv}" name="options" direction="in"/> |
| 150 |
<arg type="o" name="request_handle" direction="out"/> |
| 151 |
</method> |
| 152 |
|
| 153 |
<!-- |
| 154 |
ListShortcuts: |
| 155 |
@session_handle: Object path for the :ref:`org.freedesktop.portal.Session` object representing the session |
| 156 |
@options: Vardict with optional further information |
| 157 |
|
| 158 |
Lists shortcuts of a session. |
| 159 |
|
| 160 |
If `BindShortcuts` was called for `session` all active shortcuts for `session` are returned. |
| 161 |
Otherwise returns the shortcuts that were sucessfully bound in a previous session by this application. |
| 162 |
|
| 163 |
Supported keys in the @options vardict include: |
| 164 |
|
| 165 |
* ``handle_token`` (``s``) |
| 166 |
|
| 167 |
A string that will be used as the last element of the |
| 168 |
@handle. Must be a valid object path element. See the |
| 169 |
:ref:`org.freedesktop.portal.Request` documentation for more |
| 170 |
information about the @handle. |
| 171 |
|
| 172 |
The following results get returned via the :ref:`org.freedesktop.portal.Request::Response` signal: |
| 173 |
|
| 174 |
* ``shortcuts`` (``a(sa{sv})``) |
| 175 |
|
| 176 |
A list of shortcuts. |
| 177 |
|
| 178 |
See the :ref:`org.freedesktop.portal.Request::Response` signal of the |
| 179 |
org.freedesktop.portal.GlobalShortcuts.BindShortcuts() method for |
| 180 |
the list of supported properties of shortcuts. |
| 181 |
--> |
| 182 |
<method name="ListShortcuts"> |
| 183 |
<arg type="o" name="session_handle" direction="in"/> |
| 184 |
<annotation name="org.qtproject.QtDBus.QtTypeName.In1" value="QVariantMap"/> |
| 185 |
<arg type="a{sv}" name="options" direction="in"/> |
| 186 |
<arg type="o" name="request_handle" direction="out"/> |
| 187 |
</method> |
| 188 |
|
| 189 |
<!-- |
| 190 |
ConfigureShortcuts: |
| 191 |
@session_handle: Object path for the :ref:`org.freedesktop.portal.Session` object representing the session |
| 192 |
@parent_window: Identifier for the application window, see :doc:`window-identifiers` |
| 193 |
@options: Vardict with optional further information |
| 194 |
|
| 195 |
Request showing a configuration UI so the user is able to configure all shortcuts of this session. |
| 196 |
|
| 197 |
Supported keys in the @options vardict include: |
| 198 |
|
| 199 |
* ``activation_token`` (``s``) |
| 200 |
|
| 201 |
A token that can be used to activate the configuration window. |
| 202 |
|
| 203 |
This method was added in version 2 of this interface. |
| 204 |
--> |
| 205 |
<method name="ConfigureShortcuts"> |
| 206 |
<arg type="o" name="session_handle" direction="in"/> |
| 207 |
<arg type="s" name="parent_window" direction="in" /> |
| 208 |
<annotation name="org.qtproject.QtDBus.QtTypeName.In2" value="QVariantMap"/> |
| 209 |
<arg type="a{sv}" name="options" direction="in"/> |
| 210 |
</method> |
| 211 |
|
| 212 |
<!-- |
| 213 |
Activated: |
| 214 |
@session_handle: Session that requested the shortcut |
| 215 |
@shortcut_id: the application-provided ID for the notification |
| 216 |
@timestamp: the time of activation with millisecond granularity, with an undefined base. |
| 217 |
@options: Vardict with optional further information |
| 218 |
|
| 219 |
Notifies about a shortcut becoming active. |
| 220 |
|
| 221 |
Supported keys in the @options vardict include: |
| 222 |
|
| 223 |
* ``activation_token`` (``s``) |
| 224 |
|
| 225 |
A token that can be used to activate a window in response to the |
| 226 |
shortcut getting activated. |
| 227 |
--> |
| 228 |
<signal name="Activated"> |
| 229 |
<arg type="o" name="session_handle" direction="out"/> |
| 230 |
<arg type="s" name="shortcut_id" direction="out"/> |
| 231 |
<arg type="t" name="timestamp" direction="out"/> |
| 232 |
<annotation name="org.qtproject.QtDBus.QtTypeName.Out3" value="QVariantMap"/> |
| 233 |
<arg type="a{sv}" name="options" direction="out"/> |
| 234 |
</signal> |
| 235 |
|
| 236 |
<!-- |
| 237 |
Deactivated: |
| 238 |
@session_handle: Session that requested the shortcut |
| 239 |
@shortcut_id: the application-provided ID for the notification |
| 240 |
@timestamp: the time of deactivation with millisecond granularity, with an undefined base. |
| 241 |
@options: Vardict with optional further information |
| 242 |
|
| 243 |
Notifies that a shortcut is not active anymore. |
| 244 |
|
| 245 |
Supported keys in the @options vardict include: |
| 246 |
|
| 247 |
* ``activation_token`` (``s``) |
| 248 |
|
| 249 |
A token that can be used to activate a window in response to the |
| 250 |
shortcut getting deactivated. |
| 251 |
--> |
| 252 |
<signal name="Deactivated"> |
| 253 |
<arg type="o" name="session_handle" direction="out"/> |
| 254 |
<arg type="s" name="shortcut_id" direction="out"/> |
| 255 |
<arg type="t" name="timestamp" direction="out"/> |
| 256 |
<annotation name="org.qtproject.QtDBus.QtTypeName.Out3" value="QVariantMap"/> |
| 257 |
<arg type="a{sv}" name="options" direction="out"/> |
| 258 |
</signal> |
| 259 |
|
| 260 |
<!-- |
| 261 |
ShortcutsChanged: |
| 262 |
@session_handle: Session that requested the shortcut |
| 263 |
@shortcuts: The different shortcuts that have been registered. See org.freedesktop.portal.GlobalShortcuts. |
| 264 |
|
| 265 |
Indicates that the information associated with some of the shortcuts has changed. |
| 266 |
|
| 267 |
See the :ref:`org.freedesktop.portal.Request::Response` signal of the |
| 268 |
org.freedesktop.portal.GlobalShortcuts.BindShortcuts() method for the |
| 269 |
list of supported properties of shortcuts. |
| 270 |
--> |
| 271 |
<signal name="ShortcutsChanged"> |
| 272 |
<arg type="o" name="session_handle" direction="out"/> |
| 273 |
<annotation name="org.qtproject.QtDBus.QtTypeName.Out1" value="QList<QPair<QString,QVariantMap>>"/> |
| 274 |
<arg type="a(sa{sv})" name="shortcuts" direction="out"/> |
| 275 |
</signal> |
| 276 |
|
| 277 |
<property name="version" type="u" access="read"/> |
| 278 |
</interface> |
| 279 |
</node> |