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(nsIWidget
* aWidget
, nsIPrintSettings
* aPS
,
24 bool aIsPrintPreview
) override
;
25 already_AddRefed
<PrintTarget
> MakePrintTarget() final
;
26 NS_IMETHOD
BeginDocument(const nsAString
& aTitle
,
27 const nsAString
& aPrintToFileName
,
28 int32_t aStartPage
, int32_t aEndPage
) override
;
29 NS_IMETHOD
EndDocument() override
;
30 NS_IMETHOD
BeginPage() override
{ return NS_OK
; };
31 NS_IMETHOD
EndPage() override
{ return NS_OK
; };
33 void GetPaperRect(double* aTop
, double* aLeft
, double* aBottom
,
37 virtual ~nsDeviceContextSpecX();
40 PMPrintSession mPrintSession
; // printing context.
41 PMPageFormat mPageFormat
; // page format.
42 PMPrintSettings mPrintSettings
; // print settings.
43 #ifdef MOZ_ENABLE_SKIA_PDF
45 mTempFile
; // file "print" output is generated to if printing via PDF
50 #endif // nsDeviceContextSpecX_h_