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