michael@0: /* -*- Mode: IDL; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- michael@0: * michael@0: * This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: #include "nsISupports.idl" michael@0: michael@0: interface nsIDOMWindow; michael@0: interface nsIPrintSettings; michael@0: interface nsIWebProgressListener; michael@0: michael@0: /** michael@0: * nsIWebBrowserPrint corresponds to the main interface michael@0: * for printing an embedded Gecko web browser window/document michael@0: */ michael@0: [scriptable, uuid(9A7CA4B0-FBBA-11d4-A869-00105A183419)] michael@0: interface nsIWebBrowserPrint : nsISupports michael@0: { michael@0: /** michael@0: * PrintPreview Navigation Constants michael@0: */ michael@0: const short PRINTPREVIEW_GOTO_PAGENUM = 0; michael@0: const short PRINTPREVIEW_PREV_PAGE = 1; michael@0: const short PRINTPREVIEW_NEXT_PAGE = 2; michael@0: const short PRINTPREVIEW_HOME = 3; michael@0: const short PRINTPREVIEW_END = 4; michael@0: michael@0: /** michael@0: * Returns a "global" PrintSettings object michael@0: * Creates a new the first time, if one doesn't exist. michael@0: * michael@0: * Then returns the same object each time after that. michael@0: * michael@0: * Initializes the globalPrintSettings from the default printer michael@0: */ michael@0: readonly attribute nsIPrintSettings globalPrintSettings; michael@0: michael@0: /** michael@0: * Returns a pointer to the PrintSettings object that michael@0: * that was passed into either "print" or "print preview" michael@0: * michael@0: * This enables any consumers of the interface to have access michael@0: * to the "current" PrintSetting at later points in the execution michael@0: */ michael@0: readonly attribute nsIPrintSettings currentPrintSettings; michael@0: michael@0: /** michael@0: * Returns a pointer to the current child DOMWindow michael@0: * that is being print previewed. (FrameSet Frames) michael@0: * michael@0: * Returns null if parent document is not a frameset or the entire FrameSet michael@0: * document is being print previewed michael@0: * michael@0: * This enables any consumers of the interface to have access michael@0: * to the "current" child DOMWindow at later points in the execution michael@0: */ michael@0: readonly attribute nsIDOMWindow currentChildDOMWindow; michael@0: michael@0: /** michael@0: * Returns whether it is in Print mode michael@0: */ michael@0: readonly attribute boolean doingPrint; michael@0: michael@0: /** michael@0: * Returns whether it is in Print Preview mode michael@0: */ michael@0: readonly attribute boolean doingPrintPreview; michael@0: michael@0: /** michael@0: * This returns whether the current document is a frameset document michael@0: */ michael@0: readonly attribute boolean isFramesetDocument; michael@0: michael@0: /** michael@0: * This returns whether the current document is a frameset document michael@0: */ michael@0: readonly attribute boolean isFramesetFrameSelected; michael@0: michael@0: /** michael@0: * This returns whether there is an IFrame selected michael@0: */ michael@0: readonly attribute boolean isIFrameSelected; michael@0: michael@0: /** michael@0: * This returns whether there is a "range" selection michael@0: */ michael@0: readonly attribute boolean isRangeSelection; michael@0: michael@0: /** michael@0: * This returns the total number of pages for the Print Preview michael@0: */ michael@0: readonly attribute long printPreviewNumPages; michael@0: michael@0: /** michael@0: * Print the specified DOM window michael@0: * michael@0: * @param aThePrintSettings - Printer Settings for the print job, if aThePrintSettings is null michael@0: * then the global PS will be used. michael@0: * @param aWPListener - is updated during the print michael@0: * @return void michael@0: */ michael@0: void print(in nsIPrintSettings aThePrintSettings, michael@0: in nsIWebProgressListener aWPListener); michael@0: michael@0: /** michael@0: * Print Preview the specified DOM window michael@0: * michael@0: * @param aThePrintSettings - Printer Settings for the print preview, if aThePrintSettings is null michael@0: * then the global PS will be used. michael@0: * @param aChildDOMWin - DOM Window to be print previewed. michael@0: * @param aWPListener - is updated during the printpreview michael@0: * @return void michael@0: */ michael@0: void printPreview(in nsIPrintSettings aThePrintSettings, michael@0: in nsIDOMWindow aChildDOMWin, michael@0: in nsIWebProgressListener aWPListener); michael@0: michael@0: /** michael@0: * Print Preview - Navigates within the window michael@0: * michael@0: * @param aNavType - navigation enum michael@0: * @param aPageNum - page num to navigate to when aNavType = ePrintPreviewGoToPageNum michael@0: * @return void michael@0: */ michael@0: void printPreviewNavigate(in short aNavType, in long aPageNum); michael@0: michael@0: /** michael@0: * Cancels the current print michael@0: * @return void michael@0: */ michael@0: void cancel(); michael@0: michael@0: /** michael@0: * Returns an array of the names of all documents names (Title or URL) michael@0: * and sub-documents. This will return a single item if the attr "isFramesetDocument" is false michael@0: * and may return any number of items is "isFramesetDocument" is true michael@0: * michael@0: * @param aCount - returns number of printers returned michael@0: * @param aResult - returns array of names michael@0: * @return void michael@0: */ michael@0: void enumerateDocumentNames(out uint32_t aCount,[retval, array, size_is(aCount)] out wstring aResult); michael@0: michael@0: /** michael@0: * This exists PrintPreview mode and returns browser window to galley mode michael@0: * @return void michael@0: */ michael@0: void exitPrintPreview(); michael@0: michael@0: }; michael@0: