Back to index

lightning-sunbird  0.9+nobinonly
Public Member Functions | Public Attributes | Private Attributes
nsDOMParser Class Reference

#include <nsDOMParser.h>

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

List of all members.

Public Member Functions

 nsDOMParser ()
virtual ~nsDOMParser ()
NS_DECL_ISUPPORTS
NS_DECL_NSIDOMPARSER
NS_IMETHOD 
HandleEvent (nsIDOMEvent *aEvent)
NS_IMETHOD Load (nsIDOMEvent *aEvent)
 Processes a page or image load event.
NS_IMETHOD BeforeUnload (nsIDOMEvent *aEvent)
 Processes a page beforeUnload event.
NS_IMETHOD Unload (nsIDOMEvent *aEvent)
 Processes a page unload event.
NS_IMETHOD Abort (nsIDOMEvent *aEvent)
 Processes a load abort event.
NS_IMETHOD Error (nsIDOMEvent *aEvent)
 Processes an load error event.
NS_IMETHOD Initialize (nsISupports *aOwner, JSContext *cx, JSObject *obj, PRUint32 argc, jsval *argv)
 Initialize a newly created native instance using the owner of the constructor and the parameters passed into the JavaScript constructor.
nsIDOMDocument parseFromString (in wstring str, in string contentType)
 The string passed in is parsed into a DOM document.
nsIDOMDocument parseFromBuffer ([const, array, size_is(bufLen)] in octet buf, in PRUint32 bufLen, in string contentType)
 The buffer is parsed into a DOM document.
nsIDOMDocument parseFromStream (in nsIInputStream stream, in string charset, in long contentLength, in string contentType)
 The byte stream passed in is parsed into a DOM document.
void handleEvent (in nsIDOMEvent event)
 This method is called whenever an event occurs of the type for which the EventListener interface was registered.

Public Attributes

attribute nsIURI baseURI
 Set/Get the baseURI, may be needed when called from native code.

Private Attributes

nsCOMPtr< nsIURImBaseURI
nsCOMPtr< nsIEventQueueServicemEventQService
PRBool mLoopingForSyncLoad
nsWeakPtr mOwner

Detailed Description

Definition at line 50 of file nsDOMParser.h.


Constructor & Destructor Documentation

Definition at line 333 of file nsDOMParser.cpp.

Here is the call graph for this function:

Definition at line 339 of file nsDOMParser.cpp.

{
  NS_ABORT_IF_FALSE(!mLoopingForSyncLoad, "we rather crash than hang");
  mLoopingForSyncLoad = PR_FALSE;
}

Member Function Documentation

nsresult nsDOMParser::Abort ( nsIDOMEvent aEvent) [virtual]

Processes a load abort event.

Parameters:
aMouseEvent
See also:
nsIDOMEvent.h
Returns:
whether the event was consumed or ignored.
See also:
nsresult

Implements nsIDOMLoadListener.

Definition at line 318 of file nsDOMParser.cpp.

Processes a page beforeUnload event.

Parameters:
aMouseEvent
See also:
nsIDOMEvent.h
Returns:
whether the event was consumed or ignored.
See also:
nsresult

Implements nsIDOMLoadListener.

Definition at line 306 of file nsDOMParser.cpp.

{
  return NS_OK;
}
nsresult nsDOMParser::Error ( nsIDOMEvent aEvent) [virtual]

Processes an load error event.

Parameters:
aMouseEvent
See also:
nsIDOMEvent.h
Returns:
whether the event was consumed or ignored.
See also:
nsresult

Implements nsIDOMLoadListener.

Definition at line 326 of file nsDOMParser.cpp.

This method is called whenever an event occurs of the type for which the EventListener interface was registered.

Parameters:
evtThe Event contains contextual information about the event. It also contains the stopPropagation and preventDefault methods which are used in determining the event's flow and default action.

Definition at line 291 of file nsDOMParser.cpp.

{
  return NS_OK;
}
NS_IMETHODIMP nsDOMParser::Initialize ( nsISupports *  aOwner,
JSContext cx,
JSObject obj,
PRUint32  argc,
jsval argv 
) [virtual]

Initialize a newly created native instance using the owner of the constructor and the parameters passed into the JavaScript constructor.

Implements nsIJSNativeInitializer_MOZILLA_1_8_BRANCH.

Definition at line 705 of file nsDOMParser.cpp.

{
  mOwner = do_GetWeakReference(aOwner);
  return NS_OK;
}

Here is the call graph for this function:

nsresult nsDOMParser::Load ( nsIDOMEvent aEvent) [virtual]

Processes a page or image load event.

Parameters:
aMouseEvent
See also:
nsIDOMEvent.h
Returns:
whether the event was consumed or ignored.
See also:
nsresult

Implements nsIDOMLoadListener.

Definition at line 298 of file nsDOMParser.cpp.

nsIDOMDocument nsIDOMParser::parseFromBuffer ( [const, array, size_is(bufLen)] in octet  buf,
in PRUint32  bufLen,
in string  contentType 
) [inherited]

The buffer is parsed into a DOM document.

The charset is determined from the xml entity decl.

Parameters:
bufThe octet array data to be parsed
bufLenLength (in bytes) of the data
contentTypeThe content type of the data (see parseFromStream)
Returns:
The DOM document created as a result of parsing the string
nsIDOMDocument nsIDOMParser::parseFromStream ( in nsIInputStream  stream,
in string  charset,
in long  contentLength,
in string  contentType 
) [inherited]

The byte stream passed in is parsed into a DOM document.

Not accessible from web content.

Parameters:
streamThe byte stream whose contents are parsed
charsetThe character set that was used to encode the byte stream. NULL if not specified.
contentLengthThe number of bytes in the input stream.
contentTypeThe content type of the string - either text/xml, application/xml, or application/xhtml+xml. Must not be NULL.
Returns:
The DOM document created as a result of parsing the stream
nsIDOMDocument nsIDOMParser::parseFromString ( in wstring  str,
in string  contentType 
) [inherited]

The string passed in is parsed into a DOM document.

Parameters:
strThe UTF16 string to be parsed
contentTypeThe content type of the string (see parseFromStream)
Returns:
The DOM document created as a result of parsing the string
nsresult nsDOMParser::Unload ( nsIDOMEvent aEvent) [virtual]

Processes a page unload event.

Parameters:
aMouseEvent
See also:
nsIDOMEvent.h
Returns:
whether the event was consumed or ignored.
See also:
nsresult

Implements nsIDOMLoadListener.

Definition at line 312 of file nsDOMParser.cpp.

{
  return NS_OK;
}

Member Data Documentation

Set/Get the baseURI, may be needed when called from native code.

Definition at line 101 of file nsIDOMParser.idl.

Definition at line 78 of file nsDOMParser.h.

Definition at line 79 of file nsDOMParser.h.

Definition at line 80 of file nsDOMParser.h.

Definition at line 81 of file nsDOMParser.h.


The documentation for this class was generated from the following files: