nsIWebBrowserPrint.h 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381
  1. /*
  2. * DO NOT EDIT. THIS FILE IS GENERATED FROM c:/mozilla/embedding/browser/webBrowser/nsIWebBrowserPrint.idl
  3. */
  4. #ifndef __gen_nsIWebBrowserPrint_h__
  5. #define __gen_nsIWebBrowserPrint_h__
  6. #ifndef __gen_nsISupports_h__
  7. #include "nsISupports.h"
  8. #endif
  9. /* For IDL files that don't want to include root IDL files. */
  10. #ifndef NS_NO_VTABLE
  11. #define NS_NO_VTABLE
  12. #endif
  13. class nsIDOMWindow; /* forward declaration */
  14. class nsIPrintSettings; /* forward declaration */
  15. class nsIWebProgressListener; /* forward declaration */
  16. /* starting interface: nsIWebBrowserPrint */
  17. #define NS_IWEBBROWSERPRINT_IID_STR "9a7ca4b0-fbba-11d4-a869-00105a183419"
  18. #define NS_IWEBBROWSERPRINT_IID \
  19. {0x9a7ca4b0, 0xfbba, 0x11d4, \
  20. { 0xa8, 0x69, 0x00, 0x10, 0x5a, 0x18, 0x34, 0x19 }}
  21. /**
  22. * nsIWebBrowserPrint corresponds to the main interface
  23. * for printing an embedded Gecko web browser window/document
  24. *
  25. * @status FROZEN
  26. */
  27. class NS_NO_VTABLE nsIWebBrowserPrint : public nsISupports {
  28. public:
  29. NS_DEFINE_STATIC_IID_ACCESSOR(NS_IWEBBROWSERPRINT_IID)
  30. /**
  31. * PrintPreview Navigation Constants
  32. */
  33. enum { PRINTPREVIEW_GOTO_PAGENUM = 0 };
  34. enum { PRINTPREVIEW_PREV_PAGE = 1 };
  35. enum { PRINTPREVIEW_NEXT_PAGE = 2 };
  36. enum { PRINTPREVIEW_HOME = 3 };
  37. enum { PRINTPREVIEW_END = 4 };
  38. /**
  39. * Returns a "global" PrintSettings object
  40. * Creates a new the first time, if one doesn't exist.
  41. *
  42. * Then returns the same object each time after that.
  43. *
  44. * Initializes the globalPrintSettings from the default printer
  45. */
  46. /* readonly attribute nsIPrintSettings globalPrintSettings; */
  47. NS_IMETHOD GetGlobalPrintSettings(nsIPrintSettings * *aGlobalPrintSettings) = 0;
  48. /**
  49. * Returns a pointer to the PrintSettings object that
  50. * that was passed into either "print" or "print preview"
  51. *
  52. * This enables any consumers of the interface to have access
  53. * to the "current" PrintSetting at later points in the execution
  54. */
  55. /* readonly attribute nsIPrintSettings currentPrintSettings; */
  56. NS_IMETHOD GetCurrentPrintSettings(nsIPrintSettings * *aCurrentPrintSettings) = 0;
  57. /**
  58. * Returns a pointer to the current child DOMWindow
  59. * that is being print previewed. (FrameSet Frames)
  60. *
  61. * Returns null if parent document is not a frameset or the entire FrameSet
  62. * document is being print previewed
  63. *
  64. * This enables any consumers of the interface to have access
  65. * to the "current" child DOMWindow at later points in the execution
  66. */
  67. /* readonly attribute nsIDOMWindow currentChildDOMWindow; */
  68. NS_IMETHOD GetCurrentChildDOMWindow(nsIDOMWindow * *aCurrentChildDOMWindow) = 0;
  69. /**
  70. * Returns whether it is in Print mode
  71. */
  72. /* readonly attribute boolean doingPrint; */
  73. NS_IMETHOD GetDoingPrint(PRBool *aDoingPrint) = 0;
  74. /**
  75. * Returns whether it is in Print Preview mode
  76. */
  77. /* readonly attribute boolean doingPrintPreview; */
  78. NS_IMETHOD GetDoingPrintPreview(PRBool *aDoingPrintPreview) = 0;
  79. /**
  80. * This returns whether the current document is a frameset document
  81. */
  82. /* readonly attribute boolean isFramesetDocument; */
  83. NS_IMETHOD GetIsFramesetDocument(PRBool *aIsFramesetDocument) = 0;
  84. /**
  85. * This returns whether the current document is a frameset document
  86. */
  87. /* readonly attribute boolean isFramesetFrameSelected; */
  88. NS_IMETHOD GetIsFramesetFrameSelected(PRBool *aIsFramesetFrameSelected) = 0;
  89. /**
  90. * This returns whether there is an IFrame selected
  91. */
  92. /* readonly attribute boolean isIFrameSelected; */
  93. NS_IMETHOD GetIsIFrameSelected(PRBool *aIsIFrameSelected) = 0;
  94. /**
  95. * This returns whether there is a "range" selection
  96. */
  97. /* readonly attribute boolean isRangeSelection; */
  98. NS_IMETHOD GetIsRangeSelection(PRBool *aIsRangeSelection) = 0;
  99. /**
  100. * This returns the total number of pages for the Print Preview
  101. */
  102. /* readonly attribute long printPreviewNumPages; */
  103. NS_IMETHOD GetPrintPreviewNumPages(PRInt32 *aPrintPreviewNumPages) = 0;
  104. /**
  105. * Print the specified DOM window
  106. *
  107. * @param aThePrintSettings - Printer Settings for the print job, if aThePrintSettings is null
  108. * then the global PS will be used.
  109. * @param aWPListener - is updated during the print
  110. * @return void
  111. */
  112. /* void print (in nsIPrintSettings aThePrintSettings, in nsIWebProgressListener aWPListener); */
  113. NS_IMETHOD Print(nsIPrintSettings *aThePrintSettings, nsIWebProgressListener *aWPListener) = 0;
  114. /**
  115. * Print Preview the specified DOM window
  116. *
  117. * @param aThePrintSettings - Printer Settings for the print preview, if aThePrintSettings is null
  118. * then the global PS will be used.
  119. * @param aChildDOMWin - DOM Window of the child document to be PP (FrameSet frames)
  120. * @param aWPListener - is updated during the printpreview
  121. * @return void
  122. */
  123. /* void printPreview (in nsIPrintSettings aThePrintSettings, in nsIDOMWindow aChildDOMWin, in nsIWebProgressListener aWPListener); */
  124. NS_IMETHOD PrintPreview(nsIPrintSettings *aThePrintSettings, nsIDOMWindow *aChildDOMWin, nsIWebProgressListener *aWPListener) = 0;
  125. /**
  126. * Print Preview - Navigates within the window
  127. *
  128. * @param aNavType - navigation enum
  129. * @param aPageNum - page num to navigate to when aNavType = ePrintPreviewGoToPageNum
  130. * @return void
  131. */
  132. /* void printPreviewNavigate (in short aNavType, in long aPageNum); */
  133. NS_IMETHOD PrintPreviewNavigate(PRInt16 aNavType, PRInt32 aPageNum) = 0;
  134. /**
  135. * Cancels the current print
  136. * @return void
  137. */
  138. /* void cancel (); */
  139. NS_IMETHOD Cancel(void) = 0;
  140. /**
  141. * Returns an array of the names of all documents names (Title or URL)
  142. * and sub-documents. This will return a single item if the attr "isFramesetDocument" is false
  143. * and may return any number of items is "isFramesetDocument" is true
  144. *
  145. * @param aCount - returns number of printers returned
  146. * @param aResult - returns array of names
  147. * @return void
  148. */
  149. /* void enumerateDocumentNames (out PRUint32 aCount, [array, size_is (aCount), retval] out wstring aResult); */
  150. NS_IMETHOD EnumerateDocumentNames(PRUint32 *aCount, PRUnichar ***aResult) = 0;
  151. /**
  152. * This exists PrintPreview mode and returns browser window to galley mode
  153. * @return void
  154. */
  155. /* void exitPrintPreview (); */
  156. NS_IMETHOD ExitPrintPreview(void) = 0;
  157. };
  158. /* Use this macro when declaring classes that implement this interface. */
  159. #define NS_DECL_NSIWEBBROWSERPRINT \
  160. NS_IMETHOD GetGlobalPrintSettings(nsIPrintSettings * *aGlobalPrintSettings); \
  161. NS_IMETHOD GetCurrentPrintSettings(nsIPrintSettings * *aCurrentPrintSettings); \
  162. NS_IMETHOD GetCurrentChildDOMWindow(nsIDOMWindow * *aCurrentChildDOMWindow); \
  163. NS_IMETHOD GetDoingPrint(PRBool *aDoingPrint); \
  164. NS_IMETHOD GetDoingPrintPreview(PRBool *aDoingPrintPreview); \
  165. NS_IMETHOD GetIsFramesetDocument(PRBool *aIsFramesetDocument); \
  166. NS_IMETHOD GetIsFramesetFrameSelected(PRBool *aIsFramesetFrameSelected); \
  167. NS_IMETHOD GetIsIFrameSelected(PRBool *aIsIFrameSelected); \
  168. NS_IMETHOD GetIsRangeSelection(PRBool *aIsRangeSelection); \
  169. NS_IMETHOD GetPrintPreviewNumPages(PRInt32 *aPrintPreviewNumPages); \
  170. NS_IMETHOD Print(nsIPrintSettings *aThePrintSettings, nsIWebProgressListener *aWPListener); \
  171. NS_IMETHOD PrintPreview(nsIPrintSettings *aThePrintSettings, nsIDOMWindow *aChildDOMWin, nsIWebProgressListener *aWPListener); \
  172. NS_IMETHOD PrintPreviewNavigate(PRInt16 aNavType, PRInt32 aPageNum); \
  173. NS_IMETHOD Cancel(void); \
  174. NS_IMETHOD EnumerateDocumentNames(PRUint32 *aCount, PRUnichar ***aResult); \
  175. NS_IMETHOD ExitPrintPreview(void);
  176. /* Use this macro to declare functions that forward the behavior of this interface to another object. */
  177. #define NS_FORWARD_NSIWEBBROWSERPRINT(_to) \
  178. NS_IMETHOD GetGlobalPrintSettings(nsIPrintSettings * *aGlobalPrintSettings) { return _to GetGlobalPrintSettings(aGlobalPrintSettings); } \
  179. NS_IMETHOD GetCurrentPrintSettings(nsIPrintSettings * *aCurrentPrintSettings) { return _to GetCurrentPrintSettings(aCurrentPrintSettings); } \
  180. NS_IMETHOD GetCurrentChildDOMWindow(nsIDOMWindow * *aCurrentChildDOMWindow) { return _to GetCurrentChildDOMWindow(aCurrentChildDOMWindow); } \
  181. NS_IMETHOD GetDoingPrint(PRBool *aDoingPrint) { return _to GetDoingPrint(aDoingPrint); } \
  182. NS_IMETHOD GetDoingPrintPreview(PRBool *aDoingPrintPreview) { return _to GetDoingPrintPreview(aDoingPrintPreview); } \
  183. NS_IMETHOD GetIsFramesetDocument(PRBool *aIsFramesetDocument) { return _to GetIsFramesetDocument(aIsFramesetDocument); } \
  184. NS_IMETHOD GetIsFramesetFrameSelected(PRBool *aIsFramesetFrameSelected) { return _to GetIsFramesetFrameSelected(aIsFramesetFrameSelected); } \
  185. NS_IMETHOD GetIsIFrameSelected(PRBool *aIsIFrameSelected) { return _to GetIsIFrameSelected(aIsIFrameSelected); } \
  186. NS_IMETHOD GetIsRangeSelection(PRBool *aIsRangeSelection) { return _to GetIsRangeSelection(aIsRangeSelection); } \
  187. NS_IMETHOD GetPrintPreviewNumPages(PRInt32 *aPrintPreviewNumPages) { return _to GetPrintPreviewNumPages(aPrintPreviewNumPages); } \
  188. NS_IMETHOD Print(nsIPrintSettings *aThePrintSettings, nsIWebProgressListener *aWPListener) { return _to Print(aThePrintSettings, aWPListener); } \
  189. NS_IMETHOD PrintPreview(nsIPrintSettings *aThePrintSettings, nsIDOMWindow *aChildDOMWin, nsIWebProgressListener *aWPListener) { return _to PrintPreview(aThePrintSettings, aChildDOMWin, aWPListener); } \
  190. NS_IMETHOD PrintPreviewNavigate(PRInt16 aNavType, PRInt32 aPageNum) { return _to PrintPreviewNavigate(aNavType, aPageNum); } \
  191. NS_IMETHOD Cancel(void) { return _to Cancel(); } \
  192. NS_IMETHOD EnumerateDocumentNames(PRUint32 *aCount, PRUnichar ***aResult) { return _to EnumerateDocumentNames(aCount, aResult); } \
  193. NS_IMETHOD ExitPrintPreview(void) { return _to ExitPrintPreview(); }
  194. /* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
  195. #define NS_FORWARD_SAFE_NSIWEBBROWSERPRINT(_to) \
  196. NS_IMETHOD GetGlobalPrintSettings(nsIPrintSettings * *aGlobalPrintSettings) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetGlobalPrintSettings(aGlobalPrintSettings); } \
  197. NS_IMETHOD GetCurrentPrintSettings(nsIPrintSettings * *aCurrentPrintSettings) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetCurrentPrintSettings(aCurrentPrintSettings); } \
  198. NS_IMETHOD GetCurrentChildDOMWindow(nsIDOMWindow * *aCurrentChildDOMWindow) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetCurrentChildDOMWindow(aCurrentChildDOMWindow); } \
  199. NS_IMETHOD GetDoingPrint(PRBool *aDoingPrint) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetDoingPrint(aDoingPrint); } \
  200. NS_IMETHOD GetDoingPrintPreview(PRBool *aDoingPrintPreview) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetDoingPrintPreview(aDoingPrintPreview); } \
  201. NS_IMETHOD GetIsFramesetDocument(PRBool *aIsFramesetDocument) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetIsFramesetDocument(aIsFramesetDocument); } \
  202. NS_IMETHOD GetIsFramesetFrameSelected(PRBool *aIsFramesetFrameSelected) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetIsFramesetFrameSelected(aIsFramesetFrameSelected); } \
  203. NS_IMETHOD GetIsIFrameSelected(PRBool *aIsIFrameSelected) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetIsIFrameSelected(aIsIFrameSelected); } \
  204. NS_IMETHOD GetIsRangeSelection(PRBool *aIsRangeSelection) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetIsRangeSelection(aIsRangeSelection); } \
  205. NS_IMETHOD GetPrintPreviewNumPages(PRInt32 *aPrintPreviewNumPages) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetPrintPreviewNumPages(aPrintPreviewNumPages); } \
  206. NS_IMETHOD Print(nsIPrintSettings *aThePrintSettings, nsIWebProgressListener *aWPListener) { return !_to ? NS_ERROR_NULL_POINTER : _to->Print(aThePrintSettings, aWPListener); } \
  207. NS_IMETHOD PrintPreview(nsIPrintSettings *aThePrintSettings, nsIDOMWindow *aChildDOMWin, nsIWebProgressListener *aWPListener) { return !_to ? NS_ERROR_NULL_POINTER : _to->PrintPreview(aThePrintSettings, aChildDOMWin, aWPListener); } \
  208. NS_IMETHOD PrintPreviewNavigate(PRInt16 aNavType, PRInt32 aPageNum) { return !_to ? NS_ERROR_NULL_POINTER : _to->PrintPreviewNavigate(aNavType, aPageNum); } \
  209. NS_IMETHOD Cancel(void) { return !_to ? NS_ERROR_NULL_POINTER : _to->Cancel(); } \
  210. NS_IMETHOD EnumerateDocumentNames(PRUint32 *aCount, PRUnichar ***aResult) { return !_to ? NS_ERROR_NULL_POINTER : _to->EnumerateDocumentNames(aCount, aResult); } \
  211. NS_IMETHOD ExitPrintPreview(void) { return !_to ? NS_ERROR_NULL_POINTER : _to->ExitPrintPreview(); }
  212. #if 0
  213. /* Use the code below as a template for the implementation class for this interface. */
  214. /* Header file */
  215. class nsWebBrowserPrint : public nsIWebBrowserPrint
  216. {
  217. public:
  218. NS_DECL_ISUPPORTS
  219. NS_DECL_NSIWEBBROWSERPRINT
  220. nsWebBrowserPrint();
  221. private:
  222. ~nsWebBrowserPrint();
  223. protected:
  224. /* additional members */
  225. };
  226. /* Implementation file */
  227. NS_IMPL_ISUPPORTS1(nsWebBrowserPrint, nsIWebBrowserPrint)
  228. nsWebBrowserPrint::nsWebBrowserPrint()
  229. {
  230. /* member initializers and constructor code */
  231. }
  232. nsWebBrowserPrint::~nsWebBrowserPrint()
  233. {
  234. /* destructor code */
  235. }
  236. /* readonly attribute nsIPrintSettings globalPrintSettings; */
  237. NS_IMETHODIMP nsWebBrowserPrint::GetGlobalPrintSettings(nsIPrintSettings * *aGlobalPrintSettings)
  238. {
  239. return NS_ERROR_NOT_IMPLEMENTED;
  240. }
  241. /* readonly attribute nsIPrintSettings currentPrintSettings; */
  242. NS_IMETHODIMP nsWebBrowserPrint::GetCurrentPrintSettings(nsIPrintSettings * *aCurrentPrintSettings)
  243. {
  244. return NS_ERROR_NOT_IMPLEMENTED;
  245. }
  246. /* readonly attribute nsIDOMWindow currentChildDOMWindow; */
  247. NS_IMETHODIMP nsWebBrowserPrint::GetCurrentChildDOMWindow(nsIDOMWindow * *aCurrentChildDOMWindow)
  248. {
  249. return NS_ERROR_NOT_IMPLEMENTED;
  250. }
  251. /* readonly attribute boolean doingPrint; */
  252. NS_IMETHODIMP nsWebBrowserPrint::GetDoingPrint(PRBool *aDoingPrint)
  253. {
  254. return NS_ERROR_NOT_IMPLEMENTED;
  255. }
  256. /* readonly attribute boolean doingPrintPreview; */
  257. NS_IMETHODIMP nsWebBrowserPrint::GetDoingPrintPreview(PRBool *aDoingPrintPreview)
  258. {
  259. return NS_ERROR_NOT_IMPLEMENTED;
  260. }
  261. /* readonly attribute boolean isFramesetDocument; */
  262. NS_IMETHODIMP nsWebBrowserPrint::GetIsFramesetDocument(PRBool *aIsFramesetDocument)
  263. {
  264. return NS_ERROR_NOT_IMPLEMENTED;
  265. }
  266. /* readonly attribute boolean isFramesetFrameSelected; */
  267. NS_IMETHODIMP nsWebBrowserPrint::GetIsFramesetFrameSelected(PRBool *aIsFramesetFrameSelected)
  268. {
  269. return NS_ERROR_NOT_IMPLEMENTED;
  270. }
  271. /* readonly attribute boolean isIFrameSelected; */
  272. NS_IMETHODIMP nsWebBrowserPrint::GetIsIFrameSelected(PRBool *aIsIFrameSelected)
  273. {
  274. return NS_ERROR_NOT_IMPLEMENTED;
  275. }
  276. /* readonly attribute boolean isRangeSelection; */
  277. NS_IMETHODIMP nsWebBrowserPrint::GetIsRangeSelection(PRBool *aIsRangeSelection)
  278. {
  279. return NS_ERROR_NOT_IMPLEMENTED;
  280. }
  281. /* readonly attribute long printPreviewNumPages; */
  282. NS_IMETHODIMP nsWebBrowserPrint::GetPrintPreviewNumPages(PRInt32 *aPrintPreviewNumPages)
  283. {
  284. return NS_ERROR_NOT_IMPLEMENTED;
  285. }
  286. /* void print (in nsIPrintSettings aThePrintSettings, in nsIWebProgressListener aWPListener); */
  287. NS_IMETHODIMP nsWebBrowserPrint::Print(nsIPrintSettings *aThePrintSettings, nsIWebProgressListener *aWPListener)
  288. {
  289. return NS_ERROR_NOT_IMPLEMENTED;
  290. }
  291. /* void printPreview (in nsIPrintSettings aThePrintSettings, in nsIDOMWindow aChildDOMWin, in nsIWebProgressListener aWPListener); */
  292. NS_IMETHODIMP nsWebBrowserPrint::PrintPreview(nsIPrintSettings *aThePrintSettings, nsIDOMWindow *aChildDOMWin, nsIWebProgressListener *aWPListener)
  293. {
  294. return NS_ERROR_NOT_IMPLEMENTED;
  295. }
  296. /* void printPreviewNavigate (in short aNavType, in long aPageNum); */
  297. NS_IMETHODIMP nsWebBrowserPrint::PrintPreviewNavigate(PRInt16 aNavType, PRInt32 aPageNum)
  298. {
  299. return NS_ERROR_NOT_IMPLEMENTED;
  300. }
  301. /* void cancel (); */
  302. NS_IMETHODIMP nsWebBrowserPrint::Cancel()
  303. {
  304. return NS_ERROR_NOT_IMPLEMENTED;
  305. }
  306. /* void enumerateDocumentNames (out PRUint32 aCount, [array, size_is (aCount), retval] out wstring aResult); */
  307. NS_IMETHODIMP nsWebBrowserPrint::EnumerateDocumentNames(PRUint32 *aCount, PRUnichar ***aResult)
  308. {
  309. return NS_ERROR_NOT_IMPLEMENTED;
  310. }
  311. /* void exitPrintPreview (); */
  312. NS_IMETHODIMP nsWebBrowserPrint::ExitPrintPreview()
  313. {
  314. return NS_ERROR_NOT_IMPLEMENTED;
  315. }
  316. /* End of implementation class template. */
  317. #endif
  318. #endif /* __gen_nsIWebBrowserPrint_h__ */