Debian Codegraph @

data/org.freedesktop.impl.portal.FileChooser.xml

raw
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 * ``filters`` (``a(sa(us))``)
141
142 A list of serialized file filters.
143 See :ref:`org.freedesktop.portal.FileChooser.OpenFile` for details.
144
145 * ``current_filter`` (``(sa(us))``)
146
147 Request that this filter be set by default at dialog creation.
148 See :ref:`org.freedesktop.portal.FileChooser.OpenFile` for details.
149
150 * ``choices`` (``a(ssa(ss)s)``)
151
152 A list of serialized combo boxes.
153 See :ref:`org.freedesktop.portal.FileChooser.OpenFile` for details.
154
155 * ``current_name`` (``s``)
156
157 A suggested filename.
158
159 * ``current_folder`` (``ay``)
160
161 A suggested folder to save the file in.
162
163 * ``current_file`` (``ay``)
164
165 The current file (when saving an existing file).
166
167 The following results get returned via the @results vardict:
168
169 * ``uris`` (``as``)
170
171 An array of strings containing the uri of the selected file. It must
172 have exactly one element. All URIs must have the "file://" scheme.
173
174 * ``choices`` (``a(ss)``)
175
176 An array of pairs of strings, corresponding to the passed-in choices.
177 See :ref:`org.freedesktop.portal.FileChooser.OpenFile` for details.
178
179 * ``current_filter`` (``(sa(us))``)
180
181 The filter that was selected.
182 See :ref:`org.freedesktop.portal.FileChooser.OpenFile` for details.
183 -->
184 <method name="SaveFile">
185 <arg type="o" name="handle" direction="in"/>
186 <arg type="s" name="app_id" direction="in"/>
187 <arg type="s" name="parent_window" direction="in"/>
188 <arg type="s" name="title" direction="in"/>
189 <annotation name="org.qtproject.QtDBus.QtTypeName.In4" value="QVariantMap"/>
190 <arg type="a{sv}" name="options" direction="in"/>
191 <arg type="u" name="response" direction="out"/>
192 <annotation name="org.qtproject.QtDBus.QtTypeName.Out1" value="QVariantMap"/>
193 <arg type="a{sv}" name="results" direction="out"/>
194 </method>
195 <!--
196 SaveFiles:
197 @parent_window: Identifier for the application window, see :doc:`window-identifiers`
198 @title: Title for the file chooser dialog
199 @options: Vardict with optional further information
200 @handle: Object path for the :ref:`org.freedesktop.portal.Request` object representing this call
201 @response: Numeric response
202 @results: Vardict with the results of the call
203
204 Asks for a folder as a location to save one or more files. The
205 names of the files will be used as-is and appended to the
206 selected folder's path in the list of returned files. If the
207 selected folder already contains a file with one of the given
208 names, the portal may prompt or take some other action to
209 construct a unique file name and return that instead.
210
211 Supported keys in the @options vardict include:
212
213 * ``accept_label`` (``s``)
214
215 Label for the accept button. Mnemonic underlines are allowed.
216
217 * ``modal`` (``b``)
218
219 Whether the dialog should be modal. Default is yes.
220
221 * ``choices`` (``a(ssa(ss)s)``)
222
223 List of serialized combo boxes.
224 See :ref:`org.freedesktop.portal.FileChooser.OpenFile` for details.
225
226 * ``current_folder`` (``ay``)
227
228 Suggested folder to save the files in. The byte array is
229 expected to be null-terminated.
230
231 * ``files`` (``aay``)
232
233 An array of file names to be saved. The array and byte
234 arrays are expected to be null-terminated.
235
236 The following results get returned via the
237 :ref:`org.freedesktop.portal.Request::Response` signal:
238
239 * ``uris`` (``as``)
240
241 An array of strings containing the uri corresponding to
242 each file given by @options, in the same order. Note that
243 the file names may have changed, for example if a file
244 with the same name in the selected folder already exists.
245
246 All URIs must have the "file://" scheme.
247
248 * ``choices`` (``a(ss)``)
249
250 An array of pairs of strings, corresponding to the passed-in choices.
251 See :ref:`org.freedesktop.portal.FileChooser.OpenFile` for details.
252 -->
253 <method name="SaveFiles">
254 <arg type="o" name="handle" direction="in"/>
255 <arg type="s" name="app_id" direction="in"/>
256 <arg type="s" name="parent_window" direction="in"/>
257 <arg type="s" name="title" direction="in"/>
258 <annotation name="org.qtproject.QtDBus.QtTypeName.In4" value="QVariantMap"/>
259 <arg type="a{sv}" name="options" direction="in"/>
260 <arg type="u" name="response" direction="out"/>
261 <annotation name="org.qtproject.QtDBus.QtTypeName.Out1" value="QVariantMap"/>
262 <arg type="a{sv}" name="results" direction="out"/>
263 </method>
264 </interface>
265 </node>