michael@0: /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: #ifndef nsIPrintDialogService_h__ michael@0: #define nsIPrintDialogService_h__ michael@0: michael@0: #include "nsISupports.h" michael@0: michael@0: class nsIDOMWindow; michael@0: class nsIPrintSettings; michael@0: class nsIWebBrowserPrint; michael@0: michael@0: /* michael@0: * Interface to a print dialog accessed through the widget library. michael@0: */ michael@0: michael@0: #define NS_IPRINTDIALOGSERVICE_IID \ michael@0: { 0x3715eb1a, 0xb314, 0x447c, \ michael@0: { 0x95, 0x33, 0xd0, 0x6a, 0x6d, 0xa6, 0xa6, 0xf0 } } michael@0: michael@0: michael@0: /** michael@0: * michael@0: */ michael@0: class nsIPrintDialogService : public nsISupports michael@0: { michael@0: public: michael@0: NS_DECLARE_STATIC_IID_ACCESSOR(NS_IPRINTDIALOGSERVICE_IID) michael@0: michael@0: /** michael@0: * Initialize the service. michael@0: * @return NS_OK or a suitable error. michael@0: */ michael@0: NS_IMETHOD Init() = 0; michael@0: michael@0: /** michael@0: * Show the print dialog. michael@0: * @param aParent A DOM window the dialog will be parented to. michael@0: * @param aSettings On entry, this contains initial settings for the michael@0: * print dialog. On return, if the print operation should michael@0: * proceed then this contains settings for the print michael@0: * operation. michael@0: * @param aWebBrowserPrint A nsIWebBrowserPrint object that can be used for michael@0: * retreiving the title of the printed document. michael@0: * @return NS_OK if the print operation should proceed michael@0: * @return NS_ERROR_ABORT if the user indicated not to proceed michael@0: * @return a suitable error for failures to show the print dialog. michael@0: */ michael@0: NS_IMETHOD Show(nsIDOMWindow *aParent, nsIPrintSettings *aSettings, michael@0: nsIWebBrowserPrint *aWebBrowserPrint) = 0; michael@0: michael@0: /** michael@0: * Show the page setup dialog. Note that there is no way to tell whether the michael@0: * user clicked OK or Cancel on the dialog. michael@0: * @param aParent A DOM window the dialog will be parented to. michael@0: * @param aSettings On entry, this contains initial settings for the michael@0: * page setup dialog. On return, this contains new default michael@0: * page setup options. michael@0: * @return NS_OK if everything is OK. michael@0: * @return a suitable error for failures to show the page setup dialog. michael@0: */ michael@0: NS_IMETHOD ShowPageSetup(nsIDOMWindow *aParent, nsIPrintSettings *aSettings) = 0; michael@0: michael@0: }; michael@0: michael@0: NS_DEFINE_STATIC_IID_ACCESSOR(nsIPrintDialogService, NS_IPRINTDIALOGSERVICE_IID) michael@0: michael@0: #define NS_PRINTDIALOGSERVICE_CONTRACTID ("@mozilla.org/widget/printdialog-service;1") michael@0: michael@0: #endif // nsIPrintDialogService_h__ michael@0: