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/. */
6 #ifndef MOZILLA_GFX_PRINTINGTARGETPS_H
7 #define MOZILLA_GFX_PRINTINGTARGETPS_H
10 #include "nsIOutputStream.h"
11 #include "PrintTarget.h"
17 * PostScript printing target.
19 class PrintTargetPS final
: public PrintTarget
{
21 enum PageOrientation
{ PORTRAIT
, LANDSCAPE
};
23 static already_AddRefed
<PrintTargetPS
> CreateOrNull(
24 nsIOutputStream
* aStream
, IntSize aSizeInPoints
,
25 PageOrientation aOrientation
);
27 virtual nsresult
BeginPrinting(const nsAString
& aTitle
,
28 const nsAString
& aPrintToFileName
,
29 int32_t aStartPage
, int32_t aEndPage
) override
;
30 nsresult
EndPage() override
;
31 void Finish() override
;
33 bool GetRotateForLandscape() { return (mOrientation
== LANDSCAPE
); }
36 PrintTargetPS(cairo_surface_t
* aCairoSurface
, const IntSize
& aSize
,
37 nsIOutputStream
* aStream
, PageOrientation aOrientation
);
38 virtual ~PrintTargetPS();
40 nsCOMPtr
<nsIOutputStream
> mStream
;
41 PageOrientation mOrientation
;
45 } // namespace mozilla
47 #endif /* MOZILLA_GFX_PRINTINGTARGETPS_H */