diff --git a/mailnews/mime/cthandlers/calendar/Makefile.in b/mailnews/mime/cthandlers/calendar/Makefile.in index cae62b1d51fc..845689227bd0 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 85d4be32eb17..162d4795bfc1 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 55b5d99076af..c679959279f4 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 8e23f3052e63..c0bbb1a5cdc9 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 38e8b783a680..000000000000 --- a/mailnews/mime/cthandlers/calendar/mimexpcom.cpp +++ /dev/null @@ -1,158 +0,0 @@ -/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: NPL 1.1/GPL 2.0/LGPL 2.1 - * - * 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/ - * - * 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. - * - * The Original Code is mozilla.org code. - * - * The Initial Developer of the Original Code is - * Netscape Communications Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Pierre Phaneuf - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the NPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the NPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ -#include "nsIComponentManager.h" -#include "nsMimeObjectClassAccess.h" -#include "nsCOMPtr.h" -#include "nsMsgMimeCID.h" - -static NS_DEFINE_CID(kMimeObjectClassAccessCID, NS_MIME_OBJECT_CLASS_ACCESS_CID); - -/* - * These calls are necessary to expose the object class heirarchy - * to externally developed content type handlers. - */ -extern "C" void * -COM_GetmimeInlineTextClass(void) -{ - nsCOMPtr objAccess; - void *ptr = NULL; - - nsresult res = nsComponentManager::CreateInstance(kMimeObjectClassAccessCID, - NULL, NS_GET_IID(nsIMimeObjectClassAccess), - (void **) getter_AddRefs(objAccess)); - if (NS_SUCCEEDED(res) && objAccess) - objAccess->GetmimeInlineTextClass(&ptr); - - return ptr; -} - -extern "C" void * -COM_GetmimeLeafClass(void) -{ - nsCOMPtr objAccess; - void *ptr = NULL; - - nsresult res = nsComponentManager::CreateInstance(kMimeObjectClassAccessCID, - NULL, NS_GET_IID(nsIMimeObjectClassAccess), - (void **) getter_AddRefs(objAccess)); - if (NS_SUCCEEDED(res) && objAccess) - objAccess->GetmimeLeafClass(&ptr); - - return ptr; -} - -extern "C" void * -COM_GetmimeObjectClass(void) -{ - nsCOMPtr objAccess; - void *ptr = NULL; - - nsresult res = nsComponentManager::CreateInstance(kMimeObjectClassAccessCID, - NULL, NS_GET_IID(nsIMimeObjectClassAccess), - (void **) getter_AddRefs(objAccess)); - if (NS_SUCCEEDED(res) && objAccess) - objAccess->GetmimeObjectClass(&ptr); - - return ptr; -} - -extern "C" void * -COM_GetmimeContainerClass(void) -{ - nsCOMPtr objAccess; - void *ptr = NULL; - - nsresult res = nsComponentManager::CreateInstance(kMimeObjectClassAccessCID, - NULL, NS_GET_IID(nsIMimeObjectClassAccess), - (void **) getter_AddRefs(objAccess)); - if (NS_SUCCEEDED(res) && objAccess) - objAccess->GetmimeContainerClass(&ptr); - - return ptr; -} - -extern "C" void * -COM_GetmimeMultipartClass(void) -{ - nsCOMPtr objAccess; - void *ptr = NULL; - - nsresult res = nsComponentManager::CreateInstance(kMimeObjectClassAccessCID, - NULL, NS_GET_IID(nsIMimeObjectClassAccess), - (void **) getter_AddRefs(objAccess)); - if (NS_SUCCEEDED(res) && objAccess) - objAccess->GetmimeMultipartClass(&ptr); - - return ptr; -} - -extern "C" void * -COM_GetmimeMultipartSignedClass(void) -{ - nsCOMPtr objAccess; - void *ptr = NULL; - - nsresult res = nsComponentManager::CreateInstance(kMimeObjectClassAccessCID, - NULL, NS_GET_IID(nsIMimeObjectClassAccess), - (void **) getter_AddRefs(objAccess)); - if (NS_SUCCEEDED(res) && objAccess) - objAccess->GetmimeMultipartSignedClass(&ptr); - - return ptr; -} - -extern "C" int -COM_MimeObject_write(void *mimeObject, char *data, PRInt32 length, - PRBool user_visible_p) -{ - nsCOMPtr objAccess; - PRInt32 rc=-1; - - nsresult res = nsComponentManager::CreateInstance(kMimeObjectClassAccessCID, - NULL, NS_GET_IID(nsIMimeObjectClassAccess), - (void **) getter_AddRefs(objAccess)); - if (NS_SUCCEEDED(res) && objAccess) - { - if (NS_SUCCEEDED(objAccess->MimeObjectWrite(mimeObject, data, length, user_visible_p))) - rc = length; - else - rc = -1; - } - - return rc; -} diff --git a/mailnews/mime/cthandlers/calendar/mimexpcom.h b/mailnews/mime/cthandlers/calendar/mimexpcom.h deleted file mode 100644 index a94d219694e8..000000000000 --- a/mailnews/mime/cthandlers/calendar/mimexpcom.h +++ /dev/null @@ -1,126 +0,0 @@ -/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: NPL 1.1/GPL 2.0/LGPL 2.1 - * - * 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/ - * - * 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. - * - * The Original Code is mozilla.org code. - * - * The Initial Developer of the Original Code is - * Netscape Communications Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the NPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the NPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -/* - * This is the definitions for the Content Type Handler plugins to - * access internals of libmime via XP-COM calls - */ -#ifndef _MIMEXPCOM_H_ -#define _MIMEXPCOM_H_ - -/* - This header exposes functions that are necessary to access the - object heirarchy for the mime chart. The class hierarchy is: - - MimeObject (abstract) - | - |--- MimeContainer (abstract) - | | - | |--- MimeMultipart (abstract) - | | | - | | |--- MimeMultipartMixed - | | | - | | |--- MimeMultipartDigest - | | | - | | |--- MimeMultipartParallel - | | | - | | |--- MimeMultipartAlternative - | | | - | | |--- MimeMultipartRelated - | | | - | | |--- MimeMultipartAppleDouble - | | | - | | |--- MimeSunAttachment - | | | - | | |--- MimeMultipartSigned (abstract) - | | | - | | |--- MimeMultipartSigned - | | - | |--- MimeXlateed (abstract) - | | | - | | |--- MimeXlateed - | | - | |--- MimeMessage - | | - | |--- MimeUntypedText - | - |--- MimeLeaf (abstract) - | | - | |--- MimeInlineText (abstract) - | | | - | | |--- MimeInlineTextPlain - | | | - | | |--- MimeInlineTextHTML - | | | - | | |--- MimeInlineTextRichtext - | | | | - | | | |--- MimeInlineTextEnriched - | | | - | | |--- MimeInlineTextVCard - | | | - | | |--- MimeInlineTextCalendar - | | - | |--- MimeInlineImage - | | - | |--- MimeExternalObject - | - |--- MimeExternalBody - */ - -/* - * These functions are exposed by libmime to be used by content type - * handler plugins for processing stream data. - */ -/* - * This is the write call for outputting processed stream data. - */ -extern "C" int COM_MimeObject_write(void *mimeObject, char *data, - PRInt32 length, - PRBool user_visible_p); -/* - * The following group of calls expose the pointers for the object - * system within libmime. - */ -extern "C" void *COM_GetmimeInlineTextClass(void); -extern "C" void *COM_GetmimeLeafClass(void); -extern "C" void *COM_GetmimeObjectClass(void); -extern "C" void *COM_GetmimeContainerClass(void); -extern "C" void *COM_GetmimeMultipartClass(void); -extern "C" void *COM_GetmimeMultipartSignedClass(void); - - -#endif /* _MIMEXPCOM_H_ */ diff --git a/mailnews/mime/cthandlers/calendar/nsCalendarFactory.cpp b/mailnews/mime/cthandlers/calendar/nsCalendarFactory.cpp index 93e40e79ad38..b79911d555ad 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 7c82e24ca9c0..000000000000 --- a/mailnews/mime/cthandlers/calendar/nsMimeContentTypeHandler.cpp +++ /dev/null @@ -1,109 +0,0 @@ -/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: NPL 1.1/GPL 2.0/LGPL 2.1 - * - * 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/ - * - * 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. - * - * The Original Code is mozilla.org code. - * - * The Initial Developer of the Original Code is - * Netscape Communications Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Pierre Phaneuf - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the NPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the NPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ -#include "stdio.h" -#include "nscore.h" -#include "plstr.h" -#include "prtypes.h" -//#include "mimecth.h" -#include "nsMimeContentTypeHandler.h" - -/* - * This function will be used by the factory to generate an - * mime object class object.... - */ -nsresult NS_NewMimeContentTypeHandler(nsIMimeContentTypeHandler ** aInstancePtrResult) -{ - /* note this new macro for assertions...they can take - a string describing the assertion */ - NS_PRECONDITION(nsnull != aInstancePtrResult, "nsnull ptr"); - if (nsnull != aInstancePtrResult) - { - nsMimeContentTypeHandler *obj = new nsMimeContentTypeHandler(); - if (obj) - return obj->QueryInterface(NS_GET_IID(nsIMimeContentTypeHandler), (void**) aInstancePtrResult); - else - return NS_ERROR_OUT_OF_MEMORY; /* we couldn't allocate the object */ - } - else - return NS_ERROR_NULL_POINTER; /* aInstancePtrResult was NULL....*/ -} - -/* - * The following macros actually implement addref, release and - * query interface for our component. - */ -NS_IMPL_ISUPPORTS1(nsMimeContentTypeHandler, nsIMimeContentTypeHandler) - -/* - * nsIMimeEmitter definitions.... - */ -nsMimeContentTypeHandler::nsMimeContentTypeHandler() -{ - /* the following macro is used to initialize the ref counting data */ - NS_INIT_REFCNT(); - -} - -nsMimeContentTypeHandler::~nsMimeContentTypeHandler(void) -{ -} - -extern "C" char *MIME_GetContentType(void); -extern "C" MimeObjectClass *MIME_CreateContentTypeHandlerClass(const char *content_type, - contentTypeHandlerInitStruct *initStruct); - -// Get the content type if necessary -nsresult -nsMimeContentTypeHandler::GetContentType(char **contentType) -{ - *contentType = MIME_GetContentType(); - return NS_OK; -} - -// Set the output stream for processed data. -nsresult -nsMimeContentTypeHandler::CreateContentTypeHandlerClass(const char *content_type, - contentTypeHandlerInitStruct *initStruct, - MimeObjectClass **objClass) -{ - *objClass = MIME_CreateContentTypeHandlerClass(content_type, initStruct); - if (!*objClass) - return NS_ERROR_OUT_OF_MEMORY; /* we couldn't allocate the object */ - else - return NS_OK; -} diff --git a/mailnews/mime/cthandlers/calendar/nsMimeContentTypeHandler.h b/mailnews/mime/cthandlers/calendar/nsMimeContentTypeHandler.h deleted file mode 100644 index 0a57248659c6..000000000000 --- a/mailnews/mime/cthandlers/calendar/nsMimeContentTypeHandler.h +++ /dev/null @@ -1,75 +0,0 @@ -/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: NPL 1.1/GPL 2.0/LGPL 2.1 - * - * 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/ - * - * 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. - * - * The Original Code is mozilla.org code. - * - * The Initial Developer of the Original Code is - * Netscape Communications Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the NPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the NPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -/* - * This interface is implemented by content type handlers that will be - * called upon by libmime to process various attachments types. The primary - * purpose of these handlers will be to represent the attached data in a - * viewable HTML format that is useful for the user - * - * Note: These will all register by their content type prefixed by the - * following: mimecth:text/vcard - * - * libmime will then use nsComponentManager::ContractIDToCLSID() to - * locate the appropriate Content Type handler - */ -#ifndef nsMimeContentTypeHandler_h_ -#define nsMimeContentTypeHandler_h_ - -#include "prtypes.h" -#include "nsIMimeContentTypeHandler.h" - -class nsMimeContentTypeHandler : public nsIMimeContentTypeHandler { -public: - nsMimeContentTypeHandler (); - virtual ~nsMimeContentTypeHandler (void); - - /* this macro defines QueryInterface, AddRef and Release for this class */ - NS_DECL_ISUPPORTS - - NS_IMETHOD GetContentType(char **contentType); - - NS_IMETHOD CreateContentTypeHandlerClass(const char *content_type, - contentTypeHandlerInitStruct *initStruct, - MimeObjectClass **objClass); -}; - -/* this function will be used by the factory to generate an class access object....*/ -extern nsresult NS_NewMimeContentTypeHandler(nsIMimeContentTypeHandler **aInstancePtrResult); - - -#endif /* nsMimeContentTypeHandler_h_ */ diff --git a/mailnews/mime/cthandlers/smimestub/Makefile.in b/mailnews/mime/cthandlers/smimestub/Makefile.in index f8010c142a43..c84115cadd19 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 f6929b06fdb6..c4fdad016c4c 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 38e8b783a680..000000000000 --- a/mailnews/mime/cthandlers/smimestub/mimexpcom.cpp +++ /dev/null @@ -1,158 +0,0 @@ -/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: NPL 1.1/GPL 2.0/LGPL 2.1 - * - * 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/ - * - * 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. - * - * The Original Code is mozilla.org code. - * - * The Initial Developer of the Original Code is - * Netscape Communications Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Pierre Phaneuf - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the NPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the NPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ -#include "nsIComponentManager.h" -#include "nsMimeObjectClassAccess.h" -#include "nsCOMPtr.h" -#include "nsMsgMimeCID.h" - -static NS_DEFINE_CID(kMimeObjectClassAccessCID, NS_MIME_OBJECT_CLASS_ACCESS_CID); - -/* - * These calls are necessary to expose the object class heirarchy - * to externally developed content type handlers. - */ -extern "C" void * -COM_GetmimeInlineTextClass(void) -{ - nsCOMPtr objAccess; - void *ptr = NULL; - - nsresult res = nsComponentManager::CreateInstance(kMimeObjectClassAccessCID, - NULL, NS_GET_IID(nsIMimeObjectClassAccess), - (void **) getter_AddRefs(objAccess)); - if (NS_SUCCEEDED(res) && objAccess) - objAccess->GetmimeInlineTextClass(&ptr); - - return ptr; -} - -extern "C" void * -COM_GetmimeLeafClass(void) -{ - nsCOMPtr objAccess; - void *ptr = NULL; - - nsresult res = nsComponentManager::CreateInstance(kMimeObjectClassAccessCID, - NULL, NS_GET_IID(nsIMimeObjectClassAccess), - (void **) getter_AddRefs(objAccess)); - if (NS_SUCCEEDED(res) && objAccess) - objAccess->GetmimeLeafClass(&ptr); - - return ptr; -} - -extern "C" void * -COM_GetmimeObjectClass(void) -{ - nsCOMPtr objAccess; - void *ptr = NULL; - - nsresult res = nsComponentManager::CreateInstance(kMimeObjectClassAccessCID, - NULL, NS_GET_IID(nsIMimeObjectClassAccess), - (void **) getter_AddRefs(objAccess)); - if (NS_SUCCEEDED(res) && objAccess) - objAccess->GetmimeObjectClass(&ptr); - - return ptr; -} - -extern "C" void * -COM_GetmimeContainerClass(void) -{ - nsCOMPtr objAccess; - void *ptr = NULL; - - nsresult res = nsComponentManager::CreateInstance(kMimeObjectClassAccessCID, - NULL, NS_GET_IID(nsIMimeObjectClassAccess), - (void **) getter_AddRefs(objAccess)); - if (NS_SUCCEEDED(res) && objAccess) - objAccess->GetmimeContainerClass(&ptr); - - return ptr; -} - -extern "C" void * -COM_GetmimeMultipartClass(void) -{ - nsCOMPtr objAccess; - void *ptr = NULL; - - nsresult res = nsComponentManager::CreateInstance(kMimeObjectClassAccessCID, - NULL, NS_GET_IID(nsIMimeObjectClassAccess), - (void **) getter_AddRefs(objAccess)); - if (NS_SUCCEEDED(res) && objAccess) - objAccess->GetmimeMultipartClass(&ptr); - - return ptr; -} - -extern "C" void * -COM_GetmimeMultipartSignedClass(void) -{ - nsCOMPtr objAccess; - void *ptr = NULL; - - nsresult res = nsComponentManager::CreateInstance(kMimeObjectClassAccessCID, - NULL, NS_GET_IID(nsIMimeObjectClassAccess), - (void **) getter_AddRefs(objAccess)); - if (NS_SUCCEEDED(res) && objAccess) - objAccess->GetmimeMultipartSignedClass(&ptr); - - return ptr; -} - -extern "C" int -COM_MimeObject_write(void *mimeObject, char *data, PRInt32 length, - PRBool user_visible_p) -{ - nsCOMPtr objAccess; - PRInt32 rc=-1; - - nsresult res = nsComponentManager::CreateInstance(kMimeObjectClassAccessCID, - NULL, NS_GET_IID(nsIMimeObjectClassAccess), - (void **) getter_AddRefs(objAccess)); - if (NS_SUCCEEDED(res) && objAccess) - { - if (NS_SUCCEEDED(objAccess->MimeObjectWrite(mimeObject, data, length, user_visible_p))) - rc = length; - else - rc = -1; - } - - return rc; -} diff --git a/mailnews/mime/cthandlers/smimestub/mimexpcom.h b/mailnews/mime/cthandlers/smimestub/mimexpcom.h deleted file mode 100644 index a94d219694e8..000000000000 --- a/mailnews/mime/cthandlers/smimestub/mimexpcom.h +++ /dev/null @@ -1,126 +0,0 @@ -/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: NPL 1.1/GPL 2.0/LGPL 2.1 - * - * 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/ - * - * 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. - * - * The Original Code is mozilla.org code. - * - * The Initial Developer of the Original Code is - * Netscape Communications Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the NPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the NPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -/* - * This is the definitions for the Content Type Handler plugins to - * access internals of libmime via XP-COM calls - */ -#ifndef _MIMEXPCOM_H_ -#define _MIMEXPCOM_H_ - -/* - This header exposes functions that are necessary to access the - object heirarchy for the mime chart. The class hierarchy is: - - MimeObject (abstract) - | - |--- MimeContainer (abstract) - | | - | |--- MimeMultipart (abstract) - | | | - | | |--- MimeMultipartMixed - | | | - | | |--- MimeMultipartDigest - | | | - | | |--- MimeMultipartParallel - | | | - | | |--- MimeMultipartAlternative - | | | - | | |--- MimeMultipartRelated - | | | - | | |--- MimeMultipartAppleDouble - | | | - | | |--- MimeSunAttachment - | | | - | | |--- MimeMultipartSigned (abstract) - | | | - | | |--- MimeMultipartSigned - | | - | |--- MimeXlateed (abstract) - | | | - | | |--- MimeXlateed - | | - | |--- MimeMessage - | | - | |--- MimeUntypedText - | - |--- MimeLeaf (abstract) - | | - | |--- MimeInlineText (abstract) - | | | - | | |--- MimeInlineTextPlain - | | | - | | |--- MimeInlineTextHTML - | | | - | | |--- MimeInlineTextRichtext - | | | | - | | | |--- MimeInlineTextEnriched - | | | - | | |--- MimeInlineTextVCard - | | | - | | |--- MimeInlineTextCalendar - | | - | |--- MimeInlineImage - | | - | |--- MimeExternalObject - | - |--- MimeExternalBody - */ - -/* - * These functions are exposed by libmime to be used by content type - * handler plugins for processing stream data. - */ -/* - * This is the write call for outputting processed stream data. - */ -extern "C" int COM_MimeObject_write(void *mimeObject, char *data, - PRInt32 length, - PRBool user_visible_p); -/* - * The following group of calls expose the pointers for the object - * system within libmime. - */ -extern "C" void *COM_GetmimeInlineTextClass(void); -extern "C" void *COM_GetmimeLeafClass(void); -extern "C" void *COM_GetmimeObjectClass(void); -extern "C" void *COM_GetmimeContainerClass(void); -extern "C" void *COM_GetmimeMultipartClass(void); -extern "C" void *COM_GetmimeMultipartSignedClass(void); - - -#endif /* _MIMEXPCOM_H_ */ diff --git a/mailnews/mime/cthandlers/smimestub/nsMimeContentTypeHandler.cpp b/mailnews/mime/cthandlers/smimestub/nsMimeContentTypeHandler.cpp deleted file mode 100644 index 7c82e24ca9c0..000000000000 --- a/mailnews/mime/cthandlers/smimestub/nsMimeContentTypeHandler.cpp +++ /dev/null @@ -1,109 +0,0 @@ -/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: NPL 1.1/GPL 2.0/LGPL 2.1 - * - * 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/ - * - * 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. - * - * The Original Code is mozilla.org code. - * - * The Initial Developer of the Original Code is - * Netscape Communications Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Pierre Phaneuf - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the NPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the NPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ -#include "stdio.h" -#include "nscore.h" -#include "plstr.h" -#include "prtypes.h" -//#include "mimecth.h" -#include "nsMimeContentTypeHandler.h" - -/* - * This function will be used by the factory to generate an - * mime object class object.... - */ -nsresult NS_NewMimeContentTypeHandler(nsIMimeContentTypeHandler ** aInstancePtrResult) -{ - /* note this new macro for assertions...they can take - a string describing the assertion */ - NS_PRECONDITION(nsnull != aInstancePtrResult, "nsnull ptr"); - if (nsnull != aInstancePtrResult) - { - nsMimeContentTypeHandler *obj = new nsMimeContentTypeHandler(); - if (obj) - return obj->QueryInterface(NS_GET_IID(nsIMimeContentTypeHandler), (void**) aInstancePtrResult); - else - return NS_ERROR_OUT_OF_MEMORY; /* we couldn't allocate the object */ - } - else - return NS_ERROR_NULL_POINTER; /* aInstancePtrResult was NULL....*/ -} - -/* - * The following macros actually implement addref, release and - * query interface for our component. - */ -NS_IMPL_ISUPPORTS1(nsMimeContentTypeHandler, nsIMimeContentTypeHandler) - -/* - * nsIMimeEmitter definitions.... - */ -nsMimeContentTypeHandler::nsMimeContentTypeHandler() -{ - /* the following macro is used to initialize the ref counting data */ - NS_INIT_REFCNT(); - -} - -nsMimeContentTypeHandler::~nsMimeContentTypeHandler(void) -{ -} - -extern "C" char *MIME_GetContentType(void); -extern "C" MimeObjectClass *MIME_CreateContentTypeHandlerClass(const char *content_type, - contentTypeHandlerInitStruct *initStruct); - -// Get the content type if necessary -nsresult -nsMimeContentTypeHandler::GetContentType(char **contentType) -{ - *contentType = MIME_GetContentType(); - return NS_OK; -} - -// Set the output stream for processed data. -nsresult -nsMimeContentTypeHandler::CreateContentTypeHandlerClass(const char *content_type, - contentTypeHandlerInitStruct *initStruct, - MimeObjectClass **objClass) -{ - *objClass = MIME_CreateContentTypeHandlerClass(content_type, initStruct); - if (!*objClass) - return NS_ERROR_OUT_OF_MEMORY; /* we couldn't allocate the object */ - else - return NS_OK; -} diff --git a/mailnews/mime/cthandlers/smimestub/nsMimeContentTypeHandler.h b/mailnews/mime/cthandlers/smimestub/nsMimeContentTypeHandler.h deleted file mode 100644 index 0a57248659c6..000000000000 --- a/mailnews/mime/cthandlers/smimestub/nsMimeContentTypeHandler.h +++ /dev/null @@ -1,75 +0,0 @@ -/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: NPL 1.1/GPL 2.0/LGPL 2.1 - * - * 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/ - * - * 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. - * - * The Original Code is mozilla.org code. - * - * The Initial Developer of the Original Code is - * Netscape Communications Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the NPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the NPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -/* - * This interface is implemented by content type handlers that will be - * called upon by libmime to process various attachments types. The primary - * purpose of these handlers will be to represent the attached data in a - * viewable HTML format that is useful for the user - * - * Note: These will all register by their content type prefixed by the - * following: mimecth:text/vcard - * - * libmime will then use nsComponentManager::ContractIDToCLSID() to - * locate the appropriate Content Type handler - */ -#ifndef nsMimeContentTypeHandler_h_ -#define nsMimeContentTypeHandler_h_ - -#include "prtypes.h" -#include "nsIMimeContentTypeHandler.h" - -class nsMimeContentTypeHandler : public nsIMimeContentTypeHandler { -public: - nsMimeContentTypeHandler (); - virtual ~nsMimeContentTypeHandler (void); - - /* this macro defines QueryInterface, AddRef and Release for this class */ - NS_DECL_ISUPPORTS - - NS_IMETHOD GetContentType(char **contentType); - - NS_IMETHOD CreateContentTypeHandlerClass(const char *content_type, - contentTypeHandlerInitStruct *initStruct, - MimeObjectClass **objClass); -}; - -/* this function will be used by the factory to generate an class access object....*/ -extern nsresult NS_NewMimeContentTypeHandler(nsIMimeContentTypeHandler **aInstancePtrResult); - - -#endif /* nsMimeContentTypeHandler_h_ */ diff --git a/mailnews/mime/cthandlers/smimestub/nsSMIMEStub.cpp b/mailnews/mime/cthandlers/smimestub/nsSMIMEStub.cpp index c97f140325b8..2db6a55eaa90 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 c199526eaaec..0b9b8a863c0c 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 817ee5fa5ab4..580f4ae1b09e 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 1f618ece1399..2bc8dd02ffb1 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 595e2b9c2a8b..4b9ae3d3481b 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 e1500191939a..000000000000 --- a/mailnews/mime/cthandlers/vcard/mimexpcom.cpp +++ /dev/null @@ -1,157 +0,0 @@ -/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: NPL 1.1/GPL 2.0/LGPL 2.1 - * - * 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/ - * - * 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. - * - * The Original Code is mozilla.org code. - * - * The Initial Developer of the Original Code is - * Netscape Communications Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Pierre Phaneuf - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the NPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the NPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ -#include "nsIComponentManager.h" -#include "nsMimeObjectClassAccess.h" -#include "nsMsgMimeCID.h" -#include "nsCOMPtr.h" -static NS_DEFINE_CID(kMimeObjectClassAccessCID, NS_MIME_OBJECT_CLASS_ACCESS_CID); - -/* - * These calls are necessary to expose the object class heirarchy - * to externally developed content type handlers. - */ -extern "C" void * -COM_GetmimeInlineTextClass(void) -{ - nsCOMPtr objAccess; - void *ptr = NULL; - - nsresult res = nsComponentManager::CreateInstance(kMimeObjectClassAccessCID, - NULL, NS_GET_IID(nsIMimeObjectClassAccess), - (void **) getter_AddRefs(objAccess)); - if (NS_SUCCEEDED(res) && objAccess) - objAccess->GetmimeInlineTextClass(&ptr); - - return ptr; -} - -extern "C" void * -COM_GetmimeLeafClass(void) -{ - nsCOMPtr objAccess; - void *ptr = NULL; - - nsresult res = nsComponentManager::CreateInstance(kMimeObjectClassAccessCID, - NULL, NS_GET_IID(nsIMimeObjectClassAccess), - (void **) getter_AddRefs(objAccess)); - if (NS_SUCCEEDED(res) && objAccess) - objAccess->GetmimeLeafClass(&ptr); - - return ptr; -} - -extern "C" void * -COM_GetmimeObjectClass(void) -{ - nsCOMPtr objAccess; - void *ptr = NULL; - - nsresult res = nsComponentManager::CreateInstance(kMimeObjectClassAccessCID, - NULL, NS_GET_IID(nsIMimeObjectClassAccess), - (void **) getter_AddRefs(objAccess)); - if (NS_SUCCEEDED(res) && objAccess) - objAccess->GetmimeObjectClass(&ptr); - - return ptr; -} - -extern "C" void * -COM_GetmimeContainerClass(void) -{ - nsCOMPtr objAccess; - void *ptr = NULL; - - nsresult res = nsComponentManager::CreateInstance(kMimeObjectClassAccessCID, - NULL, NS_GET_IID(nsIMimeObjectClassAccess), - (void **) getter_AddRefs(objAccess)); - if (NS_SUCCEEDED(res) && objAccess) - objAccess->GetmimeContainerClass(&ptr); - - return ptr; -} - -extern "C" void * -COM_GetmimeMultipartClass(void) -{ - nsCOMPtr objAccess; - void *ptr = NULL; - - nsresult res = nsComponentManager::CreateInstance(kMimeObjectClassAccessCID, - NULL, NS_GET_IID(nsIMimeObjectClassAccess), - (void **) getter_AddRefs(objAccess)); - if (NS_SUCCEEDED(res) && objAccess) - objAccess->GetmimeMultipartClass(&ptr); - - return ptr; -} - -extern "C" void * -COM_GetmimeMultipartSignedClass(void) -{ - nsCOMPtr objAccess; - void *ptr = NULL; - - nsresult res = nsComponentManager::CreateInstance(kMimeObjectClassAccessCID, - NULL, NS_GET_IID(nsIMimeObjectClassAccess), - (void **) getter_AddRefs(objAccess)); - if (NS_SUCCEEDED(res) && objAccess) - objAccess->GetmimeMultipartSignedClass(&ptr); - - return ptr; -} - -extern "C" int -COM_MimeObject_write(void *mimeObject, char *data, PRInt32 length, - PRBool user_visible_p) -{ - nsCOMPtr objAccess; - PRInt32 rc=-1; - - nsresult res = nsComponentManager::CreateInstance(kMimeObjectClassAccessCID, - NULL, NS_GET_IID(nsIMimeObjectClassAccess), - (void **) getter_AddRefs(objAccess)); - if (NS_SUCCEEDED(res) && objAccess) - { - if (NS_SUCCEEDED(objAccess->MimeObjectWrite(mimeObject, data, length, user_visible_p))) - rc = length; - else - rc = -1; - } - - return rc; -} diff --git a/mailnews/mime/cthandlers/vcard/mimexpcom.h b/mailnews/mime/cthandlers/vcard/mimexpcom.h deleted file mode 100644 index 25a272e0070a..000000000000 --- a/mailnews/mime/cthandlers/vcard/mimexpcom.h +++ /dev/null @@ -1,125 +0,0 @@ -/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: NPL 1.1/GPL 2.0/LGPL 2.1 - * - * 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/ - * - * 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. - * - * The Original Code is mozilla.org code. - * - * The Initial Developer of the Original Code is - * Netscape Communications Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the NPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the NPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -/* - * This is the definitions for the Content Type Handler plugins to - * access internals of libmime via XP-COM calls - */ -#ifndef _MIMEXPCOM_H_ -#define _MIMEXPCOM_H_ - -/* - This header exposes functions that are necessary to access the - object heirarchy for the mime chart. The class hierarchy is: - - MimeObject (abstract) - | - |--- MimeContainer (abstract) - | | - | |--- MimeMultipart (abstract) - | | | - | | |--- MimeMultipartMixed - | | | - | | |--- MimeMultipartDigest - | | | - | | |--- MimeMultipartParallel - | | | - | | |--- MimeMultipartAlternative - | | | - | | |--- MimeMultipartRelated - | | | - | | |--- MimeMultipartAppleDouble - | | | - | | |--- MimeSunAttachment - | | | - | | |--- MimeMultipartSigned (abstract) - | | | - | | |--- MimeMultipartSigned - | | - | |--- MimeXlateed (abstract) - | | | - | | |--- MimeXlateed - | | - | |--- MimeMessage - | | - | |--- MimeUntypedText - | - |--- MimeLeaf (abstract) - | | - | |--- MimeInlineText (abstract) - | | | - | | |--- MimeInlineTextPlain - | | | - | | |--- MimeInlineTextHTML - | | | - | | |--- MimeInlineTextRichtext - | | | | - | | | |--- MimeInlineTextEnriched - | | | - | | |--- MimeInlineTextVCard - | | | - | | |--- MimeInlineTextCalendar - | | - | |--- MimeInlineImage - | | - | |--- MimeExternalObject - | - |--- MimeExternalBody - */ - -/* - * These functions are exposed by libmime to be used by content type - * handler plugins for processing stream data. - */ -/* - * This is the write call for outputting processed stream data. - */ -extern "C" int COM_MimeObject_write(void *mimeObject, char *data, - PRInt32 length, - PRBool user_visible_p); -/* - * The following group of calls expose the pointers for the object - * system within libmime. - */ -extern "C" void *COM_GetmimeInlineTextClass(void); -extern "C" void *COM_GetmimeLeafClass(void); -extern "C" void *COM_GetmimeObjectClass(void); -extern "C" void *COM_GetmimeContainerClass(void); -extern "C" void *COM_GetmimeMultipartClass(void); -extern "C" void *COM_GetmimeMultipartSignedClass(void); - -#endif /* _MIMEXPCOM_H_ */ diff --git a/mailnews/mime/cthandlers/vcard/nsMimeContentTypeHandler.cpp b/mailnews/mime/cthandlers/vcard/nsMimeContentTypeHandler.cpp deleted file mode 100644 index 7854f464f0f2..000000000000 --- a/mailnews/mime/cthandlers/vcard/nsMimeContentTypeHandler.cpp +++ /dev/null @@ -1,110 +0,0 @@ -/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: NPL 1.1/GPL 2.0/LGPL 2.1 - * - * 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/ - * - * 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. - * - * The Original Code is mozilla.org code. - * - * The Initial Developer of the Original Code is - * Netscape Communications Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Pierre Phaneuf - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the NPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the NPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ -#include "stdio.h" -#include "nscore.h" -#include "plstr.h" -#include "prtypes.h" -//#include "mimecth.h" -#include "nsMimeContentTypeHandler.h" - -/* - * This function will be used by the factory to generate an - * mime object class object.... - */ -nsresult NS_NewMimeContentTypeHandler(nsIMimeContentTypeHandler ** aInstancePtrResult) -{ - /* note this new macro for assertions...they can take - a string describing the assertion */ - //nsresult result = NS_OK; - NS_PRECONDITION(nsnull != aInstancePtrResult, "nsnull ptr"); - if (nsnull != aInstancePtrResult) - { - nsMimeContentTypeHandler *obj = new nsMimeContentTypeHandler(); - if (obj) - return obj->QueryInterface(NS_GET_IID(nsIMimeContentTypeHandler), (void**) aInstancePtrResult); - else - return NS_ERROR_OUT_OF_MEMORY; /* we couldn't allocate the object */ - } - else - return NS_ERROR_NULL_POINTER; /* aInstancePtrResult was NULL....*/ -} - -/* - * The following macros actually implement addref, release and - * query interface for our component. - */ -NS_IMPL_ISUPPORTS1(nsMimeContentTypeHandler, nsIMimeContentTypeHandler) - -/* - * nsIMimeEmitter definitions.... - */ -nsMimeContentTypeHandler::nsMimeContentTypeHandler() -{ - /* the following macro is used to initialize the ref counting data */ - NS_INIT_REFCNT(); - -} - -nsMimeContentTypeHandler::~nsMimeContentTypeHandler(void) -{ -} - -extern "C" char *MIME_GetContentType(void); -extern "C" MimeObjectClass *MIME_CreateContentTypeHandlerClass(const char *content_type, - contentTypeHandlerInitStruct *initStruct); - -// Get the content type if necessary -nsresult -nsMimeContentTypeHandler::GetContentType(char **contentType) -{ - *contentType = MIME_GetContentType(); - return NS_OK; -} - -// Set the output stream for processed data. -nsresult -nsMimeContentTypeHandler::CreateContentTypeHandlerClass(const char *content_type, - contentTypeHandlerInitStruct *initStruct, - MimeObjectClass **objClass) -{ - *objClass = MIME_CreateContentTypeHandlerClass(content_type, initStruct); - if (!*objClass) - return NS_ERROR_OUT_OF_MEMORY; /* we couldn't allocate the object */ - else - return NS_OK; -} diff --git a/mailnews/mime/cthandlers/vcard/nsMimeContentTypeHandler.h b/mailnews/mime/cthandlers/vcard/nsMimeContentTypeHandler.h deleted file mode 100644 index 0a57248659c6..000000000000 --- a/mailnews/mime/cthandlers/vcard/nsMimeContentTypeHandler.h +++ /dev/null @@ -1,75 +0,0 @@ -/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: NPL 1.1/GPL 2.0/LGPL 2.1 - * - * 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/ - * - * 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. - * - * The Original Code is mozilla.org code. - * - * The Initial Developer of the Original Code is - * Netscape Communications Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the NPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the NPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -/* - * This interface is implemented by content type handlers that will be - * called upon by libmime to process various attachments types. The primary - * purpose of these handlers will be to represent the attached data in a - * viewable HTML format that is useful for the user - * - * Note: These will all register by their content type prefixed by the - * following: mimecth:text/vcard - * - * libmime will then use nsComponentManager::ContractIDToCLSID() to - * locate the appropriate Content Type handler - */ -#ifndef nsMimeContentTypeHandler_h_ -#define nsMimeContentTypeHandler_h_ - -#include "prtypes.h" -#include "nsIMimeContentTypeHandler.h" - -class nsMimeContentTypeHandler : public nsIMimeContentTypeHandler { -public: - nsMimeContentTypeHandler (); - virtual ~nsMimeContentTypeHandler (void); - - /* this macro defines QueryInterface, AddRef and Release for this class */ - NS_DECL_ISUPPORTS - - NS_IMETHOD GetContentType(char **contentType); - - NS_IMETHOD CreateContentTypeHandlerClass(const char *content_type, - contentTypeHandlerInitStruct *initStruct, - MimeObjectClass **objClass); -}; - -/* this function will be used by the factory to generate an class access object....*/ -extern nsresult NS_NewMimeContentTypeHandler(nsIMimeContentTypeHandler **aInstancePtrResult); - - -#endif /* nsMimeContentTypeHandler_h_ */ diff --git a/mailnews/mime/cthandlers/vcard/nsVCardFactory.cpp b/mailnews/mime/cthandlers/vcard/nsVCardFactory.cpp index 0b7e98ac8933..2145d685f30b 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 24707b321351..cfd708143810 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