Add nsIObserver to the ShowPageSetup method for platforms that impl an Apply btn
Bug 149317 r=dcone sr=kin git-svn-id: svn://10.0.0.236/trunk@122803 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
parent
59b1fef7ab
commit
8a7c290ff7
@ -176,8 +176,11 @@ interface nsIPrintingPrompt : nsISupports
|
||||
* Shows the print progress dialog
|
||||
*
|
||||
* @param printSettings - PrintSettings for page setup (required)
|
||||
* @param aObs - An observer to know if the contents of the Print Settings
|
||||
* object has changed while the dialog is being shown.
|
||||
* For example, some platforms may implement an "Apply" button (not required)
|
||||
*/
|
||||
void showPageSetup(in nsIPrintSettings printSettings);
|
||||
void showPageSetup(in nsIPrintSettings printSettings, in nsIObserver aObs);
|
||||
|
||||
/**
|
||||
* Sometimes platforms need to bring up a special properties dialog for showing
|
||||
|
||||
@ -175,9 +175,13 @@ interface nsIPrintingPromptService : nsISupports
|
||||
*
|
||||
* @param parent - a DOM windows the dialog will be parented to (required)
|
||||
* @param printSettings - PrintSettings for page setup (required)
|
||||
* @param aObs - An observer to know if the contents of the Print Settings
|
||||
* object has changed while the dialog is being shown.
|
||||
* For example, some platforms may implement an "Apply" button (not required)
|
||||
*/
|
||||
void showPageSetup(in nsIDOMWindow parent,
|
||||
in nsIPrintSettings printSettings);
|
||||
in nsIPrintSettings printSettings,
|
||||
in nsIObserver aObs);
|
||||
|
||||
/**
|
||||
* Sometimes platforms need to bring up a special properties dialog for showing
|
||||
|
||||
@ -454,7 +454,7 @@ nsPrintingPromptService::ShowProgress(nsIDOMWindow* parent,
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsPrintingPromptService::ShowPageSetup(nsIDOMWindow *parent, nsIPrintSettings *printSettings)
|
||||
nsPrintingPromptService::ShowPageSetup(nsIDOMWindow *parent, nsIPrintSettings *printSettings, nsIObserver *aObs)
|
||||
{
|
||||
nsCOMPtr<nsIPrintSettingsMac> printSettingsMac(do_QueryInterface(printSettings));
|
||||
if (!printSettingsMac)
|
||||
|
||||
@ -312,7 +312,7 @@ nsPrintingPromptService::ShowProgress(nsIDOMWindow* parent,
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsPrintingPromptService::ShowPageSetup(nsIDOMWindow *parent, nsIPrintSettings *printSettings)
|
||||
nsPrintingPromptService::ShowPageSetup(nsIDOMWindow *parent, nsIPrintSettings *printSettings, nsIObserver *aObs)
|
||||
{
|
||||
nsCOMPtr<nsIPrintSettingsX> printSettingsX(do_QueryInterface(printSettings));
|
||||
if (!printSettingsX)
|
||||
|
||||
@ -182,7 +182,7 @@ nsPrintingPromptService::ShowProgress(nsIDOMWindow* parent,
|
||||
|
||||
/* void showPageSetup (in nsIDOMWindow parent, in nsIPrintSettings printSettings); */
|
||||
NS_IMETHODIMP
|
||||
nsPrintingPromptService::ShowPageSetup(nsIDOMWindow *parent, nsIPrintSettings *printSettings)
|
||||
nsPrintingPromptService::ShowPageSetup(nsIDOMWindow *parent, nsIPrintSettings *printSettings, nsIObserver *aObs)
|
||||
{
|
||||
NS_ENSURE_ARG(printSettings);
|
||||
|
||||
|
||||
@ -177,7 +177,7 @@ nsPrintingPromptService::ShowProgress(nsIDOMWindow* parent,
|
||||
|
||||
/* void showPageSetup (in nsIDOMWindow parent, in nsIPrintSettings printSettings); */
|
||||
NS_IMETHODIMP
|
||||
nsPrintingPromptService::ShowPageSetup(nsIDOMWindow *parent, nsIPrintSettings *printSettings)
|
||||
nsPrintingPromptService::ShowPageSetup(nsIDOMWindow *parent, nsIPrintSettings *printSettings, nsIObserver *aObs)
|
||||
{
|
||||
NS_ENSURE_ARG(printSettings);
|
||||
|
||||
|
||||
@ -238,7 +238,7 @@ nsPrintingPromptService::ShowProgress(nsIDOMWindow* parent,
|
||||
|
||||
/* void showPageSetup (in nsIDOMWindow parent, in nsIPrintSettings printSettings); */
|
||||
NS_IMETHODIMP
|
||||
nsPrintingPromptService::ShowPageSetup(nsIDOMWindow *parent, nsIPrintSettings *printSettings)
|
||||
nsPrintingPromptService::ShowPageSetup(nsIDOMWindow *parent, nsIPrintSettings *printSettings, nsIObserver *aObs)
|
||||
{
|
||||
NS_ENSURE_ARG(printSettings);
|
||||
|
||||
|
||||
@ -98,9 +98,9 @@ nsPrintingPrompt::ShowProgress(nsIWebBrowserPrint *webBrowserPrint, nsIPrintSett
|
||||
|
||||
/* void showPageSetup (in nsIPrintSettings printSettings); */
|
||||
NS_IMETHODIMP
|
||||
nsPrintingPrompt::ShowPageSetup(nsIPrintSettings *printSettings)
|
||||
nsPrintingPrompt::ShowPageSetup(nsIPrintSettings *printSettings, nsIObserver *aObs)
|
||||
{
|
||||
return mPromptService->ShowPageSetup(mParent, printSettings);
|
||||
return mPromptService->ShowPageSetup(mParent, printSettings, aObs);
|
||||
}
|
||||
|
||||
/* void showPrinterProperties (in wstring printerName, in nsIPrintSettings printSettings); */
|
||||
|
||||
@ -137,7 +137,7 @@ function goPageSetup(domwin, printSettings)
|
||||
// the ShowPrintSetupDialog method.
|
||||
var printingPromptService = Components.classes["@mozilla.org/embedcomp/printingprompt-service;1"]
|
||||
.getService(Components.interfaces.nsIPrintingPromptService);
|
||||
printingPromptService.showPageSetup(domwin, printSettings);
|
||||
printingPromptService.showPageSetup(domwin, printSettings, null);
|
||||
return true;
|
||||
} catch(e) {
|
||||
return false;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user