RemotePrintJobChild.h 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. /* -*- Mode: C++; tab-width: 8; 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 mozilla_layout_RemotePrintJobChild_h
  6. #define mozilla_layout_RemotePrintJobChild_h
  7. #include "mozilla/layout/PRemotePrintJobChild.h"
  8. #include "mozilla/RefPtr.h"
  9. #include "nsIWebProgressListener.h"
  10. class nsPagePrintTimer;
  11. class nsPrintEngine;
  12. namespace mozilla {
  13. namespace layout {
  14. class RemotePrintJobChild final : public PRemotePrintJobChild
  15. , public nsIWebProgressListener
  16. {
  17. public:
  18. NS_DECL_ISUPPORTS
  19. NS_DECL_NSIWEBPROGRESSLISTENER
  20. RemotePrintJobChild();
  21. void ActorDestroy(ActorDestroyReason aWhy) final;
  22. nsresult InitializePrint(const nsString& aDocumentTitle,
  23. const nsString& aPrintToFile,
  24. const int32_t& aStartPage,
  25. const int32_t& aEndPage);
  26. bool RecvPrintInitializationResult(const nsresult& aRv) final;
  27. void ProcessPage(const nsCString& aPageFileName);
  28. bool RecvPageProcessed() final;
  29. bool RecvAbortPrint(const nsresult& aRv) final;
  30. void SetPagePrintTimer(nsPagePrintTimer* aPagePrintTimer);
  31. void SetPrintEngine(nsPrintEngine* aPrintEngine);
  32. private:
  33. ~RemotePrintJobChild() final;
  34. bool mPrintInitialized = false;
  35. nsresult mInitializationResult = NS_OK;
  36. RefPtr<nsPagePrintTimer> mPagePrintTimer;
  37. RefPtr<nsPrintEngine> mPrintEngine;
  38. };
  39. } // namespace layout
  40. } // namespace mozilla
  41. #endif // mozilla_layout_RemotePrintJobChild_h