1999-08-09 05:34:04 +04:00
|
|
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
|
|
|
*
|
1999-11-06 06:43:54 +03:00
|
|
|
* The contents of this file are subject to the Netscape Public
|
|
|
|
* License Version 1.1 (the "License"); you may not use this file
|
|
|
|
* except in compliance with the License. You may obtain a copy of
|
|
|
|
* the License at http://www.mozilla.org/NPL/
|
1999-08-09 05:34:04 +04:00
|
|
|
*
|
1999-11-06 06:43:54 +03:00
|
|
|
* Software distributed under the License is distributed on an "AS
|
|
|
|
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
|
|
|
|
* implied. See the License for the specific language governing
|
|
|
|
* rights and limitations under the License.
|
1999-08-09 05:34:04 +04:00
|
|
|
*
|
1999-11-06 06:43:54 +03:00
|
|
|
* The Original Code is mozilla.org code.
|
|
|
|
*
|
|
|
|
* The Initial Developer of the Original Code is Netscape
|
1999-08-09 05:34:04 +04:00
|
|
|
* Communications Corporation. Portions created by Netscape are
|
1999-11-06 06:43:54 +03:00
|
|
|
* Copyright (C) 1998 Netscape Communications Corporation. All
|
|
|
|
* Rights Reserved.
|
|
|
|
*
|
|
|
|
* Contributor(s):
|
1999-08-09 05:34:04 +04:00
|
|
|
*/
|
|
|
|
|
1999-11-23 00:03:04 +03:00
|
|
|
#include "nsIGenericFactory.h"
|
1999-08-09 05:34:04 +04:00
|
|
|
|
|
|
|
#include "nsEditorCID.h"
|
|
|
|
#include "nsEditor.h" // for gInstanceCount
|
2000-02-16 06:14:20 +03:00
|
|
|
#include "nsEditorService.h"
|
2001-04-06 03:48:01 +04:00
|
|
|
#include "nsHTMLEditor.h"
|
2001-01-28 23:13:07 +03:00
|
|
|
#include "nsPlaintextEditor.h"
|
1999-08-09 05:34:04 +04:00
|
|
|
|
2001-04-06 03:48:01 +04:00
|
|
|
#include "nsEditorController.h" //CID
|
|
|
|
|
|
|
|
#define DO_COMPOSER_TOO 1
|
|
|
|
#ifdef DO_COMPOSER_TOO
|
|
|
|
#include "nsComposerController.h" //CID
|
|
|
|
#include "nsEditorShell.h" // for the CID
|
|
|
|
#endif /* DO_COMPOSER_TOO */
|
|
|
|
|
|
|
|
|
1999-11-23 00:03:04 +03:00
|
|
|
////////////////////////////////////////////////////////////////////////
|
|
|
|
// Define the contructor function for the objects
|
|
|
|
//
|
|
|
|
// NOTE: This creates an instance of objects by using the default constructor
|
|
|
|
//
|
1999-08-09 05:34:04 +04:00
|
|
|
|
2000-02-16 06:14:20 +03:00
|
|
|
NS_GENERIC_FACTORY_CONSTRUCTOR(nsEditorService)
|
2001-01-28 23:13:07 +03:00
|
|
|
NS_GENERIC_FACTORY_CONSTRUCTOR(nsPlaintextEditor)
|
2001-04-06 03:48:01 +04:00
|
|
|
NS_GENERIC_FACTORY_CONSTRUCTOR(nsEditorController)
|
|
|
|
#ifdef DO_COMPOSER_TOO
|
|
|
|
NS_GENERIC_FACTORY_CONSTRUCTOR(nsComposerController)
|
|
|
|
NS_GENERIC_FACTORY_CONSTRUCTOR(nsEditorShell)
|
|
|
|
#endif /* DO_COMPOSER_TOO */
|
1999-08-09 05:34:04 +04:00
|
|
|
|
1999-10-16 23:34:10 +04:00
|
|
|
#ifdef ENABLE_EDITOR_API_LOG
|
1999-11-23 00:03:04 +03:00
|
|
|
#include "nsHTMLEditorLog.h"
|
|
|
|
NS_GENERIC_FACTORY_CONSTRUCTOR(nsHTMLEditorLog)
|
1999-10-16 23:34:10 +04:00
|
|
|
#else
|
1999-11-23 00:03:04 +03:00
|
|
|
NS_GENERIC_FACTORY_CONSTRUCTOR(nsHTMLEditor)
|
1999-10-16 23:34:10 +04:00
|
|
|
#endif
|
1999-08-09 05:34:04 +04:00
|
|
|
|
1999-11-23 00:03:04 +03:00
|
|
|
////////////////////////////////////////////////////////////////////////
|
|
|
|
// Define a table of CIDs implemented by this module along with other
|
2000-09-14 03:57:52 +04:00
|
|
|
// information like the function to create an instance, contractid, and
|
1999-11-23 00:03:04 +03:00
|
|
|
// class name.
|
|
|
|
//
|
|
|
|
static nsModuleComponentInfo components[] = {
|
2001-01-28 23:13:07 +03:00
|
|
|
{ "Text Editor", NS_TEXTEDITOR_CID,
|
|
|
|
"@mozilla.org/editor/texteditor;1", nsPlaintextEditorConstructor, },
|
1999-11-23 00:03:04 +03:00
|
|
|
#ifdef ENABLE_EDITOR_API_LOG
|
|
|
|
{ "HTML Editor", NS_HTMLEDITOR_CID,
|
2000-09-14 03:57:52 +04:00
|
|
|
"@mozilla.org/editor/htmleditor;1", nsHTMLEditorLogConstructor, },
|
1999-11-23 00:03:04 +03:00
|
|
|
#else
|
|
|
|
{ "HTML Editor", NS_HTMLEDITOR_CID,
|
2000-09-14 03:57:52 +04:00
|
|
|
"@mozilla.org/editor/htmleditor;1", nsHTMLEditorConstructor, },
|
1999-10-16 23:34:10 +04:00
|
|
|
#endif
|
2000-02-16 06:14:20 +03:00
|
|
|
{ "Editor Service", NS_EDITORSERVICE_CID,
|
2000-09-14 03:57:52 +04:00
|
|
|
"@mozilla.org/editor/editorservice;1", nsEditorServiceConstructor,},
|
2000-02-26 06:52:06 +03:00
|
|
|
{ "Editor Startup Handler", NS_EDITORSERVICE_CID,
|
2000-09-14 03:57:52 +04:00
|
|
|
"@mozilla.org/commandlinehandler/general-startup;1?type=editor",
|
2000-02-26 06:52:06 +03:00
|
|
|
nsEditorServiceConstructor,
|
2000-02-16 06:14:20 +03:00
|
|
|
nsEditorService::RegisterProc,
|
|
|
|
nsEditorService::UnregisterProc, },
|
2000-02-26 06:52:06 +03:00
|
|
|
{ "Edit Startup Handler", NS_EDITORSERVICE_CID,
|
2000-09-14 03:57:52 +04:00
|
|
|
"@mozilla.org/commandlinehandler/general-startup;1?type=edit",
|
2000-02-26 06:52:06 +03:00
|
|
|
nsEditorServiceConstructor, },
|
2001-04-06 03:48:01 +04:00
|
|
|
{ "Editor Controller", NS_EDITORCONTROLLER_CID,
|
|
|
|
"@mozilla.org/editor/editorcontroller;1",
|
|
|
|
nsEditorControllerConstructor, },
|
|
|
|
#ifdef DO_COMPOSER_TOO
|
|
|
|
{ "Composer Controller", NS_COMPOSERCONTROLLER_CID,
|
|
|
|
"@mozilla.org/editor/composercontroller;1",
|
|
|
|
nsComposerControllerConstructor, },
|
|
|
|
{ "Editor Shell Component", NS_EDITORSHELL_CID,
|
|
|
|
"@mozilla.org/editor/editorshell;1", nsEditorShellConstructor, },
|
|
|
|
{ "Editor Shell Spell Checker", NS_EDITORSHELL_CID,
|
|
|
|
"@mozilla.org/editor/editorspellcheck;1", nsEditorShellConstructor, },
|
|
|
|
#endif /* DO_COMPOSER_TOO */
|
1999-11-23 00:03:04 +03:00
|
|
|
};
|
1999-10-16 23:34:10 +04:00
|
|
|
|
1999-11-23 00:03:04 +03:00
|
|
|
////////////////////////////////////////////////////////////////////////
|
|
|
|
// Implement the NSGetModule() exported function for your module
|
|
|
|
// and the entire implementation of the module object.
|
|
|
|
//
|
|
|
|
NS_IMPL_NSGETMODULE("nsEditorModule", components)
|