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"
14 #include "mozilla/gfx/PrintPromise.h"
17 class nsIUUIDGenerator
;
21 class RemotePrintJobChild
;
23 } // namespace mozilla
25 class nsDeviceContextSpecProxy final
: public nsIDeviceContextSpec
{
27 using IntSize
= mozilla::gfx::IntSize
;
28 using RemotePrintJobChild
= mozilla::layout::RemotePrintJobChild
;
30 explicit nsDeviceContextSpecProxy(RemotePrintJobChild
* aRemotePrintJob
);
34 NS_IMETHOD
Init(nsIPrintSettings
* aPrintSettings
, bool aIsPrintPreview
) final
;
36 already_AddRefed
<PrintTarget
> MakePrintTarget() final
;
38 NS_IMETHOD
GetDrawEventRecorder(
39 mozilla::gfx::DrawEventRecorder
** aDrawEventRecorder
) final
;
41 NS_IMETHOD
BeginDocument(const nsAString
& aTitle
,
42 const nsAString
& aPrintToFileName
,
43 int32_t aStartPage
, int32_t aEndPage
) final
;
45 RefPtr
<mozilla::gfx::PrintEndDocumentPromise
> EndDocument() final
;
47 NS_IMETHOD
BeginPage(const IntSize
& aSizeInPoints
) final
;
49 NS_IMETHOD
EndPage() final
;
52 ~nsDeviceContextSpecProxy();
54 RefPtr
<RemotePrintJobChild
> mRemotePrintJob
;
55 RefPtr
<mozilla::layout::DrawEventRecorderPRFileDesc
> mRecorder
;
56 IntSize mCurrentPageSizeInPoints
;
59 #endif // nsDeviceContextSpecProxy_h