| 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 |
The D-Bus interface for the this portal is available under the |
| 45 |
bus name org.freedesktop.portal.Documents and the object path |
| 46 |
``/org/freedesktop/portal/documents``. |
| 47 |
|
| 48 |
This documentation describes version 1 of this interface. |
| 49 |
--> |
| 50 |
<interface name="org.freedesktop.portal.FileTransfer"> |
| 51 |
<!-- |
| 52 |
StartTransfer: |
| 53 |
@options: Vardict with optional further information |
| 54 |
@key: a key that needs to be passed to org.freedesktop.portal.FileTransfer.RetrieveFiles() to obtain the files |
| 55 |
|
| 56 |
Starts a session for a file transfer. |
| 57 |
|
| 58 |
The caller should call org.freedesktop.portal.FileTransfer.AddFiles() |
| 59 |
at least once, to add files to this session. |
| 60 |
|
| 61 |
Another application can then call |
| 62 |
org.freedesktop.portal.FileTransfer.RetrieveFiles() to obtain them, if |
| 63 |
it has the @key. |
| 64 |
|
| 65 |
Supported keys in the @options vardict include: |
| 66 |
|
| 67 |
* ``writable`` (``b``) |
| 68 |
|
| 69 |
Whether to allow the chosen application to write to the files. |
| 70 |
|
| 71 |
This key only takes effect for files that need to be exported |
| 72 |
in the document portal for the receiving app. But it does require |
| 73 |
the passed-in file descriptors to be writable. |
| 74 |
|
| 75 |
Default: False |
| 76 |
|
| 77 |
* ``autostop`` (``b``) |
| 78 |
|
| 79 |
Whether to stop the transfer automatically after the first |
| 80 |
org.freedesktop.portal.FileTransfer.RetrieveFiles() call. |
| 81 |
|
| 82 |
Default: True |
| 83 |
--> |
| 84 |
<method name="StartTransfer"> |
| 85 |
<annotation name="org.qtproject.QtDBus.QtTypeName.In0" value="QVariantMap"/> |
| 86 |
<arg type="a{sv}" name="options" direction="in"/> |
| 87 |
<arg type="s" name="key" direction="out"/> |
| 88 |
</method> |
| 89 |
|
| 90 |
<!-- |
| 91 |
AddFiles: |
| 92 |
@key: A key returned by org.freedesktop.portal.FileTransfer.StartTransfer() |
| 93 |
@fds: File descriptors for the files or directories to register |
| 94 |
@options: Vardict with optional further information |
| 95 |
|
| 96 |
Adds files or directories to a session. This method can be called multiple |
| 97 |
times on a given session. Either regular files or directories can |
| 98 |
be added. |
| 99 |
|
| 100 |
Note that the session bus often has a low limit of file descriptors per |
| 101 |
message (typically, 16), so you may have to send large lists with |
| 102 |
multiple org.freedesktop.portal.FileTransfer.AddFiles() calls. |
| 103 |
|
| 104 |
The @options vardict currently has no supported entries. |
| 105 |
--> |
| 106 |
<method name="AddFiles"> |
| 107 |
<annotation name="org.gtk.GDBus.C.UnixFD" value="true"/> |
| 108 |
<arg type="s" name="key" direction="in"/> |
| 109 |
<annotation name="org.qtproject.QtDBus.QtTypeName.In1" value="QList<QDBusUnixFileDescriptor>"/> |
| 110 |
<arg type="ah" name="fds" direction="in"/> |
| 111 |
<annotation name="org.qtproject.QtDBus.QtTypeName.In2" value="QVariantMap"/> |
| 112 |
<arg type="a{sv}" name="options" direction="in"/> |
| 113 |
</method> |
| 114 |
|
| 115 |
<!-- |
| 116 |
RetrieveFiles: |
| 117 |
@key: A key returned by org.freedesktop.portal.FileTransfer.StartTransfer() |
| 118 |
@options: Vardict with optional further information |
| 119 |
@files: list of paths |
| 120 |
|
| 121 |
Retrieves files or directories that were previously added to the session with |
| 122 |
org.freedesktop.portal.FileTransfer.AddFiles(). The files or directories |
| 123 |
will be exported in the document portal as-needed for the caller, and they |
| 124 |
will be writable if the owner of the session allowed it. |
| 125 |
|
| 126 |
After the first org.freedesktop.portal.FileTransfer.RetrieveFiles() call, |
| 127 |
the session will be closed by the portal, unless @autostop has been set to False. |
| 128 |
|
| 129 |
The @options vardict currently has no supported entries. |
| 130 |
--> |
| 131 |
<method name="RetrieveFiles"> |
| 132 |
<arg type="s" name="key" direction="in"/> |
| 133 |
<annotation name="org.qtproject.QtDBus.QtTypeName.In1" value="QVariantMap"/> |
| 134 |
<arg type="a{sv}" name="options" direction="in"/> |
| 135 |
<arg type="as" name="files" direction="out"/> |
| 136 |
</method> |
| 137 |
|
| 138 |
<!-- |
| 139 |
StopTransfer: |
| 140 |
@key: A key returned by org.freedesktop.portal.FileTransfer.StartTransfer() |
| 141 |
|
| 142 |
Ends the transfer. Further calls to org.freedesktop.portal.FileTransfer.AddFiles() |
| 143 |
or org.freedesktop.portal.FileTransfer.RetrieveFiles() for this key will return an error. |
| 144 |
--> |
| 145 |
<method name="StopTransfer"> |
| 146 |
<arg type="s" name="key" direction="in"/> |
| 147 |
</method> |
| 148 |
|
| 149 |
<!-- |
| 150 |
TransferClosed: |
| 151 |
@key: key returned by StartTransfer |
| 152 |
|
| 153 |
The TransferClosed signal is emitted to the caller of StartTransfer |
| 154 |
when the transfer is closed. |
| 155 |
--> |
| 156 |
<signal name="TransferClosed"> |
| 157 |
<arg type="s" name="key"/> |
| 158 |
</signal> |
| 159 |
|
| 160 |
<property name="version" type="u" access="read"/> |
| 161 |
</interface> |
| 162 |
</node> |