Bug 1646817 - Support DocumentChannel process switching in sidebars and popups r...
[gecko.git] / widget / cocoa / nsDeviceContextSpecX.h
blob794692e57fb798887ed9fa2d3151ba2051edea90
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"
13 #include "nsCOMPtr.h"
15 #include <ApplicationServices/ApplicationServices.h>
17 class nsDeviceContextSpecX : public nsIDeviceContextSpec {
18 public:
19 NS_DECL_ISUPPORTS
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,
34 double* aRight);
36 protected:
37 virtual ~nsDeviceContextSpecX();
39 protected:
40 PMPrintSession mPrintSession; // printing context.
41 PMPageFormat mPageFormat; // page format.
42 PMPrintSettings mPrintSettings; // print settings.
43 #ifdef MOZ_ENABLE_SKIA_PDF
44 nsCOMPtr<nsIFile>
45 mTempFile; // file "print" output is generated to if printing via PDF
46 bool mPrintViaSkPDF;
47 #endif
50 #endif // nsDeviceContextSpecX_h_