1 /* -*- Mode: C++; tab-width: 2; 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 nsDeviceContextSpecGTK_h___
7 #define nsDeviceContextSpecGTK_h___
11 #include "nsIDeviceContextSpec.h"
12 #include "nsIPrinterList.h"
13 #include "nsIPrintSettings.h"
16 #include "mozilla/Attributes.h"
18 #include "nsCRT.h" /* should be <limits.h>? */
21 #include <gtk/gtkunixprint.h>
24 #define NS_LANDSCAPE 1
26 class nsPrintSettingsGTK
;
28 class nsDeviceContextSpecGTK
: public nsIDeviceContextSpec
{
30 nsDeviceContextSpecGTK();
34 already_AddRefed
<PrintTarget
> MakePrintTarget() final
;
36 NS_IMETHOD
Init(nsIWidget
* aWidget
, nsIPrintSettings
* aPS
,
37 bool aIsPrintPreview
) override
;
38 NS_IMETHOD
BeginDocument(const nsAString
& aTitle
,
39 const nsAString
& aPrintToFileName
,
40 int32_t aStartPage
, int32_t aEndPage
) override
;
41 NS_IMETHOD
EndDocument() override
;
42 NS_IMETHOD
BeginPage() override
{ return NS_OK
; }
43 NS_IMETHOD
EndPage() override
{ return NS_OK
; }
46 virtual ~nsDeviceContextSpecGTK();
47 nsCOMPtr
<nsPrintSettingsGTK
> mPrintSettings
;
48 bool mToPrinter
: 1; /* If true, print to printer */
49 GtkPrintSettings
* mGtkPrintSettings
;
50 GtkPageSetup
* mGtkPageSetup
;
53 nsCOMPtr
<nsIFile
> mSpoolFile
;
57 void EnumeratePrinters();
59 static gboolean
PrinterEnumerator(GtkPrinter
* aPrinter
, gpointer aData
);
62 #endif /* !nsDeviceContextSpecGTK_h___ */