Back to index

lightning-sunbird  0.9+nobinonly
Defines | Functions
nsComposerDocumentCommands.cpp File Reference
#include "nsIEditor.h"
#include "nsIEditingSession.h"
#include "nsIPlaintextEditor.h"
#include "nsIHTMLEditor.h"
#include "nsIHTMLObjectResizer.h"
#include "nsIHTMLInlineTableEditor.h"
#include "nsIDOMDocument.h"
#include "nsIDocument.h"
#include "nsISelectionController.h"
#include "nsIPresShell.h"
#include "nsPresContext.h"
#include "nsIDocShell.h"
#include "nsIURI.h"
#include "nsCOMPtr.h"
#include "nsComposerCommands.h"
#include "nsICommandParams.h"
#include "nsCRT.h"

Go to the source code of this file.

Defines

#define STATE_ENABLED   "state_enabled"
#define STATE_ATTRIBUTE   "state_attribute"
#define STATE_DATA   "state_data"

Functions

static nsresult GetPresContextFromEditor (nsIEditor *aEditor, nsPresContext **aResult)

Define Documentation

#define STATE_ATTRIBUTE   "state_attribute"

Definition at line 66 of file nsComposerDocumentCommands.cpp.

#define STATE_DATA   "state_data"

Definition at line 67 of file nsComposerDocumentCommands.cpp.

#define STATE_ENABLED   "state_enabled"

Definition at line 65 of file nsComposerDocumentCommands.cpp.


Function Documentation

static nsresult GetPresContextFromEditor ( nsIEditor aEditor,
nsPresContext **  aResult 
) [static]

Definition at line 71 of file nsComposerDocumentCommands.cpp.

{
  NS_ENSURE_ARG_POINTER(aResult);
  *aResult = nsnull;
  NS_ENSURE_ARG_POINTER(aEditor);

  nsCOMPtr<nsISelectionController> selCon;
  nsresult rv = aEditor->GetSelectionController(getter_AddRefs(selCon));
  if (NS_FAILED(rv)) return rv;
  if (!selCon) return NS_ERROR_FAILURE;

  nsCOMPtr<nsIPresShell> presShell = do_QueryInterface(selCon);
  if (!presShell) return NS_ERROR_FAILURE;

  NS_IF_ADDREF(*aResult = presShell->GetPresContext());
  return NS_OK;
}

Here is the call graph for this function: