summaryrefslogtreecommitdiffstats
path: root/toolkit/components/printingui/ipc/PPrintingTypes.ipdlh
blob: 73abd250ab43299c4c9cbc9c542d1bddfae55610 (plain)
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
/* -*- Mode: C++; c-basic-offset: 2; indent-tabs-mode: nil; tab-width: 8 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

include protocol PRemotePrintJob;

namespace mozilla {
namespace embedding {

struct CStringKeyValue {
  nsCString key;
  nsCString value;
};

struct PrintData {
  nullable PRemotePrintJob remotePrintJob;
  double edgeTop;
  double edgeLeft;
  double edgeBottom;
  double edgeRight;
  double marginTop;
  double marginLeft;
  double marginBottom;
  double marginRight;
  double unwriteableMarginTop;
  double unwriteableMarginLeft;
  double unwriteableMarginBottom;
  double unwriteableMarginRight;
  double scaling;
  bool printBGColors;
  bool printBGImages;
  bool honorPageRuleMargins;
  bool usePageRuleSizeAsPaperSize;
  bool ignoreUnwriteableMargins;
  bool showMarginGuides;
  bool printSelectionOnly;
  int32_t[] pageRanges;
  nsString title;
  nsString docURL;
  nsString headerStrLeft;
  nsString headerStrCenter;
  nsString headerStrRight;
  nsString footerStrLeft;
  nsString footerStrCenter;
  nsString footerStrRight;

  bool printSilent;
  bool shrinkToFit;

  nsString paperId;
  double paperWidth;
  double paperHeight;
  short paperSizeUnit;
  bool printReversed;
  bool printInColor;
  int32_t orientation;
  int32_t numCopies;
  int32_t numPagesPerSheet;

  // We do not transfer the following to the child process, since the child
  // process should not need this information, and we don't want to leak it if
  // the child process is compromised.
  //nsString printerName;
  //nsString toFileName;

  // TODO: Do we really need to deal with these in child processes?
  short outputDestination;
  short outputFormat;

  int32_t printPageDelay;
  int32_t resolution;
  int32_t duplex;
  bool isInitializedFromPrinter;
  bool isInitializedFromPrefs;

  /* Windows-specific things */
  nsString driverName;
  nsString deviceName;
  uint8_t[] devModeData;

  /**
   * GTK-specific things. Some of these might look like dupes of the
   * information we're already passing, but the generalized settings that
   * we hold in nsIPrintSettings don't map perfectly to GTK's GtkPrintSettings,
   * so there are some nuances. GtkPrintSettings, for example, stores both an
   * internal name for paper size, as well as the display name.
   */
  CStringKeyValue[] GTKPrintSettings;

  /*
   * macOS-specific things:
   * What the Cocoa print system is supposed to do with the job.
   */
  nsString disposition;
  uint16_t destination;
};

} // namespace embedding
} // namespace mozilla