This now enables print listeners, print progress and the cancelling of printing

Bug 70946 & Bug 70949 r=dcone,chak sr=attinasi
This commit is contained in:
rods%netscape.com 2006-02-07 01:12:29 +00:00
Родитель c055f94c63
Коммит 46e8962793
3 изменённых файлов: 36 добавлений и 1 удалений

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

@ -133,6 +133,7 @@ interface nsIPrintOptions : nsISupports
attribute short howToEnableFrameUI; attribute short howToEnableFrameUI;
attribute short printFrameType; attribute short printFrameType;
attribute boolean isCancelled;
/* Additional XP Related */ /* Additional XP Related */
attribute boolean printReversed; attribute boolean printReversed;
@ -142,6 +143,8 @@ interface nsIPrintOptions : nsISupports
attribute boolean printToFile; attribute boolean printToFile;
attribute wstring toFileName; attribute wstring toFileName;
attribute long printPageDelay; /* in milliseconds */
/* No Script Methods */ /* No Script Methods */
[noscript] void SetFontNamePointSize(in nsNativeStringRef aName, in PRInt32 aPointSize); [noscript] void SetFontNamePointSize(in nsNativeStringRef aName, in PRInt32 aPointSize);

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

@ -75,6 +75,7 @@ const char * kPrintPaperSize = "print.print_paper_size";
const char * kPrintCommand = "print.print_command"; const char * kPrintCommand = "print.print_command";
const char * kPrintFile = "print.print_file"; const char * kPrintFile = "print.print_file";
const char * kPrintToFile = "print.print_tofile"; const char * kPrintToFile = "print.print_tofile";
const char * kPrintPageDelay = "print.print_pagedelay";
// There are currently NOT supported // There are currently NOT supported
//const char * kPrintBevelLines = "print.print_bevellines"; //const char * kPrintBevelLines = "print.print_bevellines";
@ -104,7 +105,9 @@ nsPrintOptions::nsPrintOptions() :
mPrintToFile(PR_FALSE), mPrintToFile(PR_FALSE),
mPrintFrameType(kSelectedFrame), mPrintFrameType(kSelectedFrame),
mHowToEnableFrameUI(kFrameEnableNone), mHowToEnableFrameUI(kFrameEnableNone),
mPageNumJust(kJustLeft) mPageNumJust(kJustLeft),
mIsCancelled(PR_FALSE),
mPrintPageDelay(500)
{ {
NS_INIT_ISUPPORTS(); NS_INIT_ISUPPORTS();
@ -281,6 +284,7 @@ nsPrintOptions::ReadPrefs()
ReadPrefString(prefs, kPrintCommand, mPrintCommand); ReadPrefString(prefs, kPrintCommand, mPrintCommand);
prefs->GetBoolPref(kPrintFile, &mPrintToFile); prefs->GetBoolPref(kPrintFile, &mPrintToFile);
ReadPrefString(prefs, kPrintToFile, mToFileName); ReadPrefString(prefs, kPrintToFile, mToFileName);
prefs->GetIntPref(kPrintPageDelay, &mPrintPageDelay);
return NS_OK; return NS_OK;
} }
@ -318,6 +322,7 @@ nsPrintOptions::WritePrefs()
WritePrefString(prefs, kPrintCommand, mPrintCommand); WritePrefString(prefs, kPrintCommand, mPrintCommand);
prefs->SetBoolPref(kPrintFile, mPrintToFile); prefs->SetBoolPref(kPrintFile, mPrintToFile);
WritePrefString(prefs, kPrintToFile, mToFileName); WritePrefString(prefs, kPrintToFile, mToFileName);
prefs->SetIntPref(kPrintPageDelay, mPrintPageDelay);
return NS_OK; return NS_OK;
} }
@ -428,6 +433,18 @@ NS_IMETHODIMP nsPrintOptions::SetToFileName(const PRUnichar * aToFileName)
return NS_OK; return NS_OK;
} }
/* attribute long printPageDelay; */
NS_IMETHODIMP nsPrintOptions::GetPrintPageDelay(PRInt32 *aPrintPageDelay)
{
*aPrintPageDelay = mPrintPageDelay;
return NS_OK;
}
NS_IMETHODIMP nsPrintOptions::SetPrintPageDelay(PRInt32 aPrintPageDelay)
{
mPrintPageDelay = aPrintPageDelay;
return NS_OK;
}
/* attribute double marginTop; */ /* attribute double marginTop; */
NS_IMETHODIMP nsPrintOptions::GetMarginTop(double *aMarginTop) NS_IMETHODIMP nsPrintOptions::GetMarginTop(double *aMarginTop)
{ {
@ -560,6 +577,19 @@ NS_IMETHODIMP nsPrintOptions::SetPrintFrameType(PRInt16 aPrintFrameType)
return NS_OK; return NS_OK;
} }
/* attribute long isCancelled; */
NS_IMETHODIMP nsPrintOptions::GetIsCancelled(PRBool *aIsCancelled)
{
NS_ENSURE_ARG_POINTER(aIsCancelled);
*aIsCancelled = mIsCancelled;
return NS_OK;
}
NS_IMETHODIMP nsPrintOptions::SetIsCancelled(PRBool aIsCancelled)
{
mIsCancelled = aIsCancelled;
return NS_OK;
}
//----------------------------------------------------- //-----------------------------------------------------
//-- Protected Methods //-- Protected Methods
//----------------------------------------------------- //-----------------------------------------------------

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

@ -62,6 +62,8 @@ protected:
PRInt16 mPrintFrameType; PRInt16 mPrintFrameType;
PRBool mHowToEnableFrameUI; PRBool mHowToEnableFrameUI;
PRBool mIsCancelled;
PRInt32 mPrintPageDelay;
nsFont* mDefaultFont; nsFont* mDefaultFont;
nsString mTitle; nsString mTitle;