Back to index

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

#include <txUnknownHandler.h>

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

List of all members.

Public Member Functions

 txUnknownHandler (txExecutionState *aEs)
virtual ~txUnknownHandler ()
void attribute (const nsAString &aName, const PRInt32 aNsID, const nsAString &aValue)
 Signals to receive the start of an attribute.
void endDocument (nsresult aResult)
 Signals the end of a document.
void startElement (const nsAString &aName, const PRInt32 aNsID)
 Signals to receive the start of an element.
virtual void characters (const nsAString &aData, PRBool aDOE)=0
 Signals to receive characters.
virtual void comment (const nsAString &aData)=0
 Signals to receive data that should be treated as a comment.
virtual void endElement (const nsAString &aName, const PRInt32 aNsID)=0
 Signals to receive the end of an element.
virtual void processingInstruction (const nsAString &aTarget, const nsAString &aData)=0
 Signals to receive a processing instruction.
virtual void startDocument ()=0
 Signals the start of a document.

Protected Attributes

nsAutoPtr< txResultBuffermBuffer
PRPackedBool mCanAddAttribute

Private Member Functions

nsresult createHandlerAndFlush (txOutputMethod aMethod, const nsAString &aName, const PRInt32 aNsID)

Private Attributes

txExecutionStatemEs

Detailed Description

Definition at line 47 of file txUnknownHandler.h.


Constructor & Destructor Documentation

Definition at line 44 of file txUnknownHandler.cpp.

    : mEs(aEs)
{
}

Definition at line 49 of file txUnknownHandler.cpp.

{
}

Member Function Documentation

void txUnknownHandler::attribute ( const nsAString &  aName,
const PRInt32  aNsID,
const nsAString &  aValue 
) [virtual]

Signals to receive the start of an attribute.

Parameters:
aNamethe name of the attribute
aNsIDthe namespace ID of the attribute
aValuethe value of the attribute

Implements txAXMLEventHandler.

Definition at line 53 of file txUnknownHandler.cpp.

{
    // If this is called then the stylesheet is trying to add an attribute
    // without adding an element first. So we'll just ignore it.
    // XXX ErrorReport: Signal this?
}
virtual void txAXMLEventHandler::characters ( const nsAString &  aData,
PRBool  aDOE 
) [pure virtual, inherited]

Signals to receive characters.

Parameters:
aDatathe characters to receive
aDOEdisable output escaping for these characters

Implemented in txHTMLOutput.

Here is the caller graph for this function:

virtual void txAXMLEventHandler::comment ( const nsAString &  aData) [pure virtual, inherited]

Signals to receive data that should be treated as a comment.

Parameters:
datathe comment data to receive

Here is the caller graph for this function:

nsresult txUnknownHandler::createHandlerAndFlush ( txOutputMethod  aMethod,
const nsAString &  aName,
const PRInt32  aNsID 
) [private]

Definition at line 118 of file txUnknownHandler.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

Signals the end of a document.

It is an error to call this method more than once.

Implements txAXMLEventHandler.

Definition at line 62 of file txUnknownHandler.cpp.

{
    if (NS_FAILED(aResult)) {
        return;
    }

    // This is an unusual case, no output method has been set and we
    // didn't create a document element. Switching to XML output mode
    // anyway.

    // Make sure that mEs->mResultHandler == this is true, otherwise we'll
    // leak mEs->mResultHandler in createHandlerAndFlush and we'll crash on
    // the last line (delete this).
    NS_ASSERTION(mEs->mResultHandler == this,
                 "We're leaking mEs->mResultHandler and are going to crash.");

    nsresult rv = createHandlerAndFlush(eXMLOutput, EmptyString(),
                                        kNameSpaceID_None);
    if (NS_FAILED(rv))
        return;

    mEs->mResultHandler->endDocument(aResult);

    delete this;
}

Here is the call graph for this function:

virtual void txAXMLEventHandler::endElement ( const nsAString &  aName,
const PRInt32  aNsID 
) [pure virtual, inherited]

Signals to receive the end of an element.

Parameters:
aNamethe name of the element
aNsIDthe namespace ID of the element

Implemented in txHTMLOutput.

Here is the caller graph for this function:

virtual void txAXMLEventHandler::processingInstruction ( const nsAString &  aTarget,
const nsAString &  aData 
) [pure virtual, inherited]

Signals to receive a processing instruction.

Parameters:
aTargetthe target of the processing instruction
aDatathe data of the processing instruction

Implemented in txHTMLOutput.

Here is the caller graph for this function:

virtual void txAXMLEventHandler::startDocument ( ) [pure virtual, inherited]

Signals the start of a document.

Implemented in txRtfHandler, and txHTMLOutput.

Here is the caller graph for this function:

void txUnknownHandler::startElement ( const nsAString &  aName,
const PRInt32  aNsID 
) [virtual]

Signals to receive the start of an element.

Parameters:
aNamethe name of the element
aNsIDthe namespace ID of the element

Implements txAXMLEventHandler.

Definition at line 88 of file txUnknownHandler.cpp.

{
    // Make sure that mEs->mResultHandler == this is true, otherwise we'll
    // leak mEs->mResultHandler in createHandlerAndFlush and we may crash
    // later on trying to delete this handler again.
    NS_ASSERTION(mEs->mResultHandler == this,
                 "We're leaking mEs->mResultHandler.");

    nsresult rv = NS_OK;
    txOutputFormat* format = mEs->mStylesheet->getOutputFormat();
    if (format->mMethod != eMethodNotSet) {
        rv = createHandlerAndFlush(format->mMethod, aName, aNsID);
    }
    else if (aNsID == kNameSpaceID_None &&
             aName.Equals(NS_LITERAL_STRING("html"),
                          txCaseInsensitiveStringComparator())) {
        rv = createHandlerAndFlush(eHTMLOutput, aName, aNsID);
    }
    else {
        rv = createHandlerAndFlush(eXMLOutput, aName, aNsID);
    }
    if (NS_FAILED(rv))
        return;

    mEs->mResultHandler->startElement(aName, aNsID);

    delete this;
}

Here is the call graph for this function:


Member Data Documentation

Definition at line 82 of file txBufferingHandler.h.

Definition at line 83 of file txBufferingHandler.h.

Definition at line 68 of file txUnknownHandler.h.


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