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