Bug 1454293 [wpt PR 10484] - null is not the correct origin for createDocument()...
[gecko.git] / widget / nsIPrintSettingsWin.idl
blob65bb304bd1c9be66a6ecb4d28d508f030329cd8a
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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/. */
6 #include "nsISupports.idl"
8 %{ C++
9 #include "windows.h"
12 /**
13 * Native types
15 [ptr] native nsDevMode(DEVMODEW);
16 native nsHdc(HDC);
18 /**
19 * Simplified PrintSettings for Windows interface
21 [scriptable, uuid(c63eed41-6ac5-459e-8a64-033eb9ad770a)]
23 interface nsIPrintSettingsWin : nsISupports
25 /**
26 * Data Members
28 * Each of these data members make a copy
29 * of the contents. If you get the value,
30 * you own the memory.
32 * The following three pieces of data are needed
33 * to create a DC for printing. These are typcially
34 * gotten via the PrintDLG call ro can be obtained
35 * via the "m_pd" data member of the CPrintDialog
36 * in MFC.
38 [noscript] attribute AString deviceName;
39 [noscript] attribute AString driverName;
41 [noscript] attribute nsDevMode devMode;
43 /**
44 * On Windows we use the printable width and height for the printing surface.
45 * We don't want to have to create native print device contexts in the content
46 * process, so we need to store these in the settings.
47 * Storing in Inches is most convenient as they are retrieved from the device
48 * using fields which are in pixels and pixels per inch.
49 * Note these are stored in portrait format to ensure that we can take account
50 * of our own changes to the orientation print setting.
52 [noscript] attribute double printableWidthInInches;
53 [noscript] attribute double printableHeightInInches;
55 /**
56 * Copy relevant print settings from native Windows device.
58 * @param hdc HDC to copy from
59 * @param devMode DEVMODE to copy from
61 [notxpcom] void copyFromNative(in nsHdc hdc, in nsDevMode devMode);
63 /**
64 * Copy relevant print settings to native windows structures.
66 * @param devMode DEVMODE to be populated.
68 [notxpcom] void copyToNative(in nsDevMode devMode);