1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/embedding/browser/webBrowser/nsIWebBrowserPrint.idl Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,152 @@ 1.4 +/* -*- Mode: IDL; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- 1.5 + * 1.6 + * This Source Code Form is subject to the terms of the Mozilla Public 1.7 + * License, v. 2.0. If a copy of the MPL was not distributed with this 1.8 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 1.9 + 1.10 +#include "nsISupports.idl" 1.11 + 1.12 +interface nsIDOMWindow; 1.13 +interface nsIPrintSettings; 1.14 +interface nsIWebProgressListener; 1.15 + 1.16 +/** 1.17 + * nsIWebBrowserPrint corresponds to the main interface 1.18 + * for printing an embedded Gecko web browser window/document 1.19 + */ 1.20 +[scriptable, uuid(9A7CA4B0-FBBA-11d4-A869-00105A183419)] 1.21 +interface nsIWebBrowserPrint : nsISupports 1.22 +{ 1.23 + /** 1.24 + * PrintPreview Navigation Constants 1.25 + */ 1.26 + const short PRINTPREVIEW_GOTO_PAGENUM = 0; 1.27 + const short PRINTPREVIEW_PREV_PAGE = 1; 1.28 + const short PRINTPREVIEW_NEXT_PAGE = 2; 1.29 + const short PRINTPREVIEW_HOME = 3; 1.30 + const short PRINTPREVIEW_END = 4; 1.31 + 1.32 + /** 1.33 + * Returns a "global" PrintSettings object 1.34 + * Creates a new the first time, if one doesn't exist. 1.35 + * 1.36 + * Then returns the same object each time after that. 1.37 + * 1.38 + * Initializes the globalPrintSettings from the default printer 1.39 + */ 1.40 + readonly attribute nsIPrintSettings globalPrintSettings; 1.41 + 1.42 + /** 1.43 + * Returns a pointer to the PrintSettings object that 1.44 + * that was passed into either "print" or "print preview" 1.45 + * 1.46 + * This enables any consumers of the interface to have access 1.47 + * to the "current" PrintSetting at later points in the execution 1.48 + */ 1.49 + readonly attribute nsIPrintSettings currentPrintSettings; 1.50 + 1.51 + /** 1.52 + * Returns a pointer to the current child DOMWindow 1.53 + * that is being print previewed. (FrameSet Frames) 1.54 + * 1.55 + * Returns null if parent document is not a frameset or the entire FrameSet 1.56 + * document is being print previewed 1.57 + * 1.58 + * This enables any consumers of the interface to have access 1.59 + * to the "current" child DOMWindow at later points in the execution 1.60 + */ 1.61 + readonly attribute nsIDOMWindow currentChildDOMWindow; 1.62 + 1.63 + /** 1.64 + * Returns whether it is in Print mode 1.65 + */ 1.66 + readonly attribute boolean doingPrint; 1.67 + 1.68 + /** 1.69 + * Returns whether it is in Print Preview mode 1.70 + */ 1.71 + readonly attribute boolean doingPrintPreview; 1.72 + 1.73 + /** 1.74 + * This returns whether the current document is a frameset document 1.75 + */ 1.76 + readonly attribute boolean isFramesetDocument; 1.77 + 1.78 + /** 1.79 + * This returns whether the current document is a frameset document 1.80 + */ 1.81 + readonly attribute boolean isFramesetFrameSelected; 1.82 + 1.83 + /** 1.84 + * This returns whether there is an IFrame selected 1.85 + */ 1.86 + readonly attribute boolean isIFrameSelected; 1.87 + 1.88 + /** 1.89 + * This returns whether there is a "range" selection 1.90 + */ 1.91 + readonly attribute boolean isRangeSelection; 1.92 + 1.93 + /** 1.94 + * This returns the total number of pages for the Print Preview 1.95 + */ 1.96 + readonly attribute long printPreviewNumPages; 1.97 + 1.98 + /** 1.99 + * Print the specified DOM window 1.100 + * 1.101 + * @param aThePrintSettings - Printer Settings for the print job, if aThePrintSettings is null 1.102 + * then the global PS will be used. 1.103 + * @param aWPListener - is updated during the print 1.104 + * @return void 1.105 + */ 1.106 + void print(in nsIPrintSettings aThePrintSettings, 1.107 + in nsIWebProgressListener aWPListener); 1.108 + 1.109 + /** 1.110 + * Print Preview the specified DOM window 1.111 + * 1.112 + * @param aThePrintSettings - Printer Settings for the print preview, if aThePrintSettings is null 1.113 + * then the global PS will be used. 1.114 + * @param aChildDOMWin - DOM Window to be print previewed. 1.115 + * @param aWPListener - is updated during the printpreview 1.116 + * @return void 1.117 + */ 1.118 + void printPreview(in nsIPrintSettings aThePrintSettings, 1.119 + in nsIDOMWindow aChildDOMWin, 1.120 + in nsIWebProgressListener aWPListener); 1.121 + 1.122 + /** 1.123 + * Print Preview - Navigates within the window 1.124 + * 1.125 + * @param aNavType - navigation enum 1.126 + * @param aPageNum - page num to navigate to when aNavType = ePrintPreviewGoToPageNum 1.127 + * @return void 1.128 + */ 1.129 + void printPreviewNavigate(in short aNavType, in long aPageNum); 1.130 + 1.131 + /** 1.132 + * Cancels the current print 1.133 + * @return void 1.134 + */ 1.135 + void cancel(); 1.136 + 1.137 + /** 1.138 + * Returns an array of the names of all documents names (Title or URL) 1.139 + * and sub-documents. This will return a single item if the attr "isFramesetDocument" is false 1.140 + * and may return any number of items is "isFramesetDocument" is true 1.141 + * 1.142 + * @param aCount - returns number of printers returned 1.143 + * @param aResult - returns array of names 1.144 + * @return void 1.145 + */ 1.146 + void enumerateDocumentNames(out uint32_t aCount,[retval, array, size_is(aCount)] out wstring aResult); 1.147 + 1.148 + /** 1.149 + * This exists PrintPreview mode and returns browser window to galley mode 1.150 + * @return void 1.151 + */ 1.152 + void exitPrintPreview(); 1.153 + 1.154 +}; 1.155 +