Back to index

lightning-sunbird  0.9+nobinonly
Functions
nsPlaintextEditor.cpp File Reference
#include "nsPlaintextEditor.h"
#include "nsICaret.h"
#include "nsTextEditUtils.h"
#include "nsTextEditRules.h"
#include "nsEditorEventListeners.h"
#include "nsIEditActionListener.h"
#include "nsIDOMNodeList.h"
#include "nsIDOMDocument.h"
#include "nsIDocument.h"
#include "nsIDOMEventReceiver.h"
#include "nsIDOM3EventTarget.h"
#include "nsIDOMKeyEvent.h"
#include "nsIDOMMouseListener.h"
#include "nsISelection.h"
#include "nsISelectionPrivate.h"
#include "nsISelectionController.h"
#include "nsGUIEvent.h"
#include "nsIDOMEventGroup.h"
#include "nsCRT.h"
#include "nsIEnumerator.h"
#include "nsIContent.h"
#include "nsIContentIterator.h"
#include "nsIDOMRange.h"
#include "nsISupportsArray.h"
#include "nsIComponentManager.h"
#include "nsIServiceManager.h"
#include "nsIDocumentEncoder.h"
#include "nsIPresShell.h"
#include "nsISupportsPrimitives.h"
#include "nsReadableUtils.h"
#include "nsEditorUtils.h"
#include "nsIPrefBranch.h"
#include "nsIPrefService.h"
#include "nsUnicharUtils.h"
#include "nsAOLCiter.h"
#include "nsInternetCiter.h"
#include "nsIClipboard.h"
#include "nsITransferable.h"

Go to the source code of this file.

Functions

nsresult NS_NewTextEditRules (nsIEditRules **aInstancePtrResult)
static void CutStyle (const char *stylename, nsString &styleValue)
static nsICiterMakeACiter ()

Function Documentation

static void CutStyle ( const char *  stylename,
nsString styleValue 
) [static]

Definition at line 928 of file nsPlaintextEditor.cpp.

{
  // Find the current wrapping type:
  PRInt32 styleStart = styleValue.Find(stylename, PR_TRUE);
  if (styleStart >= 0)
  {
    PRInt32 styleEnd = styleValue.Find(";", PR_FALSE, styleStart);
    if (styleEnd > styleStart)
      styleValue.Cut(styleStart, styleEnd - styleStart + 1);
    else
      styleValue.Cut(styleStart, styleValue.Length() - styleStart);
  }
}
static nsICiter* MakeACiter ( ) [static]

Definition at line 1321 of file nsPlaintextEditor.cpp.

{
  // Make a citer of an appropriate type
  nsICiter* citer = 0;
  nsresult rv;
  nsCOMPtr<nsIPrefBranch> prefBranch =
    do_GetService(NS_PREFSERVICE_CONTRACTID, &rv);
  if (NS_FAILED(rv)) return 0;

  char *citationType = 0;
  rv = prefBranch->GetCharPref("mail.compose.citationType", &citationType);
                          
  if (NS_SUCCEEDED(rv) && citationType[0] && !strncmp(citationType, "aol", 3))
    citer = new nsAOLCiter;
  else
    citer = new nsInternetCiter;

  if (citationType)
    PL_strfree(citationType);

  if (citer)
    NS_ADDREF(citer);
  return citer;
}

Here is the call 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;
}