Back to index

lightning-sunbird  0.9+nobinonly
Public Member Functions | Static Public Member Functions | Public Attributes | Protected Member Functions
CNode Class Reference

#include <IEHtmlNode.h>

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

List of all members.

Public Member Functions

virtual HRESULT SetParent (CNode *pParent)
virtual HRESULT SetDOMNode (nsIDOMNode *pIDOMNode)

Static Public Member Functions

static HRESULT FindFromDOMNode (nsIDOMNode *pIDOMNode, CNode **pNode)

Public Attributes

CNodemParent
nsCOMPtr< nsIDOMNodemDOMNode

Protected Member Functions

 CNode ()
virtual ~CNode ()

Detailed Description

Definition at line 126 of file IEHtmlNode.h.


Constructor & Destructor Documentation

CNode::CNode ( ) [protected]

Definition at line 61 of file IEHtmlNode.cpp.

CNode::~CNode ( ) [protected, virtual]

Definition at line 66 of file IEHtmlNode.cpp.

{
}

Member Function Documentation

HRESULT CNode::FindFromDOMNode ( nsIDOMNode pIDOMNode,
CNode **  pNode 
) [static]

Definition at line 78 of file IEHtmlNode.cpp.

{
    if (pIDOMNode == nsnull)
    {
        return E_FAIL;
    }

    if (g_NodeLookupTable == NULL)
    {
        return E_FAIL;
    }

    nsCOMPtr<nsISupports> nodeAsSupports = do_QueryInterface(pIDOMNode);
    *pNode = (CNode *) PL_HashTableLookup(g_NodeLookupTable, nodeAsSupports);

    return S_OK;
}

Here is the call graph for this function:

HRESULT CNode::SetDOMNode ( nsIDOMNode pIDOMNode) [virtual]

Reimplemented in CIEHtmlDomNode, CIEHtmlButtonElement, and CIEHtmlElement.

Definition at line 96 of file IEHtmlNode.cpp.

{
    if (pIDOMNode)
    {
        if (g_NodeLookupTable == NULL)
        {
            g_NodeLookupTable = PL_NewHashTable(123, HashFunction, HashComparator, HashComparator, NULL, NULL);
        }

        mDOMNode = pIDOMNode;
        nsCOMPtr<nsISupports> nodeAsSupports= do_QueryInterface(mDOMNode);
        PL_HashTableAdd(g_NodeLookupTable, nodeAsSupports, this);
    }
    else if (mDOMNode)
    {
        // Remove the entry from the hashtable
        nsCOMPtr<nsISupports> nodeAsSupports = do_QueryInterface(mDOMNode);
        PL_HashTableRemove(g_NodeLookupTable, nodeAsSupports);
        mDOMNode = nsnull;

        if (g_NodeLookupTable->nentries == 0)
        {
            PL_HashTableDestroy(g_NodeLookupTable);
            g_NodeLookupTable = NULL;
        }
    }
    return S_OK;
}

Here is the call graph for this function:

HRESULT CNode::SetParent ( CNode pParent) [virtual]

Reimplemented in CIEHtmlButtonElement, and CIEHtmlElement.

Definition at line 71 of file IEHtmlNode.cpp.

{
    mParent = pParent;
    return S_OK;
}

Here is the caller graph for this function:


Member Data Documentation

Definition at line 135 of file IEHtmlNode.h.

Definition at line 134 of file IEHtmlNode.h.


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