Debian Codegraph @

data/org.freedesktop.portal.Print.xml

raw
1 <?xml version="1.0"?>
2 <!--
3 Copyright (C) 2016 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.Print:
26 @short_description: Portal for printing
27
28 The Print portal allows sandboxed applications to print.
29
30 Due to the way in which printing requires bi-directional communication,
31 using this portal will often require applications to make multiple requests.
32 First, use org.freedesktop.portal.Print.PreparePrint() to obtain print settings,
33 use them to format your output, then use org.freedesktop.portal.Print.Print()
34 to print the formatted document. It is expected that high-level toolkit
35 APIs such as GtkPrintOperation will hide most of this complexity.
36
37 This documentation describes version 4 of this interface.
38 -->
39 <interface name="org.freedesktop.portal.Print">
40 <!--
41 PreparePrint:
42 @parent_window: Identifier for the application window, see :doc:`window-identifiers`
43 @title: Title for the print dialog
44 @settings: Serialized print settings
45 @page_setup: Serialized page setup
46 @options: Vardict with optional further information
47 @handle: Object path for the :ref:`org.freedesktop.portal.Request` object representing this call
48
49 Presents a print dialog to the user and returns print settings
50 and page setup.
51
52 Supported keys in the @options vardict:
53
54 * ``handle_token`` (``s``)
55
56 A string that will be used as the last element of the @handle. Must be a valid
57 object path element. See the :ref:`org.freedesktop.portal.Request` documentation for
58 more information about the @handle.
59
60 * ``modal`` (``b``)
61
62 Whether to make the dialog modal. Defaults to yes.
63
64 * ``accept_label`` (``s``)
65
66 Label for the accept button. Mnemonic underlines are allowed.
67
68 This option was added in version 2.
69
70 * ``supported_output_file_formats`` (``as``)
71
72 File formats supported by the app to use for print-to-file. If not set, all formats
73 are assumed to be supported. The following values are allowed: "pdf", "ps", and "svg".
74
75 This option was added in version 3.
76
77 * ``has_current_page`` (``b``)
78
79 Whether it makes sense to return "current" for the ``print-pages`` setting.
80
81 This option was added in version 4.
82
83 * ``has_selected_pages`` (``b``)
84
85 Whether it makes sense to return "selection" for the ``print-pages`` setting.
86
87 This option was added in version 4.
88
89 The @settings and @page_setup vardict contain hints for the initial state of the print dialog.
90
91 The following keys are supported in the @settings vardict:
92
93 * ``orientation`` (``s``)
94
95 One of ``landscape``, ``portrait``, ``reverse_landscape`` or ``reverse_portrait``.
96
97 * ``paper-format`` (``s``)
98
99 A paper name according to `PWG 5101.1-2002 <ftp://ftp.pwg.org/pub/pwg/candidates/cs-pwgmsn10-20020226-5101.1.pdf>`_.
100
101 * ``paper-width`` (``s``)
102
103 Paper width, in millimeters.
104
105 * ``paper-height`` (``s``)
106
107 Paper height, in millimeters.
108
109 * ``n-copies`` (``s``)
110
111 The number of copies to print.
112
113 * ``default-source`` (``s``)
114
115 The default paper source.
116
117 * ``quality`` (``s``)
118
119 Print quality, one of normal, high, low or draft.
120
121 * ``resolution`` (``s``)
122
123 The resolution, sets both resolution-x and resolution-y.
124
125 * ``use-color`` (``s``)
126
127 Whether to use color, one of true or false.
128
129 * ``duplex`` (``s``)
130
131 Duplex printing mode, one of simplex, horizontal or vertical.
132
133 * ``collate`` (``s``)
134
135 Whether to collate copies, one of true or false.
136
137 * ``reverse`` (``s``)
138
139 Whether to reverse the order of printed pages, one of true or false.
140
141 * ``media-type`` (``s``)
142
143 A media type according to `PWG 5101.1-2002 <ftp://ftp.pwg.org/pub/pwg/candidates/cs-pwgmsn10-20020226-5101.1.pdf>`_.
144
145 * ``dither`` (``s``)
146
147 The dithering to use, one of ``fine``, ``none``, ``coarse``,
148 ``lineart``, ``grayscale`` or ``error-diffusion``.
149
150 * ``scale`` (``s``)
151
152 The scale in percent.
153
154 * ``print-pages`` (``s``)
155
156 What pages to print, one of all, selection, current or ranges.
157
158 * ``page-ranges`` (``s``)
159
160 A list of page ranges, formatted like this: `0-2,4,9-11`.
161
162 .. note::
163
164 Page ranges are 0-based, even if the are displayed as 1-based when presented to the user.
165
166 * ``page-set`` (``s``)
167
168 What pages to print, one of all, even or odd.
169
170 * ``finishings`` (``s``)
171
172 Finishings.
173
174 * ``number-up`` (``s``)
175
176 The number of pages per sheet.
177
178 * ``number-up-layout`` (``s``)
179
180 One of ``lrtb``, ``lrbt``, ``rltb``, ``rlbt``, ``tblr``, ``tbrl``,
181 ``btlr``, ``btrl``.
182
183 * ``output-bin`` (``s``)
184
185 * ``resolution-x`` (``s``)
186
187 The horizontal resolution in dpi.
188
189 * ``resolution-y`` (``s``)
190
191 The vertical resolution in dpi.
192
193 * ``printer-lpi`` (``s``)
194
195 The resolution in lpi (lines per inch).
196
197 * ``output-basename`` (``s``)
198
199 Basename to use for print-to-file.
200
201 * ``output-file-format`` (``s``)
202
203 Format to use for print-to-file, one of PDF, PS, SVG.
204
205 * ``output-uri`` (``s``)
206
207 The uri used for print-to-file.
208
209 The following keys are supported in the @page_setup vardict:
210
211 * ``PPDName`` (``s``)
212
213 The PPD name.
214
215 * ``Name`` (``s``)
216
217 The name of the page setup.
218
219 * ``DisplayName`` (``s``)
220
221 User-visible name for the page setup.
222
223 * ``Width`` (``d``)
224
225 Paper width in millimeters.
226
227 * ``Height`` (``d``)
228
229 Paper height in millimeters.
230
231 * ``MarginTop`` (``d``)
232
233 Top margin in millimeters.
234
235 * ``MarginBottom`` (``d``)
236
237 Bottom margin in millimeters.
238
239 * ``MarginLeft`` (``d``)
240
241 Left margin in millimeters.
242
243 * ``MarginRight`` (``d``)
244
245 Right margin in millimeters.
246
247 * ``Orientation`` (``s``)
248
249 Orientation, one of portrait, landscape, reverse-portrait or reverse-landscape.
250
251 The following results get returned via the :ref:`org.freedesktop.portal.Request::Response` signal:
252
253 * ``settings`` (``a{sv}``)
254
255 Print settings as set up by the user in the print dialog. The same keys as in @settings
256 are supported (see above).
257
258 * ``page-setup`` (``a{sv}``)
259
260 Page setup as set up by the user in the print dialog. The same keys as in @page_setup
261 are supported (see above).
262
263 * ``token`` (``u``)
264
265 Token that can be passed to a subsequent org.freedesktop.portal.Print.Print() call to
266 bypass the print dialog.
267 -->
268 <method name="PreparePrint">
269 <arg type="s" name="parent_window" direction="in"/>
270 <arg type="s" name="title" direction="in"/>
271 <annotation name="org.qtproject.QtDBus.QtTypeName.In2" value="QVariantMap"/>
272 <arg type="a{sv}" name="settings" direction="in"/>
273 <annotation name="org.qtproject.QtDBus.QtTypeName.In3" value="QVariantMap"/>
274 <arg type="a{sv}" name="page_setup" direction="in"/>
275 <annotation name="org.qtproject.QtDBus.QtTypeName.In4" value="QVariantMap"/>
276 <arg type="a{sv}" name="options" direction="in"/>
277 <arg type="o" name="handle" direction="out"/>
278 </method>
279
280 <!--
281 Print:
282 @parent_window: Identifier for the application window, see :doc:`window-identifiers`
283 @title: Title for the print dialog
284 @fd: File descriptor for reading the content to print
285 @options: Vardict with optional further information
286 @handle: Object path for the :ref:`org.freedesktop.portal.Request` object representing this call
287
288 Asks to print a file.
289
290 The file must be passed in the form of a file descriptor open for reading.
291 This ensures that sandboxed applications only print files that they have
292 access to.
293
294 If a valid token is present in the @options, then this call will print
295 with the settings from the Print call that the token refers to. If
296 no token is present, then a print dialog will be presented to the user.
297
298 Note that it is up to the portal implementation to determine how long
299 it considers tokens valid.
300
301 Supported keys in the @options vardict:
302
303 * ``handle_token`` (``s``)
304
305 A string that will be used as the last element of the @handle. Must be a valid
306 object path element. See the :ref:`org.freedesktop.portal.Request` documentation for
307 more information about the @handle.
308
309 * ``modal`` (``b``)
310
311 Whether to make the dialog modal. Defaults to yes.
312
313 * ``token`` (``u``)
314
315 Token that was returned by a previous org.freedesktop.portal.Print.PreparePrint() call.
316
317 * ``supported_output_file_formats`` (``as``)
318
319 File formats supported by the app to use for print-to-file. If not set, all formats
320 are assumed to be supported. The following values are allowed: "pdf", "ps", and "svg".
321
322 This option was added in version 3.
323 -->
324 <method name="Print">
325 <annotation name="org.gtk.GDBus.C.UnixFD" value="true"/>
326 <arg type="s" name="parent_window" direction="in"/>
327 <arg type="s" name="title" direction="in"/>
328 <arg type="h" name="fd" direction="in"/>
329 <annotation name="org.qtproject.QtDBus.QtTypeName.In3" value="QVariantMap"/>
330 <arg type="a{sv}" name="options" direction="in"/>
331 <arg type="o" name="handle" direction="out"/>
332 </method>
333
334 <property name="version" type="u" access="read"/>
335 </interface>
336 </node>