Bug 1692971 [wpt PR 27638] - WebKit export of https://bugs.webkit.org/show_bug.cgi...
[gecko.git] / widget / nsIPrintDialogService.h
blob106897a5c244421921061a092732f9ea47e2db25
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;
15 * Interface to a print dialog accessed through the widget library.
18 #define NS_IPRINTDIALOGSERVICE_IID \
19 { \
20 0x3715eb1a, 0xb314, 0x447c, { \
21 0x95, 0x33, 0xd0, 0x6a, 0x6d, 0xa6, 0xa6, 0xf0 \
22 } \
25 /**
28 class nsIPrintDialogService : public nsISupports {
29 public:
30 NS_DECLARE_STATIC_IID_ACCESSOR(NS_IPRINTDIALOGSERVICE_IID)
32 /**
33 * Initialize the service.
34 * @return NS_OK or a suitable error.
36 NS_IMETHOD Init() = 0;
38 /**
39 * Show the print dialog.
40 * @param aParent A DOM window the dialog will be parented to.
41 * @param aSettings On entry, this contains initial settings for the
42 * print dialog. On return, if the print operation should
43 * proceed then this contains settings for the print
44 * operation.
45 * @return NS_OK if the print operation should proceed
46 * @return NS_ERROR_ABORT if the user indicated not to proceed
47 * @return a suitable error for failures to show the print dialog.
49 NS_IMETHOD Show(nsPIDOMWindowOuter* aParent, nsIPrintSettings* aSettings) = 0;
51 /**
52 * Show the page setup dialog. Note that there is no way to tell whether the
53 * user clicked OK or Cancel on the dialog.
54 * @param aParent A DOM window the dialog will be parented to.
55 * @param aSettings On entry, this contains initial settings for the
56 * page setup dialog. On return, this contains new default
57 * page setup options.
58 * @return NS_OK if everything is OK.
59 * @return a suitable error for failures to show the page setup dialog.
61 NS_IMETHOD ShowPageSetup(nsPIDOMWindowOuter* aParent,
62 nsIPrintSettings* aSettings) = 0;
65 NS_DEFINE_STATIC_IID_ACCESSOR(nsIPrintDialogService, NS_IPRINTDIALOGSERVICE_IID)
67 #define NS_PRINTDIALOGSERVICE_CONTRACTID \
68 ("@mozilla.org/widget/printdialog-service;1")
70 #endif // nsIPrintDialogService_h__