Back to index

lightning-sunbird  0.9+nobinonly
Defines | Functions | Variables
nsHTMLEditor.cpp File Reference
#include "nsICaret.h"
#include "nsCRT.h"
#include "nsReadableUtils.h"
#include "nsUnicharUtils.h"
#include "nsHTMLEditor.h"
#include "nsHTMLEditRules.h"
#include "nsTextEditUtils.h"
#include "nsHTMLEditUtils.h"
#include "nsEditorEventListeners.h"
#include "nsHTMLEditorMouseListener.h"
#include "TypeInState.h"
#include "nsHTMLURIRefObject.h"
#include "nsIDOMText.h"
#include "nsITextContent.h"
#include "nsIDOMNodeList.h"
#include "nsIDOMDocument.h"
#include "nsIDOMAttr.h"
#include "nsIDocument.h"
#include "nsIDOMEventReceiver.h"
#include "nsIDOM3EventTarget.h"
#include "nsIDOMKeyEvent.h"
#include "nsIDOMKeyListener.h"
#include "nsIDOMMouseListener.h"
#include "nsIDOMMouseEvent.h"
#include "nsISelection.h"
#include "nsISelectionPrivate.h"
#include "nsIDOMHTMLAnchorElement.h"
#include "nsISelectionController.h"
#include "nsIDOMHTMLHtmlElement.h"
#include "nsGUIEvent.h"
#include "nsIDOMEventGroup.h"
#include "nsILinkHandler.h"
#include "TransactionFactory.h"
#include "nsICSSLoader.h"
#include "nsICSSStyleSheet.h"
#include "nsIDocumentObserver.h"
#include "nsIDocumentStateListener.h"
#include "nsIEnumerator.h"
#include "nsIContent.h"
#include "nsIContentIterator.h"
#include "nsIDOMRange.h"
#include "nsIDOMNSRange.h"
#include "nsIRangeUtils.h"
#include "nsISupportsArray.h"
#include "nsVoidArray.h"
#include "nsIURL.h"
#include "nsIComponentManager.h"
#include "nsIServiceManager.h"
#include "nsIDocumentEncoder.h"
#include "nsIDOMDocumentFragment.h"
#include "nsIPresShell.h"
#include "nsPresContext.h"
#include "nsParserCIID.h"
#include "nsIImage.h"
#include "nsAOLCiter.h"
#include "nsInternetCiter.h"
#include "nsXPCOM.h"
#include "nsISupportsPrimitives.h"
#include "SetDocTitleTxn.h"
#include "nsTextFragment.h"
#include "nsIURI.h"
#include "nsNetUtil.h"
#include "nsIClipboard.h"
#include "nsITransferable.h"
#include "nsIDragService.h"
#include "nsIDOMNSUIEvent.h"
#include "nsIContentFilter.h"
#include "nsStyleSheetTxns.h"
#include "TextEditorTest.h"
#include "nsEditorUtils.h"
#include "nsWSRunObject.h"
#include "nsHTMLObjectResizer.h"
#include "nsIFrame.h"
#include "nsIView.h"
#include "nsIWidget.h"
#include "nsIParserService.h"

Go to the source code of this file.

Defines

#define IsLinkTag(s)   (s.EqualsIgnoreCase(hrefText))
#define IsNamedAnchorTag(s)   (s.EqualsIgnoreCase(anchorTxt) || s.EqualsIgnoreCase(namedanchorText))
#define USE_PARSER_FOR_BLOCKNESS   1

Functions

static NS_DEFINE_CID (kCTransitionalDTDCID, NS_CTRANSITIONAL_DTD_CID)
nsresult NS_NewTextEditRules (nsIEditRules **aInstancePtrResult)
nsresult NS_NewHTMLEditRules (nsIEditRules **aInstancePtrResult)
static nsresult SetSelectionAroundHeadChildren (nsCOMPtr< nsISelection > aSelection, nsWeakPtr aDocWeak)

Variables

static char hrefText [] = "href"
static char anchorTxt [] = "anchor"
static char namedanchorText [] = "namedanchor"
nsIParserServicesParserService
static const PRUnichar nbsp = 160

Define Documentation

#define IsLinkTag (   s)    (s.EqualsIgnoreCase(hrefText))

Definition at line 151 of file nsHTMLEditor.cpp.

#define IsNamedAnchorTag (   s)    (s.EqualsIgnoreCase(anchorTxt) || s.EqualsIgnoreCase(namedanchorText))

Definition at line 152 of file nsHTMLEditor.cpp.


Function Documentation

static NS_DEFINE_CID ( kCTransitionalDTDCID  ,
NS_CTRANSITIONAL_DTD_CID   
) [static]
nsresult NS_NewHTMLEditRules ( nsIEditRules **  aInstancePtrResult)

Definition at line 174 of file nsHTMLEditRules.cpp.

{
  nsHTMLEditRules * rules = new nsHTMLEditRules();
  if (rules)
    return rules->QueryInterface(NS_GET_IID(nsIEditRules), (void**) aInstancePtrResult);
  return NS_ERROR_OUT_OF_MEMORY;
}

Here is the caller graph for this function:

nsresult NS_NewTextEditRules ( nsIEditRules **  aInstancePtrResult)

Definition at line 80 of file nsTextEditRules.cpp.

{
  nsTextEditRules * rules = new nsTextEditRules();
  if (rules)
    return rules->QueryInterface(NS_GET_IID(nsIEditRules), (void**) aInstancePtrResult);
  return NS_ERROR_OUT_OF_MEMORY;
}

Here is the caller graph for this function:

static nsresult SetSelectionAroundHeadChildren ( nsCOMPtr< nsISelection aSelection,
nsWeakPtr  aDocWeak 
) [static]

Definition at line 3948 of file nsHTMLEditor.cpp.

{
  nsresult res = NS_OK;
  // Set selection around <head> node
  nsCOMPtr<nsIDOMDocument> doc = do_QueryReferent(aDocWeak);
  if (!doc) return NS_ERROR_NOT_INITIALIZED;

  nsCOMPtr<nsIDOMNodeList>nodeList; 
  res = doc->GetElementsByTagName(NS_LITERAL_STRING("head"), getter_AddRefs(nodeList));
  if (NS_FAILED(res)) return res;
  if (!nodeList) return NS_ERROR_NULL_POINTER;

  PRUint32 count; 
  nodeList->GetLength(&count);
  if (count < 1) return NS_ERROR_FAILURE;

  nsCOMPtr<nsIDOMNode> headNode;
  res = nodeList->Item(0, getter_AddRefs(headNode)); 
  if (NS_FAILED(res)) return res;
  if (!headNode) return NS_ERROR_NULL_POINTER;

  // Collapse selection to before first child of the head,
  res = aSelection->Collapse(headNode, 0);
  if (NS_FAILED(res)) return res;

  //  then extend it to just after
  nsCOMPtr<nsIDOMNodeList> childNodes;
  res = headNode->GetChildNodes(getter_AddRefs(childNodes));
  if (NS_FAILED(res)) return res;
  if (!childNodes) return NS_ERROR_NULL_POINTER;
  PRUint32 childCount;
  childNodes->GetLength(&childCount);

  return aSelection->Extend(headNode, childCount+1);
}

Here is the call graph for this function:


Variable Documentation

char anchorTxt[] = "anchor" [static]

Definition at line 139 of file nsHTMLEditor.cpp.

char hrefText[] = "href" [static]

Definition at line 138 of file nsHTMLEditor.cpp.

char namedanchorText[] = "namedanchor" [static]

Definition at line 140 of file nsHTMLEditor.cpp.

const PRUnichar nbsp = 160 [static]

Definition at line 994 of file nsHTMLEditor.cpp.

Definition at line 89 of file nsEditorRegistration.cpp.