gecko-dev/widget/windows/nsPrintSettingsWin.h
Brendan Dahl 0cc1c8ec9b Bug 221706 - Use unwritable region when printing on Windows. r=jimm
Read more information from the printing device to setup the unwritable region.
Translate the printing context's coordinate system so that the point (0,0)
refers to the top-left of the physical paper instead of the top-left of the
printable region.

MozReview-Commit-ID: 9ei2FgEUDyO

--HG--
extra : rebase_source : c2e2715f47499538035101a285152eca2aba3202
2018-03-28 17:13:10 -07:00

61 lines
1.5 KiB
C++

/* -*- Mode: IDL; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#ifndef nsPrintSettingsWin_h__
#define nsPrintSettingsWin_h__
#include "nsPrintSettingsImpl.h"
#include "nsIPrintSettingsWin.h"
#include <windows.h>
//*****************************************************************************
//*** nsPrintSettingsWin
//*****************************************************************************
class nsPrintSettingsWin : public nsPrintSettings,
public nsIPrintSettingsWin
{
virtual ~nsPrintSettingsWin();
public:
NS_DECL_ISUPPORTS_INHERITED
NS_DECL_NSIPRINTSETTINGSWIN
nsPrintSettingsWin();
nsPrintSettingsWin(const nsPrintSettingsWin& aPS);
/**
* Makes a new copy
*/
virtual nsresult _Clone(nsIPrintSettings **_retval);
/**
* Assigns values
*/
virtual nsresult _Assign(nsIPrintSettings* aPS);
/**
* Assignment
*/
nsPrintSettingsWin& operator=(const nsPrintSettingsWin& rhs);
NS_IMETHOD GetEffectivePageSize(double *aWidth, double *aHeight) override;
protected:
void CopyDevMode(DEVMODEW* aInDevMode, DEVMODEW *& aOutDevMode);
void InitUnwriteableMargin(HDC aHdc);
nsString mDeviceName;
nsString mDriverName;
LPDEVMODEW mDevMode;
double mPrintableWidthInInches = 0l;
double mPrintableHeightInInches = 0l;
};
#endif /* nsPrintSettingsWin_h__ */