widget/nsIPrintDialogService.h

Thu, 22 Jan 2015 13:21:57 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 22 Jan 2015 13:21:57 +0100
branch
TOR_BUG_9701
changeset 15
b8a032363ba2
permissions
-rw-r--r--

Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6

     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 nsIDOMWindow;
    12 class nsIPrintSettings;
    13 class nsIWebBrowserPrint;
    15 /*
    16  * Interface to a print dialog accessed through the widget library.
    17  */
    19 #define NS_IPRINTDIALOGSERVICE_IID \
    20 { 0x3715eb1a, 0xb314, 0x447c, \
    21 { 0x95, 0x33, 0xd0, 0x6a, 0x6d, 0xa6, 0xa6, 0xf0 } }
    24 /**
    25  *
    26  */
    27 class nsIPrintDialogService  : public nsISupports
    28 {
    29 public:
    30   NS_DECLARE_STATIC_IID_ACCESSOR(NS_IPRINTDIALOGSERVICE_IID)
    32   /**
    33    * Initialize the service.
    34    * @return NS_OK or a suitable error.
    35    */
    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    * @param aWebBrowserPrint A nsIWebBrowserPrint object that can be used for
    46    *                         retreiving the title of the printed document.
    47    * @return NS_OK if the print operation should proceed
    48    * @return NS_ERROR_ABORT if the user indicated not to proceed
    49    * @return a suitable error for failures to show the print dialog.
    50    */
    51   NS_IMETHOD Show(nsIDOMWindow *aParent, nsIPrintSettings *aSettings,
    52                   nsIWebBrowserPrint *aWebBrowserPrint) = 0;
    54   /**
    55    * Show the page setup dialog. Note that there is no way to tell whether the
    56    * user clicked OK or Cancel on the dialog.
    57    * @param aParent   A DOM window the dialog will be parented to.
    58    * @param aSettings On entry, this contains initial settings for the
    59    *                  page setup dialog. On return, this contains new default
    60    *                  page setup options.
    61    * @return NS_OK if everything is OK.
    62    * @return a suitable error for failures to show the page setup dialog.
    63    */
    64   NS_IMETHOD ShowPageSetup(nsIDOMWindow *aParent, nsIPrintSettings *aSettings) = 0;
    66 };
    68 NS_DEFINE_STATIC_IID_ACCESSOR(nsIPrintDialogService, NS_IPRINTDIALOGSERVICE_IID)
    70 #define NS_PRINTDIALOGSERVICE_CONTRACTID ("@mozilla.org/widget/printdialog-service;1")
    72 #endif // nsIPrintDialogService_h__

mercurial