Backed out changeset f1426851ae30 (bug 1844755) for causing failures on test_printpre...
[gecko.git] / widget / android / nsDeviceContextAndroid.h
blob094f3911519c00ebaf44b80d9195dfd4feca6347
1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* This Source Code Form is subject to the terms of the Mozilla Public
3 * License, v. 2.0. If a copy of the MPL was not distributed with this
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
5 #ifndef nsDeviceContextAndroid_h__
6 #define nsDeviceContextAndroid_h__
8 #include "nsIDeviceContextSpec.h"
9 #include "nsCOMPtr.h"
10 #include "mozilla/gfx/Point.h"
11 #include "mozilla/gfx/PrintPromise.h"
13 class nsDeviceContextSpecAndroid final : public nsIDeviceContextSpec {
14 private:
15 virtual ~nsDeviceContextSpecAndroid();
17 public:
18 using IntSize = mozilla::gfx::IntSize;
20 NS_DECL_ISUPPORTS
22 already_AddRefed<PrintTarget> MakePrintTarget() final;
24 NS_IMETHOD Init(nsIPrintSettings* aPS, bool aIsPrintPreview) override;
25 NS_IMETHOD BeginDocument(const nsAString& aTitle,
26 const nsAString& aPrintToFileName,
27 int32_t aStartPage, int32_t aEndPage) override;
28 RefPtr<mozilla::gfx::PrintEndDocumentPromise> EndDocument() override;
29 NS_IMETHOD BeginPage(const IntSize& aSizeInPoints) override { return NS_OK; }
30 NS_IMETHOD EndPage() override { return NS_OK; }
32 private:
33 nsresult DoEndDocument();
34 nsCOMPtr<nsIFile> mTempFile;
36 #endif // nsDeviceContextAndroid_h__