| 1 |
<?xml version="1.0"?> |
| 2 |
<!-- |
| 3 |
Copyright (C) 2015 Red Hat, Inc. |
| 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: Alexander Larsson <[email protected]> |
| 21 |
--> |
| 22 |
<node xmlns:doc="http://www.freedesktop.org/dbus/1.0/doc.dtd" name="/"> |
| 23 |
<!-- |
| 24 |
org.freedesktop.impl.portal.FileChooser: |
| 25 |
@short_description: File chooser portal backend interface |
| 26 |
|
| 27 |
The FileChooser portal allows sandboxed applications to ask |
| 28 |
the user for access to files outside the sandbox. The portal |
| 29 |
backend will present the user with a file chooser dialog. |
| 30 |
|
| 31 |
Backends must normalize URIs of locations selected by the |
| 32 |
user into "file://" URIs. URIs that cannot be normalized |
| 33 |
should be discarded. |
| 34 |
--> |
| 35 |
<interface name="org.freedesktop.impl.portal.FileChooser"> |
| 36 |
<!-- |
| 37 |
OpenFile: |
| 38 |
@handle: Object path for the :ref:`org.freedesktop.impl.portal.Request` object representing this call |
| 39 |
@app_id: App id of the application |
| 40 |
@parent_window: Identifier for the application window, see :doc:`window-identifiers` |
| 41 |
@title: Title for the file chooser dialog |
| 42 |
@options: Vardict with optional further information |
| 43 |
@response: Numeric response |
| 44 |
@results: Vardict with the results of the call |
| 45 |
|
| 46 |
Presents a file chooser dialog to the user to open one or more files. |
| 47 |
|
| 48 |
Supported keys in the @options vardict include: |
| 49 |
|
| 50 |
* ``accept_label`` (``s``) |
| 51 |
|
| 52 |
The label for the accept button. Mnemonic underlines are allowed. |
| 53 |
|
| 54 |
* ``modal`` (``b``) |
| 55 |
|
| 56 |
Whether to make the dialog modal. Default is yes. |
| 57 |
|
| 58 |
* ``multiple`` (``b``) |
| 59 |
|
| 60 |
Whether to allow selection of multiple files. Default is no. |
| 61 |
|
| 62 |
* ``directory`` (``b``) |
| 63 |
|
| 64 |
Whether to select for folders instead of files. Default is to select files. |
| 65 |
|
| 66 |
* ``filters`` (``a(sa(us))``) |
| 67 |
|
| 68 |
A list of serialized file filters. |
| 69 |
See :ref:`org.freedesktop.portal.FileChooser.OpenFile` for details. |
| 70 |
|
| 71 |
* ``current_filter`` (``(sa(us))``) |
| 72 |
|
| 73 |
Request that this filter be set by default at dialog creation. |
| 74 |
See :ref:`org.freedesktop.portal.FileChooser.OpenFile` for details. |
| 75 |
|
| 76 |
* ``choices`` (``a(ssa(ss)s)``) |
| 77 |
|
| 78 |
A list of serialized combo boxes. |
| 79 |
See :ref:`org.freedesktop.portal.FileChooser.OpenFile` for details. |
| 80 |
|
| 81 |
* ``current_folder`` (``ay``) |
| 82 |
|
| 83 |
A suggested folder to open the files from. |
| 84 |
See :ref:`org.freedesktop.portal.FileChooser.OpenFile` for details. |
| 85 |
|
| 86 |
The following results get returned via the @results vardict: |
| 87 |
|
| 88 |
* ``uris`` (``as``) |
| 89 |
|
| 90 |
An array of strings containing the uris of the selected files. All |
| 91 |
URIs must have the ``file://`` scheme. |
| 92 |
|
| 93 |
* ``choices`` (``a(ss)``) |
| 94 |
|
| 95 |
An array of pairs of strings, corresponding to the passed-in choices. |
| 96 |
See :ref:`org.freedesktop.portal.FileChooser.OpenFile` for details. |
| 97 |
|
| 98 |
* ``current_filter`` (``(sa(us))``) |
| 99 |
|
| 100 |
The filter that was selected. |
| 101 |
See :ref:`org.freedesktop.portal.FileChooser.OpenFile` for details. |
| 102 |
|
| 103 |
* ``writable`` (``b``) |
| 104 |
|
| 105 |
Whether the file is opened with write access. Default is ``false``. |
| 106 |
--> |
| 107 |
<method name="OpenFile"> |
| 108 |
<arg type="o" name="handle" direction="in"/> |
| 109 |
<arg type="s" name="app_id" direction="in"/> |
| 110 |
<arg type="s" name="parent_window" direction="in"/> |
| 111 |
<arg type="s" name="title" direction="in"/> |
| 112 |
<annotation name="org.qtproject.QtDBus.QtTypeName.In4" value="QVariantMap"/> |
| 113 |
<arg type="a{sv}" name="options" direction="in"/> |
| 114 |
<arg type="u" name="response" direction="out"/> |
| 115 |
<annotation name="org.qtproject.QtDBus.QtTypeName.Out1" value="QVariantMap"/> |
| 116 |
<arg type="a{sv}" name="results" direction="out"/> |
| 117 |
</method> |
| 118 |
<!-- |
| 119 |
SaveFile: |
| 120 |
@handle: Object path for the :ref:`org.freedesktop.impl.portal.Request` object representing this call |
| 121 |
@app_id: App id of the application |
| 122 |
@parent_window: Identifier for the application window, see :doc:`window-identifiers` |
| 123 |
@title: Title for the file chooser dialog |
| 124 |
@options: Vardict with optional further information |
| 125 |
@response: Numeric response |
| 126 |
@results: Vardict with the results of the call |
| 127 |
|
| 128 |
Presents a file chooser dialog to the user to save a file. |
| 129 |
|
| 130 |
Supported keys in the @options vardict include: |
| 131 |
|
| 132 |
* ``accept_label`` (``s``) |
| 133 |
|
| 134 |
The label for the accept button. Mnemonic underlines are allowed. |
| 135 |
|
| 136 |
* ``modal`` (``b``) |
| 137 |
|
| 138 |
Whether to make the dialog modal. Default is yes. |
| 139 |
|
| 140 |
* ``multiple`` (``b``) |
| 141 |
|
| 142 |
Whether to allow selection of multiple files. Default is no. |
| 143 |
|
| 144 |
* ``filters`` (``a(sa(us))``) |
| 145 |
|
| 146 |
A list of serialized file filters. |
| 147 |
See :ref:`org.freedesktop.portal.FileChooser.OpenFile` for details. |
| 148 |
|
| 149 |
* ``current_filter`` (``(sa(us))``) |
| 150 |
|
| 151 |
Request that this filter be set by default at dialog creation. |
| 152 |
See :ref:`org.freedesktop.portal.FileChooser.OpenFile` for details. |
| 153 |
|
| 154 |
* ``choices`` (``a(ssa(ss)s)``) |
| 155 |
|
| 156 |
A list of serialized combo boxes. |
| 157 |
See :ref:`org.freedesktop.portal.FileChooser.OpenFile` for details. |
| 158 |
|
| 159 |
* ``current_name`` (``s``) |
| 160 |
|
| 161 |
A suggested filename. |
| 162 |
|
| 163 |
* ``current_folder`` (``ay``) |
| 164 |
|
| 165 |
A suggested folder to save the file in. |
| 166 |
|
| 167 |
* ``current_file`` (``ay``) |
| 168 |
|
| 169 |
The current file (when saving an existing file). |
| 170 |
|
| 171 |
The following results get returned via the @results vardict: |
| 172 |
|
| 173 |
* ``uris`` (``as``) |
| 174 |
|
| 175 |
An array of strings containing the uri of the selected file. All |
| 176 |
URIs must have the "file://" scheme. |
| 177 |
|
| 178 |
* ``choices`` (``a(ss)``) |
| 179 |
|
| 180 |
An array of pairs of strings, corresponding to the passed-in choices. |
| 181 |
See :ref:`org.freedesktop.portal.FileChooser.OpenFile` for details. |
| 182 |
|
| 183 |
* ``current_filter`` (``(sa(us))``) |
| 184 |
|
| 185 |
The filter that was selected. |
| 186 |
See :ref:`org.freedesktop.portal.FileChooser.OpenFile` for details. |
| 187 |
--> |
| 188 |
<method name="SaveFile"> |
| 189 |
<arg type="o" name="handle" direction="in"/> |
| 190 |
<arg type="s" name="app_id" direction="in"/> |
| 191 |
<arg type="s" name="parent_window" direction="in"/> |
| 192 |
<arg type="s" name="title" direction="in"/> |
| 193 |
<annotation name="org.qtproject.QtDBus.QtTypeName.In4" value="QVariantMap"/> |
| 194 |
<arg type="a{sv}" name="options" direction="in"/> |
| 195 |
<arg type="u" name="response" direction="out"/> |
| 196 |
<annotation name="org.qtproject.QtDBus.QtTypeName.Out1" value="QVariantMap"/> |
| 197 |
<arg type="a{sv}" name="results" direction="out"/> |
| 198 |
</method> |
| 199 |
<!-- |
| 200 |
SaveFiles: |
| 201 |
@parent_window: Identifier for the application window, see :doc:`window-identifiers` |
| 202 |
@title: Title for the file chooser dialog |
| 203 |
@options: Vardict with optional further information |
| 204 |
@handle: Object path for the :ref:`org.freedesktop.portal.Request` object representing this call |
| 205 |
@response: Numeric response |
| 206 |
@results: Vardict with the results of the call |
| 207 |
|
| 208 |
Asks for a folder as a location to save one or more files. The |
| 209 |
names of the files will be used as-is and appended to the |
| 210 |
selected folder's path in the list of returned files. If the |
| 211 |
selected folder already contains a file with one of the given |
| 212 |
names, the portal may prompt or take some other action to |
| 213 |
construct a unique file name and return that instead. |
| 214 |
|
| 215 |
Supported keys in the @options vardict include: |
| 216 |
|
| 217 |
* ``accept_label`` (``s``) |
| 218 |
|
| 219 |
Label for the accept button. Mnemonic underlines are allowed. |
| 220 |
|
| 221 |
* ``modal`` (``b``) |
| 222 |
|
| 223 |
Whether the dialog should be modal. Default is yes. |
| 224 |
|
| 225 |
* ``choices`` (``a(ssa(ss)s)``) |
| 226 |
|
| 227 |
List of serialized combo boxes. |
| 228 |
See :ref:`org.freedesktop.portal.FileChooser.OpenFile` for details. |
| 229 |
|
| 230 |
* ``current_folder`` (``ay``) |
| 231 |
|
| 232 |
Suggested folder to save the files in. The byte array is |
| 233 |
expected to be null-terminated. |
| 234 |
|
| 235 |
* ``files`` (``aay``) |
| 236 |
|
| 237 |
An array of file names to be saved. The array and byte |
| 238 |
arrays are expected to be null-terminated. |
| 239 |
|
| 240 |
The following results get returned via the |
| 241 |
:ref:`org.freedesktop.portal.Request::Response` signal: |
| 242 |
|
| 243 |
* ``uris`` (``as``) |
| 244 |
|
| 245 |
An array of strings containing the uri corresponding to |
| 246 |
each file given by @options, in the same order. Note that |
| 247 |
the file names may have changed, for example if a file |
| 248 |
with the same name in the selected folder already exists. |
| 249 |
|
| 250 |
All URIs must have the "file://" scheme. |
| 251 |
|
| 252 |
* ``choices`` (``a(ss)``) |
| 253 |
|
| 254 |
An array of pairs of strings, corresponding to the passed-in choices. |
| 255 |
See :ref:`org.freedesktop.portal.FileChooser.OpenFile` for details. |
| 256 |
--> |
| 257 |
<method name="SaveFiles"> |
| 258 |
<arg type="o" name="handle" direction="in"/> |
| 259 |
<arg type="s" name="app_id" direction="in"/> |
| 260 |
<arg type="s" name="parent_window" direction="in"/> |
| 261 |
<arg type="s" name="title" direction="in"/> |
| 262 |
<annotation name="org.qtproject.QtDBus.QtTypeName.In4" value="QVariantMap"/> |
| 263 |
<arg type="a{sv}" name="options" direction="in"/> |
| 264 |
<arg type="u" name="response" direction="out"/> |
| 265 |
<annotation name="org.qtproject.QtDBus.QtTypeName.Out1" value="QVariantMap"/> |
| 266 |
<arg type="a{sv}" name="results" direction="out"/> |
| 267 |
</method> |
| 268 |
</interface> |
| 269 |
</node> |