OLD | NEW |
(Empty) | |
| 1 /* -*- Mode: IDL; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- |
| 2 * |
| 3 * ***** BEGIN LICENSE BLOCK ***** |
| 4 * Version: MPL 1.1/GPL 2.0/LGPL 2.1 |
| 5 * |
| 6 * The contents of this file are subject to the Mozilla Public License Version |
| 7 * 1.1 (the "License"); you may not use this file except in compliance with |
| 8 * the License. You may obtain a copy of the License at |
| 9 * http://www.mozilla.org/MPL/ |
| 10 * |
| 11 * Software distributed under the License is distributed on an "AS IS" basis, |
| 12 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License |
| 13 * for the specific language governing rights and limitations under the |
| 14 * License. |
| 15 * |
| 16 * The Original Code is the Mozilla browser. |
| 17 * |
| 18 * The Initial Developer of the Original Code is |
| 19 * Netscape Communications, Inc. |
| 20 * Portions created by the Initial Developer are Copyright (C) 1999 |
| 21 * the Initial Developer. All Rights Reserved. |
| 22 * |
| 23 * Contributor(s): |
| 24 * Don Cone <dcone@netscape.com> |
| 25 * Rod Spears <rods@netscape.com> |
| 26 * |
| 27 * Alternatively, the contents of this file may be used under the terms of |
| 28 * either the GNU General Public License Version 2 or later (the "GPL"), or |
| 29 * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), |
| 30 * in which case the provisions of the GPL or the LGPL are applicable instead |
| 31 * of those above. If you wish to allow use of your version of this file only |
| 32 * under the terms of either the GPL or the LGPL, and not to allow others to |
| 33 * use your version of this file under the terms of the MPL, indicate your |
| 34 * decision by deleting the provisions above and replace them with the notice |
| 35 * and other provisions required by the GPL or the LGPL. If you do not delete |
| 36 * the provisions above, a recipient may use your version of this file under |
| 37 * the terms of any one of the MPL, the GPL or the LGPL. |
| 38 * |
| 39 * ***** END LICENSE BLOCK ***** */ |
| 40 |
| 41 #include "nsISupports.idl" |
| 42 |
| 43 interface nsIDOMWindow; |
| 44 interface nsIPrintSettings; |
| 45 interface nsIWebProgressListener; |
| 46 |
| 47 /** |
| 48 * nsIWebBrowserPrint corresponds to the main interface |
| 49 * for printing an embedded Gecko web browser window/document |
| 50 * |
| 51 * @status FROZEN |
| 52 */ |
| 53 [scriptable, uuid(9A7CA4B0-FBBA-11d4-A869-00105A183419)] |
| 54 interface nsIWebBrowserPrint : nsISupports |
| 55 { |
| 56 /** |
| 57 * PrintPreview Navigation Constants |
| 58 */ |
| 59 const short PRINTPREVIEW_GOTO_PAGENUM = 0; |
| 60 const short PRINTPREVIEW_PREV_PAGE = 1; |
| 61 const short PRINTPREVIEW_NEXT_PAGE = 2; |
| 62 const short PRINTPREVIEW_HOME = 3; |
| 63 const short PRINTPREVIEW_END = 4; |
| 64 |
| 65 /** |
| 66 * Returns a "global" PrintSettings object |
| 67 * Creates a new the first time, if one doesn't exist. |
| 68 * |
| 69 * Then returns the same object each time after that. |
| 70 * |
| 71 * Initializes the globalPrintSettings from the default printer |
| 72 */ |
| 73 readonly attribute nsIPrintSettings globalPrintSettings; |
| 74 |
| 75 /** |
| 76 * Returns a pointer to the PrintSettings object that |
| 77 * that was passed into either "print" or "print preview" |
| 78 * |
| 79 * This enables any consumers of the interface to have access |
| 80 * to the "current" PrintSetting at later points in the execution |
| 81 */ |
| 82 readonly attribute nsIPrintSettings currentPrintSettings; |
| 83 |
| 84 /** |
| 85 * Returns a pointer to the current child DOMWindow |
| 86 * that is being print previewed. (FrameSet Frames) |
| 87 * |
| 88 * Returns null if parent document is not a frameset or the entire FrameSet |
| 89 * document is being print previewed |
| 90 * |
| 91 * This enables any consumers of the interface to have access |
| 92 * to the "current" child DOMWindow at later points in the execution |
| 93 */ |
| 94 readonly attribute nsIDOMWindow currentChildDOMWindow; |
| 95 |
| 96 /** |
| 97 * Returns whether it is in Print mode |
| 98 */ |
| 99 readonly attribute boolean doingPrint; |
| 100 |
| 101 /** |
| 102 * Returns whether it is in Print Preview mode |
| 103 */ |
| 104 readonly attribute boolean doingPrintPreview; |
| 105 |
| 106 /** |
| 107 * This returns whether the current document is a frameset document |
| 108 */ |
| 109 readonly attribute boolean isFramesetDocument; |
| 110 |
| 111 /** |
| 112 * This returns whether the current document is a frameset document |
| 113 */ |
| 114 readonly attribute boolean isFramesetFrameSelected; |
| 115 |
| 116 /** |
| 117 * This returns whether there is an IFrame selected |
| 118 */ |
| 119 readonly attribute boolean isIFrameSelected; |
| 120 |
| 121 /** |
| 122 * This returns whether there is a "range" selection |
| 123 */ |
| 124 readonly attribute boolean isRangeSelection; |
| 125 |
| 126 /** |
| 127 * This returns the total number of pages for the Print Preview |
| 128 */ |
| 129 readonly attribute long printPreviewNumPages; |
| 130 |
| 131 /** |
| 132 * Print the specified DOM window |
| 133 * |
| 134 * @param aThePrintSettings - Printer Settings for the print job, if aThePrint
Settings is null |
| 135 * then the global PS will be used. |
| 136 * @param aWPListener - is updated during the print |
| 137 * @return void |
| 138 */ |
| 139 void print(in nsIPrintSettings aThePrintSettings, |
| 140 in nsIWebProgressListener aWPListener); |
| 141 |
| 142 /** |
| 143 * Print Preview the specified DOM window |
| 144 * |
| 145 * @param aThePrintSettings - Printer Settings for the print preview, if aTheP
rintSettings is null |
| 146 * then the global PS will be used. |
| 147 * @param aChildDOMWin - DOM Window of the child document to be PP (FrameSet f
rames) |
| 148 * @param aWPListener - is updated during the printpreview |
| 149 * @return void |
| 150 */ |
| 151 void printPreview(in nsIPrintSettings aThePrintSettings, |
| 152 in nsIDOMWindow aChildDOMWin, |
| 153 in nsIWebProgressListener aWPListener); |
| 154 |
| 155 /** |
| 156 * Print Preview - Navigates within the window |
| 157 * |
| 158 * @param aNavType - navigation enum |
| 159 * @param aPageNum - page num to navigate to when aNavType = ePrintPreviewGoTo
PageNum |
| 160 * @return void |
| 161 */ |
| 162 void printPreviewNavigate(in short aNavType, in long aPageNum); |
| 163 |
| 164 /** |
| 165 * Cancels the current print |
| 166 * @return void |
| 167 */ |
| 168 void cancel(); |
| 169 |
| 170 /** |
| 171 * Returns an array of the names of all documents names (Title or URL) |
| 172 * and sub-documents. This will return a single item if the attr "isFramesetDo
cument" is false |
| 173 * and may return any number of items is "isFramesetDocument" is true |
| 174 * |
| 175 * @param aCount - returns number of printers returned |
| 176 * @param aResult - returns array of names |
| 177 * @return void |
| 178 */ |
| 179 void enumerateDocumentNames(out PRUint32 aCount,[retval, array, size_is(aCount
)] out wstring aResult); |
| 180 |
| 181 /** |
| 182 * This exists PrintPreview mode and returns browser window to galley mode |
| 183 * @return void |
| 184 */ |
| 185 void exitPrintPreview(); |
| 186 |
| 187 }; |
| 188 |
OLD | NEW |