diff --git a/mailnews/mime/cthandlers/calendar/Makefile.in b/mailnews/mime/cthandlers/calendar/Makefile.in index cae62b1d51f..845689227bd 100644 --- a/mailnews/mime/cthandlers/calendar/Makefile.in +++ b/mailnews/mime/cthandlers/calendar/Makefile.in @@ -33,19 +33,21 @@ EXPORT_LIBRARY = 1 IS_COMPONENT = 1 MODULE_NAME = nsCalendarModule +EXTRA_DSO_LIBS = mimecthglue_s + CPPSRCS = \ - mimexpcom.cpp \ mimecal.cpp \ - nsMimeContentTypeHandler.cpp \ nsCalendarFactory.cpp \ $(NULL) EXTRA_DSO_LDOPTS = \ -L$(DIST)/bin \ -L$(DIST)/lib \ - $(XPCOM_LIBS) \ - $(NSPR_LIBS) \ + $(EXTRA_DSO_LIBS) \ + $(MOZ_COMPONENT_LIBS) \ $(NULL) include $(topsrcdir)/config/rules.mk +LOCAL_INCLUDES = $(srcdir)/../glue + diff --git a/mailnews/mime/cthandlers/calendar/makefile.win b/mailnews/mime/cthandlers/calendar/makefile.win index 85d4be32eb1..162d4795bfc 100644 --- a/mailnews/mime/cthandlers/calendar/makefile.win +++ b/mailnews/mime/cthandlers/calendar/makefile.win @@ -47,6 +47,15 @@ MODULE_NAME = nsCalendarModule # Exported headers here!!! # $(NULL) +REQUIRES = \ + xpcom \ + string \ + mime \ + msgbase \ + pref \ + necko \ + uconv \ + $(NULL) DEFINES= -DEBUG_rhp -D_IMPL_NS_HTML @@ -58,8 +67,6 @@ DEFINES= -DEBUG_rhp -D_IMPL_NS_HTML OBJS= \ .\$(OBJDIR)\mimecal.obj \ - .\$(OBJDIR)\mimexpcom.obj \ - .\$(OBJDIR)\nsMimeContentTypeHandler.obj \ .\$(OBJDIR)\nsCalendarFactory.obj \ $(NULL) @@ -96,9 +103,12 @@ LCFLAGS=-DNETSCAPE MSGLIBS= \ $(NULL) +LINCS= -I..\glue + # These are the libraries we need to link with to create the dll LLIBS= \ $(LLIBS) \ + $(DIST)\lib\mimecthglue_s.lib \ $(LIBNSPR) \ $(DIST)\lib\xpcom.lib \ $(NULL) diff --git a/mailnews/mime/cthandlers/calendar/mimecal.cpp b/mailnews/mime/cthandlers/calendar/mimecal.cpp index 55b5d99076a..c679959279f 100644 --- a/mailnews/mime/cthandlers/calendar/mimecal.cpp +++ b/mailnews/mime/cthandlers/calendar/mimecal.cpp @@ -50,26 +50,14 @@ static int MimeInlineTextCalendar_parse_begin (MimeObject *obj); extern "C" int CAL_OUT_OF_MEMORY = -1000; -/* - * These functions are the public interface for this content type - * handler and will be called in by the mime component. - */ -#define CAL_CONTENT_TYPE "text/calendar" - /* This is the object definition. Note: we will set the superclass to NULL and manually set this on the class creation */ MimeDefClass(MimeInlineTextCalendar, MimeInlineTextCalendarClass, mimeInlineTextCalendarClass, NULL); -extern "C" char * -MIME_GetContentType(void) -{ - return CAL_CONTENT_TYPE; -} - extern "C" MimeObjectClass * -MIME_CreateContentTypeHandlerClass(const char *content_type, - contentTypeHandlerInitStruct *initStruct) +MIME_CalendarCreateContentTypeHandlerClass(const char *content_type, + contentTypeHandlerInitStruct *initStruct) { MimeObjectClass *clazz = (MimeObjectClass *)&mimeInlineTextCalendarClass; /* @@ -143,7 +131,7 @@ MimeInlineTextCalendar_parse_line(char *line, PRInt32 length, MimeObject *obj) if (!obj->output_p) return 0; if (!obj->options || !obj->options->output_fn) return 0; if (!obj->options->write_html_p) { - return COM_MimeObject_write(obj, line, length, TRUE); + return COM_MimeObject_write(obj, line, length, PR_TRUE); } if (clazz->bufferlen + length >= clazz->buffermax) { @@ -180,7 +168,7 @@ MimeInlineTextCalendar_parse_eof (MimeObject *obj, PRBool abort_p) clazz->buffer = NULL; if (status < 0) return status; - status = COM_MimeObject_write(obj, html, PL_strlen(html), TRUE); + status = COM_MimeObject_write(obj, html, PL_strlen(html), PR_TRUE); PR_Free(html); if (status < 0) return status; diff --git a/mailnews/mime/cthandlers/calendar/mimecal.h b/mailnews/mime/cthandlers/calendar/mimecal.h index 8e23f3052e6..c0bbb1a5cdc 100644 --- a/mailnews/mime/cthandlers/calendar/mimecal.h +++ b/mailnews/mime/cthandlers/calendar/mimecal.h @@ -39,6 +39,12 @@ #include "mimetext.h" +/* + * These functions are the public interface for this content type + * handler and will be called in by the mime component. + */ +#define CAL_CONTENT_TYPE "text/calendar" + /* The MimeInlineTextCalendar class implements the text/calendar MIME content types. */ diff --git a/mailnews/mime/cthandlers/calendar/mimexpcom.cpp b/mailnews/mime/cthandlers/calendar/mimexpcom.cpp deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/mailnews/mime/cthandlers/calendar/mimexpcom.h b/mailnews/mime/cthandlers/calendar/mimexpcom.h deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/mailnews/mime/cthandlers/calendar/nsCalendarFactory.cpp b/mailnews/mime/cthandlers/calendar/nsCalendarFactory.cpp index 93e40e79ad3..b79911d555a 100644 --- a/mailnews/mime/cthandlers/calendar/nsCalendarFactory.cpp +++ b/mailnews/mime/cthandlers/calendar/nsCalendarFactory.cpp @@ -41,6 +41,7 @@ /* Include all of the interfaces our factory can generate components for */ #include "nsMimeContentTypeHandler.h" +#include "mimecal.h" //////////////////////////////////////////////////////////////////////// // Define the contructor function for the CID @@ -51,7 +52,39 @@ // // NOTE: This creates an instance by using the default constructor // -NS_GENERIC_FACTORY_CONSTRUCTOR(nsMimeContentTypeHandler) +//NS_GENERIC_FACTORY_CONSTRUCTOR(nsMimeContentTypeHandler) +extern "C" MimeObjectClass * +MIME_CalendarCreateContentTypeHandlerClass(const char *content_type, + contentTypeHandlerInitStruct *initStruct); + +static NS_IMETHODIMP +nsCalendarMimeContentTypeHandlerConstructor(nsISupports *aOuter, + REFNSIID aIID, + void **aResult) +{ + nsresult rv; + nsMimeContentTypeHandler *inst = nsnull; + + if (NULL == aResult) { + rv = NS_ERROR_NULL_POINTER; + return rv; + } + *aResult = NULL; + if (NULL != aOuter) { + rv = NS_ERROR_NO_AGGREGATION; + return rv; + } + inst = new nsMimeContentTypeHandler(CAL_CONTENT_TYPE, + &MIME_CalendarCreateContentTypeHandlerClass); + if (inst == NULL) { + return NS_ERROR_OUT_OF_MEMORY; + } + NS_ADDREF(inst); + rv = inst->QueryInterface(aIID,aResult); + NS_RELEASE(inst); + + return rv; +} //////////////////////////////////////////////////////////////////////// // Define a table of CIDs implemented by this module along with other @@ -61,7 +94,7 @@ NS_GENERIC_FACTORY_CONSTRUCTOR(nsMimeContentTypeHandler) static nsModuleComponentInfo components[] = { { "MIME Calendar Handler", NS_CALENDAR_CONTENT_TYPE_HANDLER_CID, "@mozilla.org/mimecth;1?type=text/calendar", - nsMimeContentTypeHandlerConstructor, } + nsCalendarMimeContentTypeHandlerConstructor, } }; //////////////////////////////////////////////////////////////////////// @@ -69,3 +102,6 @@ static nsModuleComponentInfo components[] = // and the entire implementation of the module object. // NS_IMPL_NSGETMODULE(nsCalendarModule, components) + + + diff --git a/mailnews/mime/cthandlers/calendar/nsMimeContentTypeHandler.cpp b/mailnews/mime/cthandlers/calendar/nsMimeContentTypeHandler.cpp deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/mailnews/mime/cthandlers/calendar/nsMimeContentTypeHandler.h b/mailnews/mime/cthandlers/calendar/nsMimeContentTypeHandler.h deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/mailnews/mime/cthandlers/smimestub/Makefile.in b/mailnews/mime/cthandlers/smimestub/Makefile.in index f8010c142a4..c84115cadd1 100644 --- a/mailnews/mime/cthandlers/smimestub/Makefile.in +++ b/mailnews/mime/cthandlers/smimestub/Makefile.in @@ -42,19 +42,20 @@ REQUIRES = xpcom \ intl \ $(NULL) +EXTRA_DSO_LIBS = mimecthglue_s + CPPSRCS = \ - mimexpcom.cpp \ nsSMIMEStub.cpp \ - nsMimeContentTypeHandler.cpp \ nsSMIMEStubFactory.cpp \ $(NULL) EXTRA_DSO_LDOPTS = \ -L$(DIST)/bin \ -L$(DIST)/lib \ - $(XPCOM_LIBS) \ - $(NSPR_LIBS) \ + $(EXTRA_DSO_LIBS) \ + $(MOZ_COMPONENT_LIBS) \ $(NULL) include $(topsrcdir)/config/rules.mk +LOCAL_INCLUDES = -I$(srcdir)/../glue diff --git a/mailnews/mime/cthandlers/smimestub/Makefile.win b/mailnews/mime/cthandlers/smimestub/Makefile.win index f6929b06fdb..c4fdad016c4 100644 --- a/mailnews/mime/cthandlers/smimestub/Makefile.win +++ b/mailnews/mime/cthandlers/smimestub/Makefile.win @@ -58,8 +58,6 @@ DEFINES= -DEBUG_rhp -D_IMPL_NS_HTML OBJS= \ .\$(OBJDIR)\nsSMIMEStub.obj \ - .\$(OBJDIR)\mimexpcom.obj \ - .\$(OBJDIR)\nsMimeContentTypeHandler.obj \ .\$(OBJDIR)\nsSMIMEStubFactory.obj \ $(NULL) @@ -100,9 +98,12 @@ LCFLAGS=-DNETSCAPE MSGLIBS= \ $(NULL) +LINCS= -I..\glue + # These are the libraries we need to link with to create the dll LLIBS= \ $(LLIBS) \ + $(DIST)\lib\mimecthglue_s.lib \ $(LIBNSPR) \ $(DIST)\lib\xpcom.lib \ $(NULL) diff --git a/mailnews/mime/cthandlers/smimestub/mimexpcom.cpp b/mailnews/mime/cthandlers/smimestub/mimexpcom.cpp deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/mailnews/mime/cthandlers/smimestub/mimexpcom.h b/mailnews/mime/cthandlers/smimestub/mimexpcom.h deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/mailnews/mime/cthandlers/smimestub/nsMimeContentTypeHandler.cpp b/mailnews/mime/cthandlers/smimestub/nsMimeContentTypeHandler.cpp deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/mailnews/mime/cthandlers/smimestub/nsMimeContentTypeHandler.h b/mailnews/mime/cthandlers/smimestub/nsMimeContentTypeHandler.h deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/mailnews/mime/cthandlers/smimestub/nsSMIMEStub.cpp b/mailnews/mime/cthandlers/smimestub/nsSMIMEStub.cpp index c97f140325b..2db6a55eaa9 100644 --- a/mailnews/mime/cthandlers/smimestub/nsSMIMEStub.cpp +++ b/mailnews/mime/cthandlers/smimestub/nsSMIMEStub.cpp @@ -116,15 +116,8 @@ static int MimeInlineTextSMIMEStub_parse_begin (MimeObject *obj); MimeDefClass(MimeInlineTextSMIMEStub, MimeInlineTextSMIMEStubClass, mimeInlineTextSMIMEStubClass, NULL); -extern "C" char * -MIME_GetContentType(void) -{ - return SMIME_CONTENT_TYPE; -} - - extern "C" MimeObjectClass * -MIME_CreateContentTypeHandlerClass(const char *content_type, +MIME_SMimeCreateContentTypeHandlerClass(const char *content_type, contentTypeHandlerInitStruct *initStruct) { MimeObjectClass *clazz = (MimeObjectClass *)&mimeInlineTextSMIMEStubClass; diff --git a/mailnews/mime/cthandlers/smimestub/nsSMIMEStubFactory.cpp b/mailnews/mime/cthandlers/smimestub/nsSMIMEStubFactory.cpp index c199526eaae..0b9b8a863c0 100644 --- a/mailnews/mime/cthandlers/smimestub/nsSMIMEStubFactory.cpp +++ b/mailnews/mime/cthandlers/smimestub/nsSMIMEStubFactory.cpp @@ -61,6 +61,7 @@ #include "nsIGenericFactory.h" /* Include all of the interfaces our factory can generate components for */ +#include "nsSMIMEStub.h" #include "nsMimeContentTypeHandler.h" //////////////////////////////////////////////////////////////////////// @@ -72,7 +73,39 @@ // // NOTE: This creates an instance by using the default constructor // -NS_GENERIC_FACTORY_CONSTRUCTOR(nsMimeContentTypeHandler) +//NS_GENERIC_FACTORY_CONSTRUCTOR(nsMimeContentTypeHandler) +extern "C" MimeObjectClass * +MIME_SMimeCreateContentTypeHandlerClass(const char *content_type, + contentTypeHandlerInitStruct *initStruct); + +static NS_IMETHODIMP +nsSMimeMimeContentTypeHandlerConstructor(nsISupports *aOuter, + REFNSIID aIID, + void **aResult) +{ + nsresult rv; + nsMimeContentTypeHandler *inst = nsnull; + + if (NULL == aResult) { + rv = NS_ERROR_NULL_POINTER; + return rv; + } + *aResult = NULL; + if (NULL != aOuter) { + rv = NS_ERROR_NO_AGGREGATION; + return rv; + } + inst = new nsMimeContentTypeHandler(SMIME_CONTENT_TYPE, + &MIME_SMimeCreateContentTypeHandlerClass); + if (inst == NULL) { + return NS_ERROR_OUT_OF_MEMORY; + } + NS_ADDREF(inst); + rv = inst->QueryInterface(aIID,aResult); + NS_RELEASE(inst); + + return rv; +} //////////////////////////////////////////////////////////////////////// // Define a table of CIDs implemented by this module along with other @@ -82,10 +115,10 @@ NS_GENERIC_FACTORY_CONSTRUCTOR(nsMimeContentTypeHandler) static nsModuleComponentInfo components[] = { { "MIME SMIMEStubed Mail Handler", NS_SMIME_CONTENT_TYPE_HANDLER_CID, "@mozilla.org/mimecth;1?type=application/x-pkcs7-mime", - nsMimeContentTypeHandlerConstructor, }, + nsSMimeMimeContentTypeHandlerConstructor, }, { "MIME SMIMEStubed Mail Handler", NS_SMIME_CONTENT_TYPE_HANDLER_CID, "@mozilla.org/mimecth;1?type=application/pkcs7-mime", - nsMimeContentTypeHandlerConstructor, } + nsSMimeMimeContentTypeHandlerConstructor, } }; diff --git a/mailnews/mime/cthandlers/vcard/Makefile.in b/mailnews/mime/cthandlers/vcard/Makefile.in index 817ee5fa5ab..580f4ae1b09 100644 --- a/mailnews/mime/cthandlers/vcard/Makefile.in +++ b/mailnews/mime/cthandlers/vcard/Makefile.in @@ -51,13 +51,13 @@ else EXTRA_DSO_LIBS = msgbaseutil endif +EXTRA_DSO_LIBS += mimecthglue_s + CPPSRCS = \ mimevcrd.cpp \ - mimexpcom.cpp \ nsVCard.cpp \ nsVCardObj.cpp \ nsVCardFactory.cpp \ - nsMimeContentTypeHandler.cpp \ $(NULL) EXTRA_DSO_LDOPTS = \ @@ -69,3 +69,4 @@ EXTRA_DSO_LDOPTS = \ include $(topsrcdir)/config/rules.mk +LOCAL_INCLUDES = -I$(srcdir)/../glue diff --git a/mailnews/mime/cthandlers/vcard/makefile.win b/mailnews/mime/cthandlers/vcard/makefile.win index 1f618ece139..2bc8dd02ffb 100644 --- a/mailnews/mime/cthandlers/vcard/makefile.win +++ b/mailnews/mime/cthandlers/vcard/makefile.win @@ -72,11 +72,9 @@ DEFINES= -DEBUG_rhp -D_IMPL_NS_HTML OBJS= \ .\$(OBJDIR)\mimevcrd.obj \ - .\$(OBJDIR)\mimexpcom.obj \ .\$(OBJDIR)\nsVCard.obj \ .\$(OBJDIR)\nsVCardObj.obj \ .\$(OBJDIR)\nsVCardFactory.obj \ - .\$(OBJDIR)\nsMimeContentTypeHandler.obj \ $(NULL) #//------------------------------------------------------------------------ @@ -107,9 +105,12 @@ LCFLAGS=-DNETSCAPE MSGLIBS= \ $(NULL) +LINCS= -I..\glue + # These are the libraries we need to link with to create the dll LLIBS= \ $(LLIBS) \ + $(DIST)\lib\mimecthglue_s.lib \ $(LIBNSPR) \ $(DIST)\lib\js32$(VERSION_NUMBER).lib \ $(DIST)\lib\xpcom.lib \ diff --git a/mailnews/mime/cthandlers/vcard/mimevcrd.cpp b/mailnews/mime/cthandlers/vcard/mimevcrd.cpp index 595e2b9c2a8..4b9ae3d3481 100644 --- a/mailnews/mime/cthandlers/vcard/mimevcrd.cpp +++ b/mailnews/mime/cthandlers/vcard/mimevcrd.cpp @@ -101,13 +101,6 @@ typedef struct // Define CIDs... static NS_DEFINE_CID(kIOServiceCID, NS_IOSERVICE_CID); -/* - * These functions are the public interface for this content type - * handler and will be called in by the mime component. - */ -#define VCARD_CONTENT_TYPE "text/x-vcard" - - /* This is the next generation string retrieval call */ static NS_DEFINE_CID(kPrefCID, NS_PREF_CID); static NS_DEFINE_CID(kStringBundleServiceCID, NS_STRINGBUNDLESERVICE_CID); @@ -119,14 +112,8 @@ static NS_DEFINE_CID(kStringBundleServiceCID, NS_STRINGBUNDLESERVICE_CID); MimeDefClass(MimeInlineTextVCard, MimeInlineTextVCardClass, mimeInlineTextVCardClass, NULL); -extern "C" char * -MIME_GetContentType(void) -{ - return VCARD_CONTENT_TYPE; -} - extern "C" MimeObjectClass * -MIME_CreateContentTypeHandlerClass(const char *content_type, +MIME_VCardCreateContentTypeHandlerClass(const char *content_type, contentTypeHandlerInitStruct *initStruct) { MimeObjectClass *clazz = (MimeObjectClass *)&mimeInlineTextVCardClass; diff --git a/mailnews/mime/cthandlers/vcard/mimexpcom.cpp b/mailnews/mime/cthandlers/vcard/mimexpcom.cpp deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/mailnews/mime/cthandlers/vcard/mimexpcom.h b/mailnews/mime/cthandlers/vcard/mimexpcom.h deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/mailnews/mime/cthandlers/vcard/nsMimeContentTypeHandler.cpp b/mailnews/mime/cthandlers/vcard/nsMimeContentTypeHandler.cpp deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/mailnews/mime/cthandlers/vcard/nsMimeContentTypeHandler.h b/mailnews/mime/cthandlers/vcard/nsMimeContentTypeHandler.h deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/mailnews/mime/cthandlers/vcard/nsVCardFactory.cpp b/mailnews/mime/cthandlers/vcard/nsVCardFactory.cpp index 0b7e98ac893..2145d685f30 100644 --- a/mailnews/mime/cthandlers/vcard/nsVCardFactory.cpp +++ b/mailnews/mime/cthandlers/vcard/nsVCardFactory.cpp @@ -40,6 +40,12 @@ /* Include all of the interfaces our factory can generate components for */ #include "nsMimeContentTypeHandler.h" +/* + * These functions are the public interface for this content type + * handler and will be called in by the mime component. + */ +#define VCARD_CONTENT_TYPE "text/x-vcard" + //////////////////////////////////////////////////////////////////////// // Define the contructor function for the CID // @@ -49,7 +55,39 @@ // // NOTE: This creates an instance by using the default constructor // -NS_GENERIC_FACTORY_CONSTRUCTOR(nsMimeContentTypeHandler) +//NS_GENERIC_FACTORY_CONSTRUCTOR(nsMimeContentTypeHandler) +extern "C" MimeObjectClass * +MIME_VCardCreateContentTypeHandlerClass(const char *content_type, + contentTypeHandlerInitStruct *initStruct); + +static NS_IMETHODIMP +nsVCardMimeContentTypeHandlerConstructor(nsISupports *aOuter, + REFNSIID aIID, + void **aResult) +{ + nsresult rv; + nsMimeContentTypeHandler *inst = nsnull; + + if (NULL == aResult) { + rv = NS_ERROR_NULL_POINTER; + return rv; + } + *aResult = NULL; + if (NULL != aOuter) { + rv = NS_ERROR_NO_AGGREGATION; + return rv; + } + inst = new nsMimeContentTypeHandler(VCARD_CONTENT_TYPE, + &MIME_VCardCreateContentTypeHandlerClass); + if (inst == NULL) { + return NS_ERROR_OUT_OF_MEMORY; + } + NS_ADDREF(inst); + rv = inst->QueryInterface(aIID,aResult); + NS_RELEASE(inst); + + return rv; +} //////////////////////////////////////////////////////////////////////// // Define a table of CIDs implemented by this module along with other @@ -59,7 +97,7 @@ NS_GENERIC_FACTORY_CONSTRUCTOR(nsMimeContentTypeHandler) static nsModuleComponentInfo components[] = { { "MIME VCard Handler", NS_VCARD_CONTENT_TYPE_HANDLER_CID, "@mozilla.org/mimecth;1?type=text/x-vcard", - nsMimeContentTypeHandlerConstructor, } + nsVCardMimeContentTypeHandlerConstructor, } }; //////////////////////////////////////////////////////////////////////// diff --git a/mailnews/mime/cthandlers/vcard/vcard.def b/mailnews/mime/cthandlers/vcard/vcard.def index 24707b32135..cfd70814381 100644 --- a/mailnews/mime/cthandlers/vcard/vcard.def +++ b/mailnews/mime/cthandlers/vcard/vcard.def @@ -20,5 +20,3 @@ LIBRARY vcard.dll EXPORTS - MIME_GetContentType - MIME_CreateContentTypeHandlerClass