Back to index

lightning-sunbird  0.9+nobinonly
Public Member Functions | Public Attributes
nsIWebBrowserPersist Interface Reference

Interface for persisting DOM documents and URIs to local or remote storage. More...

import "nsIWebBrowserPersist.idl";

Inheritance diagram for nsIWebBrowserPersist:
Inheritance graph
[legend]
Collaboration diagram for nsIWebBrowserPersist:
Collaboration graph
[legend]

List of all members.

Public Member Functions

void saveURI (in nsIURI aURI, in nsISupports aCacheKey, in nsIURI aReferrer, in nsIInputStream aPostData, in string aExtraHeaders, in nsISupports aFile)
 Save the specified URI to file.
void saveChannel (in nsIChannel aChannel, in nsISupports aFile)
 Save a channel to a file.
void saveDocument (in nsIDOMDocument aDocument, in nsISupports aFile, in nsISupports aDataPath, in string aOutputContentType, in unsigned long aEncodingFlags, in unsigned long aWrapColumn)
 Save the specified DOM document to file and optionally all linked files (e.g.
void cancelSave ()
 Cancels the current operation.
void cancel (in nsresult aReason)
 Call this method to request that this object abort whatever operation it may be performing.

Public Attributes

const unsigned long PERSIST_FLAGS_NONE = 0
 No special persistence behaviour.
const unsigned long PERSIST_FLAGS_FROM_CACHE = 1
 Only use cached data (could result in failure if data is not cached).
const unsigned long PERSIST_FLAGS_BYPASS_CACHE = 2
 Bypass the cached data.
const unsigned long PERSIST_FLAGS_IGNORE_REDIRECTED_DATA = 4
 Ignore any redirected data (usually adverts).
const unsigned long PERSIST_FLAGS_IGNORE_IFRAMES = 8
 Ignore IFRAME content (usually adverts).
const unsigned long PERSIST_FLAGS_NO_CONVERSION = 16
 Do not run the incoming data through a content converter e.g.
const unsigned long PERSIST_FLAGS_REPLACE_EXISTING_FILES = 32
 Replace existing files on the disk (use with due diligence!)
const unsigned long PERSIST_FLAGS_NO_BASE_TAG_MODIFICATIONS = 64
 Don't modify or add base tags.
const unsigned long PERSIST_FLAGS_FIXUP_ORIGINAL_DOM = 128
 Make changes to original dom rather than cloning nodes.
const unsigned long PERSIST_FLAGS_FIXUP_LINKS_TO_DESTINATION = 256
 Fix links relative to destination location (not origin)
const unsigned long PERSIST_FLAGS_DONT_FIXUP_LINKS = 512
 Don't make any adjustments to links.
const unsigned long PERSIST_FLAGS_SERIALIZE_OUTPUT = 1024
 Force serialization of output (one file at a time; not concurrent)
const unsigned long PERSIST_FLAGS_DONT_CHANGE_FILENAMES = 2048
 Don't make any adjustments to filenames.
const unsigned long PERSIST_FLAGS_FAIL_ON_BROKEN_LINKS = 4096
 Fail on broken inline links.
const unsigned long PERSIST_FLAGS_CLEANUP_ON_FAILURE = 8192
 Automatically cleanup after a failed or cancelled operation, deleting all created files and directories.
const unsigned long PERSIST_FLAGS_AUTODETECT_APPLY_CONVERSION = 16384
 Let the WebBrowserPersist decide whether the incoming data is encoded and whether it needs to go through a content converter e.g.
attribute unsigned long persistFlags
 Flags governing how data is fetched and saved from the network.
const unsigned long PERSIST_STATE_READY = 1
 Persister is ready to save data.
const unsigned long PERSIST_STATE_SAVING = 2
 Persister is saving data.
const unsigned long PERSIST_STATE_FINISHED = 3
 Persister has finished saving data.
readonly attribute unsigned long currentState
 Current state of the persister object.
readonly attribute unsigned long result
 Value indicating the success or failure of the persist operation.
attribute nsIWebProgressListener progressListener
 Callback listener for progress notifications.
const unsigned long ENCODE_FLAGS_SELECTION_ONLY = 1
 Output only the current selection as opposed to the whole document.
const unsigned long ENCODE_FLAGS_FORMATTED = 2
 For plaintext output.
const unsigned long ENCODE_FLAGS_RAW = 4
 Output without formatting or wrapping the content.
const unsigned long ENCODE_FLAGS_BODY_ONLY = 8
 Output only the body section, no HTML tags.
const unsigned long ENCODE_FLAGS_PREFORMATTED = 16
 Wrap even if when not doing formatted output (e.g.
const unsigned long ENCODE_FLAGS_WRAP = 32
 Wrap documents at the specified column.
const unsigned long ENCODE_FLAGS_FORMAT_FLOWED = 64
 For plaintext output.
const unsigned long ENCODE_FLAGS_ABSOLUTE_LINKS = 128
 Convert links to absolute links where possible.
const unsigned long ENCODE_FLAGS_ENCODE_W3C_ENTITIES = 256
 Attempt to encode entities standardized at W3C (HTML, MathML, etc).
const unsigned long ENCODE_FLAGS_CR_LINEBREAKS = 512
 Output with carriage return line breaks.
const unsigned long ENCODE_FLAGS_LF_LINEBREAKS = 1024
 Output with linefeed line breaks.
const unsigned long ENCODE_FLAGS_NOSCRIPT_CONTENT = 2048
 For plaintext output.
const unsigned long ENCODE_FLAGS_NOFRAMES_CONTENT = 4096
 For plaintext output.
const unsigned long ENCODE_FLAGS_ENCODE_BASIC_ENTITIES = 8192
 Encode basic entities, e.g.
const unsigned long ENCODE_FLAGS_ENCODE_LATIN1_ENTITIES = 16384
 Encode Latin1 entities.
const unsigned long ENCODE_FLAGS_ENCODE_HTML_ENTITIES = 32768
 Encode HTML4 entities.

Detailed Description

Interface for persisting DOM documents and URIs to local or remote storage.

UNDER_REVIEW

Definition at line 55 of file nsIWebBrowserPersist.idl.


Member Function Documentation

void nsICancelable::cancel ( in nsresult  aReason) [inherited]

Call this method to request that this object abort whatever operation it may be performing.

Parameters:
aReasonPass a failure code to indicate the reason why this operation is being canceled. It is an error to pass a success code.

Cancels the current operation.

The caller is responsible for cleaning up partially written files or directories. This has the same effect as calling cancel with an argument of NS_BINDING_ABORTED.

void nsIWebBrowserPersist::saveChannel ( in nsIChannel  aChannel,
in nsISupports  aFile 
)

Save a channel to a file.

It must not be opened yet.

See also:
saveURI
void nsIWebBrowserPersist::saveDocument ( in nsIDOMDocument  aDocument,
in nsISupports  aFile,
in nsISupports  aDataPath,
in string  aOutputContentType,
in unsigned long  aEncodingFlags,
in unsigned long  aWrapColumn 
)

Save the specified DOM document to file and optionally all linked files (e.g.

images, CSS, JS & subframes). Do not call this method until the document has finished loading!

Parameters:
aDocumentDocument to save to file. Some implementations of this interface may also support nsnull to imply the currently loaded document.
aFileTarget local file. This may be a nsILocalFile object or an nsIURI object with a file scheme or a scheme that supports uploading (e.g. ftp).
aDataPathPath to directory where URIs linked to the document are saved or nsnull if no linked URIs should be saved. This may be a nsILocalFile object or an nsIURI object with a file scheme.
aOutputContentTypeThe desired MIME type format to save the document and all subdocuments into or nsnull to use the default behaviour.
aEncodingFlagsFlags to pass to the encoder.
aWrapColumnFor text documents, indicates the desired width to wrap text at. Parameter is ignored if wrapping is not specified by the encoding flags.
See also:
nsILocalFile
nsIURI
Returns:
NS_OK Operation has been started.
NS_ERROR_INVALID_ARG One or more arguments was invalid.
void nsIWebBrowserPersist::saveURI ( in nsIURI  aURI,
in nsISupports  aCacheKey,
in nsIURI  aReferrer,
in nsIInputStream  aPostData,
in string  aExtraHeaders,
in nsISupports  aFile 
)

Save the specified URI to file.

Parameters:
aURIURI to save to file. Some implementations of this interface may also support nsnull to imply the currently loaded URI.
aCacheKeyAn object representing the URI in the cache or nsnull.
aReferrerThe referrer URI to pass with an HTTP request or nsnull.
aPostDataPost data to pass with an HTTP request or nsnull.
aExtraHeadersAdditional headers to supply with an HTTP request or nsnull.
aFileTarget file. This may be a nsILocalFile object or an nsIURI object with a file scheme or a scheme that supports uploading (e.g. ftp).
See also:
nsILocalFile
nsIURI
nsIInputStream
Returns:
NS_OK Operation has been started.
NS_ERROR_INVALID_ARG One or more arguments was invalid.

Member Data Documentation

Current state of the persister object.

Definition at line 116 of file nsIWebBrowserPersist.idl.

Convert links to absolute links where possible.

Definition at line 201 of file nsIWebBrowserPersist.idl.

Output only the body section, no HTML tags.

Definition at line 188 of file nsIWebBrowserPersist.idl.

Output with carriage return line breaks.

May also be combined with ENCODE_FLAGS_LF_LINEBREAKS and if neither is specified, the platform default format is used.

Definition at line 216 of file nsIWebBrowserPersist.idl.

Encode basic entities, e.g.

output   instead of character code 0xa0. The basic set is just   & < > " for interoperability with older products that don't support and friends.

Definition at line 233 of file nsIWebBrowserPersist.idl.

Encode HTML4 entities.

This includes the basic set, accented letters, greek letters and certain special markup symbols.

Definition at line 243 of file nsIWebBrowserPersist.idl.

Encode Latin1 entities.

This includes the basic set and accented letters between 128 and 255.

Definition at line 238 of file nsIWebBrowserPersist.idl.

Attempt to encode entities standardized at W3C (HTML, MathML, etc).

This is a catch-all flag for documents with mixed contents. Beware of interoperability issues. See below for other flags which might likely do what you want.

Definition at line 209 of file nsIWebBrowserPersist.idl.

For plaintext output.

Output for format flowed (RFC 2646). This is used when converting to text for mail sending. This differs just slightly but in an important way from normal formatted, and that is that lines are space stuffed. This can't (correctly) be done later.

Definition at line 199 of file nsIWebBrowserPersist.idl.

For plaintext output.

Convert html to plaintext that looks like the html. Implies wrap (except inside <pre>), since html wraps. HTML output: always do prettyprinting, ignoring existing formatting.

Definition at line 181 of file nsIWebBrowserPersist.idl.

Output with linefeed line breaks.

May also be combined with ENCODE_FLAGS_CR_LINEBREAKS and if neither is specified, the platform default format is used.

Definition at line 222 of file nsIWebBrowserPersist.idl.

For plaintext output.

Output the content of noframes elements.

Definition at line 226 of file nsIWebBrowserPersist.idl.

For plaintext output.

Output the content of noscript elements.

Definition at line 224 of file nsIWebBrowserPersist.idl.

Wrap even if when not doing formatted output (e.g.

for text fields).

Definition at line 190 of file nsIWebBrowserPersist.idl.

Output without formatting or wrapping the content.

This flag may be used to preserve the original formatting as much as possible.

Definition at line 186 of file nsIWebBrowserPersist.idl.

Output only the current selection as opposed to the whole document.

Definition at line 175 of file nsIWebBrowserPersist.idl.

Wrap documents at the specified column.

Definition at line 192 of file nsIWebBrowserPersist.idl.

Let the WebBrowserPersist decide whether the incoming data is encoded and whether it needs to go through a content converter e.g.

to decompress it.

Definition at line 96 of file nsIWebBrowserPersist.idl.

Bypass the cached data.

Definition at line 62 of file nsIWebBrowserPersist.idl.

Automatically cleanup after a failed or cancelled operation, deleting all created files and directories.

This flag does nothing for failed upload operations to remote servers.

Definition at line 90 of file nsIWebBrowserPersist.idl.

Don't make any adjustments to filenames.

Definition at line 82 of file nsIWebBrowserPersist.idl.

Don't make any adjustments to links.

Definition at line 78 of file nsIWebBrowserPersist.idl.

Fail on broken inline links.

Definition at line 84 of file nsIWebBrowserPersist.idl.

Fix links relative to destination location (not origin)

Definition at line 76 of file nsIWebBrowserPersist.idl.

Make changes to original dom rather than cloning nodes.

Definition at line 74 of file nsIWebBrowserPersist.idl.

Only use cached data (could result in failure if data is not cached).

Definition at line 60 of file nsIWebBrowserPersist.idl.

Ignore IFRAME content (usually adverts).

Definition at line 66 of file nsIWebBrowserPersist.idl.

Ignore any redirected data (usually adverts).

Definition at line 64 of file nsIWebBrowserPersist.idl.

Don't modify or add base tags.

Definition at line 72 of file nsIWebBrowserPersist.idl.

Do not run the incoming data through a content converter e.g.

to decompress it

Definition at line 68 of file nsIWebBrowserPersist.idl.

No special persistence behaviour.

Definition at line 58 of file nsIWebBrowserPersist.idl.

Replace existing files on the disk (use with due diligence!)

Definition at line 70 of file nsIWebBrowserPersist.idl.

Force serialization of output (one file at a time; not concurrent)

Definition at line 80 of file nsIWebBrowserPersist.idl.

Persister has finished saving data.

Definition at line 111 of file nsIWebBrowserPersist.idl.

Persister is ready to save data.

Definition at line 107 of file nsIWebBrowserPersist.idl.

Persister is saving data.

Definition at line 109 of file nsIWebBrowserPersist.idl.

Flags governing how data is fetched and saved from the network.

It is best to set this value explicitly unless you are prepared to accept the default values.

Definition at line 104 of file nsIWebBrowserPersist.idl.

Callback listener for progress notifications.

The object that the embbedder supplies may also implement nsIInterfaceRequestor and be prepared to return nsIAuthPrompt or other interfaces that may be required to download data.

See also:
nsIAuthPrompt
nsIInterfaceRequestor

Definition at line 137 of file nsIWebBrowserPersist.idl.

Value indicating the success or failure of the persist operation.

Returns:
NS_OK Operation was successful or is still ongoing.
NS_BINDING_ABORTED Operation cancelled.
NS_ERROR_FAILURE Non-specific failure.

Definition at line 126 of file nsIWebBrowserPersist.idl.


The documentation for this interface was generated from the following file: