|
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/. */ |
|
5 |
|
6 #ifndef nsIDeviceContextSpec_h___ |
|
7 #define nsIDeviceContextSpec_h___ |
|
8 |
|
9 #include "nsISupports.h" |
|
10 |
|
11 class nsIWidget; |
|
12 class nsIPrintSettings; |
|
13 class gfxASurface; |
|
14 |
|
15 #define NS_IDEVICE_CONTEXT_SPEC_IID \ |
|
16 { 0xb5548fb1, 0xf43e, 0x4921, \ |
|
17 { 0x82, 0x19, 0xc3, 0x82, 0x06, 0xee, 0x74, 0x5c } } |
|
18 |
|
19 class nsIDeviceContextSpec : public nsISupports |
|
20 { |
|
21 public: |
|
22 NS_DECLARE_STATIC_IID_ACCESSOR(NS_IDEVICE_CONTEXT_SPEC_IID) |
|
23 |
|
24 /** |
|
25 * Initialize the device context spec. |
|
26 * @param aWidget A widget a dialog can be hosted in |
|
27 * @param aPrintSettings Print settings for the print operation |
|
28 * @param aIsPrintPreview True if creating Spec for PrintPreview |
|
29 * @return NS_OK or a suitable error code. |
|
30 */ |
|
31 NS_IMETHOD Init(nsIWidget *aWidget, |
|
32 nsIPrintSettings* aPrintSettings, |
|
33 bool aIsPrintPreview) = 0; |
|
34 |
|
35 NS_IMETHOD GetSurfaceForPrinter(gfxASurface **nativeSurface) = 0; |
|
36 |
|
37 NS_IMETHOD BeginDocument(const nsAString& aTitle, |
|
38 char16_t* aPrintToFileName, |
|
39 int32_t aStartPage, |
|
40 int32_t aEndPage) = 0; |
|
41 |
|
42 NS_IMETHOD EndDocument() = 0; |
|
43 NS_IMETHOD BeginPage() = 0; |
|
44 NS_IMETHOD EndPage() = 0; |
|
45 }; |
|
46 |
|
47 NS_DEFINE_STATIC_IID_ACCESSOR(nsIDeviceContextSpec, |
|
48 NS_IDEVICE_CONTEXT_SPEC_IID) |
|
49 #endif |