summaryrefslogtreecommitdiffstats
path: root/layout/printing/ipc/RemotePrintJobParent.h
diff options
context:
space:
mode:
authorMatt A. Tobin <mattatobin@localhost.localdomain>2018-02-02 04:16:08 -0500
committerMatt A. Tobin <mattatobin@localhost.localdomain>2018-02-02 04:16:08 -0500
commit5f8de423f190bbb79a62f804151bc24824fa32d8 (patch)
tree10027f336435511475e392454359edea8e25895d /layout/printing/ipc/RemotePrintJobParent.h
parent49ee0794b5d912db1f95dce6eb52d781dc210db5 (diff)
downloadUXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.gz
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.lz
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.xz
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.zip
Add m-esr52 at 52.6.0
Diffstat (limited to 'layout/printing/ipc/RemotePrintJobParent.h')
-rw-r--r--layout/printing/ipc/RemotePrintJobParent.h84
1 files changed, 84 insertions, 0 deletions
diff --git a/layout/printing/ipc/RemotePrintJobParent.h b/layout/printing/ipc/RemotePrintJobParent.h
new file mode 100644
index 000000000..a96cc7eaa
--- /dev/null
+++ b/layout/printing/ipc/RemotePrintJobParent.h
@@ -0,0 +1,84 @@
+/* -*- 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 mozilla_layout_RemotePrintJobParent_h
+#define mozilla_layout_RemotePrintJobParent_h
+
+#include "mozilla/layout/PRemotePrintJobParent.h"
+
+#include "nsCOMArray.h"
+#include "nsCOMPtr.h"
+#include "mozilla/RefPtr.h"
+#include "mozilla/UniquePtr.h"
+
+class nsDeviceContext;
+class nsIPrintSettings;
+class nsIWebProgressListener;
+class PrintTranslator;
+
+namespace mozilla {
+namespace layout {
+
+class RemotePrintJobParent final : public PRemotePrintJobParent
+{
+public:
+ explicit RemotePrintJobParent(nsIPrintSettings* aPrintSettings);
+
+ void ActorDestroy(ActorDestroyReason aWhy) final;
+
+ bool RecvInitializePrint(const nsString& aDocumentTitle,
+ const nsString& aPrintToFile,
+ const int32_t& aStartPage,
+ const int32_t& aEndPage) final;
+
+ bool RecvProcessPage(const nsCString& aPageFileName) final;
+
+ bool RecvFinalizePrint() final;
+
+ bool RecvAbortPrint(const nsresult& aRv) final;
+
+ bool RecvStateChange(const long& aStateFlags,
+ const nsresult& aStatus) final;
+
+ bool RecvProgressChange(const long& aCurSelfProgress,
+ const long& aMaxSelfProgress,
+ const long& aCurTotalProgress,
+ const long& aMaxTotalProgress) final;
+
+ bool RecvStatusChange(const nsresult& aStatus) final;
+
+ /**
+ * Register a progress listener to receive print progress updates.
+ *
+ * @param aListener the progress listener to register. Must not be null.
+ */
+ void RegisterListener(nsIWebProgressListener* aListener);
+
+ /**
+ * @return the print settings for this remote print job.
+ */
+ already_AddRefed<nsIPrintSettings> GetPrintSettings();
+
+private:
+ ~RemotePrintJobParent() final;
+
+ nsresult InitializePrintDevice(const nsString& aDocumentTitle,
+ const nsString& aPrintToFile,
+ const int32_t& aStartPage,
+ const int32_t& aEndPage);
+
+ nsresult PrintPage(const nsCString& aPageFileName);
+
+ nsCOMPtr<nsIPrintSettings> mPrintSettings;
+ RefPtr<nsDeviceContext> mPrintDeviceContext;
+ UniquePtr<PrintTranslator> mPrintTranslator;
+ nsCOMArray<nsIWebProgressListener> mPrintProgressListeners;
+};
+
+} // namespace layout
+} // namespace mozilla
+
+#endif // mozilla_layout_RemotePrintJobParent_h