Back to index

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

#include <IEHtmlTxtRange.h>

Inheritance diagram for CRange:
Inheritance graph
Collaboration diagram for CRange:
Collaboration graph

List of all members.

Public Member Functions

 CRange ()
void SetRange (nsIDOMRange *pRange)
virtual HRESULT GetParentElement (IHTMLElement **ppParent)

Protected Member Functions

virtual ~CRange ()

Protected Attributes

nsCOMPtr< nsIDOMRangemRange

Detailed Description

Definition at line 43 of file IEHtmlTxtRange.h.

Constructor & Destructor Documentation

Definition at line 47 of file IEHtmlTxtRange.cpp.

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

Definition at line 51 of file IEHtmlTxtRange.cpp.


Member Function Documentation

HRESULT CRange::GetParentElement ( IHTMLElement **  ppParent) [virtual]

Definition at line 60 of file IEHtmlTxtRange.cpp.

    if (ppParent == NULL)
        return E_INVALIDARG;
    *ppParent = NULL;
    // get common ancestor property:
    nsCOMPtr<nsIDOMNode> domNode;
    if (!domNode)
        return S_OK;
    nsCOMPtr<nsIDOMElement> domElement = do_QueryInterface(domNode);
    if (!domElement)
        // domNode can be a nsITextNode. In this case, its parent is a nsIDOMElement:
        nsCOMPtr<nsIDOMNode> parentNode;
        domElement = do_QueryInterface(parentNode);
        // Is a textrange always supposed to have a parentElement? Remove 2 lines if not:
        if (!domElement)
            return E_UNEXPECTED;
        domNode = parentNode;
    // get or create com object:
    CComPtr<IUnknown> pNode;
    HRESULT hr = CIEHtmlDomNode::FindOrCreateFromDOMNode(domNode, &pNode);
    if (FAILED(hr))
        return hr;
    if (FAILED(pNode->QueryInterface(IID_IHTMLElement, (void **)ppParent)))
        return E_UNEXPECTED;

    return S_OK;

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 55 of file IEHtmlTxtRange.cpp.

    mRange = pRange;

Member Data Documentation

Definition at line 58 of file IEHtmlTxtRange.h.

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