2006-02-07 04:12:56 +03:00
|
|
|
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
2012-05-21 15:12:37 +04:00
|
|
|
/* 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/. */
|
2006-02-07 04:11:45 +03:00
|
|
|
|
|
|
|
#include "nsISupports.idl"
|
|
|
|
|
2006-02-07 04:13:12 +03:00
|
|
|
%{ C++
|
|
|
|
#include "nsMargin.h"
|
2011-12-07 08:45:06 +04:00
|
|
|
#include "nsTArray.h"
|
2021-11-16 11:17:02 +03:00
|
|
|
|
|
|
|
namespace mozilla {
|
|
|
|
struct PrintSettingsInitializer;
|
|
|
|
}
|
2006-02-07 04:13:12 +03:00
|
|
|
%}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Native types
|
|
|
|
*/
|
2020-09-10 18:25:59 +03:00
|
|
|
native nsNativeIntMargin(nsIntMargin);
|
2019-04-21 04:47:00 +03:00
|
|
|
[ref] native nsNativeIntMarginRef(nsIntMargin);
|
2022-07-06 17:53:06 +03:00
|
|
|
native PrintSettingsInitializer(mozilla::PrintSettingsInitializer);
|
2019-04-21 04:47:00 +03:00
|
|
|
|
2022-03-30 21:51:58 +03:00
|
|
|
interface nsIOutputStream;
|
2006-02-07 04:13:12 +03:00
|
|
|
|
2006-02-07 04:11:45 +03:00
|
|
|
/**
|
|
|
|
* Simplified graphics interface for JS rendering.
|
|
|
|
*/
|
2020-09-10 18:25:59 +03:00
|
|
|
[scriptable, builtinclass, uuid(ecc5cbad-57fc-4731-b0bd-09e865bd62ad)]
|
2006-02-07 04:11:45 +03:00
|
|
|
interface nsIPrintSettings : nsISupports
|
|
|
|
{
|
2006-02-07 04:13:37 +03:00
|
|
|
/**
|
|
|
|
* PrintSettings to be Saved Navigation Constants
|
|
|
|
*/
|
2020-10-06 18:33:29 +03:00
|
|
|
/* Flag 0x00000001 is unused */
|
2006-02-07 04:13:37 +03:00
|
|
|
const unsigned long kInitSaveHeaderLeft = 0x00000002;
|
|
|
|
const unsigned long kInitSaveHeaderCenter = 0x00000004;
|
|
|
|
const unsigned long kInitSaveHeaderRight = 0x00000008;
|
|
|
|
const unsigned long kInitSaveFooterLeft = 0x00000010;
|
|
|
|
const unsigned long kInitSaveFooterCenter = 0x00000020;
|
|
|
|
const unsigned long kInitSaveFooterRight = 0x00000040;
|
|
|
|
const unsigned long kInitSaveBGColors = 0x00000080;
|
|
|
|
const unsigned long kInitSaveBGImages = 0x00000100;
|
|
|
|
const unsigned long kInitSavePaperSize = 0x00000200;
|
2022-05-13 18:00:29 +03:00
|
|
|
/* Flag 0x00000400 is unused */
|
2013-04-11 17:10:42 +04:00
|
|
|
const unsigned long kInitSaveDuplex = 0x00000800;
|
2007-08-27 04:19:15 +04:00
|
|
|
/* Flag 0x00001000 is unused */
|
2020-09-18 18:28:46 +03:00
|
|
|
/* Flag 0x00002000 is unused */
|
2008-03-19 23:51:42 +03:00
|
|
|
const unsigned long kInitSaveUnwriteableMargins = 0x00004000;
|
2007-11-13 22:14:07 +03:00
|
|
|
const unsigned long kInitSaveEdges = 0x00008000;
|
2006-02-07 04:13:37 +03:00
|
|
|
|
|
|
|
const unsigned long kInitSaveReversed = 0x00010000;
|
|
|
|
const unsigned long kInitSaveInColor = 0x00020000;
|
|
|
|
const unsigned long kInitSaveOrientation = 0x00040000;
|
2015-06-10 09:10:28 +03:00
|
|
|
|
2006-02-07 04:13:37 +03:00
|
|
|
const unsigned long kInitSavePrinterName = 0x00100000;
|
|
|
|
const unsigned long kInitSavePrintToFile = 0x00200000;
|
|
|
|
const unsigned long kInitSaveToFileName = 0x00400000;
|
|
|
|
const unsigned long kInitSavePageDelay = 0x00800000;
|
|
|
|
const unsigned long kInitSaveMargins = 0x01000000;
|
2006-02-07 04:13:52 +03:00
|
|
|
const unsigned long kInitSaveNativeData = 0x02000000;
|
2015-06-11 00:34:27 +03:00
|
|
|
|
2006-02-07 04:14:46 +03:00
|
|
|
const unsigned long kInitSaveShrinkToFit = 0x08000000;
|
|
|
|
const unsigned long kInitSaveScaling = 0x10000000;
|
2015-06-11 00:34:27 +03:00
|
|
|
|
2006-02-07 04:13:37 +03:00
|
|
|
const unsigned long kInitSaveAll = 0xFFFFFFFF;
|
2006-02-07 04:13:12 +03:00
|
|
|
|
2021-02-23 13:52:53 +03:00
|
|
|
// These settings should be read from global prefs. Other settings should be
|
|
|
|
// read only from printer-specific prefs.
|
|
|
|
const unsigned long kGlobalSettings =
|
|
|
|
kInitSaveHeaderLeft | kInitSaveHeaderCenter | kInitSaveHeaderRight |
|
|
|
|
kInitSaveFooterLeft | kInitSaveFooterCenter | kInitSaveFooterRight |
|
|
|
|
kInitSaveEdges | kInitSaveReversed | kInitSaveInColor |
|
|
|
|
kInitSaveBGColors | kInitSaveBGImages | kInitSaveShrinkToFit;
|
|
|
|
|
2006-02-07 04:11:45 +03:00
|
|
|
/* Justification Enums */
|
|
|
|
const long kJustLeft = 0;
|
|
|
|
const long kJustCenter = 1;
|
|
|
|
const long kJustRight = 2;
|
|
|
|
|
2022-03-30 21:51:58 +03:00
|
|
|
/** Page Size Unit Constants */
|
2006-02-07 04:13:12 +03:00
|
|
|
const short kPaperSizeInches = 0;
|
|
|
|
const short kPaperSizeMillimeters = 1;
|
2006-02-07 04:11:45 +03:00
|
|
|
|
2022-03-30 21:51:58 +03:00
|
|
|
/** Orientation Constants */
|
2006-02-07 04:13:05 +03:00
|
|
|
const short kPortraitOrientation = 0;
|
|
|
|
const short kLandscapeOrientation = 1;
|
2006-02-07 04:13:04 +03:00
|
|
|
|
2022-03-30 21:51:58 +03:00
|
|
|
/** Output file format */
|
2007-03-01 03:02:27 +03:00
|
|
|
const short kOutputFormatNative = 0;
|
|
|
|
const short kOutputFormatPDF = 2;
|
|
|
|
|
2022-03-30 21:51:58 +03:00
|
|
|
/** Output destination */
|
|
|
|
cenum OutputDestinationType : 8 {
|
|
|
|
kOutputDestinationPrinter = 0,
|
|
|
|
kOutputDestinationFile = 1,
|
|
|
|
kOutputDestinationStream = 2,
|
|
|
|
};
|
|
|
|
|
2020-08-25 23:31:56 +03:00
|
|
|
/**
|
2021-02-03 01:19:30 +03:00
|
|
|
* Duplex printing options.
|
|
|
|
*
|
2021-02-18 02:57:27 +03:00
|
|
|
* Note that other libraries refer to equivalent duplex settings using
|
|
|
|
* various sets of terminology. This can be confusing and inconsistent both
|
|
|
|
* with other libraries, and with the behavior that these terms intend to describe.
|
|
|
|
*
|
|
|
|
* kDuplexNone is equivalent to Simplex. Thankfully, both of these terms are
|
|
|
|
* consistent with the behavior that they describe, which is to have single-sided
|
|
|
|
* printing per sheet.
|
|
|
|
*
|
|
|
|
* kDuplexFlipOnLongEdge is equivalent to the following platform-specific constants:
|
|
|
|
* CUPS/macOS: NoTumble
|
|
|
|
* Windows: DMDUP_VERTICAL
|
|
|
|
* GTK: GTK_PRINT_DUPLEX_HORIZONTAL
|
|
|
|
*
|
|
|
|
* kDuplexFlipOnShortEdge is equivalent to the following platform-specific constants:
|
|
|
|
* CUPS/macOS: Tumble
|
|
|
|
* Windows: DMDUP_HORIZONTAL
|
|
|
|
* GTK: GTK_PRINT_DUPLEX_VERTICAL
|
|
|
|
*
|
|
|
|
*
|
|
|
|
* Notice that the GTK and Windows constants have opposite meanings for
|
|
|
|
* VERTICAL and HORIZONTAL.
|
|
|
|
*
|
|
|
|
* To make matters more confusing, these platform-specific terms describe different
|
|
|
|
* behavior (from the user's perspective) depending on whether the sheet is in
|
|
|
|
* portrait vs. landscape orientation.
|
|
|
|
*
|
|
|
|
* For example, the generic term "tumble" describes behavior where a sheet flips over
|
|
|
|
* a binding on the top edge (like a calendar). This requires that the back side of
|
|
|
|
* the sheet is printed upside down with respect to the front side of the sheet,
|
|
|
|
* so that its content appears upright to the reader when they tumble-flip the
|
|
|
|
* sheet over the top-edge binding.
|
|
|
|
*
|
|
|
|
* However, the CUPS/macOS Tumble setting only inverts the back side of the
|
|
|
|
* sheet in portrait orientation. When you switch to landscape orientation, the
|
|
|
|
* Tumble setting behaves like a book-like sheet flip, where the front and back
|
|
|
|
* sides of the sheet are both printed upright with respect to each other.
|
|
|
|
*
|
|
|
|
* This is why it is more consistent and more clear to think of these terms
|
|
|
|
* with regard to sheets being bound on the long edge or the short edge.
|
|
|
|
*
|
|
|
|
* kDuplexFlipOnLongEdge + Portrait = book-like flip (front/back same direction)
|
|
|
|
* kDuplexFlipOnLongEdge + Landscape = calendar-like flip (front/back inverted)
|
|
|
|
*
|
|
|
|
* kDuplexFlipOnShortEdge + Portrait = calendar-like flip (front/back inverted)
|
|
|
|
* kDuplexFlipOnShortEdge + Landscape = book-like flip (front/back same direction)
|
|
|
|
*
|
|
|
|
* The long-edge and short-edge terminology unfortunately breaks down when printing
|
|
|
|
* with square sheet dimensions. Thankfully this edge case (hah) is quite uncommon,
|
|
|
|
* since most standard printing paper dimensions are not square. Such a paper size
|
|
|
|
* would even break the uniformly used portrait and landscape terminology.
|
2020-08-25 23:31:56 +03:00
|
|
|
*/
|
2021-02-03 01:19:30 +03:00
|
|
|
const short kDuplexNone = 0;
|
2021-02-18 02:57:26 +03:00
|
|
|
const short kDuplexFlipOnLongEdge = 1;
|
|
|
|
const short kDuplexFlipOnShortEdge = 2;
|
2020-08-25 23:31:56 +03:00
|
|
|
|
2006-02-07 04:13:12 +03:00
|
|
|
/**
|
2007-07-17 03:16:48 +04:00
|
|
|
* Get the page size in twips, considering the
|
|
|
|
* orientation (portrait or landscape).
|
2006-02-07 04:13:12 +03:00
|
|
|
*/
|
2007-07-17 03:16:48 +04:00
|
|
|
void GetEffectivePageSize(out double aWidth, out double aHeight);
|
2006-02-07 04:13:12 +03:00
|
|
|
|
Bug 1669905 part 2: Add nsIPrintSettings APIs to handle the possibility that pages and sheets may have orthogonal orientation, in pages-per-sheet printouts. r=jfkthame
This patch does three things, all centered around these new APIs:
(1) Add the APIs themselves -- some nsIPrintSettings methods to reason about
the sheet-orientation being potentially flipped to accomodate 2 and 6
pages-per-sheet.
(2) Use these new APIs, where appropriate, in places where we previously used
the page-orientation to set up the platform-native print-settings objects and
print-target. Now, we'll use the *sheet* orientation instead of the page
orientation, to be sure we produce the appropriately-oriented platform-native
surfaces. Also, for symmetry, this patch adds similar logic to the reverse
codepaths, where we update an existing nsIPrintSettings object based on a
platform-native print-settings object.
(3) Update nsPrintJob's code that informs nsPresContext about the page-size.
This patch makes sure that this code uses the *page* size, rather than the
*sheet* size, in cases where they differ. (The code that consumes this
nsPresContext::GetPageSize API, e.g. our CSS media-query code, really does want
the page size, not the sheet size.)
Differential Revision: https://phabricator.services.mozilla.com/D100372
2021-01-05 05:24:00 +03:00
|
|
|
/**
|
|
|
|
* Get the printed sheet size in twips, considering both the user-specified
|
|
|
|
* orientation (portrait or landscape) *as well as* the fact that we might be
|
|
|
|
* inverting the orientation to account for 2 or 6 pages-per-sheet.
|
|
|
|
*
|
|
|
|
* This API will usually behave the same (& return the same thing) as
|
|
|
|
* GetEffectivePageSize, *except for* when we are printing with 2 or 6
|
|
|
|
* pages-per-sheet, in which case the return values (aWidth & aHeight) will
|
|
|
|
* be swapped with respect to what GetEffectivePageSize would return.
|
|
|
|
*
|
|
|
|
* Callers should use this method rather than GetEffectivePageSize when they
|
|
|
|
* really do want the size of the sheet of paper to be printed, rather than
|
|
|
|
* the possibly-"virtualized"-via-pages-per-sheet page size.
|
|
|
|
*/
|
|
|
|
[noscript, notxpcom, nostdcall] void GetEffectiveSheetSize(out double aWidth,
|
|
|
|
out double aHeight);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Get the orientation of a printed sheet. This is usually the same as the
|
|
|
|
* 'orientation' attribute (which is the orientation of individual pages),
|
|
|
|
* except when we're printing with 2 or 6 pages-per-sheet, in which case
|
|
|
|
* it'll be the opposite value.
|
|
|
|
*
|
|
|
|
* Note that this value is not independently settable. Its value is fully
|
|
|
|
* determined by the 'orientation' and 'numPagesPerSheet' attributes.
|
|
|
|
*/
|
|
|
|
[noscript, notxpcom, nostdcall] long GetSheetOrientation();
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Convenience getter, which returns true IFF the sheet orientation and the
|
|
|
|
* page orientation are orthogonal. (In other words, returns true IFF we
|
|
|
|
* are printing with 2 or 6 pages-per-sheet.)
|
|
|
|
*/
|
|
|
|
[noscript, notxpcom, nostdcall] bool HasOrthogonalSheetsAndPages();
|
|
|
|
|
2006-02-07 04:13:52 +03:00
|
|
|
/**
|
|
|
|
* Makes a new copy
|
|
|
|
*/
|
2020-09-16 14:21:41 +03:00
|
|
|
nsIPrintSettings clone();
|
2006-02-07 04:13:52 +03:00
|
|
|
|
2006-02-07 04:14:05 +03:00
|
|
|
/**
|
|
|
|
* Assigns the internal values from the "in" arg to the current object
|
|
|
|
*/
|
2020-09-16 14:21:41 +03:00
|
|
|
void assign(in nsIPrintSettings aPS);
|
2006-02-07 04:14:05 +03:00
|
|
|
|
2021-11-16 11:17:02 +03:00
|
|
|
/**
|
|
|
|
* Returns true if the settings will result in an equivalent preview and
|
|
|
|
* therefore print. The printer name is ignored and it allows for a small
|
|
|
|
* delta in sizes to allow for rounding differences.
|
|
|
|
*/
|
|
|
|
bool equivalentTo(in nsIPrintSettings aPrintSettings);
|
|
|
|
|
2007-11-13 22:14:07 +03:00
|
|
|
/**
|
2008-03-19 23:51:42 +03:00
|
|
|
* The edge measurements define the positioning of the headers
|
2020-09-10 21:03:04 +03:00
|
|
|
* and footers on the page. They're treated as an offset from the edges of
|
|
|
|
* the page, but are forced to be at least the "unwriteable margin"
|
|
|
|
* (described below).
|
2007-11-13 22:14:07 +03:00
|
|
|
*/
|
|
|
|
attribute double edgeTop; /* these are in inches */
|
|
|
|
attribute double edgeLeft;
|
|
|
|
attribute double edgeBottom;
|
|
|
|
attribute double edgeRight;
|
|
|
|
|
|
|
|
/**
|
2008-03-19 23:51:42 +03:00
|
|
|
* The margins define the positioning of the content on the page.
|
2020-09-10 21:03:04 +03:00
|
|
|
* and footers on the page. They're treated as an offset from the edges of
|
2022-08-15 22:55:08 +03:00
|
|
|
* the page, but are forced to be at least the "unwriteable margin," unless
|
|
|
|
* set to be ignored (described below).
|
2007-11-13 22:14:07 +03:00
|
|
|
*/
|
2006-02-07 04:11:45 +03:00
|
|
|
attribute double marginTop; /* these are in inches */
|
|
|
|
attribute double marginLeft;
|
|
|
|
attribute double marginBottom;
|
|
|
|
attribute double marginRight;
|
2008-03-19 23:51:42 +03:00
|
|
|
/**
|
2020-09-10 21:03:04 +03:00
|
|
|
* The unwriteable margin defines the printable region of the paper.
|
2008-03-19 23:51:42 +03:00
|
|
|
*/
|
|
|
|
attribute double unwriteableMarginTop; /* these are in inches */
|
|
|
|
attribute double unwriteableMarginLeft;
|
|
|
|
attribute double unwriteableMarginBottom;
|
|
|
|
attribute double unwriteableMarginRight;
|
2006-02-07 04:11:45 +03:00
|
|
|
|
2006-02-07 04:13:10 +03:00
|
|
|
attribute double scaling; /* values 0.0 - 1.0 */
|
2020-09-16 14:21:41 +03:00
|
|
|
[infallible] attribute boolean printBGColors; /* Print Background Colors */
|
|
|
|
[infallible] attribute boolean printBGImages; /* Print Background Images */
|
2006-02-07 04:13:10 +03:00
|
|
|
|
2022-08-15 22:55:08 +03:00
|
|
|
/**
|
|
|
|
* Whether @page rule margins should be honored or not. If the @page
|
|
|
|
* rule sets its margins to zero, we automatically ignore unwriteable
|
|
|
|
* margins, but nonzero values will be clamped to unwriteable margins.
|
|
|
|
*/
|
2020-10-01 16:18:01 +03:00
|
|
|
[infallible] attribute boolean honorPageRuleMargins;
|
|
|
|
|
2022-08-15 22:55:08 +03:00
|
|
|
/**
|
|
|
|
* Whether unwritable margins should be ignored. This should be set when
|
|
|
|
* when the user explicitly requests "Margins: None", e.g. for documents
|
|
|
|
* where accurate scaling matters. Note: While `honorPageRuleMargins` and
|
|
|
|
* this flag can't be set at the same time through the UI, doing so will
|
|
|
|
* cause even the nonzero @page rule margins to ignore unwriteable margins.
|
|
|
|
*/
|
|
|
|
[infallible] attribute boolean ignoreUnwriteableMargins;
|
|
|
|
|
2020-10-01 13:54:18 +03:00
|
|
|
/** Whether to draw guidelines showing the margin settings */
|
|
|
|
[infallible] attribute boolean showMarginGuides;
|
|
|
|
|
2020-10-02 16:59:48 +03:00
|
|
|
/** Whether to only print the selected nodes */
|
|
|
|
[infallible] attribute boolean printSelectionOnly;
|
|
|
|
|
2017-10-09 02:08:09 +03:00
|
|
|
attribute AString title;
|
|
|
|
attribute AString docURL;
|
2006-02-07 04:11:45 +03:00
|
|
|
|
2017-10-09 02:08:09 +03:00
|
|
|
attribute AString headerStrLeft;
|
|
|
|
attribute AString headerStrCenter;
|
|
|
|
attribute AString headerStrRight;
|
2006-02-07 04:11:45 +03:00
|
|
|
|
2017-10-09 02:08:09 +03:00
|
|
|
attribute AString footerStrLeft;
|
|
|
|
attribute AString footerStrCenter;
|
|
|
|
attribute AString footerStrRight;
|
2006-02-07 04:11:45 +03:00
|
|
|
|
2019-04-21 04:47:00 +03:00
|
|
|
attribute boolean printSilent; /* print without putting up the dialog */
|
2021-11-16 11:17:02 +03:00
|
|
|
[infallible] attribute boolean shrinkToFit; /* shrinks content to fit on page */
|
2006-02-07 04:13:04 +03:00
|
|
|
|
2006-02-07 04:13:05 +03:00
|
|
|
/* Additional XP Related */
|
2020-09-20 00:31:05 +03:00
|
|
|
attribute AString paperId; /* identifier of paper (not display name) */
|
2006-02-07 04:13:12 +03:00
|
|
|
attribute double paperWidth; /* width of the paper in inches or mm */
|
|
|
|
attribute double paperHeight; /* height of the paper in inches or mm */
|
|
|
|
attribute short paperSizeUnit; /* paper is in inches or mm */
|
|
|
|
|
2006-02-07 04:13:05 +03:00
|
|
|
attribute boolean printReversed;
|
2020-10-23 14:58:42 +03:00
|
|
|
[infallible] attribute boolean printInColor; /* a false means grayscale */
|
2006-02-07 04:13:05 +03:00
|
|
|
attribute long orientation; /* see orientation consts */
|
2006-02-07 04:13:12 +03:00
|
|
|
attribute long numCopies;
|
2006-02-07 04:15:09 +03:00
|
|
|
|
2020-10-14 01:55:03 +03:00
|
|
|
/**
|
|
|
|
* For numPagesPerSheet, we support these values: 1, 2, 4, 6, 9, 16.
|
|
|
|
*
|
|
|
|
* Unsupported values will be treated internally as 1 page per sheet, and
|
|
|
|
* will trigger assertion failures in debug builds.
|
|
|
|
*/
|
|
|
|
attribute long numPagesPerSheet;
|
|
|
|
|
2022-03-30 21:51:58 +03:00
|
|
|
/** Output device information */
|
|
|
|
[infallible] attribute nsIPrintSettings_OutputDestinationType outputDestination;
|
|
|
|
[infallible] attribute short outputFormat;
|
2006-02-07 04:15:09 +03:00
|
|
|
|
2022-05-21 01:51:00 +03:00
|
|
|
/**
|
|
|
|
* If outputDestination==kOutputDestinationPrinter, this is set to the name
|
|
|
|
* of the printer that the print output should be saved to, but only in the
|
|
|
|
* parent process (we don't want to leak printer names to potentially
|
|
|
|
* compromised content processes).
|
|
|
|
*/
|
|
|
|
attribute AString printerName;
|
2022-05-21 01:50:59 +03:00
|
|
|
|
|
|
|
/**
|
|
|
|
* If outputDestination==kOutputDestinationFile, this is set to the path
|
|
|
|
* of the file that the print output should be saved to, but only in the
|
|
|
|
* parent process (we don't want to leak system paths to potentially
|
|
|
|
* compromised content processes).
|
|
|
|
*/
|
|
|
|
attribute AString toFileName;
|
|
|
|
|
2022-03-30 21:51:58 +03:00
|
|
|
attribute nsIOutputStream outputStream; /* for kOutputDestinationPrinter */
|
2006-02-07 04:11:45 +03:00
|
|
|
|
2022-03-30 21:51:58 +03:00
|
|
|
[infallible] attribute long printPageDelay; /* in milliseconds */
|
2013-04-11 17:10:42 +04:00
|
|
|
|
2022-03-30 21:51:58 +03:00
|
|
|
[infallible] attribute long resolution; /* print resolution (dpi) */
|
2013-04-11 17:10:42 +04:00
|
|
|
|
2022-03-30 21:51:58 +03:00
|
|
|
[infallible] attribute long duplex; /* duplex mode */
|
2013-04-11 17:10:42 +04:00
|
|
|
|
2006-02-07 04:14:23 +03:00
|
|
|
/* initialize helpers */
|
|
|
|
/**
|
2019-04-21 04:47:00 +03:00
|
|
|
* This attribute tracks whether the PS has been initialized
|
|
|
|
* from a printer specified by the "printerName" attr.
|
|
|
|
* If a different name is set into the "printerName"
|
2006-02-07 04:14:23 +03:00
|
|
|
* attribute than the one it was initialized with the PS
|
2022-03-30 21:51:58 +03:00
|
|
|
* will then get initialized from that printer.
|
2006-02-07 04:14:23 +03:00
|
|
|
*/
|
|
|
|
attribute boolean isInitializedFromPrinter;
|
|
|
|
|
|
|
|
/**
|
2019-04-21 04:47:00 +03:00
|
|
|
* This attribute tracks whether the PS has been initialized
|
|
|
|
* from prefs. If a different name is set into the "printerName"
|
2006-02-07 04:14:23 +03:00
|
|
|
* attribute than the one it was initialized with the PS
|
2022-03-30 21:51:58 +03:00
|
|
|
* will then get initialized from prefs again.
|
2006-02-07 04:14:23 +03:00
|
|
|
*/
|
|
|
|
attribute boolean isInitializedFromPrefs;
|
|
|
|
|
2006-02-07 04:13:12 +03:00
|
|
|
/* C++ Helper Functions */
|
2009-01-15 06:27:09 +03:00
|
|
|
[noscript] void SetMarginInTwips(in nsNativeIntMarginRef aMargin);
|
|
|
|
[noscript] void SetEdgeInTwips(in nsNativeIntMarginRef aEdge);
|
2020-09-10 18:25:59 +03:00
|
|
|
[noscript, notxpcom, nostdcall] nsNativeIntMargin GetMarginInTwips();
|
|
|
|
[noscript, notxpcom, nostdcall] nsNativeIntMargin GetEdgeInTwips();
|
2008-01-21 06:47:25 +03:00
|
|
|
|
2008-03-19 23:51:42 +03:00
|
|
|
/**
|
|
|
|
* Sets/Gets the "unwriteable margin" for the page format. This defines
|
2019-04-21 04:47:00 +03:00
|
|
|
* the boundary from which we'll measure the EdgeInTwips and MarginInTwips
|
2008-03-19 23:51:42 +03:00
|
|
|
* attributes, to place the headers and content, respectively.
|
|
|
|
*
|
|
|
|
* Note: Implementations of SetUnwriteableMarginInTwips should handle
|
|
|
|
* negative margin values by falling back on the system default for
|
|
|
|
* that margin.
|
|
|
|
*/
|
2009-01-15 06:27:09 +03:00
|
|
|
[noscript] void SetUnwriteableMarginInTwips(in nsNativeIntMarginRef aEdge);
|
2020-09-10 18:25:59 +03:00
|
|
|
[noscript, notxpcom, nostdcall] nsNativeIntMargin GetUnwriteableMarginInTwips();
|
2019-04-21 04:47:00 +03:00
|
|
|
|
2011-12-07 08:45:06 +04:00
|
|
|
/**
|
2019-04-21 04:47:00 +03:00
|
|
|
* Get more accurate print ranges from the superior interval
|
|
|
|
* (startPageRange, endPageRange). The aPages array is populated with a
|
|
|
|
* list of pairs (start, end), where the endpoints are included. The print
|
|
|
|
* ranges (start, end), must not overlap and must be in the
|
2011-12-07 08:45:06 +04:00
|
|
|
* (startPageRange, endPageRange) scope.
|
|
|
|
*
|
2020-11-07 19:01:57 +03:00
|
|
|
* If there are no print ranges the aPages array is empty.
|
2011-12-07 08:45:06 +04:00
|
|
|
*/
|
2020-11-07 19:01:57 +03:00
|
|
|
attribute Array<long> pageRanges;
|
|
|
|
|
2021-11-16 11:17:02 +03:00
|
|
|
/**
|
|
|
|
* Get a PrintSettingsInitializer populated with the relevant current settings.
|
|
|
|
*/
|
2022-07-06 17:53:06 +03:00
|
|
|
[notxpcom, nostdcall] PrintSettingsInitializer getSettingsInitializer();
|
2021-11-16 11:17:02 +03:00
|
|
|
|
2022-07-06 17:53:06 +03:00
|
|
|
%{C++
|
2020-11-07 19:01:57 +03:00
|
|
|
static bool IsPageSkipped(int32_t aPageNum, const nsTArray<int32_t>& aRanges);
|
|
|
|
%}
|
2006-02-07 04:11:45 +03:00
|
|
|
};
|
2020-08-20 09:11:08 +03:00
|
|
|
|
|
|
|
%{ C++
|
|
|
|
already_AddRefed<nsIPrintSettings> CreatePlatformPrintSettings(const mozilla::PrintSettingsInitializer&);
|
|
|
|
%}
|