|
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ |
|
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 |
|
7 #ifndef nsDeviceContextSpecQt_h___ |
|
8 #define nsDeviceContextSpecQt_h___ |
|
9 |
|
10 #include "nsIDeviceContextSpec.h" |
|
11 #include "nsIPrintSettings.h" |
|
12 #include "nsIPrintOptions.h" |
|
13 #include "nsCOMPtr.h" |
|
14 #include "nsString.h" |
|
15 |
|
16 #include "nsCRT.h" /* should be <limits.h>? */ |
|
17 |
|
18 class nsDeviceContextSpecQt : public nsIDeviceContextSpec |
|
19 { |
|
20 public: |
|
21 nsDeviceContextSpecQt(); |
|
22 virtual ~nsDeviceContextSpecQt(); |
|
23 |
|
24 NS_DECL_ISUPPORTS |
|
25 |
|
26 NS_IMETHOD GetSurfaceForPrinter(gfxASurface** surface); |
|
27 |
|
28 NS_IMETHOD Init(nsIWidget* aWidget, |
|
29 nsIPrintSettings* aPS, |
|
30 bool aIsPrintPreview); |
|
31 NS_IMETHOD BeginDocument(const nsAString& aTitle, |
|
32 char16_t* aPrintToFileName, |
|
33 int32_t aStartPage, |
|
34 int32_t aEndPage); |
|
35 NS_IMETHOD EndDocument(); |
|
36 NS_IMETHOD BeginPage() { return NS_OK; } |
|
37 NS_IMETHOD EndPage() { return NS_OK; } |
|
38 |
|
39 NS_IMETHOD GetPath (const char** aPath); |
|
40 |
|
41 protected: |
|
42 nsCOMPtr<nsIPrintSettings> mPrintSettings; |
|
43 bool mToPrinter : 1; /* If true, print to printer */ |
|
44 bool mIsPPreview : 1; /* If true, is print preview */ |
|
45 char mPath[PATH_MAX]; /* If toPrinter = false, dest file */ |
|
46 char mPrinter[256]; /* Printer name */ |
|
47 nsCString mSpoolName; |
|
48 nsCOMPtr<nsIFile> mSpoolFile; |
|
49 }; |
|
50 |
|
51 class nsPrinterEnumeratorQt : public nsIPrinterEnumerator |
|
52 { |
|
53 public: |
|
54 nsPrinterEnumeratorQt(); |
|
55 NS_DECL_ISUPPORTS |
|
56 NS_DECL_NSIPRINTERENUMERATOR |
|
57 }; |
|
58 |
|
59 #endif /* !nsDeviceContextSpecQt_h___ */ |