1/* -*- Mode: C++; c-basic-offset: 2; indent-tabs-mode: nil; tab-width: 8 -*- */
2/* This Source Code Form is subject to the terms of the Mozilla Public
3 * License, v. 2.0. If a copy of the MPL was not distributed with this
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
5
6include protocol PRemotePrintJob;
7
8namespace mozilla {
9namespace embedding {
10
11struct CStringKeyValue {
12  nsCString key;
13  nsCString value;
14};
15
16struct PrintData {
17  nullable PRemotePrintJob remotePrintJob;
18  int32_t startPageRange;
19  int32_t endPageRange;
20  double edgeTop;
21  double edgeLeft;
22  double edgeBottom;
23  double edgeRight;
24  double marginTop;
25  double marginLeft;
26  double marginBottom;
27  double marginRight;
28  double unwriteableMarginTop;
29  double unwriteableMarginLeft;
30  double unwriteableMarginBottom;
31  double unwriteableMarginRight;
32  double scaling;
33  bool printBGColors;
34  bool printBGImages;
35  short printRange;
36  nsString title;
37  nsString docURL;
38  nsString headerStrLeft;
39  nsString headerStrCenter;
40  nsString headerStrRight;
41  nsString footerStrLeft;
42  nsString footerStrCenter;
43  nsString footerStrRight;
44
45  short  howToEnableFrameUI;
46  bool isCancelled;
47  short printFrameTypeUsage;
48  short  printFrameType;
49  bool printSilent;
50  bool shrinkToFit;
51  bool showPrintProgress;
52
53  nsString paperName;
54  short paperData;
55  double paperWidth;
56  double paperHeight;
57  short paperSizeUnit;
58  bool printReversed;
59  bool printInColor;
60  int32_t orientation;
61  int32_t numCopies;
62  nsString printerName;
63  bool printToFile;
64  nsString toFileName;
65  short outputFormat;
66  int32_t printPageDelay;
67  int32_t resolution;
68  int32_t duplex;
69  bool isInitializedFromPrinter;
70  bool isInitializedFromPrefs;
71  int32_t optionFlags;
72
73  /* Windows-specific things */
74  nsString driverName;
75  nsString deviceName;
76  double printableWidthInInches;
77  double printableHeightInInches;
78  bool isFramesetDocument;
79  bool isFramesetFrameSelected;
80  bool isIFrameSelected;
81  bool isRangeSelection;
82  uint8_t[] devModeData;
83
84  /**
85   * GTK-specific things. Some of these might look like dupes of the
86   * information we're already passing, but the generalized settings that
87   * we hold in nsIPrintSettings don't map perfectly to GTK's GtkPrintSettings,
88   * so there are some nuances. GtkPrintSettings, for example, stores both an
89   * internal name for paper size, as well as the display name.
90   */
91  CStringKeyValue[] GTKPrintSettings;
92
93  /**
94   * OS X specific things.
95   */
96  nsString printJobName;
97  bool printAllPages;
98  bool mustCollate;
99  nsString disposition;
100  /** TODO: Is there an "unsigned short" primitive? **/
101  short pagesAcross;
102  short pagesDown;
103  double printTime;
104  bool detailedErrorReporting;
105  nsString faxNumber;
106  bool addHeaderAndFooter;
107  bool fileNameExtensionHidden;
108  /*
109   * Holds the scaling factor from the Print dialog when shrink
110   * to fit is not used. This is needed by the child when it
111   * isn't using remote printing. When shrink to fit is enabled
112   * (default), print dialog code ensures this value is 1.0.
113   */
114  float scalingFactor;
115  /*
116   * Scaling factor for converting from OS X native paper size
117   * units to inches.
118   */
119  float widthScale;
120  float heightScale;
121  double adjustedPaperWidth;
122  double adjustedPaperHeight;
123};
124
125} // namespace embedding
126} // namespace mozilla
127