PageRenderTime 40ms CodeModel.GetById 19ms RepoModel.GetById 0ms app.codeStats 0ms

/gecko_sdk/idl/nsIWebBrowserPrint.idl

http://firefox-mac-pdf.googlecode.com/
IDL | 188 lines | 32 code | 21 blank | 135 comment | 0 complexity | a9785c8e9b94dd0b88d013df20b3eb5b MD5 | raw file
  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. #include "nsISupports.idl"
  41. interface nsIDOMWindow;
  42. interface nsIPrintSettings;
  43. interface nsIWebProgressListener;
  44. /**
  45. * nsIWebBrowserPrint corresponds to the main interface
  46. * for printing an embedded Gecko web browser window/document
  47. *
  48. * @status FROZEN
  49. */
  50. [scriptable, uuid(9A7CA4B0-FBBA-11d4-A869-00105A183419)]
  51. interface nsIWebBrowserPrint : nsISupports
  52. {
  53. /**
  54. * PrintPreview Navigation Constants
  55. */
  56. const short PRINTPREVIEW_GOTO_PAGENUM = 0;
  57. const short PRINTPREVIEW_PREV_PAGE = 1;
  58. const short PRINTPREVIEW_NEXT_PAGE = 2;
  59. const short PRINTPREVIEW_HOME = 3;
  60. const short PRINTPREVIEW_END = 4;
  61. /**
  62. * Returns a "global" PrintSettings object
  63. * Creates a new the first time, if one doesn't exist.
  64. *
  65. * Then returns the same object each time after that.
  66. *
  67. * Initializes the globalPrintSettings from the default printer
  68. */
  69. readonly attribute nsIPrintSettings globalPrintSettings;
  70. /**
  71. * Returns a pointer to the PrintSettings object that
  72. * that was passed into either "print" or "print preview"
  73. *
  74. * This enables any consumers of the interface to have access
  75. * to the "current" PrintSetting at later points in the execution
  76. */
  77. readonly attribute nsIPrintSettings currentPrintSettings;
  78. /**
  79. * Returns a pointer to the current child DOMWindow
  80. * that is being print previewed. (FrameSet Frames)
  81. *
  82. * Returns null if parent document is not a frameset or the entire FrameSet
  83. * document is being print previewed
  84. *
  85. * This enables any consumers of the interface to have access
  86. * to the "current" child DOMWindow at later points in the execution
  87. */
  88. readonly attribute nsIDOMWindow currentChildDOMWindow;
  89. /**
  90. * Returns whether it is in Print mode
  91. */
  92. readonly attribute boolean doingPrint;
  93. /**
  94. * Returns whether it is in Print Preview mode
  95. */
  96. readonly attribute boolean doingPrintPreview;
  97. /**
  98. * This returns whether the current document is a frameset document
  99. */
  100. readonly attribute boolean isFramesetDocument;
  101. /**
  102. * This returns whether the current document is a frameset document
  103. */
  104. readonly attribute boolean isFramesetFrameSelected;
  105. /**
  106. * This returns whether there is an IFrame selected
  107. */
  108. readonly attribute boolean isIFrameSelected;
  109. /**
  110. * This returns whether there is a "range" selection
  111. */
  112. readonly attribute boolean isRangeSelection;
  113. /**
  114. * This returns the total number of pages for the Print Preview
  115. */
  116. readonly attribute long printPreviewNumPages;
  117. /**
  118. * Print the specified DOM window
  119. *
  120. * @param aThePrintSettings - Printer Settings for the print job, if aThePrintSettings is null
  121. * then the global PS will be used.
  122. * @param aWPListener - is updated during the print
  123. * @return void
  124. */
  125. void print(in nsIPrintSettings aThePrintSettings,
  126. in nsIWebProgressListener aWPListener);
  127. /**
  128. * Print Preview the specified DOM window
  129. *
  130. * @param aThePrintSettings - Printer Settings for the print preview, if aThePrintSettings is null
  131. * then the global PS will be used.
  132. * @param aChildDOMWin - DOM Window of the child document to be PP (FrameSet frames)
  133. * @param aWPListener - is updated during the printpreview
  134. * @return void
  135. */
  136. void printPreview(in nsIPrintSettings aThePrintSettings,
  137. in nsIDOMWindow aChildDOMWin,
  138. in nsIWebProgressListener aWPListener);
  139. /**
  140. * Print Preview - Navigates within the window
  141. *
  142. * @param aNavType - navigation enum
  143. * @param aPageNum - page num to navigate to when aNavType = ePrintPreviewGoToPageNum
  144. * @return void
  145. */
  146. void printPreviewNavigate(in short aNavType, in long aPageNum);
  147. /**
  148. * Cancels the current print
  149. * @return void
  150. */
  151. void cancel();
  152. /**
  153. * Returns an array of the names of all documents names (Title or URL)
  154. * and sub-documents. This will return a single item if the attr "isFramesetDocument" is false
  155. * and may return any number of items is "isFramesetDocument" is true
  156. *
  157. * @param aCount - returns number of printers returned
  158. * @param aResult - returns array of names
  159. * @return void
  160. */
  161. void enumerateDocumentNames(out PRUint32 aCount,[retval, array, size_is(aCount)] out wstring aResult);
  162. /**
  163. * This exists PrintPreview mode and returns browser window to galley mode
  164. * @return void
  165. */
  166. void exitPrintPreview();
  167. };