Debian Codegraph @

data/org.freedesktop.portal.FileTransfer.xml

raw
1 <?xml version="1.0"?>
2 <!--
3 Copyright (C) 2018 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: Matthias Clasen <[email protected]>
21 -->
22
23 <node name="/" xmlns:doc="http://www.freedesktop.org/dbus/1.0/doc.dtd">
24 <!--
25 org.freedesktop.portal.FileTransfer:
26 @short_description: Portal for transferring files between apps
27
28 The #org.freedesktop.portal.FileTransfer portal operates as a middle-man
29 between apps when transferring files via drag-and-drop or copy-paste,
30 taking care of the necessary exporting of files in the document portal.
31
32 Toolkits are expected to use the application/vnd.portal.filetransfer
33 mimetype when using this mechanism for file exchange via copy-paste
34 or drag-and-drop.
35
36 The data that is transmitted with this mimetype should be the key
37 returned by the org.freedesktop.portal.FileTransfer.StartTransfer()
38 method. Upon receiving this mimetype, the target should call
39 org.freedesktop.portal.FileTransfer.RetrieveFiles() with the key,
40 to obtain the list of files. The portal will take care of exporting
41 files in the document store as necessary to make them accessible to the
42 target.
43
44 Files added to the :ref:`Documents
45 portal<org.freedesktop.portal.Documents>` by this portal do not stay
46 accessible across sessions.
47
48 The D-Bus interface for the this portal is available under the
49 bus name org.freedesktop.portal.Documents and the object path
50 ``/org/freedesktop/portal/documents``.
51
52 This documentation describes version 1 of this interface.
53 -->
54 <interface name="org.freedesktop.portal.FileTransfer">
55 <!--
56 StartTransfer:
57 @options: Vardict with optional further information
58 @key: a key that needs to be passed to org.freedesktop.portal.FileTransfer.RetrieveFiles() to obtain the files
59
60 Starts a session for a file transfer.
61
62 The caller should call org.freedesktop.portal.FileTransfer.AddFiles()
63 at least once, to add files to this session.
64
65 Another application can then call
66 org.freedesktop.portal.FileTransfer.RetrieveFiles() to obtain them, if
67 it has the @key.
68
69 Supported keys in the @options vardict include:
70
71 * ``writable`` (``b``)
72
73 Whether to allow the chosen application to write to the files.
74
75 This key only takes effect for files that need to be exported
76 in the document portal for the receiving app. But it does require
77 the passed-in file descriptors to be writable.
78
79 Default: False
80
81 * ``autostop`` (``b``)
82
83 Whether to stop the transfer automatically after the first
84 org.freedesktop.portal.FileTransfer.RetrieveFiles() call.
85
86 Default: True
87 -->
88 <method name="StartTransfer">
89 <annotation name="org.qtproject.QtDBus.QtTypeName.In0" value="QVariantMap"/>
90 <arg type="a{sv}" name="options" direction="in"/>
91 <arg type="s" name="key" direction="out"/>
92 </method>
93
94 <!--
95 AddFiles:
96 @key: A key returned by org.freedesktop.portal.FileTransfer.StartTransfer()
97 @fds: File descriptors for the files or directories to register
98 @options: Vardict with optional further information
99
100 Adds files or directories to a session. This method can be called multiple
101 times on a given session. Either regular files or directories can
102 be added.
103
104 Note that the session bus often has a low limit of file descriptors per
105 message (typically, 16), so you may have to send large lists with
106 multiple org.freedesktop.portal.FileTransfer.AddFiles() calls.
107
108 The @options vardict currently has no supported entries.
109 -->
110 <method name="AddFiles">
111 <annotation name="org.gtk.GDBus.C.UnixFD" value="true"/>
112 <arg type="s" name="key" direction="in"/>
113 <annotation name="org.qtproject.QtDBus.QtTypeName.In1" value="QList&lt;QDBusUnixFileDescriptor&gt;"/>
114 <arg type="ah" name="fds" direction="in"/>
115 <annotation name="org.qtproject.QtDBus.QtTypeName.In2" value="QVariantMap"/>
116 <arg type="a{sv}" name="options" direction="in"/>
117 </method>
118
119 <!--
120 RetrieveFiles:
121 @key: A key returned by org.freedesktop.portal.FileTransfer.StartTransfer()
122 @options: Vardict with optional further information
123 @files: list of paths
124
125 Retrieves files or directories that were previously added to the session with
126 org.freedesktop.portal.FileTransfer.AddFiles(). The files or directories
127 will be exported in the document portal as-needed for the caller, and they
128 will be writable if the owner of the session allowed it.
129
130 After the first org.freedesktop.portal.FileTransfer.RetrieveFiles() call,
131 the session will be closed by the portal, unless @autostop has been set to False.
132
133 The @options vardict currently has no supported entries.
134 -->
135 <method name="RetrieveFiles">
136 <arg type="s" name="key" direction="in"/>
137 <annotation name="org.qtproject.QtDBus.QtTypeName.In1" value="QVariantMap"/>
138 <arg type="a{sv}" name="options" direction="in"/>
139 <arg type="as" name="files" direction="out"/>
140 </method>
141
142 <!--
143 StopTransfer:
144 @key: A key returned by org.freedesktop.portal.FileTransfer.StartTransfer()
145
146 Ends the transfer. Further calls to org.freedesktop.portal.FileTransfer.AddFiles()
147 or org.freedesktop.portal.FileTransfer.RetrieveFiles() for this key will return an error.
148 -->
149 <method name="StopTransfer">
150 <arg type="s" name="key" direction="in"/>
151 </method>
152
153 <!--
154 TransferClosed:
155 @key: key returned by StartTransfer
156
157 The TransferClosed signal is emitted to the caller of StartTransfer
158 when the transfer is closed.
159 -->
160 <signal name="TransferClosed">
161 <arg type="s" name="key"/>
162 </signal>
163
164 <property name="version" type="u" access="read"/>
165 </interface>
166 </node>