Source code

Revision control

Copy as Markdown

Other Tools

/* -*- 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 */
#ifndef nsPrintSettingsImpl_h__
#define nsPrintSettingsImpl_h__
#include "nsIPrintSettings.h"
#include "nsIWeakReferenceUtils.h"
#include "nsMargin.h"
#include "nsPaper.h"
#include "nsProxyRelease.h"
#include "nsString.h"
#define NUM_HEAD_FOOT 3
//*** nsPrintSettings
class nsPrintSettings;
namespace mozilla {
* A struct that can be used off the main thread to collect printer-specific
* info that can be used to initialized a default nsIPrintSettings object.
struct PrintSettingsInitializer {
nsString mPrinter;
PaperInfo mPaperInfo;
int16_t mPaperSizeUnit = nsIPrintSettings::kPaperSizeInches;
// If we fail to obtain printer capabilities, being given the option to print
// in color to your monochrome printer is a lot less annoying than not being
// given the option to print in color to your color printer.
bool mPrintInColor = true;
int mResolution = 0;
int mSheetOrientation = nsIPrintSettings::kPortraitOrientation;
int mNumCopies = 1;
int mDuplex = nsIPrintSettings::kDuplexNone;
// This is to hold a reference to a newly cloned settings object that will
// then be initialized by the other values in the initializer that may have
// been changed on a background thread.
nsMainThreadPtrHandle<nsPrintSettings> mPrintSettings;
#ifdef XP_WIN
CopyableTArray<uint8_t> mDevmodeWStorage;
} // namespace mozilla
class nsPrintSettings : public nsIPrintSettings {