Debian Codegraph @

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