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"
13 #include "mozilla/layout/printing/DrawEventRecorder.h"
16 class nsIUUIDGenerator
;
20 class RemotePrintJobChild
;
22 } // namespace mozilla
24 class nsDeviceContextSpecProxy final
: public nsIDeviceContextSpec
{
26 using RemotePrintJobChild
= mozilla::layout::RemotePrintJobChild
;
28 explicit nsDeviceContextSpecProxy(RemotePrintJobChild
* aRemotePrintJob
);
32 NS_IMETHOD
Init(nsIWidget
* aWidget
, nsIPrintSettings
* aPrintSettings
,
33 bool aIsPrintPreview
) final
;
35 already_AddRefed
<PrintTarget
> MakePrintTarget() final
;
37 NS_IMETHOD
GetDrawEventRecorder(
38 mozilla::gfx::DrawEventRecorder
** aDrawEventRecorder
) final
;
42 float GetPrintingScale() final
;
44 gfxPoint
GetPrintingTranslate() final
;
46 NS_IMETHOD
BeginDocument(const nsAString
& aTitle
,
47 const nsAString
& aPrintToFileName
,
48 int32_t aStartPage
, int32_t aEndPage
) final
;
50 NS_IMETHOD
EndDocument() final
;
52 NS_IMETHOD
AbortDocument() final
;
54 NS_IMETHOD
BeginPage() final
;
56 NS_IMETHOD
EndPage() final
;
59 ~nsDeviceContextSpecProxy();
61 nsCOMPtr
<nsIPrintSettings
> mPrintSettings
;
62 nsCOMPtr
<nsIDeviceContextSpec
> mRealDeviceContextSpec
;
63 RefPtr
<RemotePrintJobChild
> mRemotePrintJob
;
64 RefPtr
<mozilla::layout::DrawEventRecorderPRFileDesc
> mRecorder
;
67 #endif // nsDeviceContextSpecProxy_h