/src/mozilla-central/widget/nsDeviceContextSpecProxy.h
Line | Count | Source (jump to first uncovered line) |
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/. */ |
6 | | |
7 | | #ifndef nsDeviceContextSpecProxy_h |
8 | | #define nsDeviceContextSpecProxy_h |
9 | | |
10 | | #include "nsIDeviceContextSpec.h" |
11 | | #include "nsCOMPtr.h" |
12 | | #include "nsString.h" |
13 | | #include "mozilla/layout/printing/DrawEventRecorder.h" |
14 | | |
15 | | class nsIFile; |
16 | | class nsIPrintSession; |
17 | | class nsIUUIDGenerator; |
18 | | |
19 | | namespace mozilla { |
20 | | namespace layout { |
21 | | class RemotePrintJobChild; |
22 | | } |
23 | | } |
24 | | |
25 | | class nsDeviceContextSpecProxy final : public nsIDeviceContextSpec |
26 | | { |
27 | | public: |
28 | | NS_DECL_ISUPPORTS |
29 | | |
30 | | NS_IMETHOD Init(nsIWidget* aWidget, nsIPrintSettings* aPrintSettings, |
31 | | bool aIsPrintPreview) final; |
32 | | |
33 | | already_AddRefed<PrintTarget> MakePrintTarget() final; |
34 | | |
35 | | NS_IMETHOD GetDrawEventRecorder(mozilla::gfx::DrawEventRecorder** aDrawEventRecorder) final; |
36 | | |
37 | | float GetDPI() final; |
38 | | |
39 | | float GetPrintingScale() final; |
40 | | |
41 | | gfxPoint GetPrintingTranslate() final; |
42 | | |
43 | | |
44 | | NS_IMETHOD BeginDocument(const nsAString& aTitle, |
45 | | const nsAString& aPrintToFileName, |
46 | | int32_t aStartPage, int32_t aEndPage) final; |
47 | | |
48 | | NS_IMETHOD EndDocument() final; |
49 | | |
50 | | NS_IMETHOD AbortDocument() final; |
51 | | |
52 | | NS_IMETHOD BeginPage() final; |
53 | | |
54 | | NS_IMETHOD EndPage() final; |
55 | | |
56 | | private: |
57 | 0 | ~nsDeviceContextSpecProxy() {} |
58 | | |
59 | | nsCOMPtr<nsIPrintSettings> mPrintSettings; |
60 | | nsCOMPtr<nsIPrintSession> mPrintSession; |
61 | | nsCOMPtr<nsIDeviceContextSpec> mRealDeviceContextSpec; |
62 | | RefPtr<mozilla::layout::RemotePrintJobChild> mRemotePrintJob; |
63 | | RefPtr<mozilla::layout::DrawEventRecorderPRFileDesc> mRecorder; |
64 | | }; |
65 | | |
66 | | #endif // nsDeviceContextSpecProxy_h |