Line data Source code
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 :
14 : class nsIFile;
15 : class nsIPrintSession;
16 : class nsIUUIDGenerator;
17 :
18 : namespace mozilla {
19 : namespace gfx {
20 : class DrawEventRecorderFile;
21 : }
22 :
23 : namespace layout {
24 : class RemotePrintJobChild;
25 : }
26 : }
27 :
28 0 : class nsDeviceContextSpecProxy final : public nsIDeviceContextSpec
29 : {
30 : public:
31 : NS_DECL_ISUPPORTS
32 :
33 : NS_IMETHOD Init(nsIWidget* aWidget, nsIPrintSettings* aPrintSettings,
34 : bool aIsPrintPreview) final;
35 :
36 : virtual already_AddRefed<PrintTarget> MakePrintTarget() final;
37 :
38 : NS_IMETHOD GetDrawEventRecorder(mozilla::gfx::DrawEventRecorder** aDrawEventRecorder) final;
39 :
40 : float GetDPI() final;
41 :
42 : float GetPrintingScale() final;
43 :
44 :
45 : NS_IMETHOD BeginDocument(const nsAString& aTitle,
46 : const nsAString& aPrintToFileName,
47 : int32_t aStartPage, int32_t aEndPage) final;
48 :
49 : NS_IMETHOD EndDocument() final;
50 :
51 : NS_IMETHOD AbortDocument() final;
52 :
53 : NS_IMETHOD BeginPage() final;
54 :
55 : NS_IMETHOD EndPage() final;
56 :
57 : private:
58 0 : ~nsDeviceContextSpecProxy() {}
59 :
60 : nsresult CreateUniqueTempPath(nsACString& aFilePath);
61 :
62 : nsCOMPtr<nsIPrintSettings> mPrintSettings;
63 : nsCOMPtr<nsIPrintSession> mPrintSession;
64 : nsCOMPtr<nsIDeviceContextSpec> mRealDeviceContextSpec;
65 : RefPtr<mozilla::layout::RemotePrintJobChild> mRemotePrintJob;
66 : RefPtr<mozilla::gfx::DrawEventRecorderFile> mRecorder;
67 : nsCOMPtr<nsIFile> mRecordingDir;
68 : nsCOMPtr<nsIUUIDGenerator> mUuidGenerator;
69 : nsCString mRecordingFileName;
70 : };
71 :
72 : #endif // nsDeviceContextSpecProxy_h
|