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