widget/cocoa/nsPrintSettingsX.h

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/widget/cocoa/nsPrintSettingsX.h	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,55 @@
     1.4 +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
     1.5 +/* This Source Code Form is subject to the terms of the Mozilla Public
     1.6 + * License, v. 2.0. If a copy of the MPL was not distributed with this
     1.7 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     1.8 +
     1.9 +#ifndef nsPrintSettingsX_h_
    1.10 +#define nsPrintSettingsX_h_
    1.11 +
    1.12 +#include "nsPrintSettingsImpl.h"  
    1.13 +#import <Cocoa/Cocoa.h>
    1.14 +
    1.15 +#define NS_PRINTSETTINGSX_IID \
    1.16 +{ 0x0DF2FDBD, 0x906D, 0x4726, \
    1.17 +  { 0x9E, 0x4D, 0xCF, 0xE0, 0x87, 0x8D, 0x70, 0x7C } }
    1.18 +
    1.19 +class nsPrintSettingsX : public nsPrintSettings
    1.20 +{
    1.21 +public:
    1.22 +  NS_DECLARE_STATIC_IID_ACCESSOR(NS_PRINTSETTINGSX_IID)
    1.23 +  NS_DECL_ISUPPORTS_INHERITED
    1.24 +
    1.25 +  nsPrintSettingsX();
    1.26 +  virtual ~nsPrintSettingsX();
    1.27 +  nsresult Init();
    1.28 +  NSPrintInfo* GetCocoaPrintInfo() { return mPrintInfo; }
    1.29 +  void SetCocoaPrintInfo(NSPrintInfo* aPrintInfo);
    1.30 +  virtual nsresult ReadPageFormatFromPrefs();
    1.31 +  virtual nsresult WritePageFormatToPrefs();
    1.32 +
    1.33 +  PMPrintSettings GetPMPrintSettings();
    1.34 +  PMPrintSession GetPMPrintSession();
    1.35 +  PMPageFormat GetPMPageFormat();
    1.36 +  void SetPMPageFormat(PMPageFormat aPageFormat);
    1.37 +
    1.38 +protected:
    1.39 +  nsPrintSettingsX(const nsPrintSettingsX& src);
    1.40 +  nsPrintSettingsX& operator=(const nsPrintSettingsX& rhs);
    1.41 +
    1.42 +  nsresult _Clone(nsIPrintSettings **_retval);
    1.43 +  nsresult _Assign(nsIPrintSettings *aPS);
    1.44 +
    1.45 +  // Re-initialize mUnwriteableMargin with values from mPageFormat.
    1.46 +  // Should be called whenever mPageFormat is initialized or overwritten.
    1.47 +  nsresult InitUnwriteableMargin();
    1.48 +
    1.49 +  // The out param has a ref count of 1 on return so caller needs to PMRelase() when done.
    1.50 +  OSStatus CreateDefaultPageFormat(PMPrintSession aSession, PMPageFormat& outFormat);
    1.51 +  OSStatus CreateDefaultPrintSettings(PMPrintSession aSession, PMPrintSettings& outSettings);
    1.52 +
    1.53 +  NSPrintInfo* mPrintInfo;
    1.54 +};
    1.55 +
    1.56 +NS_DEFINE_STATIC_IID_ACCESSOR(nsPrintSettingsX, NS_PRINTSETTINGSX_IID)
    1.57 +
    1.58 +#endif // nsPrintSettingsX_h_

mercurial