1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* This Source Code Form is subject to the terms of the Mozilla Public
3 * License, v. 2.0. If a copy of the MPL was not distributed with this
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
6 #ifndef nsIPrintDialogService_h__
7 #define nsIPrintDialogService_h__
9 #include "nsISupports.h"
11 class nsPIDOMWindowOuter
;
12 class nsIPrintSettings
;
13 class nsIWebBrowserPrint
;
16 * Interface to a print dialog accessed through the widget library.
19 #define NS_IPRINTDIALOGSERVICE_IID \
21 0x3715eb1a, 0xb314, 0x447c, { \
22 0x95, 0x33, 0xd0, 0x6a, 0x6d, 0xa6, 0xa6, 0xf0 \
29 class nsIPrintDialogService
: public nsISupports
{
31 NS_DECLARE_STATIC_IID_ACCESSOR(NS_IPRINTDIALOGSERVICE_IID
)
34 * Initialize the service.
35 * @return NS_OK or a suitable error.
37 NS_IMETHOD
Init() = 0;
40 * Show the print dialog.
41 * @param aParent A DOM window the dialog will be parented to.
42 * @param aSettings On entry, this contains initial settings for the
43 * print dialog. On return, if the print operation should
44 * proceed then this contains settings for the print
46 * @param aWebBrowserPrint A nsIWebBrowserPrint object that can be used for
47 * retreiving the title of the printed document.
48 * @return NS_OK if the print operation should proceed
49 * @return NS_ERROR_ABORT if the user indicated not to proceed
50 * @return a suitable error for failures to show the print dialog.
52 NS_IMETHOD
Show(nsPIDOMWindowOuter
*aParent
, nsIPrintSettings
*aSettings
,
53 nsIWebBrowserPrint
*aWebBrowserPrint
) = 0;
56 * Show the page setup dialog. Note that there is no way to tell whether the
57 * user clicked OK or Cancel on the dialog.
58 * @param aParent A DOM window the dialog will be parented to.
59 * @param aSettings On entry, this contains initial settings for the
60 * page setup dialog. On return, this contains new default
62 * @return NS_OK if everything is OK.
63 * @return a suitable error for failures to show the page setup dialog.
65 NS_IMETHOD
ShowPageSetup(nsPIDOMWindowOuter
*aParent
,
66 nsIPrintSettings
*aSettings
) = 0;
69 NS_DEFINE_STATIC_IID_ACCESSOR(nsIPrintDialogService
, NS_IPRINTDIALOGSERVICE_IID
)
71 #define NS_PRINTDIALOGSERVICE_CONTRACTID \
72 ("@mozilla.org/widget/printdialog-service;1")
74 #endif // nsIPrintDialogService_h__