|
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 nsPrintSettingsX_h_ |
|
7 #define nsPrintSettingsX_h_ |
|
8 |
|
9 #include "nsPrintSettingsImpl.h" |
|
10 #import <Cocoa/Cocoa.h> |
|
11 |
|
12 #define NS_PRINTSETTINGSX_IID \ |
|
13 { 0x0DF2FDBD, 0x906D, 0x4726, \ |
|
14 { 0x9E, 0x4D, 0xCF, 0xE0, 0x87, 0x8D, 0x70, 0x7C } } |
|
15 |
|
16 class nsPrintSettingsX : public nsPrintSettings |
|
17 { |
|
18 public: |
|
19 NS_DECLARE_STATIC_IID_ACCESSOR(NS_PRINTSETTINGSX_IID) |
|
20 NS_DECL_ISUPPORTS_INHERITED |
|
21 |
|
22 nsPrintSettingsX(); |
|
23 virtual ~nsPrintSettingsX(); |
|
24 nsresult Init(); |
|
25 NSPrintInfo* GetCocoaPrintInfo() { return mPrintInfo; } |
|
26 void SetCocoaPrintInfo(NSPrintInfo* aPrintInfo); |
|
27 virtual nsresult ReadPageFormatFromPrefs(); |
|
28 virtual nsresult WritePageFormatToPrefs(); |
|
29 |
|
30 PMPrintSettings GetPMPrintSettings(); |
|
31 PMPrintSession GetPMPrintSession(); |
|
32 PMPageFormat GetPMPageFormat(); |
|
33 void SetPMPageFormat(PMPageFormat aPageFormat); |
|
34 |
|
35 protected: |
|
36 nsPrintSettingsX(const nsPrintSettingsX& src); |
|
37 nsPrintSettingsX& operator=(const nsPrintSettingsX& rhs); |
|
38 |
|
39 nsresult _Clone(nsIPrintSettings **_retval); |
|
40 nsresult _Assign(nsIPrintSettings *aPS); |
|
41 |
|
42 // Re-initialize mUnwriteableMargin with values from mPageFormat. |
|
43 // Should be called whenever mPageFormat is initialized or overwritten. |
|
44 nsresult InitUnwriteableMargin(); |
|
45 |
|
46 // The out param has a ref count of 1 on return so caller needs to PMRelase() when done. |
|
47 OSStatus CreateDefaultPageFormat(PMPrintSession aSession, PMPageFormat& outFormat); |
|
48 OSStatus CreateDefaultPrintSettings(PMPrintSession aSession, PMPrintSettings& outSettings); |
|
49 |
|
50 NSPrintInfo* mPrintInfo; |
|
51 }; |
|
52 |
|
53 NS_DEFINE_STATIC_IID_ACCESSOR(nsPrintSettingsX, NS_PRINTSETTINGSX_IID) |
|
54 |
|
55 #endif // nsPrintSettingsX_h_ |