Bug 1671598 [wpt PR 26128] - [AspectRatio] Fix divide by zero with a small float...
[gecko.git] / widget / nsDeviceContextSpecProxy.h
blobd82b182c97c1cf4d989876cb8b30b06e1955b69c
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 private:
56 ~nsDeviceContextSpecProxy() = default;
58 nsCOMPtr<nsIPrintSettings> mPrintSettings;
59 nsCOMPtr<nsIPrintSession> mPrintSession;
60 nsCOMPtr<nsIDeviceContextSpec> mRealDeviceContextSpec;
61 RefPtr<mozilla::layout::RemotePrintJobChild> mRemotePrintJob;
62 RefPtr<mozilla::layout::DrawEventRecorderPRFileDesc> mRecorder;
65 #endif // nsDeviceContextSpecProxy_h