summaryrefslogtreecommitdiffstats
path: root/widget/nsIPrintDialogService.idl
blob: b1e318b9484da6d6c6e8d6484e53b070de21554a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

/* Doc interface here */

#include "nsISupports.idl"
#include "nsIWebProgressListener.idl"
#include "nsIPrintSettings.idl"
#include "nsIObserver.idl"

interface mozIDOMWindowProxy;

/**
 * Service for opening native print dialogs provided by the operating system.
 * (The widget code may customize the dialog.)
 */
[scriptable, uuid(88af6712-a9fd-4393-9af3-3ffbb1f2caaf)]
interface nsIPrintDialogService : nsISupports
{
  /**
   * Initialize the service.
   */
  void init();

  /**
   * Show the print dialog.
   * @param aParent   A DOM window the dialog will be parented to.
   * @param aHaveSelection A boolean indicating whether the document to be
   *                  printed has some selected text, which is used to
   *                  determine whether the "Print selection only" radio
   *                  button is enabled in the print settings dialog.
   * @param aSettings On entry, this contains initial settings for the
   *                  print dialog. On return, if the print operation should
   *                  proceed, then this has been updated with the settings
   *                  that the user selected in the dialog.
   * @return NS_OK if the print operation should proceed
   * @return NS_ERROR_ABORT if the user indicated not to proceed
   * @return a suitable error for failures to show the print dialog.
   */
  void showPrintDialog(in mozIDOMWindowProxy aParent,
                       in boolean aHaveSelection,
                       in nsIPrintSettings aPrintSettings);

  /**
   * Show the page setup dialog. Note that there is no way to tell whether the
   * user clicked OK or Cancel on the dialog.
   * @param aParent   A DOM window the dialog will be parented to.
   * @param aSettings On entry, this contains initial settings for the
   *                  page setup dialog. On return, if the dialog wasn't
   *                  cancelled, then this has been updated with the settings
   *                  that the user selected in the dialog.
   */
  void showPageSetupDialog(in mozIDOMWindowProxy aParent,
                           in nsIPrintSettings aPrintSettings);

};