widget/cocoa/nsPrintSettingsX.h

Thu, 22 Jan 2015 13:21:57 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 22 Jan 2015 13:21:57 +0100
branch
TOR_BUG_9701
changeset 15
b8a032363ba2
permissions
-rw-r--r--

Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6

michael@0 1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
michael@0 2 /* This Source Code Form is subject to the terms of the Mozilla Public
michael@0 3 * License, v. 2.0. If a copy of the MPL was not distributed with this
michael@0 4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
michael@0 5
michael@0 6 #ifndef nsPrintSettingsX_h_
michael@0 7 #define nsPrintSettingsX_h_
michael@0 8
michael@0 9 #include "nsPrintSettingsImpl.h"
michael@0 10 #import <Cocoa/Cocoa.h>
michael@0 11
michael@0 12 #define NS_PRINTSETTINGSX_IID \
michael@0 13 { 0x0DF2FDBD, 0x906D, 0x4726, \
michael@0 14 { 0x9E, 0x4D, 0xCF, 0xE0, 0x87, 0x8D, 0x70, 0x7C } }
michael@0 15
michael@0 16 class nsPrintSettingsX : public nsPrintSettings
michael@0 17 {
michael@0 18 public:
michael@0 19 NS_DECLARE_STATIC_IID_ACCESSOR(NS_PRINTSETTINGSX_IID)
michael@0 20 NS_DECL_ISUPPORTS_INHERITED
michael@0 21
michael@0 22 nsPrintSettingsX();
michael@0 23 virtual ~nsPrintSettingsX();
michael@0 24 nsresult Init();
michael@0 25 NSPrintInfo* GetCocoaPrintInfo() { return mPrintInfo; }
michael@0 26 void SetCocoaPrintInfo(NSPrintInfo* aPrintInfo);
michael@0 27 virtual nsresult ReadPageFormatFromPrefs();
michael@0 28 virtual nsresult WritePageFormatToPrefs();
michael@0 29
michael@0 30 PMPrintSettings GetPMPrintSettings();
michael@0 31 PMPrintSession GetPMPrintSession();
michael@0 32 PMPageFormat GetPMPageFormat();
michael@0 33 void SetPMPageFormat(PMPageFormat aPageFormat);
michael@0 34
michael@0 35 protected:
michael@0 36 nsPrintSettingsX(const nsPrintSettingsX& src);
michael@0 37 nsPrintSettingsX& operator=(const nsPrintSettingsX& rhs);
michael@0 38
michael@0 39 nsresult _Clone(nsIPrintSettings **_retval);
michael@0 40 nsresult _Assign(nsIPrintSettings *aPS);
michael@0 41
michael@0 42 // Re-initialize mUnwriteableMargin with values from mPageFormat.
michael@0 43 // Should be called whenever mPageFormat is initialized or overwritten.
michael@0 44 nsresult InitUnwriteableMargin();
michael@0 45
michael@0 46 // The out param has a ref count of 1 on return so caller needs to PMRelase() when done.
michael@0 47 OSStatus CreateDefaultPageFormat(PMPrintSession aSession, PMPageFormat& outFormat);
michael@0 48 OSStatus CreateDefaultPrintSettings(PMPrintSession aSession, PMPrintSettings& outSettings);
michael@0 49
michael@0 50 NSPrintInfo* mPrintInfo;
michael@0 51 };
michael@0 52
michael@0 53 NS_DEFINE_STATIC_IID_ACCESSOR(nsPrintSettingsX, NS_PRINTSETTINGSX_IID)
michael@0 54
michael@0 55 #endif // nsPrintSettingsX_h_

mercurial