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"
|
2016-01-05 13:08:57 +03:00
|
|
|
|
2016-11-22 17:06:46 +03:00
|
|
|
class nsIFile;
|
2016-01-05 13:08:57 +03:00
|
|
|
class nsIPrintSession;
|
2016-11-22 17:06:46 +03:00
|
|
|
class nsIUUIDGenerator;
|
2016-01-05 13:08:57 +03:00
|
|
|
|
|
|
|
namespace mozilla {
|
|
|
|
namespace gfx {
|
2016-11-22 17:06:46 +03:00
|
|
|
class DrawEventRecorderFile;
|
2016-01-05 13:08:57 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
namespace layout {
|
|
|
|
class RemotePrintJobChild;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
class nsDeviceContextSpecProxy final : public nsIDeviceContextSpec
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
NS_DECL_ISUPPORTS
|
|
|
|
|
2016-08-08 03:54:50 +03:00
|
|
|
NS_IMETHOD Init(nsIWidget* aWidget, nsIPrintSettings* aPrintSettings,
|
2016-01-05 13:08:57 +03:00
|
|
|
bool aIsPrintPreview) final;
|
|
|
|
|
2016-06-03 13:27:31 +03:00
|
|
|
virtual already_AddRefed<PrintTarget> MakePrintTarget() final;
|
2016-01-05 13:08:57 +03:00
|
|
|
|
2016-08-08 03:54:50 +03:00
|
|
|
NS_IMETHOD GetDrawEventRecorder(mozilla::gfx::DrawEventRecorder** aDrawEventRecorder) final;
|
2016-01-05 13:08:57 +03:00
|
|
|
|
|
|
|
float GetDPI() final;
|
|
|
|
|
|
|
|
float GetPrintingScale() final;
|
|
|
|
|
2016-11-22 17:06:46 +03:00
|
|
|
|
2016-08-08 03:54:50 +03:00
|
|
|
NS_IMETHOD BeginDocument(const nsAString& aTitle,
|
|
|
|
const nsAString& aPrintToFileName,
|
|
|
|
int32_t aStartPage, int32_t aEndPage) final;
|
2016-01-05 13:08:57 +03:00
|
|
|
|
2016-08-08 03:54:50 +03:00
|
|
|
NS_IMETHOD EndDocument() final;
|
2016-01-05 13:08:57 +03:00
|
|
|
|
2016-08-08 03:54:50 +03:00
|
|
|
NS_IMETHOD AbortDocument() final;
|
2016-01-05 13:08:57 +03:00
|
|
|
|
2016-08-08 03:54:50 +03:00
|
|
|
NS_IMETHOD BeginPage() final;
|
2016-01-05 13:08:57 +03:00
|
|
|
|
2016-08-08 03:54:50 +03:00
|
|
|
NS_IMETHOD EndPage() final;
|
2016-01-05 13:08:57 +03:00
|
|
|
|
|
|
|
private:
|
|
|
|
~nsDeviceContextSpecProxy() {}
|
|
|
|
|
2016-11-22 17:06:46 +03:00
|
|
|
nsresult CreateUniqueTempPath(nsACString& aFilePath);
|
|
|
|
|
2016-01-05 13:08:57 +03:00
|
|
|
nsCOMPtr<nsIPrintSettings> mPrintSettings;
|
|
|
|
nsCOMPtr<nsIPrintSession> mPrintSession;
|
|
|
|
nsCOMPtr<nsIDeviceContextSpec> mRealDeviceContextSpec;
|
|
|
|
RefPtr<mozilla::layout::RemotePrintJobChild> mRemotePrintJob;
|
2016-11-22 17:06:46 +03:00
|
|
|
RefPtr<mozilla::gfx::DrawEventRecorderFile> mRecorder;
|
|
|
|
nsCOMPtr<nsIFile> mRecordingDir;
|
|
|
|
nsCOMPtr<nsIUUIDGenerator> mUuidGenerator;
|
|
|
|
nsCString mRecordingFileName;
|
2016-01-05 13:08:57 +03:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // nsDeviceContextSpecProxy_h
|