michael@0: /* -*- Mode: C++; tab-width: 20; indent-tabs-mode: nil; c-basic-offset: 4 -*- michael@0: * This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: #ifndef GFX_PDFSURFACE_H michael@0: #define GFX_PDFSURFACE_H michael@0: michael@0: #include "gfxASurface.h" michael@0: #include "gfxContext.h" michael@0: michael@0: /* for the output stream */ michael@0: #include "nsCOMPtr.h" michael@0: #include "nsIOutputStream.h" michael@0: michael@0: class gfxPDFSurface : public gfxASurface { michael@0: public: michael@0: gfxPDFSurface(nsIOutputStream *aStream, const gfxSize& aSizeInPoints); michael@0: virtual ~gfxPDFSurface(); michael@0: michael@0: virtual nsresult BeginPrinting(const nsAString& aTitle, const nsAString& aPrintToFileName); michael@0: virtual nsresult EndPrinting(); michael@0: virtual nsresult AbortPrinting(); michael@0: virtual nsresult BeginPage(); michael@0: virtual nsresult EndPage(); michael@0: virtual void Finish(); michael@0: michael@0: void SetDPI(double x, double y); michael@0: void GetDPI(double *xDPI, double *yDPI); michael@0: michael@0: // this is in points! michael@0: virtual const gfxIntSize GetSize() const michael@0: { michael@0: return gfxIntSize(mSize.width, mSize.height); michael@0: } michael@0: michael@0: virtual int32_t GetDefaultContextFlags() const michael@0: { michael@0: return gfxContext::FLAG_SIMPLIFY_OPERATORS | michael@0: gfxContext::FLAG_DISABLE_SNAPPING | michael@0: gfxContext::FLAG_DISABLE_COPY_BACKGROUND; michael@0: } michael@0: michael@0: private: michael@0: nsCOMPtr mStream; michael@0: double mXDPI; michael@0: double mYDPI; michael@0: gfxSize mSize; michael@0: }; michael@0: michael@0: #endif /* GFX_PDFSURFACE_H */