1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/widget/nsIPrintDialogService.h Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,73 @@ 1.4 +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ 1.5 +/* This Source Code Form is subject to the terms of the Mozilla Public 1.6 + * License, v. 2.0. If a copy of the MPL was not distributed with this 1.7 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 1.8 + 1.9 +#ifndef nsIPrintDialogService_h__ 1.10 +#define nsIPrintDialogService_h__ 1.11 + 1.12 +#include "nsISupports.h" 1.13 + 1.14 +class nsIDOMWindow; 1.15 +class nsIPrintSettings; 1.16 +class nsIWebBrowserPrint; 1.17 + 1.18 +/* 1.19 + * Interface to a print dialog accessed through the widget library. 1.20 + */ 1.21 + 1.22 +#define NS_IPRINTDIALOGSERVICE_IID \ 1.23 +{ 0x3715eb1a, 0xb314, 0x447c, \ 1.24 +{ 0x95, 0x33, 0xd0, 0x6a, 0x6d, 0xa6, 0xa6, 0xf0 } } 1.25 + 1.26 + 1.27 +/** 1.28 + * 1.29 + */ 1.30 +class nsIPrintDialogService : public nsISupports 1.31 +{ 1.32 +public: 1.33 + NS_DECLARE_STATIC_IID_ACCESSOR(NS_IPRINTDIALOGSERVICE_IID) 1.34 + 1.35 + /** 1.36 + * Initialize the service. 1.37 + * @return NS_OK or a suitable error. 1.38 + */ 1.39 + NS_IMETHOD Init() = 0; 1.40 + 1.41 + /** 1.42 + * Show the print dialog. 1.43 + * @param aParent A DOM window the dialog will be parented to. 1.44 + * @param aSettings On entry, this contains initial settings for the 1.45 + * print dialog. On return, if the print operation should 1.46 + * proceed then this contains settings for the print 1.47 + * operation. 1.48 + * @param aWebBrowserPrint A nsIWebBrowserPrint object that can be used for 1.49 + * retreiving the title of the printed document. 1.50 + * @return NS_OK if the print operation should proceed 1.51 + * @return NS_ERROR_ABORT if the user indicated not to proceed 1.52 + * @return a suitable error for failures to show the print dialog. 1.53 + */ 1.54 + NS_IMETHOD Show(nsIDOMWindow *aParent, nsIPrintSettings *aSettings, 1.55 + nsIWebBrowserPrint *aWebBrowserPrint) = 0; 1.56 + 1.57 + /** 1.58 + * Show the page setup dialog. Note that there is no way to tell whether the 1.59 + * user clicked OK or Cancel on the dialog. 1.60 + * @param aParent A DOM window the dialog will be parented to. 1.61 + * @param aSettings On entry, this contains initial settings for the 1.62 + * page setup dialog. On return, this contains new default 1.63 + * page setup options. 1.64 + * @return NS_OK if everything is OK. 1.65 + * @return a suitable error for failures to show the page setup dialog. 1.66 + */ 1.67 + NS_IMETHOD ShowPageSetup(nsIDOMWindow *aParent, nsIPrintSettings *aSettings) = 0; 1.68 + 1.69 +}; 1.70 + 1.71 +NS_DEFINE_STATIC_IID_ACCESSOR(nsIPrintDialogService, NS_IPRINTDIALOGSERVICE_IID) 1.72 + 1.73 +#define NS_PRINTDIALOGSERVICE_CONTRACTID ("@mozilla.org/widget/printdialog-service;1") 1.74 + 1.75 +#endif // nsIPrintDialogService_h__ 1.76 +