PrintTargetPDF.h 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. /* -*- Mode: C++; tab-width: 20; indent-tabs-mode: nil; c-basic-offset: 4 -*-
  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_GFX_PRINTTARGETPDF_H
  6. #define MOZILLA_GFX_PRINTTARGETPDF_H
  7. #include "nsCOMPtr.h"
  8. #include "nsIOutputStream.h"
  9. #include "PrintTarget.h"
  10. namespace mozilla {
  11. namespace gfx {
  12. /**
  13. * PDF printing target.
  14. */
  15. class PrintTargetPDF final : public PrintTarget
  16. {
  17. public:
  18. static already_AddRefed<PrintTargetPDF>
  19. CreateOrNull(nsIOutputStream *aStream,
  20. const IntSize& aSizeInPoints);
  21. virtual nsresult EndPage() override;
  22. virtual void Finish() override;
  23. private:
  24. PrintTargetPDF(cairo_surface_t* aCairoSurface,
  25. const IntSize& aSize,
  26. nsIOutputStream *aStream);
  27. virtual ~PrintTargetPDF();
  28. nsCOMPtr<nsIOutputStream> mStream;
  29. };
  30. } // namespace gfx
  31. } // namespace mozilla
  32. #endif /* MOZILLA_GFX_PRINTTARGETPDF_H */