Debian Codegraph @

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

raw
1 <?xml version="1.0"?>
2 <!--
3 Copyright 2022 Google LLC
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
21 <node name="/"
22 xmlns:doc="http://www.freedesktop.org/dbus/1.0/doc.dtd">
23 <!--
24 org.freedesktop.impl.portal.Clipboard
25 @short_description: Clipboard portal backend interface
26
27 The Clipboard portal allows sessions to access the clipboard.
28 -->
29 <interface name="org.freedesktop.impl.portal.Clipboard">
30 <!--
31 RequestClipboard:
32 @session_handle: Object path for the :ref:`org.freedesktop.portal.Session` object
33 @options: Vardict with optional further information
34
35 Requests clipboard access for the given portal session. This request
36 must be made before the session starts.
37
38 This portal does NOT create it's own session. Instead, it offers existing sessions
39 created from other portals the option to integrate with the clipboard. For whether
40 this interface is supported for a given session, refer to that portal's documentation.
41 See :ref:`org.freedesktop.portal.RemoteDesktop` to integrate clipboard with the
42 remote desktop session.
43 -->
44 <method name="RequestClipboard">
45 <arg type="o" name="session_handle" direction="in"/>
46 <annotation name="org.qtproject.QtDBus.QtTypeName.In1" value="QVariantMap"/>
47 <arg type="a{sv}" name="options" direction="in"/>
48 </method>
49 <!--
50 SetSelection:
51 @session_handle: Object path for the :ref:`org.freedesktop.portal.Session` object
52 @options: Vardict with optional further information
53
54 Sets the owner of the clipboard formats in 'mime_types' in @options to
55 the session, i.e. this session has data for the advertised clipboard formats.
56
57 See :ref:`org.freedesktop.portal.FileTransfer` to transfer files using the
58 'application/vnd.portal.filetransfer' mimetype.
59
60 May only be called if clipboard access was given after starting the session.
61
62 Supported keys in the @options vardict include:
63
64 * ``mime_types`` (``as``)
65
66 A list of mime types that the session has clipboard content for.
67 -->
68 <method name="SetSelection">
69 <arg type="o" name="session_handle" direction="in"/>
70 <annotation name="org.qtproject.QtDBus.QtTypeName.In1" value="QVariantMap"/>
71 <arg type="a{sv}" name="options" direction="in"/>
72 </method>
73 <!--
74 SelectionWrite:
75 @session_handle: Object path for the :ref:`org.freedesktop.portal.Session` object
76 @serial: The serial of the request where this answer is directed towards
77 @fd: A UnixFD handle to the contents of the selection being written to
78
79 Answer to 'SelectionTransfer' signal. Transfers the clipboard content for
80 the given serial to the method callee via a file descriptor.
81 It is the Callee that creates the file descriptor.
82
83 May only be called if clipboard access was given after starting the session.
84 -->
85 <method name="SelectionWrite">
86 <annotation name="org.gtk.GDBus.C.UnixFD" value="true"/>
87 <arg type="o" name="session_handle" direction="in"/>
88 <arg type="u" name="serial" direction="in"/>
89 <arg type="h" name="fd" direction="out"/>
90 </method>
91 <!--
92 SelectionWriteDone:
93 @session_handle: Object path for the :ref:`org.freedesktop.portal.Session` object
94 @serial: The serial of the request where this answer is directed to
95 @success: A boolean which indicates whether the transfer of the clipboard data was successful (true') or not ('false')
96
97 Notifies that the transfer of the clipboard data has either completed
98 successfully, or failed.
99
100 May only be called if clipboard access was given after starting the session.
101 -->
102 <method name="SelectionWriteDone">
103 <arg type="o" name="session_handle" direction="in"/>
104 <arg type="u" name="serial" direction="in"/>
105 <arg type="b" name="success" direction="in"/>
106 </method>
107 <!--
108 SelectionRead:
109 @session_handle: Object path for the :ref:`org.freedesktop.portal.Session` object
110 @mime_type: The mime-type string of the requested format
111 @fd: A UnixFD handle to the contents of the selection being read
112
113 Transfer the clipboard content given the specified mime type to the
114 method caller via a file descriptor.
115 It is the callee that creates the file descriptor.
116
117 May only be called if clipboard access was given after starting the session.
118 -->
119 <method name="SelectionRead">
120 <annotation name="org.gtk.GDBus.C.UnixFD" value="true"/>
121 <arg type="o" name="session_handle" direction="in"/>
122 <arg type="s" name="mime_type" direction="in"/>
123 <arg type="h" name="fd" direction="out"/>
124 </method>
125 <!--
126 SelectionOwnerChanged:
127 @session_handle: Object path for the :ref:`org.freedesktop.portal.Session` object
128 @options: Vardict with optional further information
129
130 Notifies the session that the clipboard selection has changed.
131
132 Caller will only be notified if clipboard access was given after starting the session.
133
134 Supported keys in the @options vardict include:
135
136 * ``mime_types`` (``as``)
137
138 A list of mime types that the the new clipboard selection has content for.
139
140 * ``session_is_owner`` (``b``)
141
142 A boolean for whether the session is the owner of the clipboard selection
143 (``true``) or not (``false``).
144 -->
145 <signal name="SelectionOwnerChanged">
146 <arg type="o" name="session_handle" direction="out"/>
147 <annotation name="org.qtproject.QtDBus.QtTypeName.Out1" value="QVariantMap"/>
148 <arg type="a{sv}" name="options" direction="out"/>
149 </signal>
150 <!--
151 SelectionTransfer:
152 @session_handle: Object path for the :ref:`org.freedesktop.portal.Session` object
153 @mime_type: The mime-type string of the requested format
154 @serial: The serial used to track this transfer, to which the answer of this request must use
155
156 Notifies the session of a request for clipboard content of the given mime type. The
157 callee provides a serial to track the request, which any
158 :ref:`org.freedesktop.portal.Clipboard.SelectionWrite` responses must use.
159
160 Once the caller is done handling the 'SelectionTransfer' request, they must call
161 :ref:`org.freedesktop.portal.Clipboard.SelectionWriteDone` with the corresponding request's serial
162 and whether the request completed successfully. If the request is not handled, the caller should
163 respond by setting 'success' to 'false'.
164
165 Caller will only be notified if clipboard access was given after starting the session.
166 -->
167 <signal name="SelectionTransfer">
168 <arg type="o" name="session_handle" direction="out"/>
169 <arg type="s" name="mime_type" direction="out"/>
170 <arg type="u" name="serial" direction="out"/>
171 </signal>
172
173 <property name="version" type="u" access="read"/>
174 </interface>
175 </node>