Back to index

lightning-sunbird  0.9+nobinonly
Defines | Functions | Variables
nsComposerRegistration.cpp File Reference
#include "nsIGenericFactory.h"
#include "nsEditingSession.h"
#include "nsComposerController.h"
#include "nsEditorSpellCheck.h"
#include "nsComposeTxtSrvFilter.h"
#include "nsIController.h"
#include "nsIControllerContext.h"
#include "nsIControllerCommandTable.h"
#include "nsServiceManagerUtils.h"

Go to the source code of this file.

Defines

#define NS_HTMLEDITOR_COMMANDTABLE_CID   { 0x13e50d8d, 0x9cee, 0x4ad1, { 0xa3, 0xa2, 0x4a, 0x44, 0x2f, 0xdf, 0x7d, 0xfa } }
#define NS_HTMLEDITOR_DOCSTATE_COMMANDTABLE_CID   { 0xa33982d3, 0x1adf, 0x4162, { 0x99, 0x41, 0xf7, 0x34, 0xbc, 0x45, 0xe4, 0xed } }

Functions

static NS_DEFINE_CID (kHTMLEditorCommandTableCID, NS_HTMLEDITOR_COMMANDTABLE_CID)
static NS_DEFINE_CID (kHTMLEditorDocStateCommandTableCID, NS_HTMLEDITOR_DOCSTATE_COMMANDTABLE_CID)
static NS_METHOD nsComposeTxtSrvFilterConstructor (nsISupports *aOuter, REFNSIID aIID, void **aResult, PRBool aIsForMail)
static NS_METHOD nsComposeTxtSrvFilterConstructorForComposer (nsISupports *aOuter, REFNSIID aIID, void **aResult)
static NS_METHOD nsComposeTxtSrvFilterConstructorForMail (nsISupports *aOuter, REFNSIID aIID, void **aResult)
static nsresult CreateControllerWithSingletonCommandTable (const nsCID &inCommandTableCID, nsIController **aResult)
static NS_METHOD nsHTMLEditorDocStateControllerConstructor (nsISupports *aOuter, REFNSIID aIID, void **aResult)
static NS_METHOD nsHTMLEditorControllerConstructor (nsISupports *aOuter, REFNSIID aIID, void **aResult)
static NS_METHOD nsHTMLEditorCommandTableConstructor (nsISupports *aOuter, REFNSIID aIID, void **aResult)
static NS_METHOD nsHTMLEditorDocStateCommandTableConstructor (nsISupports *aOuter, REFNSIID aIID, void **aResult)

Variables

static const nsModuleComponentInfo components []

Define Documentation

#define NS_HTMLEDITOR_COMMANDTABLE_CID   { 0x13e50d8d, 0x9cee, 0x4ad1, { 0xa3, 0xa2, 0x4a, 0x44, 0x2f, 0xdf, 0x7d, 0xfa } }

Definition at line 52 of file nsComposerRegistration.cpp.

#define NS_HTMLEDITOR_DOCSTATE_COMMANDTABLE_CID   { 0xa33982d3, 0x1adf, 0x4162, { 0x99, 0x41, 0xf7, 0x34, 0xbc, 0x45, 0xe4, 0xed } }

Definition at line 55 of file nsComposerRegistration.cpp.


Function Documentation

static nsresult CreateControllerWithSingletonCommandTable ( const nsCID inCommandTableCID,
nsIController **  aResult 
) [static]

Definition at line 125 of file nsComposerRegistration.cpp.

{
  nsresult rv;
  nsCOMPtr<nsIController> controller = do_CreateInstance("@mozilla.org/embedcomp/base-command-controller;1", &rv);
  if (NS_FAILED(rv)) return rv;

  nsCOMPtr<nsIControllerCommandTable> composerCommandTable = do_GetService(inCommandTableCID, &rv);
  if (NS_FAILED(rv)) return rv;
  
  // this guy is a singleton, so make it immutable
  composerCommandTable->MakeImmutable();
  
  nsCOMPtr<nsIControllerContext> controllerContext = do_QueryInterface(controller, &rv);
  if (NS_FAILED(rv)) return rv;
  
  rv = controllerContext->Init(composerCommandTable);
  if (NS_FAILED(rv)) return rv;
  
  *aResult = controller;
  NS_ADDREF(*aResult);
  return NS_OK;
}

Here is the call graph for this function:

Here is the caller graph for this function:

static NS_DEFINE_CID ( kHTMLEditorCommandTableCID  ,
NS_HTMLEDITOR_COMMANDTABLE_CID   
) [static]
static NS_DEFINE_CID ( kHTMLEditorDocStateCommandTableCID  ,
NS_HTMLEDITOR_DOCSTATE_COMMANDTABLE_CID   
) [static]
static NS_METHOD nsComposeTxtSrvFilterConstructor ( nsISupports *  aOuter,
REFNSIID  aIID,
void **  aResult,
PRBool  aIsForMail 
) [static]

Definition at line 79 of file nsComposerRegistration.cpp.

{
    *aResult = NULL;
    if (NULL != aOuter) 
    {
        return NS_ERROR_NO_AGGREGATION;
    }
    nsComposeTxtSrvFilter * inst;
    NS_NEWXPCOM(inst, nsComposeTxtSrvFilter);
    if (NULL == inst) 
    {
        return NS_ERROR_OUT_OF_MEMORY;
    }
    NS_ADDREF(inst);
         inst->Init(aIsForMail);
    nsresult rv = inst->QueryInterface(aIID, aResult);
    NS_RELEASE(inst);
    return rv;
}

Here is the call graph for this function:

Here is the caller graph for this function:

static NS_METHOD nsComposeTxtSrvFilterConstructorForComposer ( nsISupports *  aOuter,
REFNSIID  aIID,
void **  aResult 
) [static]

Definition at line 101 of file nsComposerRegistration.cpp.

Here is the call graph for this function:

static NS_METHOD nsComposeTxtSrvFilterConstructorForMail ( nsISupports *  aOuter,
REFNSIID  aIID,
void **  aResult 
) [static]

Definition at line 109 of file nsComposerRegistration.cpp.

Here is the call graph for this function:

static NS_METHOD nsHTMLEditorCommandTableConstructor ( nsISupports *  aOuter,
REFNSIID  aIID,
void **  aResult 
) [static]

Definition at line 176 of file nsComposerRegistration.cpp.

{
  nsresult rv;
  nsCOMPtr<nsIControllerCommandTable> commandTable =
      do_CreateInstance(NS_CONTROLLERCOMMANDTABLE_CONTRACTID, &rv);
  if (NS_FAILED(rv)) return rv;
  
  rv = nsComposerController::RegisterHTMLEditorCommands(commandTable);
  if (NS_FAILED(rv)) return rv;
  
  // we don't know here whether we're being created as an instance,
  // or a service, so we can't become immutable
  
  return commandTable->QueryInterface(aIID, aResult);
}

Here is the call graph for this function:

static NS_METHOD nsHTMLEditorControllerConstructor ( nsISupports *  aOuter,
REFNSIID  aIID,
void **  aResult 
) [static]

Definition at line 165 of file nsComposerRegistration.cpp.

{
  nsCOMPtr<nsIController> controller;
  nsresult rv = CreateControllerWithSingletonCommandTable(kHTMLEditorCommandTableCID, getter_AddRefs(controller));
  if (NS_FAILED(rv)) return rv;

  return controller->QueryInterface(aIID, aResult);
}

Here is the call graph for this function:

static NS_METHOD nsHTMLEditorDocStateCommandTableConstructor ( nsISupports *  aOuter,
REFNSIID  aIID,
void **  aResult 
) [static]

Definition at line 196 of file nsComposerRegistration.cpp.

{
  nsresult rv;
  nsCOMPtr<nsIControllerCommandTable> commandTable =
      do_CreateInstance(NS_CONTROLLERCOMMANDTABLE_CONTRACTID, &rv);
  if (NS_FAILED(rv)) return rv;
  
  rv = nsComposerController::RegisterEditorDocStateCommands(commandTable);
  if (NS_FAILED(rv)) return rv;
  
  // we don't know here whether we're being created as an instance,
  // or a service, so we can't become immutable
  
  return commandTable->QueryInterface(aIID, aResult);
}

Here is the call graph for this function:

static NS_METHOD nsHTMLEditorDocStateControllerConstructor ( nsISupports *  aOuter,
REFNSIID  aIID,
void **  aResult 
) [static]

Definition at line 152 of file nsComposerRegistration.cpp.

{
  nsCOMPtr<nsIController> controller;
  nsresult rv = CreateControllerWithSingletonCommandTable(kHTMLEditorDocStateCommandTableCID, getter_AddRefs(controller));
  if (NS_FAILED(rv)) return rv;

  return controller->QueryInterface(aIID, aResult);
}

Here is the call graph for this function:


Variable Documentation

Definition at line 218 of file nsComposerRegistration.cpp.