зеркало из https://github.com/mozilla/pjs.git
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:
Родитель
c055f94c63
Коммит
46e8962793
|
@ -133,6 +133,7 @@ interface nsIPrintOptions : nsISupports
|
|||
|
||||
attribute short howToEnableFrameUI;
|
||||
attribute short printFrameType;
|
||||
attribute boolean isCancelled;
|
||||
|
||||
/* Additional XP Related */
|
||||
attribute boolean printReversed;
|
||||
|
@ -142,6 +143,8 @@ interface nsIPrintOptions : nsISupports
|
|||
attribute boolean printToFile;
|
||||
attribute wstring toFileName;
|
||||
|
||||
attribute long printPageDelay; /* in milliseconds */
|
||||
|
||||
/* No Script Methods */
|
||||
|
||||
[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 * kPrintFile = "print.print_file";
|
||||
const char * kPrintToFile = "print.print_tofile";
|
||||
const char * kPrintPageDelay = "print.print_pagedelay";
|
||||
|
||||
// There are currently NOT supported
|
||||
//const char * kPrintBevelLines = "print.print_bevellines";
|
||||
|
@ -104,7 +105,9 @@ nsPrintOptions::nsPrintOptions() :
|
|||
mPrintToFile(PR_FALSE),
|
||||
mPrintFrameType(kSelectedFrame),
|
||||
mHowToEnableFrameUI(kFrameEnableNone),
|
||||
mPageNumJust(kJustLeft)
|
||||
mPageNumJust(kJustLeft),
|
||||
mIsCancelled(PR_FALSE),
|
||||
mPrintPageDelay(500)
|
||||
{
|
||||
NS_INIT_ISUPPORTS();
|
||||
|
||||
|
@ -281,6 +284,7 @@ nsPrintOptions::ReadPrefs()
|
|||
ReadPrefString(prefs, kPrintCommand, mPrintCommand);
|
||||
prefs->GetBoolPref(kPrintFile, &mPrintToFile);
|
||||
ReadPrefString(prefs, kPrintToFile, mToFileName);
|
||||
prefs->GetIntPref(kPrintPageDelay, &mPrintPageDelay);
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
@ -318,6 +322,7 @@ nsPrintOptions::WritePrefs()
|
|||
WritePrefString(prefs, kPrintCommand, mPrintCommand);
|
||||
prefs->SetBoolPref(kPrintFile, mPrintToFile);
|
||||
WritePrefString(prefs, kPrintToFile, mToFileName);
|
||||
prefs->SetIntPref(kPrintPageDelay, mPrintPageDelay);
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
@ -428,6 +433,18 @@ NS_IMETHODIMP nsPrintOptions::SetToFileName(const PRUnichar * aToFileName)
|
|||
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; */
|
||||
NS_IMETHODIMP nsPrintOptions::GetMarginTop(double *aMarginTop)
|
||||
{
|
||||
|
@ -560,6 +577,19 @@ NS_IMETHODIMP nsPrintOptions::SetPrintFrameType(PRInt16 aPrintFrameType)
|
|||
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
|
||||
//-----------------------------------------------------
|
||||
|
|
|
@ -62,6 +62,8 @@ protected:
|
|||
|
||||
PRInt16 mPrintFrameType;
|
||||
PRBool mHowToEnableFrameUI;
|
||||
PRBool mIsCancelled;
|
||||
PRInt32 mPrintPageDelay;
|
||||
|
||||
nsFont* mDefaultFont;
|
||||
nsString mTitle;
|
||||
|
|
Загрузка…
Ссылка в новой задаче