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_PRINTTARGETTHEBES_H
7 #define MOZILLA_GFX_PRINTTARGETTHEBES_H
9 #include "mozilla/gfx/PrintTarget.h"
17 * XXX Remove this class.
19 * This class should go away once all the logic from the gfxASurface subclasses
20 * has been moved to new PrintTarget subclasses and we no longer need to
23 * When removing this class, be sure to make PrintTarget::MakeDrawTarget
26 class PrintTargetThebes final
: public PrintTarget
{
28 static already_AddRefed
<PrintTargetThebes
> CreateOrNull(
29 gfxASurface
* aSurface
);
31 nsresult
BeginPrinting(const nsAString
& aTitle
,
32 const nsAString
& aPrintToFileName
, int32_t aStartPage
,
33 int32_t aEndPage
) override
;
34 nsresult
EndPrinting() override
;
35 nsresult
AbortPrinting() override
;
36 nsresult
BeginPage(const IntSize
& aSizeInPoints
) override
;
37 nsresult
EndPage() override
;
38 void Finish() override
;
40 already_AddRefed
<DrawTarget
> MakeDrawTarget(
41 const IntSize
& aSize
, DrawEventRecorder
* aRecorder
= nullptr) override
;
43 already_AddRefed
<DrawTarget
> GetReferenceDrawTarget() final
;
46 // Only created via CreateOrNull
47 explicit PrintTargetThebes(gfxASurface
* aSurface
);
49 RefPtr
<gfxASurface
> mGfxSurface
;
53 } // namespace mozilla
55 #endif /* MOZILLA_GFX_PRINTTARGETTHEBES_H */