Thu, 22 Jan 2015 13:21:57 +0100
Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6
michael@0 | 1 | /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ |
michael@0 | 2 | /* This Source Code Form is subject to the terms of the Mozilla Public |
michael@0 | 3 | * License, v. 2.0. If a copy of the MPL was not distributed with this |
michael@0 | 4 | * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
michael@0 | 5 | |
michael@0 | 6 | #ifndef nsIPrintDialogService_h__ |
michael@0 | 7 | #define nsIPrintDialogService_h__ |
michael@0 | 8 | |
michael@0 | 9 | #include "nsISupports.h" |
michael@0 | 10 | |
michael@0 | 11 | class nsIDOMWindow; |
michael@0 | 12 | class nsIPrintSettings; |
michael@0 | 13 | class nsIWebBrowserPrint; |
michael@0 | 14 | |
michael@0 | 15 | /* |
michael@0 | 16 | * Interface to a print dialog accessed through the widget library. |
michael@0 | 17 | */ |
michael@0 | 18 | |
michael@0 | 19 | #define NS_IPRINTDIALOGSERVICE_IID \ |
michael@0 | 20 | { 0x3715eb1a, 0xb314, 0x447c, \ |
michael@0 | 21 | { 0x95, 0x33, 0xd0, 0x6a, 0x6d, 0xa6, 0xa6, 0xf0 } } |
michael@0 | 22 | |
michael@0 | 23 | |
michael@0 | 24 | /** |
michael@0 | 25 | * |
michael@0 | 26 | */ |
michael@0 | 27 | class nsIPrintDialogService : public nsISupports |
michael@0 | 28 | { |
michael@0 | 29 | public: |
michael@0 | 30 | NS_DECLARE_STATIC_IID_ACCESSOR(NS_IPRINTDIALOGSERVICE_IID) |
michael@0 | 31 | |
michael@0 | 32 | /** |
michael@0 | 33 | * Initialize the service. |
michael@0 | 34 | * @return NS_OK or a suitable error. |
michael@0 | 35 | */ |
michael@0 | 36 | NS_IMETHOD Init() = 0; |
michael@0 | 37 | |
michael@0 | 38 | /** |
michael@0 | 39 | * Show the print dialog. |
michael@0 | 40 | * @param aParent A DOM window the dialog will be parented to. |
michael@0 | 41 | * @param aSettings On entry, this contains initial settings for the |
michael@0 | 42 | * print dialog. On return, if the print operation should |
michael@0 | 43 | * proceed then this contains settings for the print |
michael@0 | 44 | * operation. |
michael@0 | 45 | * @param aWebBrowserPrint A nsIWebBrowserPrint object that can be used for |
michael@0 | 46 | * retreiving the title of the printed document. |
michael@0 | 47 | * @return NS_OK if the print operation should proceed |
michael@0 | 48 | * @return NS_ERROR_ABORT if the user indicated not to proceed |
michael@0 | 49 | * @return a suitable error for failures to show the print dialog. |
michael@0 | 50 | */ |
michael@0 | 51 | NS_IMETHOD Show(nsIDOMWindow *aParent, nsIPrintSettings *aSettings, |
michael@0 | 52 | nsIWebBrowserPrint *aWebBrowserPrint) = 0; |
michael@0 | 53 | |
michael@0 | 54 | /** |
michael@0 | 55 | * Show the page setup dialog. Note that there is no way to tell whether the |
michael@0 | 56 | * user clicked OK or Cancel on the dialog. |
michael@0 | 57 | * @param aParent A DOM window the dialog will be parented to. |
michael@0 | 58 | * @param aSettings On entry, this contains initial settings for the |
michael@0 | 59 | * page setup dialog. On return, this contains new default |
michael@0 | 60 | * page setup options. |
michael@0 | 61 | * @return NS_OK if everything is OK. |
michael@0 | 62 | * @return a suitable error for failures to show the page setup dialog. |
michael@0 | 63 | */ |
michael@0 | 64 | NS_IMETHOD ShowPageSetup(nsIDOMWindow *aParent, nsIPrintSettings *aSettings) = 0; |
michael@0 | 65 | |
michael@0 | 66 | }; |
michael@0 | 67 | |
michael@0 | 68 | NS_DEFINE_STATIC_IID_ACCESSOR(nsIPrintDialogService, NS_IPRINTDIALOGSERVICE_IID) |
michael@0 | 69 | |
michael@0 | 70 | #define NS_PRINTDIALOGSERVICE_CONTRACTID ("@mozilla.org/widget/printdialog-service;1") |
michael@0 | 71 | |
michael@0 | 72 | #endif // nsIPrintDialogService_h__ |
michael@0 | 73 |