Bug 1716846 [wpt PR 29402] - Update wpt metadata, a=testonly
[gecko.git] / widget / nsDeviceContextSpecProxy.h
blob1c4a4e19949b7c494cbf855755a42cdf44703b4d
1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
3 /* This Source Code Form is subject to the terms of the Mozilla Public
4 * License, v. 2.0. If a copy of the MPL was not distributed with this
5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
7 #ifndef nsDeviceContextSpecProxy_h
8 #define nsDeviceContextSpecProxy_h
10 #include "nsIDeviceContextSpec.h"
11 #include "nsCOMPtr.h"
12 #include "nsString.h"
13 #include "mozilla/layout/printing/DrawEventRecorder.h"
15 class nsIFile;
16 class nsIPrintSession;
17 class nsIUUIDGenerator;
19 namespace mozilla {
20 namespace layout {
21 class RemotePrintJobChild;
23 } // namespace mozilla
25 class nsDeviceContextSpecProxy final : public nsIDeviceContextSpec {
26 public:
27 NS_DECL_ISUPPORTS
29 NS_IMETHOD Init(nsIWidget* aWidget, nsIPrintSettings* aPrintSettings,
30 bool aIsPrintPreview) final;
32 already_AddRefed<PrintTarget> MakePrintTarget() final;
34 NS_IMETHOD GetDrawEventRecorder(
35 mozilla::gfx::DrawEventRecorder** aDrawEventRecorder) final;
37 float GetDPI() final;
39 float GetPrintingScale() final;
41 gfxPoint GetPrintingTranslate() final;
43 NS_IMETHOD BeginDocument(const nsAString& aTitle,
44 const nsAString& aPrintToFileName,
45 int32_t aStartPage, int32_t aEndPage) final;
47 NS_IMETHOD EndDocument() final;
49 NS_IMETHOD AbortDocument() final;
51 NS_IMETHOD BeginPage() final;
53 NS_IMETHOD EndPage() final;
55 nsDeviceContextSpecProxy();
57 private:
58 ~nsDeviceContextSpecProxy();
60 nsCOMPtr<nsIPrintSettings> mPrintSettings;
61 nsCOMPtr<nsIPrintSession> mPrintSession;
62 nsCOMPtr<nsIDeviceContextSpec> mRealDeviceContextSpec;
63 RefPtr<mozilla::layout::RemotePrintJobChild> mRemotePrintJob;
64 RefPtr<mozilla::layout::DrawEventRecorderPRFileDesc> mRecorder;
67 #endif // nsDeviceContextSpecProxy_h