Back to index

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

#include <IEHtmlTxtRange.h>

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

List of all members.

Public Member Functions

 CIEHtmlTxtRange ()
virtual HRESULT STDMETHODCALLTYPE pasteHTML (BSTR html)
virtual HRESULT STDMETHODCALLTYPE get_text (BSTR __RPC_FAR *p)
virtual HRESULT STDMETHODCALLTYPE parentElement (IHTMLElement __RPC_FAR *__RPC_FAR *Parent)
virtual HRESULT STDMETHODCALLTYPE get_htmlText (BSTR __RPC_FAR *p)
virtual HRESULT STDMETHODCALLTYPE put_text (BSTR v)
virtual HRESULT STDMETHODCALLTYPE duplicate (IHTMLTxtRange __RPC_FAR *__RPC_FAR *Duplicate)
virtual HRESULT STDMETHODCALLTYPE inRange (IHTMLTxtRange __RPC_FAR *Range, VARIANT_BOOL __RPC_FAR *InRange)
virtual HRESULT STDMETHODCALLTYPE isEqual (IHTMLTxtRange __RPC_FAR *Range, VARIANT_BOOL __RPC_FAR *IsEqual)
virtual HRESULT STDMETHODCALLTYPE scrollIntoView (VARIANT_BOOL fStart=-1)
virtual HRESULT STDMETHODCALLTYPE collapse (VARIANT_BOOL Start=-1)
virtual HRESULT STDMETHODCALLTYPE expand (BSTR Unit, VARIANT_BOOL __RPC_FAR *Success)
virtual HRESULT STDMETHODCALLTYPE move (BSTR Unit, long Count, long __RPC_FAR *ActualCount)
virtual HRESULT STDMETHODCALLTYPE moveStart (BSTR Unit, long Count, long __RPC_FAR *ActualCount)
virtual HRESULT STDMETHODCALLTYPE moveEnd (BSTR Unit, long Count, long __RPC_FAR *ActualCount)
virtual HRESULT STDMETHODCALLTYPE select (void)
virtual HRESULT STDMETHODCALLTYPE moveToElementText (IHTMLElement __RPC_FAR *element)
virtual HRESULT STDMETHODCALLTYPE setEndPoint (BSTR how, IHTMLTxtRange __RPC_FAR *SourceRange)
virtual HRESULT STDMETHODCALLTYPE compareEndPoints (BSTR how, IHTMLTxtRange __RPC_FAR *SourceRange, long __RPC_FAR *ret)
virtual HRESULT STDMETHODCALLTYPE findText (BSTR String, long count, long Flags, VARIANT_BOOL __RPC_FAR *Success)
virtual HRESULT STDMETHODCALLTYPE moveToPoint (long x, long y)
virtual HRESULT STDMETHODCALLTYPE getBookmark (BSTR __RPC_FAR *Boolmark)
virtual HRESULT STDMETHODCALLTYPE moveToBookmark (BSTR Bookmark, VARIANT_BOOL __RPC_FAR *Success)
virtual HRESULT STDMETHODCALLTYPE queryCommandSupported (BSTR cmdID, VARIANT_BOOL __RPC_FAR *pfRet)
virtual HRESULT STDMETHODCALLTYPE queryCommandEnabled (BSTR cmdID, VARIANT_BOOL __RPC_FAR *pfRet)
virtual HRESULT STDMETHODCALLTYPE queryCommandState (BSTR cmdID, VARIANT_BOOL __RPC_FAR *pfRet)
virtual HRESULT STDMETHODCALLTYPE queryCommandIndeterm (BSTR cmdID, VARIANT_BOOL __RPC_FAR *pfRet)
virtual HRESULT STDMETHODCALLTYPE queryCommandText (BSTR cmdID, BSTR __RPC_FAR *pcmdText)
virtual HRESULT STDMETHODCALLTYPE queryCommandValue (BSTR cmdID, VARIANT __RPC_FAR *pcmdValue)
virtual HRESULT STDMETHODCALLTYPE execCommand (BSTR cmdID, VARIANT_BOOL showUI, VARIANT value, VARIANT_BOOL __RPC_FAR *pfRet)
virtual HRESULT STDMETHODCALLTYPE execCommandShowHelp (BSTR cmdID, VARIANT_BOOL __RPC_FAR *pfRet)
void SetRange (nsIDOMRange *pRange)
virtual HRESULT GetParentElement (IHTMLElement **ppParent)

Protected Member Functions

virtual ~CIEHtmlTxtRange ()

Protected Attributes

nsCOMPtr< nsIDOMRangemRange

Detailed Description

Definition at line 61 of file IEHtmlTxtRange.h.


Constructor & Destructor Documentation

Definition at line 95 of file IEHtmlTxtRange.cpp.

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

Definition at line 99 of file IEHtmlTxtRange.cpp.

{
}

Member Function Documentation

HRESULT STDMETHODCALLTYPE CIEHtmlTxtRange::collapse ( VARIANT_BOOL  Start = -1) [virtual]

Definition at line 170 of file IEHtmlTxtRange.cpp.

{
    nsresult rv = mRange->Collapse(Start?PR_TRUE:PR_FALSE);
    return FAILED(rv)?E_FAIL:S_OK;
}
HRESULT STDMETHODCALLTYPE CIEHtmlTxtRange::compareEndPoints ( BSTR  how,
IHTMLTxtRange __RPC_FAR *  SourceRange,
long __RPC_FAR *  ret 
) [virtual]

Definition at line 211 of file IEHtmlTxtRange.cpp.

{
    return E_NOTIMPL;
}
HRESULT STDMETHODCALLTYPE CIEHtmlTxtRange::duplicate ( IHTMLTxtRange __RPC_FAR *__RPC_FAR *  Duplicate) [virtual]

Definition at line 150 of file IEHtmlTxtRange.cpp.

{
    return E_NOTIMPL;
}
HRESULT STDMETHODCALLTYPE CIEHtmlTxtRange::execCommand ( BSTR  cmdID,
VARIANT_BOOL  showUI,
VARIANT  value,
VARIANT_BOOL __RPC_FAR *  pfRet 
) [virtual]

Definition at line 266 of file IEHtmlTxtRange.cpp.

{
    return E_NOTIMPL;
}
HRESULT STDMETHODCALLTYPE CIEHtmlTxtRange::execCommandShowHelp ( BSTR  cmdID,
VARIANT_BOOL __RPC_FAR *  pfRet 
) [virtual]

Definition at line 271 of file IEHtmlTxtRange.cpp.

{
    return E_NOTIMPL;
}
HRESULT STDMETHODCALLTYPE CIEHtmlTxtRange::expand ( BSTR  Unit,
VARIANT_BOOL __RPC_FAR *  Success 
) [virtual]

Definition at line 176 of file IEHtmlTxtRange.cpp.

{
    return E_NOTIMPL;
}
HRESULT STDMETHODCALLTYPE CIEHtmlTxtRange::findText ( BSTR  String,
long  count,
long  Flags,
VARIANT_BOOL __RPC_FAR *  Success 
) [virtual]

Definition at line 216 of file IEHtmlTxtRange.cpp.

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

Definition at line 140 of file IEHtmlTxtRange.cpp.

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

Definition at line 122 of file IEHtmlTxtRange.cpp.

{
    if (p == NULL)
        return E_INVALIDARG;
    *p = NULL;

    nsAutoString strText;
    mRange->ToString(strText);
    
    *p = SysAllocString(strText.get());
    return *p ? S_OK : E_OUTOFMEMORY;
}

Here is the call graph for this function:

HRESULT STDMETHODCALLTYPE CIEHtmlTxtRange::getBookmark ( BSTR __RPC_FAR *  Boolmark) [virtual]

Definition at line 226 of file IEHtmlTxtRange.cpp.

{
    return E_NOTIMPL;
}
HRESULT CRange::GetParentElement ( IHTMLElement **  ppParent) [virtual, inherited]

Definition at line 60 of file IEHtmlTxtRange.cpp.

{
    if (ppParent == NULL)
        return E_INVALIDARG;
    *ppParent = NULL;
    // get common ancestor property:
    nsCOMPtr<nsIDOMNode> domNode;
    mRange->GetCommonAncestorContainer(getter_AddRefs(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;
        domNode->GetParentNode(getter_AddRefs(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:

HRESULT STDMETHODCALLTYPE CIEHtmlTxtRange::inRange ( IHTMLTxtRange __RPC_FAR *  Range,
VARIANT_BOOL __RPC_FAR *  InRange 
) [virtual]

Definition at line 155 of file IEHtmlTxtRange.cpp.

{
    return E_NOTIMPL;
}
HRESULT STDMETHODCALLTYPE CIEHtmlTxtRange::isEqual ( IHTMLTxtRange __RPC_FAR *  Range,
VARIANT_BOOL __RPC_FAR *  IsEqual 
) [virtual]

Definition at line 160 of file IEHtmlTxtRange.cpp.

{
    return E_NOTIMPL;
}
HRESULT STDMETHODCALLTYPE CIEHtmlTxtRange::move ( BSTR  Unit,
long  Count,
long __RPC_FAR *  ActualCount 
) [virtual]

Definition at line 181 of file IEHtmlTxtRange.cpp.

{
    return E_NOTIMPL;
}
HRESULT STDMETHODCALLTYPE CIEHtmlTxtRange::moveEnd ( BSTR  Unit,
long  Count,
long __RPC_FAR *  ActualCount 
) [virtual]

Definition at line 191 of file IEHtmlTxtRange.cpp.

{
    return E_NOTIMPL;
}
HRESULT STDMETHODCALLTYPE CIEHtmlTxtRange::moveStart ( BSTR  Unit,
long  Count,
long __RPC_FAR *  ActualCount 
) [virtual]

Definition at line 186 of file IEHtmlTxtRange.cpp.

{
    return E_NOTIMPL;
}
HRESULT STDMETHODCALLTYPE CIEHtmlTxtRange::moveToBookmark ( BSTR  Bookmark,
VARIANT_BOOL __RPC_FAR *  Success 
) [virtual]

Definition at line 231 of file IEHtmlTxtRange.cpp.

{
    return E_NOTIMPL;
}
HRESULT STDMETHODCALLTYPE CIEHtmlTxtRange::moveToElementText ( IHTMLElement __RPC_FAR *  element) [virtual]

Definition at line 201 of file IEHtmlTxtRange.cpp.

{
    return E_NOTIMPL;
}
HRESULT STDMETHODCALLTYPE CIEHtmlTxtRange::moveToPoint ( long  x,
long  y 
) [virtual]

Definition at line 221 of file IEHtmlTxtRange.cpp.

{
    return E_NOTIMPL;
}
HRESULT STDMETHODCALLTYPE CIEHtmlTxtRange::parentElement ( IHTMLElement __RPC_FAR *__RPC_FAR *  Parent) [virtual]

Definition at line 135 of file IEHtmlTxtRange.cpp.

{
    return GetParentElement(Parent);
}

Here is the call graph for this function:

HRESULT STDMETHODCALLTYPE CIEHtmlTxtRange::pasteHTML ( BSTR  html) [virtual]

Definition at line 103 of file IEHtmlTxtRange.cpp.

{
    nsCOMPtr<nsIDOMDocumentFragment> domDocFragment;
    nsAutoString nsStrHtml(OLE2W(html));

    if (NS_FAILED(mRange->DeleteContents()))
        return E_FAIL;
    nsCOMPtr<nsIDOMNSRange> domNSRange = do_QueryInterface(mRange);
    if (!domNSRange)
        return E_FAIL;
    domNSRange->CreateContextualFragment(nsStrHtml, getter_AddRefs(domDocFragment));
    if (!domDocFragment)
        return E_FAIL;
    mRange->InsertNode(domDocFragment);
    mRange->Detach();
    
    return S_OK;
}

Here is the call graph for this function:

HRESULT STDMETHODCALLTYPE CIEHtmlTxtRange::put_text ( BSTR  v) [virtual]

Definition at line 145 of file IEHtmlTxtRange.cpp.

{
    return E_NOTIMPL;
}
HRESULT STDMETHODCALLTYPE CIEHtmlTxtRange::queryCommandEnabled ( BSTR  cmdID,
VARIANT_BOOL __RPC_FAR *  pfRet 
) [virtual]

Definition at line 241 of file IEHtmlTxtRange.cpp.

{
    return E_NOTIMPL;
}
HRESULT STDMETHODCALLTYPE CIEHtmlTxtRange::queryCommandIndeterm ( BSTR  cmdID,
VARIANT_BOOL __RPC_FAR *  pfRet 
) [virtual]

Definition at line 251 of file IEHtmlTxtRange.cpp.

{
    return E_NOTIMPL;
}
HRESULT STDMETHODCALLTYPE CIEHtmlTxtRange::queryCommandState ( BSTR  cmdID,
VARIANT_BOOL __RPC_FAR *  pfRet 
) [virtual]

Definition at line 246 of file IEHtmlTxtRange.cpp.

{
    return E_NOTIMPL;
}
HRESULT STDMETHODCALLTYPE CIEHtmlTxtRange::queryCommandSupported ( BSTR  cmdID,
VARIANT_BOOL __RPC_FAR *  pfRet 
) [virtual]

Definition at line 236 of file IEHtmlTxtRange.cpp.

{
    return E_NOTIMPL;
}
HRESULT STDMETHODCALLTYPE CIEHtmlTxtRange::queryCommandText ( BSTR  cmdID,
BSTR __RPC_FAR *  pcmdText 
) [virtual]

Definition at line 256 of file IEHtmlTxtRange.cpp.

{
    return E_NOTIMPL;
}
HRESULT STDMETHODCALLTYPE CIEHtmlTxtRange::queryCommandValue ( BSTR  cmdID,
VARIANT __RPC_FAR *  pcmdValue 
) [virtual]

Definition at line 261 of file IEHtmlTxtRange.cpp.

{
    return E_NOTIMPL;
}
HRESULT STDMETHODCALLTYPE CIEHtmlTxtRange::scrollIntoView ( VARIANT_BOOL  fStart = -1) [virtual]

Definition at line 165 of file IEHtmlTxtRange.cpp.

{
    return E_NOTIMPL;
}
HRESULT STDMETHODCALLTYPE CIEHtmlTxtRange::select ( void  ) [virtual]

Definition at line 196 of file IEHtmlTxtRange.cpp.

{
    return E_NOTIMPL;
}
HRESULT STDMETHODCALLTYPE CIEHtmlTxtRange::setEndPoint ( BSTR  how,
IHTMLTxtRange __RPC_FAR *  SourceRange 
) [virtual]

Definition at line 206 of file IEHtmlTxtRange.cpp.

{
    return E_NOTIMPL;
}
void CRange::SetRange ( nsIDOMRange pRange) [inherited]

Definition at line 55 of file IEHtmlTxtRange.cpp.

{
    mRange = pRange;
}

Member Data Documentation

nsCOMPtr<nsIDOMRange> CRange::mRange [protected, inherited]

Definition at line 58 of file IEHtmlTxtRange.h.


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