Back to index

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

#include <nsHTMLEditUtils.h>

List of all members.

Static Public Member Functions

static PRBool IsBig (nsIDOMNode *aNode)
static PRBool IsSmall (nsIDOMNode *aNode)
static PRBool IsInlineStyle (nsIDOMNode *aNode)
static PRBool IsFormatNode (nsIDOMNode *aNode)
static PRBool IsNodeThatCanOutdent (nsIDOMNode *aNode)
static PRBool IsHeader (nsIDOMNode *aNode)
static PRBool IsParagraph (nsIDOMNode *aNode)
static PRBool IsHR (nsIDOMNode *aNode)
static PRBool IsListItem (nsIDOMNode *aNode)
static PRBool IsTable (nsIDOMNode *aNode)
static PRBool IsTableRow (nsIDOMNode *aNode)
static PRBool IsTableElement (nsIDOMNode *aNode)
static PRBool IsTableElementButNotTable (nsIDOMNode *aNode)
static PRBool IsTableCell (nsIDOMNode *aNode)
static PRBool IsTableCellOrCaption (nsIDOMNode *aNode)
static PRBool IsList (nsIDOMNode *aNode)
static PRBool IsOrderedList (nsIDOMNode *aNode)
static PRBool IsUnorderedList (nsIDOMNode *aNode)
static PRBool IsBlockquote (nsIDOMNode *aNode)
static PRBool IsPre (nsIDOMNode *aNode)
static PRBool IsAddress (nsIDOMNode *aNode)
static PRBool IsAnchor (nsIDOMNode *aNode)
static PRBool IsImage (nsIDOMNode *aNode)
static PRBool IsLink (nsIDOMNode *aNode)
static PRBool IsNamedAnchor (nsIDOMNode *aNode)
static PRBool IsDiv (nsIDOMNode *aNode)
static PRBool IsMozDiv (nsIDOMNode *aNode)
static PRBool IsMailCite (nsIDOMNode *aNode)
static PRBool IsFormWidget (nsIDOMNode *aNode)
static PRBool SupportsAlignAttr (nsIDOMNode *aNode)

Detailed Description

Definition at line 46 of file nsHTMLEditUtils.h.


Member Function Documentation

Definition at line 321 of file nsHTMLEditUtils.cpp.

Here is the call graph for this function:

static PRBool nsHTMLEditUtils::IsAnchor ( nsIDOMNode aNode) [static]
PRBool nsHTMLEditUtils::IsBig ( nsIDOMNode aNode) [static]

Definition at line 54 of file nsHTMLEditUtils.cpp.

{
  return nsEditor::NodeIsType(node, nsEditProperty::big);
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 301 of file nsHTMLEditUtils.cpp.

{
  return nsEditor::NodeIsType(node, nsEditProperty::blockquote);
}

Here is the call graph for this function:

Here is the caller graph for this function:

PRBool nsHTMLEditUtils::IsDiv ( nsIDOMNode aNode) [static]

Definition at line 369 of file nsHTMLEditUtils.cpp.

{
  return nsEditor::NodeIsType(node, nsEditProperty::div);
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 86 of file nsHTMLEditUtils.cpp.

{
  NS_PRECONDITION(node, "null parent passed to nsHTMLEditUtils::IsFormatNode");
  nsCOMPtr<nsIAtom> nodeAtom = nsEditor::GetTag(node);
  return (nodeAtom == nsEditProperty::p)
      || (nodeAtom == nsEditProperty::pre)
      || (nodeAtom == nsEditProperty::h1)
      || (nodeAtom == nsEditProperty::h2)
      || (nodeAtom == nsEditProperty::h3)
      || (nodeAtom == nsEditProperty::h4)
      || (nodeAtom == nsEditProperty::h5)
      || (nodeAtom == nsEditProperty::h6)
      || (nodeAtom == nsEditProperty::address);
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 426 of file nsHTMLEditUtils.cpp.

{
  NS_PRECONDITION(node, "null node passed to nsHTMLEditUtils::IsFormWidget");
  nsCOMPtr<nsIAtom> nodeAtom = nsEditor::GetTag(node);
  return (nodeAtom == nsEditProperty::textarea)
      || (nodeAtom == nsEditProperty::select)
      || (nodeAtom == nsEditProperty::button)
      || (nodeAtom == nsEditProperty::input);
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 135 of file nsHTMLEditUtils.cpp.

{
  NS_PRECONDITION(node, "null parent passed to nsHTMLEditUtils::IsHeader");
  nsCOMPtr<nsIAtom> nodeAtom = nsEditor::GetTag(node);
  return (nodeAtom == nsEditProperty::h1)
      || (nodeAtom == nsEditProperty::h2)
      || (nodeAtom == nsEditProperty::h3)
      || (nodeAtom == nsEditProperty::h4)
      || (nodeAtom == nsEditProperty::h5)
      || (nodeAtom == nsEditProperty::h6);
}

Here is the call graph for this function:

Here is the caller graph for this function:

PRBool nsHTMLEditUtils::IsHR ( nsIDOMNode aNode) [static]

Definition at line 162 of file nsHTMLEditUtils.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 331 of file nsHTMLEditUtils.cpp.

{
  return nsEditor::NodeIsType(node, nsEditProperty::img);
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 64 of file nsHTMLEditUtils.cpp.

{
  NS_PRECONDITION(node, "null parent passed to nsHTMLEditUtils::IsInlineStyle");
  nsCOMPtr<nsIAtom> nodeAtom = nsEditor::GetTag(node);
  return (nodeAtom == nsEditProperty::b)
      || (nodeAtom == nsEditProperty::i)
      || (nodeAtom == nsEditProperty::u)
      || (nodeAtom == nsEditProperty::tt)
      || (nodeAtom == nsEditProperty::s)
      || (nodeAtom == nsEditProperty::strike)
      || (nodeAtom == nsEditProperty::big)
      || (nodeAtom == nsEditProperty::small)
      || (nodeAtom == nsEditProperty::blink)
      || (nodeAtom == nsEditProperty::sub)
      || (nodeAtom == nsEditProperty::sup)
      || (nodeAtom == nsEditProperty::font);
}

Here is the call graph for this function:

Here is the caller graph for this function:

PRBool nsHTMLEditUtils::IsLink ( nsIDOMNode aNode) [static]

Definition at line 337 of file nsHTMLEditUtils.cpp.

{
  if (!aNode) return PR_FALSE;
  nsCOMPtr<nsIDOMHTMLAnchorElement> anchor = do_QueryInterface(aNode);
  if (anchor)
  {
    nsAutoString tmpText;
    if (NS_SUCCEEDED(anchor->GetHref(tmpText)) && !tmpText.IsEmpty())
      return PR_TRUE;
  }
  return PR_FALSE;
}

Here is the call graph for this function:

Here is the caller graph for this function:

PRBool nsHTMLEditUtils::IsList ( nsIDOMNode aNode) [static]

Definition at line 267 of file nsHTMLEditUtils.cpp.

{
  NS_PRECONDITION(node, "null parent passed to nsHTMLEditUtils::IsList");
  nsCOMPtr<nsIAtom> nodeAtom = nsEditor::GetTag(node);
  return (nodeAtom == nsEditProperty::ul)
      || (nodeAtom == nsEditProperty::ol)
      || (nodeAtom == nsEditProperty::dl);
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 172 of file nsHTMLEditUtils.cpp.

{
  NS_PRECONDITION(node, "null parent passed to nsHTMLEditUtils::IsListItem");
  nsCOMPtr<nsIAtom> nodeAtom = nsEditor::GetTag(node);
  return (nodeAtom == nsEditProperty::li)
      || (nodeAtom == nsEditProperty::dd)
      || (nodeAtom == nsEditProperty::dt);
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 391 of file nsHTMLEditUtils.cpp.

{
  NS_PRECONDITION(node, "null parent passed to nsHTMLEditUtils::IsMailCite");
  nsCOMPtr<nsIDOMElement> elem = do_QueryInterface(node);
  if (!elem) return PR_FALSE;
  nsAutoString attrName (NS_LITERAL_STRING("type")); 
  
  // don't ask me why, but our html mailcites are id'd by "type=cite"...
  nsAutoString attrVal;
  nsresult res = elem->GetAttribute(attrName, attrVal);
  ToLowerCase(attrVal);
  if (NS_SUCCEEDED(res))
  {
    if (attrVal.EqualsLiteral("cite"))
      return PR_TRUE;
  }

  // ... but our plaintext mailcites by "_moz_quote=true".  go figure.
  attrName.AssignLiteral("_moz_quote");
  res = elem->GetAttribute(attrName, attrVal);
  if (NS_SUCCEEDED(res))
  {
    ToLowerCase(attrVal);
    if (attrVal.EqualsLiteral("true"))
      return PR_TRUE;
  }

  return PR_FALSE;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 379 of file nsHTMLEditUtils.cpp.

{
  if (IsDiv(node) && nsTextEditUtils::HasMozAttr(node)) return PR_TRUE;
  return PR_FALSE;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 351 of file nsHTMLEditUtils.cpp.

{
  if (!aNode) return PR_FALSE;
  nsCOMPtr<nsIDOMHTMLAnchorElement> anchor = do_QueryInterface(aNode);
  if (anchor)
  {
    nsAutoString tmpText;
    if (NS_SUCCEEDED(anchor->GetName(tmpText)) && !tmpText.IsEmpty())
      return PR_TRUE;
  }
  return PR_FALSE;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 105 of file nsHTMLEditUtils.cpp.

{
  NS_PRECONDITION(node, "null parent passed to nsHTMLEditUtils::IsNodeThatCanOutdent");
  nsCOMPtr<nsIAtom> nodeAtom = nsEditor::GetTag(node);
  return (nodeAtom == nsEditProperty::ul)
      || (nodeAtom == nsEditProperty::ol)
      || (nodeAtom == nsEditProperty::dl)
      || (nodeAtom == nsEditProperty::li)
      || (nodeAtom == nsEditProperty::dd)
      || (nodeAtom == nsEditProperty::dt)
      || (nodeAtom == nsEditProperty::blockquote);
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 281 of file nsHTMLEditUtils.cpp.

{
  return nsEditor::NodeIsType(node, nsEditProperty::ol);
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 152 of file nsHTMLEditUtils.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

PRBool nsHTMLEditUtils::IsPre ( nsIDOMNode aNode) [static]

Definition at line 311 of file nsHTMLEditUtils.cpp.

{
  return nsEditor::NodeIsType(node, nsEditProperty::pre);
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 121 of file nsHTMLEditUtils.cpp.

{
  return nsEditor::NodeIsType(node, nsEditProperty::small);
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 221 of file nsHTMLEditUtils.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 240 of file nsHTMLEditUtils.cpp.

{
  NS_PRECONDITION(node, "null parent passed to nsHTMLEditUtils::IsTableCell");
  nsCOMPtr<nsIAtom> nodeAtom = nsEditor::GetTag(node);
  return (nodeAtom == nsEditProperty::td)
      || (nodeAtom == nsEditProperty::th);
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 253 of file nsHTMLEditUtils.cpp.

{
  NS_PRECONDITION(node, "null parent passed to nsHTMLEditUtils::IsTableCell");
  nsCOMPtr<nsIAtom> nodeAtom = nsEditor::GetTag(node);
  return (nodeAtom == nsEditProperty::td)
      || (nodeAtom == nsEditProperty::th)
      || (nodeAtom == nsEditProperty::caption);
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 186 of file nsHTMLEditUtils.cpp.

{
  NS_PRECONDITION(node, "null node passed to nsHTMLEditor::IsTableElement");
  nsCOMPtr<nsIAtom> nodeAtom = nsEditor::GetTag(node);
  return (nodeAtom == nsEditProperty::table)
      || (nodeAtom == nsEditProperty::tr)
      || (nodeAtom == nsEditProperty::td)
      || (nodeAtom == nsEditProperty::th)
      || (nodeAtom == nsEditProperty::thead)
      || (nodeAtom == nsEditProperty::tfoot)
      || (nodeAtom == nsEditProperty::tbody)
      || (nodeAtom == nsEditProperty::caption);
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 204 of file nsHTMLEditUtils.cpp.

{
  NS_PRECONDITION(node, "null node passed to nsHTMLEditor::IsTableElementButNotTable");
  nsCOMPtr<nsIAtom> nodeAtom = nsEditor::GetTag(node);
  return (nodeAtom == nsEditProperty::tr)
      || (nodeAtom == nsEditProperty::td)
      || (nodeAtom == nsEditProperty::th)
      || (nodeAtom == nsEditProperty::thead)
      || (nodeAtom == nsEditProperty::tfoot)
      || (nodeAtom == nsEditProperty::tbody)
      || (nodeAtom == nsEditProperty::caption);
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 230 of file nsHTMLEditUtils.cpp.

{
  return nsEditor::NodeIsType(node, nsEditProperty::tr);
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 291 of file nsHTMLEditUtils.cpp.

{
  return nsEditor::NodeIsType(node, nsEditProperty::ul);
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 437 of file nsHTMLEditUtils.cpp.

{
  NS_PRECONDITION(aNode, "null node passed to nsHTMLEditUtils::SupportsAlignAttr");
  nsCOMPtr<nsIAtom> nodeAtom = nsEditor::GetTag(aNode);
  return (nodeAtom == nsEditProperty::hr)
      || (nodeAtom == nsEditProperty::table)
      || (nodeAtom == nsEditProperty::tbody)
      || (nodeAtom == nsEditProperty::tfoot)
      || (nodeAtom == nsEditProperty::thead)
      || (nodeAtom == nsEditProperty::tr)
      || (nodeAtom == nsEditProperty::td)
      || (nodeAtom == nsEditProperty::th)
      || (nodeAtom == nsEditProperty::div)
      || (nodeAtom == nsEditProperty::p)
      || (nodeAtom == nsEditProperty::h1)
      || (nodeAtom == nsEditProperty::h2)
      || (nodeAtom == nsEditProperty::h3)
      || (nodeAtom == nsEditProperty::h4)
      || (nodeAtom == nsEditProperty::h5)
      || (nodeAtom == nsEditProperty::h6);
}

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: