/
org.freedesktop.portal.Print.xml
398 lines (380 loc) · 14.4 KB
/
org.freedesktop.portal.Print.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
<?xml version="1.0"?>
<!--
Copyright (C) 2016 Red Hat, Inc.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library. If not, see <http://www.gnu.org/licenses/>.
Author: Matthias Clasen <mclasen@redhat.com>
-->
<node name="/" xmlns:doc="http://www.freedesktop.org/dbus/1.0/doc.dtd">
<!--
org.freedesktop.portal.Print:
@short_description: Portal for printing
The Print portal allows sandboxed applications to print.
Due to the way in which printing requires bi-directional communication,
using this portal will often require applications to make multiple requests.
First, use org.freedesktop.portal.Print.PreparePrint() to obtain print settings,
use them to format your output, then use org.freedesktop.portal.Print.Print()
to print the formatted document. It is expected that high-level toolkit
APIs such as GtkPrintOperation will hide most of this complexity.
This documentation describes version 2 of this interface.
-->
<interface name="org.freedesktop.portal.Print">
<!--
Print:
@parent_window: Identifier for the application window, see <link linkend="parent_window">Common Conventions</link>
@title: Title for the print dialog
@fd: File descriptor for reading the content to print
@options: Vardict with optional further information
@handle: Object path for the #org.freedesktop.portal.Request object representing this call
Asks to print a file.
The file must be passed in the form of a file descriptor open for reading.
This ensures that sandboxed applications only print files that they have
access to.
If a valid token is present in the @options, then this call will print
with the settings from the Print call that the token refers to. If
no token is present, then a print dialog will be presented to the user.
Note that it is up to the portal implementation to determine how long
it considers tokens valid.
Supported keys in the @options vardict:
<variablelist>
<varlistentry>
<term>handle_token s</term>
<listitem><para>
A string that will be used as the last element of the @handle. Must be a valid
object path element. See the #org.freedesktop.portal.Request documentation for
more information about the @handle.
</para></listitem>
</varlistentry>
<varlistentry>
<term>modal b</term>
<listitem><para>
Whether to make the dialog modal. Defaults to yes.
</para></listitem>
</varlistentry>
<varlistentry>
<term>token u</term>
<listitem><para>
Token that was returned by a previous org.freedesktop.portal.Print.PreparePrint() call.
</para></listitem>
</varlistentry>
</variablelist>
-->
<method name="Print">
<annotation name="org.gtk.GDBus.C.UnixFD" value="true"/>
<arg type="s" name="parent_window" direction="in"/>
<arg type="s" name="title" direction="in"/>
<arg type="h" name="fd" direction="in"/>
<arg type="a{sv}" name="options" direction="in"/>
<arg type="o" name="handle" direction="out"/>
</method>
<!--
PreparePrint:
@parent_window: Identifier for the application window, see <link linkend="parent_window">Common Conventions</link>
@title: Title for the print dialog
@settings: Serialized print settings
@page_setup: Serialized page setup
@options: Vardict with optional further information
@handle: Object path for the #org.freedesktop.portal.Request object representing this call
Presents a print dialog to the user and returns print settings
and page setup.
Supported keys in the @options vardict:
<variablelist>
<varlistentry>
<term>handle_token s</term>
<listitem><para>
A string that will be used as the last element of the @handle. Must be a valid
object path element. See the #org.freedesktop.portal.Request documentation for
more information about the @handle.
</para></listitem>
</varlistentry>
<varlistentry>
<term>modal b</term>
<listitem><para>
Whether to make the dialog modal. Defaults to yes.
</para></listitem>
</varlistentry>
<varlistentry>
<term>accept_label s</term>
<listitem><para>
Label for the accept button. Mnemonic underlines are allowed.
</para><para>
This option was added in version 2.
</para></listitem>
</varlistentry>
</variablelist>
The following results get returned via the #org.freedesktop.portal.Request::Response signal:
<variablelist>
<varlistentry>
<term>settings a{sv}</term>
<listitem><para>
Print settings as set up by the user in the print dialog.
</para></listitem>
</varlistentry>
<varlistentry>
<term>page-setup a{sv}</term>
<listitem><para>
Page setup as set up by the user in the print dialog.
</para></listitem>
</varlistentry>
<varlistentry>
<term>token u</term>
<listitem><para>
Token that can be passed to a subsequent org.freedesktop.portal.Print.Print() call to
bypass the print dialog.
</para></listitem>
</varlistentry>
</variablelist>
The following keys are supported in the print settings vardict:
<variablelist>
<varlistentry>
<term>orientation s</term>
<listitem><para>
One of landscape, portrait, reverse_landscape or reverse_portrait.
</para></listitem>
</varlistentry>
<varlistentry>
<term>paper-format s</term>
<listitem><para>
A paper name according to <ulink url="ftp://ftp.pwg.org/pub/pwg/candidates/cs-pwgmsn10-20020226-5101.1.pdf">PWG 5101.1-2002</ulink>.
</para></listitem>
</varlistentry>
<varlistentry>
<term>paper-width s</term>
<listitem><para>
Paper width, in millimeters.
</para></listitem>
</varlistentry>
<varlistentry>
<term>paper-height s</term>
<listitem><para>
Paper height, in millimeters.
</para></listitem>
</varlistentry>
<varlistentry>
<term>n-copies s</term>
<listitem><para>
The number of copies to print.
</para></listitem>
</varlistentry>
<varlistentry>
<term>default-source s</term>
<listitem><para>
The default paper source.
</para></listitem>
</varlistentry>
<varlistentry>
<term>quality s</term>
<listitem><para>
Print quality, one of normal, high, low or draft.
</para></listitem>
</varlistentry>
<varlistentry>
<term>resolution s</term>
<listitem><para>
The resolution, sets both resolution-x and resolution-y.
</para></listitem>
</varlistentry>
<varlistentry>
<term>use-color s</term>
<listitem><para>
Whether to use color, one of true or false.
</para></listitem>
</varlistentry>
<varlistentry>
<term>duplex s</term>
<listitem><para>
Duplex printing mode, one of simplex, horizontal or vertical.
</para></listitem>
</varlistentry>
<varlistentry>
<term>collate s</term>
<listitem><para>
Whether to collate copies, one of true or false.
</para></listitem>
</varlistentry>
<varlistentry>
<term>reverse s</term>
<listitem><para>
Whether to reverse the order of printed pages, one of true or false.
</para></listitem>
</varlistentry>
<varlistentry>
<term>media-type s</term>
<listitem><para>
A media type according to <ulink url="ftp://ftp.pwg.org/pub/pwg/candidates/cs-pwgmsn10-20020226-5101.1.pdf">PWG 5101.1-2002</ulink>.
</para></listitem>
</varlistentry>
<varlistentry>
<term>dither s</term>
<listitem><para>
The dithering to use, one of fine, none, coarse, lineart, grayscale or error-diffusion.
</para></listitem>
</varlistentry>
<varlistentry>
<term>scale s</term>
<listitem><para>
The scale in percent.
</para></listitem>
</varlistentry>
<varlistentry>
<term>print-pages s</term>
<listitem><para>
What pages to print, one of all, selection, current or ranges.
</para></listitem>
</varlistentry>
<varlistentry>
<term>page-ranges s</term>
<listitem><para>
A list of page ranges, formatted like this: 0-2,4,9-11.
</para><para>
Note that page ranges are 0-based, even if the are displayed as 1-based when presented to the user.
</para></listitem>
</varlistentry>
<varlistentry>
<term>page-set s</term>
<listitem><para>
What pages to print, one of all, even or odd.
</para></listitem>
</varlistentry>
<varlistentry>
<term>finishings s</term>
<listitem><para>
</para></listitem>
</varlistentry>
<varlistentry>
<term>number-up s</term>
<listitem><para>
The number of pages per sheet.
</para></listitem>
</varlistentry>
<varlistentry>
<term>number-up-layout s</term>
<listitem><para>
One of lrtb, lrbt, rltb, rlbt, tblr, tbrl, btlr, btrl.
</para></listitem>
</varlistentry>
<varlistentry>
<term>output-bin s</term>
<listitem><para>
</para></listitem>
</varlistentry>
<varlistentry>
<term>resolution-x s</term>
<listitem><para>
The horizontal resolution in dpi.
</para></listitem>
</varlistentry>
<varlistentry>
<term>resolution-y s</term>
<listitem><para>
The vertical resolution in dpi.
</para></listitem>
</varlistentry>
<varlistentry>
<term>printer-lpi s</term>
<listitem><para>
The resolution in lpi (lines per inch).
</para></listitem>
</varlistentry>
<varlistentry>
<term>output-basename s</term>
<listitem><para>
Basename to use for print-to-file.
</para></listitem>
</varlistentry>
<varlistentry>
<term>output-file-format s</term>
<listitem><para>
Format to use for print-to-file, one of PDF, PS, SVG.
</para></listitem>
</varlistentry>
<varlistentry>
<term>output-uri s</term>
<listitem><para>
The uri used for print-to-file.
</para></listitem>
</varlistentry>
</variablelist>
The following keys are supported in the page setup vardict:
<variablelist>
<varlistentry>
<term>PPDName s</term>
<listitem><para>
The PPD name.
</para></listitem>
</varlistentry>
<varlistentry>
<term>Name s</term>
<listitem><para>
The name of the page setup.
</para></listitem>
</varlistentry>
<varlistentry>
<term>DisplayName s</term>
<listitem><para>
User-visible name for the page setup.
</para></listitem>
</varlistentry>
<varlistentry>
<term>Width d</term>
<listitem><para>
Paper width in millimeters.
</para></listitem>
</varlistentry>
<varlistentry>
<term>Height d</term>
<listitem><para>
Paper height in millimeters.
</para></listitem>
</varlistentry>
<varlistentry>
<term>MarginTop d</term>
<listitem><para>
Top margin in millimeters.
</para></listitem>
</varlistentry>
<varlistentry>
<term>MarginBottom d</term>
<listitem><para>
Bottom margin in millimeters.
</para></listitem>
</varlistentry>
<varlistentry>
<term>MarginLeft d</term>
<listitem><para>
Left margin in millimeters.
</para></listitem>
</varlistentry>
<varlistentry>
<term>MarginRight d</term>
<listitem><para>
Right margin in millimeters.
</para></listitem>
</varlistentry>
<varlistentry>
<term>Orientation s</term>
<listitem><para>
Orientation, one of portrait, landscape, reverse-portrait or reverse-landscape.
</para></listitem>
</varlistentry>
</variablelist>
-->
<method name="PreparePrint">
<arg type="s" name="parent_window" direction="in"/>
<arg type="s" name="title" direction="in"/>
<arg type="a{sv}" name="settings" direction="in"/>
<arg type="a{sv}" name="page_setup" direction="in"/>
<arg type="a{sv}" name="options" direction="in"/>
<arg type="o" name="handle" direction="out"/>
</method>
<property name="version" type="u" access="read"/>
</interface>
</node>