From 48e63af39977b4eb4fb5d35483da908613e8bd15 Mon Sep 17 00:00:00 2001 From: "sspitzer%netscape.com" Date: Wed, 16 Feb 2000 03:14:20 +0000 Subject: [PATCH] move the nsICmdLineHandler responsibilties from nsHTMLEditorLog to nsEditorService. r=sfraser git-svn-id: svn://10.0.0.236/trunk@61035 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/editor/base/Makefile.in | 1 + mozilla/editor/base/makefile.win | 1 + mozilla/editor/base/nsEditorRegistration.cpp | 11 +++++++---- mozilla/editor/base/nsHTMLEditorLog.cpp | 8 -------- mozilla/editor/base/nsHTMLEditorLog.h | 7 +------ mozilla/editor/idl/MANIFEST | 1 + mozilla/editor/idl/Makefile.in | 1 + mozilla/editor/idl/makefile.win | 1 + .../editor/libeditor/build/nsEditorRegistration.cpp | 11 +++++++---- mozilla/editor/libeditor/html/nsHTMLEditorLog.cpp | 8 -------- mozilla/editor/libeditor/html/nsHTMLEditorLog.h | 7 +------ mozilla/editor/public/nsEditorCID.h | 5 +++++ 12 files changed, 26 insertions(+), 36 deletions(-) diff --git a/mozilla/editor/base/Makefile.in b/mozilla/editor/base/Makefile.in index 2a5a231f2ad..82d8b7827ac 100644 --- a/mozilla/editor/base/Makefile.in +++ b/mozilla/editor/base/Makefile.in @@ -32,6 +32,7 @@ IS_COMPONENT = 1 CPPSRCS = \ nsEditor.cpp \ + nsEditorService.cpp \ nsEditorController.cpp \ nsEditorCommands.cpp \ nsEditorUtils.cpp \ diff --git a/mozilla/editor/base/makefile.win b/mozilla/editor/base/makefile.win index f47e8a5147a..40aa8ff888e 100644 --- a/mozilla/editor/base/makefile.win +++ b/mozilla/editor/base/makefile.win @@ -27,6 +27,7 @@ LIBRARY_NAME=ender CPPSRCS = \ nsEditor.cpp \ + nsEditorService.cpp \ nsEditorController.cpp \ nsEditorCommands.cpp \ nsEditorUtils.cpp \ diff --git a/mozilla/editor/base/nsEditorRegistration.cpp b/mozilla/editor/base/nsEditorRegistration.cpp index d78553fb492..2ff6bd0d49a 100644 --- a/mozilla/editor/base/nsEditorRegistration.cpp +++ b/mozilla/editor/base/nsEditorRegistration.cpp @@ -26,7 +26,7 @@ #include "nsEditorShell.h" // for the CID #include "nsEditor.h" // for gInstanceCount #include "nsEditorController.h" //CID - +#include "nsEditorService.h" //////////////////////////////////////////////////////////////////////// // Define the contructor function for the objects @@ -36,6 +36,7 @@ NS_GENERIC_FACTORY_CONSTRUCTOR(nsEditorShell) NS_GENERIC_FACTORY_CONSTRUCTOR(nsEditorController) +NS_GENERIC_FACTORY_CONSTRUCTOR(nsEditorService) #ifdef ENABLE_EDITOR_API_LOG #include "nsHTMLEditorLog.h" @@ -52,9 +53,7 @@ NS_GENERIC_FACTORY_CONSTRUCTOR(nsHTMLEditor) static nsModuleComponentInfo components[] = { #ifdef ENABLE_EDITOR_API_LOG { "HTML Editor", NS_HTMLEDITOR_CID, - "component://netscape/editor/htmleditor", nsHTMLEditorLogConstructor, - nsHTMLEditorLog::RegisterProc, - nsHTMLEditorLog::UnregisterProc, }, + "component://netscape/editor/htmleditor", nsHTMLEditorLogConstructor, }, #else { "HTML Editor", NS_HTMLEDITOR_CID, "component://netscape/editor/htmleditor", nsHTMLEditorConstructor, }, @@ -65,6 +64,10 @@ static nsModuleComponentInfo components[] = { "component://netscape/editor/editorshell", nsEditorShellConstructor, }, { "Editor Shell Spell Checker", NS_EDITORSHELL_CID, "component://netscape/editor/editorspellcheck", nsEditorShellConstructor, }, + { "Editor Service", NS_EDITORSERVICE_CID, + "component://netscape/editor/editorservice", nsEditorServiceConstructor, + nsEditorService::RegisterProc, + nsEditorService::UnregisterProc, }, }; //////////////////////////////////////////////////////////////////////// diff --git a/mozilla/editor/base/nsHTMLEditorLog.cpp b/mozilla/editor/base/nsHTMLEditorLog.cpp index a9a138b6bfa..0b7f083c5a1 100644 --- a/mozilla/editor/base/nsHTMLEditorLog.cpp +++ b/mozilla/editor/base/nsHTMLEditorLog.cpp @@ -33,7 +33,6 @@ #include "nsIDOMRange.h" #include "nsHTMLEditorLog.h" #include "nsCOMPtr.h" -#include "nsICmdLineHandler.h" #include "nsEditorTxnLog.h" @@ -68,11 +67,6 @@ nsHTMLEditorLog::QueryInterface(REFNSIID aIID, void** aInstancePtr) NS_ADDREF_THIS(); return NS_OK; } - if (aIID.Equals(NS_GET_IID(nsICmdLineHandler))) { - *aInstancePtr = (void*)(nsICmdLineHandler*)this; - NS_ADDREF_THIS(); - return NS_OK; - } return nsHTMLEditor::QueryInterface(aIID, aInstancePtr); } @@ -1399,5 +1393,3 @@ function EditorSetSelectionFromOffsets(selRanges) } #endif - -CMDLINEHANDLER_IMPL(nsHTMLEditorLog,"-edit","general.startup.editor","chrome://editor/content/","Start with editor","component://netscape/editor/htmleditor","Editor Cmd Line Handler", PR_TRUE,"about:blank", PR_TRUE) diff --git a/mozilla/editor/base/nsHTMLEditorLog.h b/mozilla/editor/base/nsHTMLEditorLog.h index 7bef47f7ad7..dd296c57388 100644 --- a/mozilla/editor/base/nsHTMLEditorLog.h +++ b/mozilla/editor/base/nsHTMLEditorLog.h @@ -27,7 +27,6 @@ #include "nsIEditorLogging.h" #include "nsIFileSpec.h" #include "nsCOMPtr.h" -#include "nsICmdLineHandler.h" class nsEditorTxnLog; @@ -35,8 +34,7 @@ class nsEditorTxnLog; * */ class nsHTMLEditorLog : public nsHTMLEditor, - public nsIEditorLogging, - public nsICmdLineHandler + public nsIEditorLogging { private: @@ -50,9 +48,6 @@ public: // Interfaces for AddRef, Release, and QueryInterface. NS_DECL_ISUPPORTS_INHERITED - NS_DECL_NSICMDLINEHANDLER - CMDLINEHANDLER_REGISTERPROC_DECLS - nsHTMLEditorLog(); virtual ~nsHTMLEditorLog(); diff --git a/mozilla/editor/idl/MANIFEST b/mozilla/editor/idl/MANIFEST index 6acdff6e70b..f0266194119 100644 --- a/mozilla/editor/idl/MANIFEST +++ b/mozilla/editor/idl/MANIFEST @@ -23,3 +23,4 @@ nsIEditorShell.idl nsIEditorSpellCheck.idl nsIDocumentStateListener.idl +nsIEditorService.idl diff --git a/mozilla/editor/idl/Makefile.in b/mozilla/editor/idl/Makefile.in index d5537bd8d3b..fa5b5d1b713 100644 --- a/mozilla/editor/idl/Makefile.in +++ b/mozilla/editor/idl/Makefile.in @@ -32,6 +32,7 @@ XPIDLSRCS = \ nsIEditorShell.idl \ nsIEditorSpellCheck.idl \ nsIDocumentStateListener.idl \ + nsIEditorService.idl \ $(NULL) include $(topsrcdir)/config/rules.mk diff --git a/mozilla/editor/idl/makefile.win b/mozilla/editor/idl/makefile.win index 4b6ea1cf310..2c5bb4150fc 100644 --- a/mozilla/editor/idl/makefile.win +++ b/mozilla/editor/idl/makefile.win @@ -30,6 +30,7 @@ XPIDL_MODULE=editor XPIDLSRCS = .\nsIEditorShell.idl \ .\nsIEditorSpellCheck.idl \ .\nsIDocumentStateListener.idl \ + .\nsIEditorService.idl \ $(NULL) include <$(DEPTH)\config\rules.mak> diff --git a/mozilla/editor/libeditor/build/nsEditorRegistration.cpp b/mozilla/editor/libeditor/build/nsEditorRegistration.cpp index d78553fb492..2ff6bd0d49a 100644 --- a/mozilla/editor/libeditor/build/nsEditorRegistration.cpp +++ b/mozilla/editor/libeditor/build/nsEditorRegistration.cpp @@ -26,7 +26,7 @@ #include "nsEditorShell.h" // for the CID #include "nsEditor.h" // for gInstanceCount #include "nsEditorController.h" //CID - +#include "nsEditorService.h" //////////////////////////////////////////////////////////////////////// // Define the contructor function for the objects @@ -36,6 +36,7 @@ NS_GENERIC_FACTORY_CONSTRUCTOR(nsEditorShell) NS_GENERIC_FACTORY_CONSTRUCTOR(nsEditorController) +NS_GENERIC_FACTORY_CONSTRUCTOR(nsEditorService) #ifdef ENABLE_EDITOR_API_LOG #include "nsHTMLEditorLog.h" @@ -52,9 +53,7 @@ NS_GENERIC_FACTORY_CONSTRUCTOR(nsHTMLEditor) static nsModuleComponentInfo components[] = { #ifdef ENABLE_EDITOR_API_LOG { "HTML Editor", NS_HTMLEDITOR_CID, - "component://netscape/editor/htmleditor", nsHTMLEditorLogConstructor, - nsHTMLEditorLog::RegisterProc, - nsHTMLEditorLog::UnregisterProc, }, + "component://netscape/editor/htmleditor", nsHTMLEditorLogConstructor, }, #else { "HTML Editor", NS_HTMLEDITOR_CID, "component://netscape/editor/htmleditor", nsHTMLEditorConstructor, }, @@ -65,6 +64,10 @@ static nsModuleComponentInfo components[] = { "component://netscape/editor/editorshell", nsEditorShellConstructor, }, { "Editor Shell Spell Checker", NS_EDITORSHELL_CID, "component://netscape/editor/editorspellcheck", nsEditorShellConstructor, }, + { "Editor Service", NS_EDITORSERVICE_CID, + "component://netscape/editor/editorservice", nsEditorServiceConstructor, + nsEditorService::RegisterProc, + nsEditorService::UnregisterProc, }, }; //////////////////////////////////////////////////////////////////////// diff --git a/mozilla/editor/libeditor/html/nsHTMLEditorLog.cpp b/mozilla/editor/libeditor/html/nsHTMLEditorLog.cpp index a9a138b6bfa..0b7f083c5a1 100644 --- a/mozilla/editor/libeditor/html/nsHTMLEditorLog.cpp +++ b/mozilla/editor/libeditor/html/nsHTMLEditorLog.cpp @@ -33,7 +33,6 @@ #include "nsIDOMRange.h" #include "nsHTMLEditorLog.h" #include "nsCOMPtr.h" -#include "nsICmdLineHandler.h" #include "nsEditorTxnLog.h" @@ -68,11 +67,6 @@ nsHTMLEditorLog::QueryInterface(REFNSIID aIID, void** aInstancePtr) NS_ADDREF_THIS(); return NS_OK; } - if (aIID.Equals(NS_GET_IID(nsICmdLineHandler))) { - *aInstancePtr = (void*)(nsICmdLineHandler*)this; - NS_ADDREF_THIS(); - return NS_OK; - } return nsHTMLEditor::QueryInterface(aIID, aInstancePtr); } @@ -1399,5 +1393,3 @@ function EditorSetSelectionFromOffsets(selRanges) } #endif - -CMDLINEHANDLER_IMPL(nsHTMLEditorLog,"-edit","general.startup.editor","chrome://editor/content/","Start with editor","component://netscape/editor/htmleditor","Editor Cmd Line Handler", PR_TRUE,"about:blank", PR_TRUE) diff --git a/mozilla/editor/libeditor/html/nsHTMLEditorLog.h b/mozilla/editor/libeditor/html/nsHTMLEditorLog.h index 7bef47f7ad7..dd296c57388 100644 --- a/mozilla/editor/libeditor/html/nsHTMLEditorLog.h +++ b/mozilla/editor/libeditor/html/nsHTMLEditorLog.h @@ -27,7 +27,6 @@ #include "nsIEditorLogging.h" #include "nsIFileSpec.h" #include "nsCOMPtr.h" -#include "nsICmdLineHandler.h" class nsEditorTxnLog; @@ -35,8 +34,7 @@ class nsEditorTxnLog; * */ class nsHTMLEditorLog : public nsHTMLEditor, - public nsIEditorLogging, - public nsICmdLineHandler + public nsIEditorLogging { private: @@ -50,9 +48,6 @@ public: // Interfaces for AddRef, Release, and QueryInterface. NS_DECL_ISUPPORTS_INHERITED - NS_DECL_NSICMDLINEHANDLER - CMDLINEHANDLER_REGISTERPROC_DECLS - nsHTMLEditorLog(); virtual ~nsHTMLEditorLog(); diff --git a/mozilla/editor/public/nsEditorCID.h b/mozilla/editor/public/nsEditorCID.h index 27c78fcadb3..abfede691c7 100644 --- a/mozilla/editor/public/nsEditorCID.h +++ b/mozilla/editor/public/nsEditorCID.h @@ -10,6 +10,11 @@ 0xed0244e0, 0xc144, 0x11d2, \ { 0x8f, 0x4c, 0x0, 0x60, 0x08, 0x15, 0x9b, 0x0c } } +#define NS_EDITORSERVICE_CID \ +{/* {91ea5158-1dd2-11b2-939c-cfe895090b1b}*/ \ +0x91ea5158, 0x1dd2, 0x11b2, \ +{ 0x93, 0x9c, 0xcf, 0xe8, 0x95, 0x09, 0x0b, 0x1b} } + #endif //NSEDITORCID_H___