Back to index

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

#include <IEHtmlNode.h>

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

List of all members.

Public Member Functions

 CIEHtmlDomNode ()
virtual HRESULT SetDOMNode (nsIDOMNode *pIDOMNode)
virtual HRESULT STDMETHODCALLTYPE get_nodeType (long __RPC_FAR *p)
virtual HRESULT STDMETHODCALLTYPE get_parentNode (IHTMLDOMNode __RPC_FAR *__RPC_FAR *p)
virtual HRESULT STDMETHODCALLTYPE hasChildNodes (VARIANT_BOOL __RPC_FAR *fChildren)
virtual HRESULT STDMETHODCALLTYPE get_childNodes (IDispatch __RPC_FAR *__RPC_FAR *p)
virtual HRESULT STDMETHODCALLTYPE get_attributes (IDispatch __RPC_FAR *__RPC_FAR *p)
virtual HRESULT STDMETHODCALLTYPE insertBefore (IHTMLDOMNode __RPC_FAR *newChild, VARIANT refChild, IHTMLDOMNode __RPC_FAR *__RPC_FAR *node)
virtual HRESULT STDMETHODCALLTYPE removeChild (IHTMLDOMNode __RPC_FAR *oldChild, IHTMLDOMNode __RPC_FAR *__RPC_FAR *node)
virtual HRESULT STDMETHODCALLTYPE replaceChild (IHTMLDOMNode __RPC_FAR *newChild, IHTMLDOMNode __RPC_FAR *oldChild, IHTMLDOMNode __RPC_FAR *__RPC_FAR *node)
virtual HRESULT STDMETHODCALLTYPE cloneNode (VARIANT_BOOL fDeep, IHTMLDOMNode __RPC_FAR *__RPC_FAR *clonedNode)
virtual HRESULT STDMETHODCALLTYPE removeNode (VARIANT_BOOL fDeep, IHTMLDOMNode __RPC_FAR *__RPC_FAR *removed)
virtual HRESULT STDMETHODCALLTYPE swapNode (IHTMLDOMNode __RPC_FAR *otherNode, IHTMLDOMNode __RPC_FAR *__RPC_FAR *swappedNode)
virtual HRESULT STDMETHODCALLTYPE replaceNode (IHTMLDOMNode __RPC_FAR *replacement, IHTMLDOMNode __RPC_FAR *__RPC_FAR *replaced)
virtual HRESULT STDMETHODCALLTYPE appendChild (IHTMLDOMNode __RPC_FAR *newChild, IHTMLDOMNode __RPC_FAR *__RPC_FAR *node)
virtual HRESULT STDMETHODCALLTYPE get_nodeName (BSTR __RPC_FAR *p)
virtual HRESULT STDMETHODCALLTYPE put_nodeValue (VARIANT p)
virtual HRESULT STDMETHODCALLTYPE get_nodeValue (VARIANT __RPC_FAR *p)
virtual HRESULT STDMETHODCALLTYPE get_firstChild (IHTMLDOMNode __RPC_FAR *__RPC_FAR *p)
virtual HRESULT STDMETHODCALLTYPE get_lastChild (IHTMLDOMNode __RPC_FAR *__RPC_FAR *p)
virtual HRESULT STDMETHODCALLTYPE get_previousSibling (IHTMLDOMNode __RPC_FAR *__RPC_FAR *p)
virtual HRESULT STDMETHODCALLTYPE get_nextSibling (IHTMLDOMNode __RPC_FAR *__RPC_FAR *p)
virtual HRESULT SetParent (CNode *pParent)

Static Public Member Functions

static HRESULT FindFromDOMNode (nsIDOMNode *pIDOMNode, IUnknown **pNode)
static HRESULT FindOrCreateFromDOMNode (nsIDOMNode *pIDOMNode, IUnknown **pNode)
static HRESULT CreateFromDOMNode (nsIDOMNode *pIDOMNode, IUnknown **pNode)
static HRESULT WINAPI QueryInterfaceOnNode (void *pv, REFIID riid, LPVOID *ppv, DWORD dw)
static HRESULT FindFromDOMNode (nsIDOMNode *pIDOMNode, CNode **pNode)

Public Attributes

CNodemParent
nsCOMPtr< nsIDOMNodemDOMNode

Protected Member Functions

virtual ~CIEHtmlDomNode ()

Detailed Description

Definition at line 142 of file IEHtmlNode.h.


Constructor & Destructor Documentation

Definition at line 134 of file IEHtmlNode.cpp.

{
}
CIEHtmlDomNode::~CIEHtmlDomNode ( ) [protected, virtual]

Definition at line 138 of file IEHtmlNode.cpp.

Here is the call graph for this function:


Member Function Documentation

virtual HRESULT STDMETHODCALLTYPE CIEHtmlDomNode::appendChild ( IHTMLDOMNode __RPC_FAR *  newChild,
IHTMLDOMNode __RPC_FAR *__RPC_FAR *  node 
) [virtual]
virtual HRESULT STDMETHODCALLTYPE CIEHtmlDomNode::cloneNode ( VARIANT_BOOL  fDeep,
IHTMLDOMNode __RPC_FAR *__RPC_FAR *  clonedNode 
) [virtual]
HRESULT CIEHtmlDomNode::CreateFromDOMNode ( nsIDOMNode pIDOMNode,
IUnknown **  pNode 
) [static]

Definition at line 161 of file IEHtmlNode.cpp.

Here is the caller graph for this function:

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

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 CIEHtmlDomNode::FindFromDOMNode ( nsIDOMNode pIDOMNode,
IUnknown **  pNode 
) [static]

Definition at line 169 of file IEHtmlNode.cpp.

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

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

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

    return S_OK;
}

Here is the call graph for this function:

Here is the caller graph for this function:

HRESULT CIEHtmlDomNode::FindOrCreateFromDOMNode ( nsIDOMNode pIDOMNode,
IUnknown **  pNode 
) [static]

Definition at line 187 of file IEHtmlNode.cpp.

{
    FindFromDOMNode(pIDOMNode,pNode);

    if (*pNode)
    {
        (*pNode)->AddRef();
        return S_OK;
    }

    HRESULT hr = CreateFromDOMNode(pIDOMNode, pNode);
    if SUCCEEDED(hr)
        return S_OK;
    return hr;
}

Here is the call graph for this function:

Here is the caller graph for this function:

virtual HRESULT STDMETHODCALLTYPE CIEHtmlDomNode::get_attributes ( IDispatch __RPC_FAR *__RPC_FAR *  p) [virtual]
virtual HRESULT STDMETHODCALLTYPE CIEHtmlDomNode::get_childNodes ( IDispatch __RPC_FAR *__RPC_FAR *  p) [virtual]
HRESULT STDMETHODCALLTYPE CIEHtmlDomNode::get_firstChild ( IHTMLDOMNode __RPC_FAR *__RPC_FAR *  p) [virtual]

Definition at line 367 of file IEHtmlNode.cpp.

{
  return E_NOTIMPL;
}
virtual HRESULT STDMETHODCALLTYPE CIEHtmlDomNode::get_lastChild ( IHTMLDOMNode __RPC_FAR *__RPC_FAR *  p) [virtual]
HRESULT STDMETHODCALLTYPE CIEHtmlDomNode::get_nextSibling ( IHTMLDOMNode __RPC_FAR *__RPC_FAR *  p) [virtual]

Definition at line 378 of file IEHtmlNode.cpp.

{
  return E_NOTIMPL;
}
HRESULT STDMETHODCALLTYPE CIEHtmlDomNode::get_nodeName ( BSTR __RPC_FAR *  p) [virtual]

Definition at line 327 of file IEHtmlNode.cpp.

{
  if (!mDOMNode) return E_UNEXPECTED;
  nsString szTagName;
  HRESULT rc = mDOMNode->GetNodeName(szTagName);
  USES_CONVERSION;
  *p = SysAllocString(W2COLE(ToNewUnicode(szTagName)));
  return rc;
}

Here is the call graph for this function:

HRESULT STDMETHODCALLTYPE CIEHtmlDomNode::get_nodeType ( long __RPC_FAR *  p) [virtual]

Definition at line 245 of file IEHtmlNode.cpp.

{ \
    return E_NOTIMPL; \
}

HRESULT STDMETHODCALLTYPE CIEHtmlDomNode::get_parentNode(IHTMLDOMNode __RPC_FAR *__RPC_FAR *p)
  SIB_NODE_GET_ELEMENT(GetParentNode,nsIDOMNode)

HRESULT STDMETHODCALLTYPE CIEHtmlDomNode::hasChildNodes(VARIANT_BOOL __RPC_FAR *p)
  SIB_NODE_GET_NUMERIC(HasChildNodes,PRBool)

#define SIB_STD_NOTIMPL \
{ \
  return E_NOTIMPL; \
}

HRESULT STDMETHODCALLTYPE CIEHtmlDomNode::get_childNodes(IDispatch __RPC_FAR *__RPC_FAR *p)
  SIB_STD_NOTIMPL

HRESULT STDMETHODCALLTYPE CIEHtmlDomNode::get_attributes(IDispatch __RPC_FAR *__RPC_FAR *p)
  SIB_STD_NOTIMPL

HRESULT STDMETHODCALLTYPE CIEHtmlDomNode::insertBefore(IHTMLDOMNode __RPC_FAR *newChild,
    VARIANT refChild,
    IHTMLDOMNode __RPC_FAR *__RPC_FAR *node)
  SIB_STD_NOTIMPL

HRESULT STDMETHODCALLTYPE CIEHtmlDomNode::removeChild(
    IHTMLDOMNode __RPC_FAR *oldChild,
    IHTMLDOMNode __RPC_FAR *__RPC_FAR *node)
  SIB_STD_NOTIMPL

HRESULT STDMETHODCALLTYPE CIEHtmlDomNode::replaceChild(
    IHTMLDOMNode __RPC_FAR *newChild,
    IHTMLDOMNode __RPC_FAR *oldChild,
    IHTMLDOMNode __RPC_FAR *__RPC_FAR *node)
  SIB_STD_NOTIMPL

HRESULT STDMETHODCALLTYPE CIEHtmlDomNode::cloneNode( 
    VARIANT_BOOL fDeep,
    IHTMLDOMNode __RPC_FAR *__RPC_FAR *clonedNode)
  SIB_STD_NOTIMPL

HRESULT STDMETHODCALLTYPE CIEHtmlDomNode::removeNode( 
    VARIANT_BOOL fDeep,
    IHTMLDOMNode __RPC_FAR *__RPC_FAR *removed)
  SIB_STD_NOTIMPL

HRESULT STDMETHODCALLTYPE CIEHtmlDomNode::swapNode( 
    IHTMLDOMNode __RPC_FAR *otherNode,
    IHTMLDOMNode __RPC_FAR *__RPC_FAR *swappedNode)
  SIB_STD_NOTIMPL

HRESULT STDMETHODCALLTYPE CIEHtmlDomNode::replaceNode( 
    IHTMLDOMNode __RPC_FAR *replacement,
    IHTMLDOMNode __RPC_FAR *__RPC_FAR *replaced)
  SIB_STD_NOTIMPL

HRESULT STDMETHODCALLTYPE CIEHtmlDomNode::appendChild(IHTMLDOMNode *newChild, IHTMLDOMNode **node)
{
    if (!newChild || !node)
        return E_INVALIDARG;
    *node = NULL;
    if (!mDOMNode)
        return E_UNEXPECTED;
    nsCOMPtr<nsIDOMNode> domNode;
    nsresult rv = mDOMNode->AppendChild(((CIEHtmlDomNode*)newChild)->mDOMNode, getter_AddRefs(domNode));
    if (NS_FAILED(rv))
        return E_FAIL;
    // Create com object:
    CComPtr<IUnknown> pNode = NULL;
    HRESULT hr = CIEHtmlDomNode::FindOrCreateFromDOMNode(domNode, &pNode);
    if (FAILED(hr))
        return hr;
    if (FAILED(pNode->QueryInterface(__uuidof(IHTMLDOMNode), (void**)node)))
        return E_UNEXPECTED;
    return S_OK;
}

Here is the call graph for this function:

HRESULT STDMETHODCALLTYPE CIEHtmlDomNode::get_nodeValue ( VARIANT __RPC_FAR *  p) [virtual]

Definition at line 350 of file IEHtmlNode.cpp.

{
  if (p == NULL) {
    return E_INVALIDARG;
  }
  if (!mDOMNode) return E_UNEXPECTED;
  nsString szValue;
  nsresult nr = mDOMNode->GetNodeValue(szValue);
  if (nr == NS_OK) {
    USES_CONVERSION;
    p->vt = VT_BSTR;
    p->bstrVal = SysAllocString(W2COLE(ToNewUnicode(szValue)));
    return S_OK;
  }
  return E_FAIL;
}

Here is the call graph for this function:

virtual HRESULT STDMETHODCALLTYPE CIEHtmlDomNode::get_parentNode ( IHTMLDOMNode __RPC_FAR *__RPC_FAR *  p) [virtual]
virtual HRESULT STDMETHODCALLTYPE CIEHtmlDomNode::get_previousSibling ( IHTMLDOMNode __RPC_FAR *__RPC_FAR *  p) [virtual]
virtual HRESULT STDMETHODCALLTYPE CIEHtmlDomNode::hasChildNodes ( VARIANT_BOOL __RPC_FAR *  fChildren) [virtual]
virtual HRESULT STDMETHODCALLTYPE CIEHtmlDomNode::insertBefore ( IHTMLDOMNode __RPC_FAR *  newChild,
VARIANT  refChild,
IHTMLDOMNode __RPC_FAR *__RPC_FAR *  node 
) [virtual]
HRESULT STDMETHODCALLTYPE CIEHtmlDomNode::put_nodeValue ( VARIANT  p) [virtual]

Definition at line 337 of file IEHtmlNode.cpp.

{
  if (!mDOMNode) return E_UNEXPECTED;
  CComVariant vValue;
  if (FAILED(vValue.ChangeType(VT_BSTR, &p))) {
    return E_INVALIDARG;
  }
  nsString szValue(OLE2W(vValue.bstrVal));
  if (!mDOMNode->SetNodeValue(szValue))
    return E_FAIL;
  return S_OK;
}
static HRESULT WINAPI CIEHtmlDomNode::QueryInterfaceOnNode ( void pv,
REFIID  riid,
LPVOID ppv,
DWORD  dw 
) [static]
virtual HRESULT STDMETHODCALLTYPE CIEHtmlDomNode::removeChild ( IHTMLDOMNode __RPC_FAR *  oldChild,
IHTMLDOMNode __RPC_FAR *__RPC_FAR *  node 
) [virtual]
virtual HRESULT STDMETHODCALLTYPE CIEHtmlDomNode::removeNode ( VARIANT_BOOL  fDeep,
IHTMLDOMNode __RPC_FAR *__RPC_FAR *  removed 
) [virtual]
virtual HRESULT STDMETHODCALLTYPE CIEHtmlDomNode::replaceChild ( IHTMLDOMNode __RPC_FAR *  newChild,
IHTMLDOMNode __RPC_FAR *  oldChild,
IHTMLDOMNode __RPC_FAR *__RPC_FAR *  node 
) [virtual]
virtual HRESULT STDMETHODCALLTYPE CIEHtmlDomNode::replaceNode ( IHTMLDOMNode __RPC_FAR *  replacement,
IHTMLDOMNode __RPC_FAR *__RPC_FAR *  replaced 
) [virtual]
HRESULT CIEHtmlDomNode::SetDOMNode ( nsIDOMNode pIDOMNode) [virtual]

Reimplemented from CNode.

Definition at line 203 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, (IUnknown *)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:

Here is the caller graph for this function:

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

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:

virtual HRESULT STDMETHODCALLTYPE CIEHtmlDomNode::swapNode ( IHTMLDOMNode __RPC_FAR *  otherNode,
IHTMLDOMNode __RPC_FAR *__RPC_FAR *  swappedNode 
) [virtual]

Member Data Documentation

Definition at line 135 of file IEHtmlNode.h.

CNode* CNode::mParent [inherited]

Definition at line 134 of file IEHtmlNode.h.


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