1 /* -*- Mode: C++; tab-width: 4; 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 nsDeviceContextSpecX_h_
7 #define nsDeviceContextSpecX_h_
9 #include "nsIDeviceContextSpec.h"
10 #include "nsIPrinter.h"
11 #include "nsIPrinterList.h"
15 #include <ApplicationServices/ApplicationServices.h>
17 class nsDeviceContextSpecX
: public nsIDeviceContextSpec
{
21 nsDeviceContextSpecX();
23 NS_IMETHOD
Init(nsIPrintSettings
* aPS
, bool aIsPrintPreview
) override
;
24 already_AddRefed
<PrintTarget
> MakePrintTarget() final
;
25 NS_IMETHOD
BeginDocument(const nsAString
& aTitle
,
26 const nsAString
& aPrintToFileName
,
27 int32_t aStartPage
, int32_t aEndPage
) override
;
28 NS_IMETHOD
EndDocument() override
;
29 NS_IMETHOD
BeginPage() override
{ return NS_OK
; };
30 NS_IMETHOD
EndPage() override
{ return NS_OK
; };
32 void GetPaperRect(double* aTop
, double* aLeft
, double* aBottom
,
36 virtual ~nsDeviceContextSpecX();
39 PMPrintSession mPrintSession
= nullptr;
40 PMPageFormat mPageFormat
= nullptr;
41 PMPrintSettings mPMPrintSettings
= nullptr;
42 nsCOMPtr
<nsIOutputStream
> mOutputStream
; // Output stream from settings.
43 #ifdef MOZ_ENABLE_SKIA_PDF
44 // file "print" output generated if printing via PDF
45 nsCOMPtr
<nsIFile
> mTempFile
;
49 #endif // nsDeviceContextSpecX_h_