1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
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 #ifndef nsDeviceContextSpecOS2_h___
7 #define nsDeviceContextSpecOS2_h___
11 #define INCL_DOSERRORS
12 #define INCL_SPLDOSPRINT
15 #define INCL_GRE_DEVICE
18 #include "nsIDeviceContextSpec.h"
19 #include "nsIPrintOptions.h"
20 #include "nsIPrintSettings.h"
21 #include "nsPrintdOS2.h"
25 #include "nsPrintOS2.h"
26 //---------------------------------------------------------------------
27 // nsDeviceContextSpecOS2
28 //---------------------------------------------------------------------
30 class nsDeviceContextSpecOS2
: public nsIDeviceContextSpec
34 * Construct a nsDeviceContextSpecOS2, which is an object which contains and manages a mac printrecord
37 nsDeviceContextSpecOS2();
42 * Initialize the nsDeviceContextSpecOS2 for use. This will allocate a printrecord for use
44 * @param aWidget Unused
45 * @param aPS Settings for this print job
46 * @param aIsPrintPreview if true, creating Spec for PrintPreview
47 * @return error status
49 NS_IMETHOD
Init(nsIWidget
*aWidget
, nsIPrintSettings
* aPS
, bool aIsPrintPreview
);
51 NS_IMETHOD
ClosePrintManager();
53 NS_IMETHOD
GetDestination ( int &aDestination
);
55 NS_IMETHOD
GetPrinterName ( char **aPrinter
);
57 NS_IMETHOD
GetCopies ( int &aCopies
);
59 NS_IMETHOD
GetPath ( char **aPath
);
61 NS_IMETHOD
GetUserCancelled( bool &aCancel
);
63 NS_IMETHOD
GetPRTQUEUE(PRTQUEUE
*&p
);
65 NS_IMETHOD
GetSurfaceForPrinter(gfxASurface
**nativeSurface
);
66 NS_IMETHOD
BeginDocument(const nsAString
& aTitle
, char16_t
* aPrintToFileName
,
67 int32_t aStartPage
, int32_t aEndPage
);
68 NS_IMETHOD
EndDocument();
69 NS_IMETHOD
BeginPage();
73 * Destructor for nsDeviceContextSpecOS2, this will release the printrecord
76 virtual ~nsDeviceContextSpecOS2();
78 static PRINTDLG PrnDlg
;
79 static nsresult
SetPrintSettingsFromDevMode(nsIPrintSettings
* aPrintSettings
, ULONG printer
);
84 nsCOMPtr
<nsIPrintSettings
> mPrintSettings
;
86 bool mPrintingStarted
;
89 //-------------------------------------------------------------------------
91 //-------------------------------------------------------------------------
92 class nsPrinterEnumeratorOS2
: public nsIPrinterEnumerator
95 nsPrinterEnumeratorOS2();
97 NS_DECL_NSIPRINTERENUMERATOR