PageRenderTime 50ms CodeModel.GetById 21ms RepoModel.GetById 0ms app.codeStats 0ms

/mozilla/mozilla/dist/include/webbrowserpersist/nsIWebBrowserPersist.h

http://kmbrasil.codeplex.com
C++ Header | 442 lines | 160 code | 80 blank | 202 comment | 0 complexity | 9dd203daef92669457b10c4f9e5c55a4 MD5 | raw file
Possible License(s): MPL-2.0-no-copyleft-exception, GPL-2.0
  1. /*
  2. * DO NOT EDIT. THIS FILE IS GENERATED FROM h:/projects/mozilla/mozilla/embedding/components/webbrowserpersist/public/nsIWebBrowserPersist.idl
  3. */
  4. #ifndef __gen_nsIWebBrowserPersist_h__
  5. #define __gen_nsIWebBrowserPersist_h__
  6. #ifndef __gen_nsICancelable_h__
  7. #include "nsICancelable.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 nsIURI; /* forward declaration */
  14. class nsIInputStream; /* forward declaration */
  15. class nsIDOMDocument; /* forward declaration */
  16. class nsIWebProgressListener; /* forward declaration */
  17. class nsILocalFile; /* forward declaration */
  18. class nsIChannel; /* forward declaration */
  19. /* starting interface: nsIWebBrowserPersist */
  20. #define NS_IWEBBROWSERPERSIST_IID_STR "dd4e0a6a-210f-419a-ad85-40e8543b9465"
  21. #define NS_IWEBBROWSERPERSIST_IID \
  22. {0xdd4e0a6a, 0x210f, 0x419a, \
  23. { 0xad, 0x85, 0x40, 0xe8, 0x54, 0x3b, 0x94, 0x65 }}
  24. /**
  25. * Interface for persisting DOM documents and URIs to local or remote storage.
  26. *
  27. * @status UNDER_REVIEW
  28. */
  29. class NS_NO_VTABLE nsIWebBrowserPersist : public nsICancelable {
  30. public:
  31. NS_DEFINE_STATIC_IID_ACCESSOR(NS_IWEBBROWSERPERSIST_IID)
  32. /** No special persistence behaviour. */
  33. enum { PERSIST_FLAGS_NONE = 0U };
  34. /** Only use cached data (could result in failure if data is not cached). */
  35. enum { PERSIST_FLAGS_FROM_CACHE = 1U };
  36. /** Bypass the cached data. */
  37. enum { PERSIST_FLAGS_BYPASS_CACHE = 2U };
  38. /** Ignore any redirected data (usually adverts). */
  39. enum { PERSIST_FLAGS_IGNORE_REDIRECTED_DATA = 4U };
  40. /** Ignore IFRAME content (usually adverts). */
  41. enum { PERSIST_FLAGS_IGNORE_IFRAMES = 8U };
  42. /** Do not run the incoming data through a content converter e.g. to decompress it */
  43. enum { PERSIST_FLAGS_NO_CONVERSION = 16U };
  44. /** Replace existing files on the disk (use with due diligence!) */
  45. enum { PERSIST_FLAGS_REPLACE_EXISTING_FILES = 32U };
  46. /** Don't modify or add base tags */
  47. enum { PERSIST_FLAGS_NO_BASE_TAG_MODIFICATIONS = 64U };
  48. /** Make changes to original dom rather than cloning nodes */
  49. enum { PERSIST_FLAGS_FIXUP_ORIGINAL_DOM = 128U };
  50. /** Fix links relative to destination location (not origin) */
  51. enum { PERSIST_FLAGS_FIXUP_LINKS_TO_DESTINATION = 256U };
  52. /** Don't make any adjustments to links */
  53. enum { PERSIST_FLAGS_DONT_FIXUP_LINKS = 512U };
  54. /** Force serialization of output (one file at a time; not concurrent) */
  55. enum { PERSIST_FLAGS_SERIALIZE_OUTPUT = 1024U };
  56. /** Don't make any adjustments to filenames */
  57. enum { PERSIST_FLAGS_DONT_CHANGE_FILENAMES = 2048U };
  58. /** Fail on broken inline links */
  59. enum { PERSIST_FLAGS_FAIL_ON_BROKEN_LINKS = 4096U };
  60. /**
  61. * Automatically cleanup after a failed or cancelled operation, deleting all
  62. * created files and directories. This flag does nothing for failed upload
  63. * operations to remote servers.
  64. */
  65. enum { PERSIST_FLAGS_CLEANUP_ON_FAILURE = 8192U };
  66. /**
  67. * Let the WebBrowserPersist decide whether the incoming data is encoded
  68. * and whether it needs to go through a content converter e.g. to
  69. * decompress it.
  70. */
  71. enum { PERSIST_FLAGS_AUTODETECT_APPLY_CONVERSION = 16384U };
  72. /**
  73. * Flags governing how data is fetched and saved from the network.
  74. * It is best to set this value explicitly unless you are prepared
  75. * to accept the default values.
  76. */
  77. /* attribute unsigned long persistFlags; */
  78. NS_IMETHOD GetPersistFlags(PRUint32 *aPersistFlags) = 0;
  79. NS_IMETHOD SetPersistFlags(PRUint32 aPersistFlags) = 0;
  80. /** Persister is ready to save data */
  81. enum { PERSIST_STATE_READY = 1U };
  82. /** Persister is saving data */
  83. enum { PERSIST_STATE_SAVING = 2U };
  84. /** Persister has finished saving data */
  85. enum { PERSIST_STATE_FINISHED = 3U };
  86. /**
  87. * Current state of the persister object.
  88. */
  89. /* readonly attribute unsigned long currentState; */
  90. NS_IMETHOD GetCurrentState(PRUint32 *aCurrentState) = 0;
  91. /**
  92. * Value indicating the success or failure of the persist
  93. * operation.
  94. *
  95. * @return NS_OK Operation was successful or is still ongoing.
  96. * @return NS_BINDING_ABORTED Operation cancelled.
  97. * @return NS_ERROR_FAILURE Non-specific failure.
  98. */
  99. /* readonly attribute unsigned long result; */
  100. NS_IMETHOD GetResult(PRUint32 *aResult) = 0;
  101. /**
  102. * Callback listener for progress notifications. The object that the
  103. * embbedder supplies may also implement nsIInterfaceRequestor and be
  104. * prepared to return nsIAuthPrompt or other interfaces that may be required
  105. * to download data.
  106. *
  107. * @see nsIAuthPrompt
  108. * @see nsIInterfaceRequestor
  109. */
  110. /* attribute nsIWebProgressListener progressListener; */
  111. NS_IMETHOD GetProgressListener(nsIWebProgressListener * *aProgressListener) = 0;
  112. NS_IMETHOD SetProgressListener(nsIWebProgressListener * aProgressListener) = 0;
  113. /**
  114. * Save the specified URI to file.
  115. *
  116. * @param aURI URI to save to file. Some implementations of this interface
  117. * may also support <CODE>nsnull</CODE> to imply the currently
  118. * loaded URI.
  119. * @param aCacheKey An object representing the URI in the cache or
  120. * <CODE>nsnull</CODE>.
  121. * @param aReferrer The referrer URI to pass with an HTTP request or
  122. * <CODE>nsnull</CODE>.
  123. * @param aPostData Post data to pass with an HTTP request or
  124. * <CODE>nsnull</CODE>.
  125. * @param aExtraHeaders Additional headers to supply with an HTTP request
  126. * or <CODE>nsnull</CODE>.
  127. * @param aFile Target file. This may be a nsILocalFile object or an
  128. * nsIURI object with a file scheme or a scheme that
  129. * supports uploading (e.g. ftp).
  130. *
  131. * @see nsILocalFile
  132. * @see nsIURI
  133. * @see nsIInputStream
  134. *
  135. * @return NS_OK Operation has been started.
  136. * @return NS_ERROR_INVALID_ARG One or more arguments was invalid.
  137. */
  138. /* void saveURI (in nsIURI aURI, in nsISupports aCacheKey, in nsIURI aReferrer, in nsIInputStream aPostData, in string aExtraHeaders, in nsISupports aFile); */
  139. NS_IMETHOD SaveURI(nsIURI *aURI, nsISupports *aCacheKey, nsIURI *aReferrer, nsIInputStream *aPostData, const char *aExtraHeaders, nsISupports *aFile) = 0;
  140. /**
  141. * Save a channel to a file. It must not be opened yet.
  142. * @see saveURI
  143. */
  144. /* void saveChannel (in nsIChannel aChannel, in nsISupports aFile); */
  145. NS_IMETHOD SaveChannel(nsIChannel *aChannel, nsISupports *aFile) = 0;
  146. /** Output only the current selection as opposed to the whole document. */
  147. enum { ENCODE_FLAGS_SELECTION_ONLY = 1U };
  148. /**
  149. * For plaintext output. Convert html to plaintext that looks like the html.
  150. * Implies wrap (except inside &lt;pre&gt;), since html wraps.
  151. * HTML output: always do prettyprinting, ignoring existing formatting.
  152. */
  153. enum { ENCODE_FLAGS_FORMATTED = 2U };
  154. /**
  155. * Output without formatting or wrapping the content. This flag
  156. * may be used to preserve the original formatting as much as possible.
  157. */
  158. enum { ENCODE_FLAGS_RAW = 4U };
  159. /** Output only the body section, no HTML tags. */
  160. enum { ENCODE_FLAGS_BODY_ONLY = 8U };
  161. /** Wrap even if when not doing formatted output (e.g. for text fields). */
  162. enum { ENCODE_FLAGS_PREFORMATTED = 16U };
  163. /** Wrap documents at the specified column. */
  164. enum { ENCODE_FLAGS_WRAP = 32U };
  165. /**
  166. * For plaintext output. Output for format flowed (RFC 2646). This is used
  167. * when converting to text for mail sending. This differs just slightly
  168. * but in an important way from normal formatted, and that is that
  169. * lines are space stuffed. This can't (correctly) be done later.
  170. */
  171. enum { ENCODE_FLAGS_FORMAT_FLOWED = 64U };
  172. /** Convert links to absolute links where possible. */
  173. enum { ENCODE_FLAGS_ABSOLUTE_LINKS = 128U };
  174. /**
  175. * Attempt to encode entities standardized at W3C (HTML, MathML, etc).
  176. * This is a catch-all flag for documents with mixed contents. Beware of
  177. * interoperability issues. See below for other flags which might likely
  178. * do what you want.
  179. */
  180. enum { ENCODE_FLAGS_ENCODE_W3C_ENTITIES = 256U };
  181. /**
  182. * Output with carriage return line breaks. May also be combined with
  183. * ENCODE_FLAGS_LF_LINEBREAKS and if neither is specified, the platform
  184. * default format is used.
  185. */
  186. enum { ENCODE_FLAGS_CR_LINEBREAKS = 512U };
  187. /**
  188. * Output with linefeed line breaks. May also be combined with
  189. * ENCODE_FLAGS_CR_LINEBREAKS and if neither is specified, the platform
  190. * default format is used.
  191. */
  192. enum { ENCODE_FLAGS_LF_LINEBREAKS = 1024U };
  193. /** For plaintext output. Output the content of noscript elements. */
  194. enum { ENCODE_FLAGS_NOSCRIPT_CONTENT = 2048U };
  195. /** For plaintext output. Output the content of noframes elements. */
  196. enum { ENCODE_FLAGS_NOFRAMES_CONTENT = 4096U };
  197. /**
  198. * Encode basic entities, e.g. output &nbsp; instead of character code 0xa0.
  199. * The basic set is just &nbsp; &amp; &lt; &gt; &quot; for interoperability
  200. * with older products that don't support &alpha; and friends.
  201. */
  202. enum { ENCODE_FLAGS_ENCODE_BASIC_ENTITIES = 8192U };
  203. /**
  204. * Encode Latin1 entities. This includes the basic set and
  205. * accented letters between 128 and 255.
  206. */
  207. enum { ENCODE_FLAGS_ENCODE_LATIN1_ENTITIES = 16384U };
  208. /**
  209. * Encode HTML4 entities. This includes the basic set, accented
  210. * letters, greek letters and certain special markup symbols.
  211. */
  212. enum { ENCODE_FLAGS_ENCODE_HTML_ENTITIES = 32768U };
  213. /**
  214. * Save the specified DOM document to file and optionally all linked files
  215. * (e.g. images, CSS, JS & subframes). Do not call this method until the
  216. * document has finished loading!
  217. *
  218. * @param aDocument Document to save to file. Some implementations of
  219. * this interface may also support <CODE>nsnull</CODE>
  220. * to imply the currently loaded document.
  221. * @param aFile Target local file. This may be a nsILocalFile object or an
  222. * nsIURI object with a file scheme or a scheme that
  223. * supports uploading (e.g. ftp).
  224. * @param aDataPath Path to directory where URIs linked to the document
  225. * are saved or nsnull if no linked URIs should be saved.
  226. * This may be a nsILocalFile object or an nsIURI object
  227. * with a file scheme.
  228. * @param aOutputContentType The desired MIME type format to save the
  229. * document and all subdocuments into or nsnull to use
  230. * the default behaviour.
  231. * @param aEncodingFlags Flags to pass to the encoder.
  232. * @param aWrapColumn For text documents, indicates the desired width to
  233. * wrap text at. Parameter is ignored if wrapping is not
  234. * specified by the encoding flags.
  235. *
  236. * @see nsILocalFile
  237. * @see nsIURI
  238. *
  239. * @return NS_OK Operation has been started.
  240. * @return NS_ERROR_INVALID_ARG One or more arguments was invalid.
  241. */
  242. /* void saveDocument (in nsIDOMDocument aDocument, in nsISupports aFile, in nsISupports aDataPath, in string aOutputContentType, in unsigned long aEncodingFlags, in unsigned long aWrapColumn); */
  243. NS_IMETHOD SaveDocument(nsIDOMDocument *aDocument, nsISupports *aFile, nsISupports *aDataPath, const char *aOutputContentType, PRUint32 aEncodingFlags, PRUint32 aWrapColumn) = 0;
  244. /**
  245. * Cancels the current operation. The caller is responsible for cleaning up
  246. * partially written files or directories. This has the same effect as calling
  247. * cancel with an argument of NS_BINDING_ABORTED.
  248. */
  249. /* void cancelSave (); */
  250. NS_IMETHOD CancelSave(void) = 0;
  251. };
  252. /* Use this macro when declaring classes that implement this interface. */
  253. #define NS_DECL_NSIWEBBROWSERPERSIST \
  254. NS_IMETHOD GetPersistFlags(PRUint32 *aPersistFlags); \
  255. NS_IMETHOD SetPersistFlags(PRUint32 aPersistFlags); \
  256. NS_IMETHOD GetCurrentState(PRUint32 *aCurrentState); \
  257. NS_IMETHOD GetResult(PRUint32 *aResult); \
  258. NS_IMETHOD GetProgressListener(nsIWebProgressListener * *aProgressListener); \
  259. NS_IMETHOD SetProgressListener(nsIWebProgressListener * aProgressListener); \
  260. NS_IMETHOD SaveURI(nsIURI *aURI, nsISupports *aCacheKey, nsIURI *aReferrer, nsIInputStream *aPostData, const char *aExtraHeaders, nsISupports *aFile); \
  261. NS_IMETHOD SaveChannel(nsIChannel *aChannel, nsISupports *aFile); \
  262. NS_IMETHOD SaveDocument(nsIDOMDocument *aDocument, nsISupports *aFile, nsISupports *aDataPath, const char *aOutputContentType, PRUint32 aEncodingFlags, PRUint32 aWrapColumn); \
  263. NS_IMETHOD CancelSave(void);
  264. /* Use this macro to declare functions that forward the behavior of this interface to another object. */
  265. #define NS_FORWARD_NSIWEBBROWSERPERSIST(_to) \
  266. NS_IMETHOD GetPersistFlags(PRUint32 *aPersistFlags) { return _to GetPersistFlags(aPersistFlags); } \
  267. NS_IMETHOD SetPersistFlags(PRUint32 aPersistFlags) { return _to SetPersistFlags(aPersistFlags); } \
  268. NS_IMETHOD GetCurrentState(PRUint32 *aCurrentState) { return _to GetCurrentState(aCurrentState); } \
  269. NS_IMETHOD GetResult(PRUint32 *aResult) { return _to GetResult(aResult); } \
  270. NS_IMETHOD GetProgressListener(nsIWebProgressListener * *aProgressListener) { return _to GetProgressListener(aProgressListener); } \
  271. NS_IMETHOD SetProgressListener(nsIWebProgressListener * aProgressListener) { return _to SetProgressListener(aProgressListener); } \
  272. NS_IMETHOD SaveURI(nsIURI *aURI, nsISupports *aCacheKey, nsIURI *aReferrer, nsIInputStream *aPostData, const char *aExtraHeaders, nsISupports *aFile) { return _to SaveURI(aURI, aCacheKey, aReferrer, aPostData, aExtraHeaders, aFile); } \
  273. NS_IMETHOD SaveChannel(nsIChannel *aChannel, nsISupports *aFile) { return _to SaveChannel(aChannel, aFile); } \
  274. NS_IMETHOD SaveDocument(nsIDOMDocument *aDocument, nsISupports *aFile, nsISupports *aDataPath, const char *aOutputContentType, PRUint32 aEncodingFlags, PRUint32 aWrapColumn) { return _to SaveDocument(aDocument, aFile, aDataPath, aOutputContentType, aEncodingFlags, aWrapColumn); } \
  275. NS_IMETHOD CancelSave(void) { return _to CancelSave(); }
  276. /* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
  277. #define NS_FORWARD_SAFE_NSIWEBBROWSERPERSIST(_to) \
  278. NS_IMETHOD GetPersistFlags(PRUint32 *aPersistFlags) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetPersistFlags(aPersistFlags); } \
  279. NS_IMETHOD SetPersistFlags(PRUint32 aPersistFlags) { return !_to ? NS_ERROR_NULL_POINTER : _to->SetPersistFlags(aPersistFlags); } \
  280. NS_IMETHOD GetCurrentState(PRUint32 *aCurrentState) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetCurrentState(aCurrentState); } \
  281. NS_IMETHOD GetResult(PRUint32 *aResult) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetResult(aResult); } \
  282. NS_IMETHOD GetProgressListener(nsIWebProgressListener * *aProgressListener) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetProgressListener(aProgressListener); } \
  283. NS_IMETHOD SetProgressListener(nsIWebProgressListener * aProgressListener) { return !_to ? NS_ERROR_NULL_POINTER : _to->SetProgressListener(aProgressListener); } \
  284. NS_IMETHOD SaveURI(nsIURI *aURI, nsISupports *aCacheKey, nsIURI *aReferrer, nsIInputStream *aPostData, const char *aExtraHeaders, nsISupports *aFile) { return !_to ? NS_ERROR_NULL_POINTER : _to->SaveURI(aURI, aCacheKey, aReferrer, aPostData, aExtraHeaders, aFile); } \
  285. NS_IMETHOD SaveChannel(nsIChannel *aChannel, nsISupports *aFile) { return !_to ? NS_ERROR_NULL_POINTER : _to->SaveChannel(aChannel, aFile); } \
  286. NS_IMETHOD SaveDocument(nsIDOMDocument *aDocument, nsISupports *aFile, nsISupports *aDataPath, const char *aOutputContentType, PRUint32 aEncodingFlags, PRUint32 aWrapColumn) { return !_to ? NS_ERROR_NULL_POINTER : _to->SaveDocument(aDocument, aFile, aDataPath, aOutputContentType, aEncodingFlags, aWrapColumn); } \
  287. NS_IMETHOD CancelSave(void) { return !_to ? NS_ERROR_NULL_POINTER : _to->CancelSave(); }
  288. #if 0
  289. /* Use the code below as a template for the implementation class for this interface. */
  290. /* Header file */
  291. class nsWebBrowserPersist : public nsIWebBrowserPersist
  292. {
  293. public:
  294. NS_DECL_ISUPPORTS
  295. NS_DECL_NSIWEBBROWSERPERSIST
  296. nsWebBrowserPersist();
  297. private:
  298. ~nsWebBrowserPersist();
  299. protected:
  300. /* additional members */
  301. };
  302. /* Implementation file */
  303. NS_IMPL_ISUPPORTS1(nsWebBrowserPersist, nsIWebBrowserPersist)
  304. nsWebBrowserPersist::nsWebBrowserPersist()
  305. {
  306. /* member initializers and constructor code */
  307. }
  308. nsWebBrowserPersist::~nsWebBrowserPersist()
  309. {
  310. /* destructor code */
  311. }
  312. /* attribute unsigned long persistFlags; */
  313. NS_IMETHODIMP nsWebBrowserPersist::GetPersistFlags(PRUint32 *aPersistFlags)
  314. {
  315. return NS_ERROR_NOT_IMPLEMENTED;
  316. }
  317. NS_IMETHODIMP nsWebBrowserPersist::SetPersistFlags(PRUint32 aPersistFlags)
  318. {
  319. return NS_ERROR_NOT_IMPLEMENTED;
  320. }
  321. /* readonly attribute unsigned long currentState; */
  322. NS_IMETHODIMP nsWebBrowserPersist::GetCurrentState(PRUint32 *aCurrentState)
  323. {
  324. return NS_ERROR_NOT_IMPLEMENTED;
  325. }
  326. /* readonly attribute unsigned long result; */
  327. NS_IMETHODIMP nsWebBrowserPersist::GetResult(PRUint32 *aResult)
  328. {
  329. return NS_ERROR_NOT_IMPLEMENTED;
  330. }
  331. /* attribute nsIWebProgressListener progressListener; */
  332. NS_IMETHODIMP nsWebBrowserPersist::GetProgressListener(nsIWebProgressListener * *aProgressListener)
  333. {
  334. return NS_ERROR_NOT_IMPLEMENTED;
  335. }
  336. NS_IMETHODIMP nsWebBrowserPersist::SetProgressListener(nsIWebProgressListener * aProgressListener)
  337. {
  338. return NS_ERROR_NOT_IMPLEMENTED;
  339. }
  340. /* void saveURI (in nsIURI aURI, in nsISupports aCacheKey, in nsIURI aReferrer, in nsIInputStream aPostData, in string aExtraHeaders, in nsISupports aFile); */
  341. NS_IMETHODIMP nsWebBrowserPersist::SaveURI(nsIURI *aURI, nsISupports *aCacheKey, nsIURI *aReferrer, nsIInputStream *aPostData, const char *aExtraHeaders, nsISupports *aFile)
  342. {
  343. return NS_ERROR_NOT_IMPLEMENTED;
  344. }
  345. /* void saveChannel (in nsIChannel aChannel, in nsISupports aFile); */
  346. NS_IMETHODIMP nsWebBrowserPersist::SaveChannel(nsIChannel *aChannel, nsISupports *aFile)
  347. {
  348. return NS_ERROR_NOT_IMPLEMENTED;
  349. }
  350. /* void saveDocument (in nsIDOMDocument aDocument, in nsISupports aFile, in nsISupports aDataPath, in string aOutputContentType, in unsigned long aEncodingFlags, in unsigned long aWrapColumn); */
  351. NS_IMETHODIMP nsWebBrowserPersist::SaveDocument(nsIDOMDocument *aDocument, nsISupports *aFile, nsISupports *aDataPath, const char *aOutputContentType, PRUint32 aEncodingFlags, PRUint32 aWrapColumn)
  352. {
  353. return NS_ERROR_NOT_IMPLEMENTED;
  354. }
  355. /* void cancelSave (); */
  356. NS_IMETHODIMP nsWebBrowserPersist::CancelSave()
  357. {
  358. return NS_ERROR_NOT_IMPLEMENTED;
  359. }
  360. /* End of implementation class template. */
  361. #endif
  362. #endif /* __gen_nsIWebBrowserPersist_h__ */