Back to index

lightning-sunbird  0.9+nobinonly
Static Public Member Functions
nsTextEditUtils Class Reference

#include <nsTextEditUtils.h>

List of all members.

Static Public Member Functions

static PRBool IsBody (nsIDOMNode *aNode)
static PRBool IsBreak (nsIDOMNode *aNode)
static PRBool IsMozBR (nsIDOMNode *aNode)
static PRBool HasMozAttr (nsIDOMNode *aNode)
static PRBool InBody (nsIDOMNode *aNode, nsIEditor *aEditor)

Detailed Description

Definition at line 48 of file nsTextEditUtils.h.


Member Function Documentation

Definition at line 86 of file nsTextEditUtils.cpp.

{
  NS_PRECONDITION(node, "null parent passed to nsHTMLEditUtils::HasMozAttr");
  nsCOMPtr<nsIDOMElement> elem = do_QueryInterface(node);
  if (elem)
  {
    nsAutoString typeAttrVal;
    nsresult res = elem->GetAttribute(NS_LITERAL_STRING("type"), typeAttrVal);
    if (NS_SUCCEEDED(res) && (typeAttrVal.LowerCaseEqualsLiteral("_moz")))
      return PR_TRUE;
  }
  return PR_FALSE;
}

Here is the call graph for this function:

Here is the caller graph for this function:

PRBool nsTextEditUtils::InBody ( nsIDOMNode aNode,
nsIEditor aEditor 
) [static]

Definition at line 105 of file nsTextEditUtils.cpp.

{
  if (node)
  {
    nsCOMPtr<nsIDOMElement> rootElement;
    editor->GetRootElement(getter_AddRefs(rootElement));

    nsCOMPtr<nsIDOMNode> rootNode = do_QueryInterface(rootElement);
    if (!rootNode)
      return PR_FALSE;

    nsCOMPtr<nsIDOMNode> tmp;
    nsCOMPtr<nsIDOMNode> p = node;
    while (p && p != rootNode)
    {
      if (NS_FAILED(p->GetParentNode(getter_AddRefs(tmp))) || !tmp)
        return PR_FALSE;
      p = tmp;
    }
  }
  return PR_TRUE;
}

Here is the call graph for this function:

Here is the caller graph for this function:

PRBool nsTextEditUtils::IsBody ( nsIDOMNode aNode) [static]

Definition at line 51 of file nsTextEditUtils.cpp.

{
  return nsEditor::NodeIsTypeString(node, NS_LITERAL_STRING("body"));
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 62 of file nsTextEditUtils.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 72 of file nsTextEditUtils.cpp.

{
  NS_PRECONDITION(node, "null node passed to nsHTMLEditUtils::IsMozBR");
  if (IsBreak(node) && HasMozAttr(node)) return PR_TRUE;
  return PR_FALSE;
}

Here is the call graph for this function:

Here is the caller graph for this function:


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