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

     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/. */
     6 #ifndef nsPrintSettingsX_h_
     7 #define nsPrintSettingsX_h_
     9 #include "nsPrintSettingsImpl.h"  
    10 #import <Cocoa/Cocoa.h>
    12 #define NS_PRINTSETTINGSX_IID \
    13 { 0x0DF2FDBD, 0x906D, 0x4726, \
    14   { 0x9E, 0x4D, 0xCF, 0xE0, 0x87, 0x8D, 0x70, 0x7C } }
    16 class nsPrintSettingsX : public nsPrintSettings
    17 {
    18 public:
    19   NS_DECLARE_STATIC_IID_ACCESSOR(NS_PRINTSETTINGSX_IID)
    20   NS_DECL_ISUPPORTS_INHERITED
    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();
    30   PMPrintSettings GetPMPrintSettings();
    31   PMPrintSession GetPMPrintSession();
    32   PMPageFormat GetPMPageFormat();
    33   void SetPMPageFormat(PMPageFormat aPageFormat);
    35 protected:
    36   nsPrintSettingsX(const nsPrintSettingsX& src);
    37   nsPrintSettingsX& operator=(const nsPrintSettingsX& rhs);
    39   nsresult _Clone(nsIPrintSettings **_retval);
    40   nsresult _Assign(nsIPrintSettings *aPS);
    42   // Re-initialize mUnwriteableMargin with values from mPageFormat.
    43   // Should be called whenever mPageFormat is initialized or overwritten.
    44   nsresult InitUnwriteableMargin();
    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);
    50   NSPrintInfo* mPrintInfo;
    51 };
    53 NS_DEFINE_STATIC_IID_ACCESSOR(nsPrintSettingsX, NS_PRINTSETTINGSX_IID)
    55 #endif // nsPrintSettingsX_h_

mercurial