PrintTargetWindows.h (1253B)
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_PRINTTARGETWINDOWS_H 7 #define MOZILLA_GFX_PRINTTARGETWINDOWS_H 8 9 #include "PrintTarget.h" 10 11 /* include windows.h for the HDC definitions that we need. */ 12 #include <windows.h> 13 14 namespace mozilla { 15 namespace gfx { 16 17 /** 18 * Windows printing target. 19 */ 20 class PrintTargetWindows final : public PrintTarget { 21 public: 22 static already_AddRefed<PrintTargetWindows> CreateOrNull(HDC aDC); 23 24 nsresult BeginPrinting(const nsAString& aTitle, 25 const nsAString& aPrintToFileName, int32_t aStartPage, 26 int32_t aEndPage) override; 27 nsresult EndPrinting() override; 28 nsresult AbortPrinting() override; 29 nsresult BeginPage(const IntSize& aSizeInPoints) override; 30 nsresult EndPage() override; 31 32 private: 33 PrintTargetWindows(cairo_surface_t* aCairoSurface, const IntSize& aSize, 34 HDC aDC); 35 HDC mDC; 36 }; 37 38 } // namespace gfx 39 } // namespace mozilla 40 41 #endif /* MOZILLA_GFX_PRINTTARGETWINDOWS_H */