PrintTargetPDF.h (1127B)
1 /* -*- Mode: C++; tab-width: 20; 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 6 #ifndef MOZILLA_GFX_PRINTTARGETPDF_H 7 #define MOZILLA_GFX_PRINTTARGETPDF_H 8 9 #include "nsCOMPtr.h" 10 #include "nsIOutputStream.h" 11 #include "PrintTarget.h" 12 13 namespace mozilla { 14 namespace gfx { 15 16 /** 17 * PDF printing target. 18 */ 19 class PrintTargetPDF final : public PrintTarget { 20 public: 21 // NOTE: Might create a PrintTargetSkPDF. 22 static already_AddRefed<PrintTarget> CreateOrNull( 23 nsIOutputStream* aStream, const IntSize& aSizeInPoints); 24 25 nsresult BeginPage(const IntSize& aSizeInPoints) override; 26 nsresult EndPage() override; 27 void Finish() override; 28 29 private: 30 PrintTargetPDF(cairo_surface_t* aCairoSurface, const IntSize& aSize, 31 nsIOutputStream* aStream); 32 virtual ~PrintTargetPDF(); 33 34 nsCOMPtr<nsIOutputStream> mStream; 35 }; 36 37 } // namespace gfx 38 } // namespace mozilla 39 40 #endif /* MOZILLA_GFX_PRINTTARGETPDF_H */