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 nsPrintSettingsX_h_ michael@0: #define nsPrintSettingsX_h_ michael@0: michael@0: #include "nsPrintSettingsImpl.h" michael@0: #import michael@0: michael@0: #define NS_PRINTSETTINGSX_IID \ michael@0: { 0x0DF2FDBD, 0x906D, 0x4726, \ michael@0: { 0x9E, 0x4D, 0xCF, 0xE0, 0x87, 0x8D, 0x70, 0x7C } } michael@0: michael@0: class nsPrintSettingsX : public nsPrintSettings michael@0: { michael@0: public: michael@0: NS_DECLARE_STATIC_IID_ACCESSOR(NS_PRINTSETTINGSX_IID) michael@0: NS_DECL_ISUPPORTS_INHERITED michael@0: michael@0: nsPrintSettingsX(); michael@0: virtual ~nsPrintSettingsX(); michael@0: nsresult Init(); michael@0: NSPrintInfo* GetCocoaPrintInfo() { return mPrintInfo; } michael@0: void SetCocoaPrintInfo(NSPrintInfo* aPrintInfo); michael@0: virtual nsresult ReadPageFormatFromPrefs(); michael@0: virtual nsresult WritePageFormatToPrefs(); michael@0: michael@0: PMPrintSettings GetPMPrintSettings(); michael@0: PMPrintSession GetPMPrintSession(); michael@0: PMPageFormat GetPMPageFormat(); michael@0: void SetPMPageFormat(PMPageFormat aPageFormat); michael@0: michael@0: protected: michael@0: nsPrintSettingsX(const nsPrintSettingsX& src); michael@0: nsPrintSettingsX& operator=(const nsPrintSettingsX& rhs); michael@0: michael@0: nsresult _Clone(nsIPrintSettings **_retval); michael@0: nsresult _Assign(nsIPrintSettings *aPS); michael@0: michael@0: // Re-initialize mUnwriteableMargin with values from mPageFormat. michael@0: // Should be called whenever mPageFormat is initialized or overwritten. michael@0: nsresult InitUnwriteableMargin(); michael@0: michael@0: // The out param has a ref count of 1 on return so caller needs to PMRelase() when done. michael@0: OSStatus CreateDefaultPageFormat(PMPrintSession aSession, PMPageFormat& outFormat); michael@0: OSStatus CreateDefaultPrintSettings(PMPrintSession aSession, PMPrintSettings& outSettings); michael@0: michael@0: NSPrintInfo* mPrintInfo; michael@0: }; michael@0: michael@0: NS_DEFINE_STATIC_IID_ACCESSOR(nsPrintSettingsX, NS_PRINTSETTINGSX_IID) michael@0: michael@0: #endif // nsPrintSettingsX_h_