nsIPrintDialogService.h 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  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/. */
  5. #ifndef nsIPrintDialogService_h__
  6. #define nsIPrintDialogService_h__
  7. #include "nsISupports.h"
  8. class nsPIDOMWindowOuter;
  9. class nsIPrintSettings;
  10. class nsIWebBrowserPrint;
  11. /*
  12. * Interface to a print dialog accessed through the widget library.
  13. */
  14. #define NS_IPRINTDIALOGSERVICE_IID \
  15. { 0x3715eb1a, 0xb314, 0x447c, \
  16. { 0x95, 0x33, 0xd0, 0x6a, 0x6d, 0xa6, 0xa6, 0xf0 } }
  17. /**
  18. *
  19. */
  20. class nsIPrintDialogService : public nsISupports
  21. {
  22. public:
  23. NS_DECLARE_STATIC_IID_ACCESSOR(NS_IPRINTDIALOGSERVICE_IID)
  24. /**
  25. * Initialize the service.
  26. * @return NS_OK or a suitable error.
  27. */
  28. NS_IMETHOD Init() = 0;
  29. /**
  30. * Show the print dialog.
  31. * @param aParent A DOM window the dialog will be parented to.
  32. * @param aSettings On entry, this contains initial settings for the
  33. * print dialog. On return, if the print operation should
  34. * proceed then this contains settings for the print
  35. * operation.
  36. * @param aWebBrowserPrint A nsIWebBrowserPrint object that can be used for
  37. * retreiving the title of the printed document.
  38. * @return NS_OK if the print operation should proceed
  39. * @return NS_ERROR_ABORT if the user indicated not to proceed
  40. * @return a suitable error for failures to show the print dialog.
  41. */
  42. NS_IMETHOD Show(nsPIDOMWindowOuter *aParent, nsIPrintSettings *aSettings,
  43. nsIWebBrowserPrint *aWebBrowserPrint) = 0;
  44. /**
  45. * Show the page setup dialog. Note that there is no way to tell whether the
  46. * user clicked OK or Cancel on the dialog.
  47. * @param aParent A DOM window the dialog will be parented to.
  48. * @param aSettings On entry, this contains initial settings for the
  49. * page setup dialog. On return, this contains new default
  50. * page setup options.
  51. * @return NS_OK if everything is OK.
  52. * @return a suitable error for failures to show the page setup dialog.
  53. */
  54. NS_IMETHOD ShowPageSetup(nsPIDOMWindowOuter *aParent, nsIPrintSettings *aSettings) = 0;
  55. };
  56. NS_DEFINE_STATIC_IID_ACCESSOR(nsIPrintDialogService, NS_IPRINTDIALOGSERVICE_IID)
  57. #define NS_PRINTDIALOGSERVICE_CONTRACTID ("@mozilla.org/widget/printdialog-service;1")
  58. #endif // nsIPrintDialogService_h__