Bug 226600 - Add a print preview flag to *nix print device context specs.

r=blizzard, sr=roc
This commit is contained in:
kjh-5727%comcast.net 2006-02-07 01:15:05 +00:00
Родитель c698aa6a85
Коммит 41abb25613
3 изменённых файлов: 17 добавлений и 10 удалений

Просмотреть файл

@ -82,7 +82,7 @@ NS_IMETHODIMP nsDeviceContextSpecFactoryGTK :: CreateDeviceContextSpec(nsIWidget
nsCOMPtr<nsIDeviceContextSpec> devSpec = do_CreateInstance(kDeviceContextSpecCID, &rv);
if (NS_SUCCEEDED(rv))
{
rv = ((nsDeviceContextSpecGTK *)devSpec.get())->Init(aPrintSettings);
rv = ((nsDeviceContextSpecGTK *)devSpec.get())->Init(aPrintSettings, aIsPrintPreview);
if (NS_SUCCEEDED(rv))
{
aNewSpec = devSpec;

Просмотреть файл

@ -319,13 +319,11 @@ NS_IMPL_ISUPPORTS1(nsDeviceContextSpecGTK,
* - Xlib-toolkit:
* file: mozilla/gfx/src/xlib/nsDeviceContextSpecXlib.cpp
* function: NS_IMETHODIMP nsDeviceContextSpecXlib::Init()
* - Qt-toolkit:
* file: mozilla/gfx/src/qt/nsDeviceContextSpecQT.cpp
* function: NS_IMETHODIMP nsDeviceContextSpecQT::Init()
*
* ** Please update the other toolkits when changing this function.
*/
NS_IMETHODIMP nsDeviceContextSpecGTK::Init(nsIPrintSettings *aPS)
NS_IMETHODIMP nsDeviceContextSpecGTK::Init(nsIPrintSettings *aPS,
PRBool aIsPrintPreview)
{
DO_PR_DEBUG_LOG(("nsDeviceContextSpecGTK::Init(aPS=%p)\n", aPS));
nsresult rv = NS_ERROR_FAILURE;
@ -408,6 +406,7 @@ NS_IMETHODIMP nsDeviceContextSpecGTK::Init(nsIPrintSettings *aPS)
mOrientation = orientation;
mToPrinter = !tofile;
mCopies = copies;
mIsPPreview = aIsPrintPreview;
}
return rv;
@ -419,6 +418,12 @@ NS_IMETHODIMP nsDeviceContextSpecGTK::GetToPrinter(PRBool &aToPrinter)
return NS_OK;
}
NS_IMETHODIMP nsDeviceContextSpecGTK::GetIsPrintPreview(PRBool &aIsPPreview)
{
aIsPPreview = mIsPPreview;
return NS_OK;
}
NS_IMETHODIMP nsDeviceContextSpecGTK::GetPrinterName ( const char **aPrinter )
{
*aPrinter = mPrinter;

Просмотреть файл

@ -75,10 +75,11 @@ public:
NS_DECL_ISUPPORTS
NS_IMETHOD Init(nsIPrintSettings* aPS);
NS_IMETHOD Init(nsIPrintSettings* aPS, PRBool aIsPrintPreview);
NS_IMETHOD ClosePrintManager();
NS_IMETHOD GetToPrinter(PRBool &aToPrinter);
NS_IMETHOD GetIsPrintPreview(PRBool &aIsPPreview);
NS_IMETHOD GetPrinterName ( const char **aPrinter );
NS_IMETHOD GetCopies ( int &aCopies );
NS_IMETHOD GetFirstPageFirst(PRBool &aFpf);
@ -100,9 +101,11 @@ public:
protected:
nsCOMPtr<nsIPrintSettings> mPrintSettings;
PRBool mToPrinter; /* If PR_TRUE, print to printer */
PRBool mFpf; /* If PR_TRUE, first page first */
PRBool mGrayscale; /* If PR_TRUE, print grayscale */
PRBool mToPrinter : 1; /* If PR_TRUE, print to printer */
PRBool mIsPPreview : 1; /* If PR_TRUE, is print preview */
PRBool mFpf : 1; /* If PR_TRUE, first page first */
PRBool mGrayscale : 1; /* If PR_TRUE, print grayscale */
PRBool mCancel : 1; /* If PR_TRUE, user cancelled */
int mOrientation; /* Orientation e.g. Portrait */
char mCommand[PATH_MAX]; /* Print command e.g., lpr */
char mPath[PATH_MAX]; /* If toPrinter = PR_FALSE, dest file */
@ -110,7 +113,6 @@ protected:
char mPaperName[256]; /* Printer name */
char mPlexName[256]; /* Plex mode name */
int mCopies; /* number of copies */
PRBool mCancel; /* If PR_TRUE, user cancelled */
float mLeft; /* left margin */
float mRight; /* right margin */
float mTop; /* top margin */