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