2016-01-05 13:08:57 +03:00
|
|
|
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
|
|
|
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
|
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
|
|
|
|
|
|
|
#ifndef nsDeviceContextSpecProxy_h
|
|
|
|
#define nsDeviceContextSpecProxy_h
|
|
|
|
|
|
|
|
#include "nsIDeviceContextSpec.h"
|
|
|
|
#include "nsCOMPtr.h"
|
2016-11-22 17:06:46 +03:00
|
|
|
#include "nsString.h"
|
2017-10-03 19:29:15 +03:00
|
|
|
#include "mozilla/layout/printing/DrawEventRecorder.h"
|
2022-12-19 18:42:48 +03:00
|
|
|
#include "mozilla/gfx/PrintPromise.h"
|
2016-01-05 13:08:57 +03:00
|
|
|
|
2016-11-22 17:06:46 +03:00
|
|
|
class nsIFile;
|
|
|
|
class nsIUUIDGenerator;
|
2016-01-05 13:08:57 +03:00
|
|
|
|
|
|
|
namespace mozilla {
|
|
|
|
namespace layout {
|
|
|
|
class RemotePrintJobChild;
|
|
|
|
}
|
|
|
|
} // namespace mozilla
|
|
|
|
|
|
|
|
class nsDeviceContextSpecProxy final : public nsIDeviceContextSpec {
|
|
|
|
public:
|
2023-07-10 17:26:12 +03:00
|
|
|
using IntSize = mozilla::gfx::IntSize;
|
2022-05-16 11:38:01 +03:00
|
|
|
using RemotePrintJobChild = mozilla::layout::RemotePrintJobChild;
|
|
|
|
|
|
|
|
explicit nsDeviceContextSpecProxy(RemotePrintJobChild* aRemotePrintJob);
|
|
|
|
|
2016-01-05 13:08:57 +03:00
|
|
|
NS_DECL_ISUPPORTS
|
|
|
|
|
2022-05-23 22:34:40 +03:00
|
|
|
NS_IMETHOD Init(nsIPrintSettings* aPrintSettings, bool aIsPrintPreview) final;
|
2016-01-05 13:08:57 +03:00
|
|
|
|
2018-02-09 08:22:43 +03:00
|
|
|
already_AddRefed<PrintTarget> MakePrintTarget() final;
|
2016-01-05 13:08:57 +03:00
|
|
|
|
2018-02-06 09:46:57 +03:00
|
|
|
NS_IMETHOD GetDrawEventRecorder(
|
|
|
|
mozilla::gfx::DrawEventRecorder** aDrawEventRecorder) final;
|
2016-01-05 13:08:57 +03:00
|
|
|
|
2016-08-08 03:54:50 +03:00
|
|
|
NS_IMETHOD BeginDocument(const nsAString& aTitle,
|
|
|
|
const nsAString& aPrintToFileName,
|
2018-02-06 09:46:57 +03:00
|
|
|
int32_t aStartPage, int32_t aEndPage) final;
|
2016-01-05 13:08:57 +03:00
|
|
|
|
2022-12-19 18:42:48 +03:00
|
|
|
RefPtr<mozilla::gfx::PrintEndDocumentPromise> EndDocument() final;
|
2016-01-05 13:08:57 +03:00
|
|
|
|
2023-07-10 17:26:12 +03:00
|
|
|
NS_IMETHOD BeginPage(const IntSize& aSizeInPoints) final;
|
2016-01-05 13:08:57 +03:00
|
|
|
|
2018-02-06 09:46:57 +03:00
|
|
|
NS_IMETHOD EndPage() final;
|
2016-01-05 13:08:57 +03:00
|
|
|
|
|
|
|
private:
|
2021-06-13 12:16:53 +03:00
|
|
|
~nsDeviceContextSpecProxy();
|
2016-01-05 13:08:57 +03:00
|
|
|
|
2022-05-16 11:38:01 +03:00
|
|
|
RefPtr<RemotePrintJobChild> mRemotePrintJob;
|
2017-10-03 19:29:15 +03:00
|
|
|
RefPtr<mozilla::layout::DrawEventRecorderPRFileDesc> mRecorder;
|
2023-07-10 17:26:12 +03:00
|
|
|
IntSize mCurrentPageSizeInPoints;
|
2016-01-05 13:08:57 +03:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // nsDeviceContextSpecProxy_h
|