michael@0: /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ 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 nsDeviceContextSpecGTK_h___ michael@0: #define nsDeviceContextSpecGTK_h___ michael@0: michael@0: #include "nsIDeviceContextSpec.h" michael@0: #include "nsIPrintSettings.h" michael@0: #include "nsIPrintOptions.h" michael@0: #include "nsCOMPtr.h" michael@0: #include "nsString.h" michael@0: #include "mozilla/Attributes.h" michael@0: michael@0: #include "nsCRT.h" /* should be ? */ michael@0: michael@0: #include michael@0: #if (MOZ_WIDGET_GTK == 2) michael@0: #include michael@0: #include michael@0: #else michael@0: #include michael@0: #endif michael@0: michael@0: #define NS_PORTRAIT 0 michael@0: #define NS_LANDSCAPE 1 michael@0: michael@0: typedef enum michael@0: { michael@0: pmInvalid = 0, michael@0: pmPostScript michael@0: } PrintMethod; michael@0: michael@0: class nsDeviceContextSpecGTK : public nsIDeviceContextSpec michael@0: { michael@0: public: michael@0: nsDeviceContextSpecGTK(); michael@0: michael@0: NS_DECL_ISUPPORTS michael@0: michael@0: NS_IMETHOD GetSurfaceForPrinter(gfxASurface **surface); michael@0: michael@0: NS_IMETHOD Init(nsIWidget *aWidget, nsIPrintSettings* aPS, bool aIsPrintPreview); michael@0: NS_IMETHOD BeginDocument(const nsAString& aTitle, char16_t * aPrintToFileName, int32_t aStartPage, int32_t aEndPage); michael@0: NS_IMETHOD EndDocument(); michael@0: NS_IMETHOD BeginPage() { return NS_OK; } michael@0: NS_IMETHOD EndPage() { return NS_OK; } michael@0: michael@0: NS_IMETHOD GetPath (const char **aPath); michael@0: static nsresult GetPrintMethod(const char *aPrinter, PrintMethod &aMethod); michael@0: virtual ~nsDeviceContextSpecGTK(); michael@0: michael@0: protected: michael@0: nsCOMPtr mPrintSettings; michael@0: bool mToPrinter : 1; /* If true, print to printer */ michael@0: bool mIsPPreview : 1; /* If true, is print preview */ michael@0: char mPath[PATH_MAX]; /* If toPrinter = false, dest file */ michael@0: char mPrinter[256]; /* Printer name */ michael@0: GtkPrintJob* mPrintJob; michael@0: GtkPrinter* mGtkPrinter; michael@0: GtkPrintSettings* mGtkPrintSettings; michael@0: GtkPageSetup* mGtkPageSetup; michael@0: michael@0: nsCString mSpoolName; michael@0: nsCOMPtr mSpoolFile; michael@0: michael@0: }; michael@0: michael@0: //------------------------------------------------------------------------- michael@0: // Printer Enumerator michael@0: //------------------------------------------------------------------------- michael@0: class nsPrinterEnumeratorGTK MOZ_FINAL : public nsIPrinterEnumerator michael@0: { michael@0: public: michael@0: nsPrinterEnumeratorGTK(); michael@0: NS_DECL_ISUPPORTS michael@0: NS_DECL_NSIPRINTERENUMERATOR michael@0: }; michael@0: michael@0: #endif /* !nsDeviceContextSpecGTK_h___ */