Bug 290247: add simple, scriptable interface for MIME-part conversion and

display.  Components can now implement nsISimpleMimeConverter to
            produce HTML for their chosen content type.  Also removed some
            vestigial references to text/calendar processing. r=bienvenu,
            a=dveditz for the trunk.
This commit is contained in:
shaver%mozilla.org 2005-04-15 17:52:51 +00:00
Родитель 5e3c74fe1b
Коммит 6e25bfe019
7 изменённых файлов: 23 добавлений и 15 удалений

Просмотреть файл

@ -91,8 +91,6 @@
| | | |--- MimeInlineTextEnriched
| | |
| | |--- MimeInlineTextVCard
| | |
| | |--- MimeInlineTextCalendar
| |
| |--- MimeInlineImage
| |

Просмотреть файл

@ -57,6 +57,7 @@ XPIDLSRCS = \
nsIMimeMiscStatus.idl \
nsIMimeHeaders.idl \
nsIMimeConverter.idl \
nsISimpleMimeConverter.idl \
$(NULL)
include $(topsrcdir)/config/rules.mk

Просмотреть файл

@ -68,10 +68,6 @@ typedef struct {
{ 0x20dabda1, 0xf8b5, 0x11d2, \
{ 0x8e, 0xe0, 0x0, 0xa0, 0x24, 0xa7, 0xd1, 0x44 } }
#define NS_CALENDAR_CONTENT_TYPE_HANDLER_CID \
{ 0x20dabdac, 0xf8b5, 0x11d2, \
{ 0x0b, 0xe0, 0x0, 0xa0, 0x24, 0xa7, 0xd1, 0x44 } }
#define NS_SMIME_CONTENT_TYPE_HANDLER_CID \
{ 0x20dabdac, 0xf8b5, 0x11d2, \
{ 0xFF, 0xe0, 0x0, 0xa0, 0x24, 0xa7, 0xd1, 0x44 } }

Просмотреть файл

@ -94,6 +94,7 @@ endif
CPPSRCS = \
nsMimeObjectClassAccess.cpp \
nsMimeConverter.cpp \
nsSimpleMimeConverterStub.cpp \
mimecont.cpp \
mimeebod.cpp \
mimeenc.cpp \

Просмотреть файл

@ -101,8 +101,6 @@
| | | |--- MimeInlineTextEnriched
| | |
| | |--- MimeInlineTextVCard
| | |
| | |--- MimeInlineTextCalendar
| |
| |--- MimeInlineImage
| |

Просмотреть файл

@ -74,7 +74,6 @@
#include "mimetric.h" /* | | |--- MimeInlineTextRichtext */
#include "mimetenr.h" /* | | | |--- MimeInlineTextEnriched */
/* SUPPORTED VIA PLUGIN | | |--- MimeInlineTextVCard */
/* SUPPORTED VIA PLUGIN | | |--- MimeInlineTextCalendar */
#include "mimeiimg.h" /* | |--- MimeInlineImage */
#include "mimeeobj.h" /* | |--- MimeExternalObject */
#include "mimeebod.h" /* |--- MimeExternalBody */
@ -92,6 +91,10 @@
#include "mimemoz2.h"
#include "nsIMimeContentTypeHandler.h"
#include "nsIComponentManager.h"
#include "nsCategoryManagerUtils.h"
#include "nsXPCOMCID.h"
#include "nsISimpleMimeConverter.h"
#include "nsSimpleMimeConverterStub.h"
#include "nsVoidArray.h"
#include "nsMimeStringResources.h"
#include "nsMimeTypes.h"
@ -230,8 +233,22 @@ mime_locate_external_content_handler(const char *content_type,
PR_snprintf(lookupID, sizeof(lookupID), "@mozilla.org/mimecth;1?type=%s", content_type);
ctHandler = do_CreateInstance(lookupID, &rv);
if (NS_FAILED(rv) || !ctHandler)
return nsnull;
if (NS_FAILED(rv) || !ctHandler) {
nsCOMPtr<nsICategoryManager> catman =
do_GetService(NS_CATEGORYMANAGER_CONTRACTID, &rv);
if (NS_FAILED(rv))
return nsnull;
nsXPIDLCString value;
rv = catman->GetCategoryEntry(NS_SIMPLEMIMECONVERTERS_CATEGORY,
content_type, getter_Copies(value));
if (NS_FAILED(rv) || !value)
return nsnull;
rv = MIME_NewSimpleMimeConverterStub(content_type,
getter_AddRefs(ctHandler));
if (NS_FAILED(rv) || !ctHandler)
return nsnull;
}
rv = ctHandler->CreateContentTypeHandlerClass(content_type, ctHandlerInfo, &newObj);
if (NS_FAILED(rv))
@ -495,8 +512,7 @@ mime_find_class (const char *content_type, MimeHeaders *hdrs,
if ((tempClass = mime_locate_external_content_handler(content_type, &ctHandlerInfo)) != NULL)
{
if (types_of_classes_to_disallow > 0
&& (!nsCRT::strncasecmp(content_type, "text/x-vcard", 12) ||
!nsCRT::strncasecmp(content_type, "text/calendar", 13))
&& (!nsCRT::strncasecmp(content_type, "text/x-vcard", 12))
)
/* Use a little hack to prevent some dangerous plugins, which ship
with Mozilla, to run.

Просмотреть файл

@ -110,8 +110,6 @@
| | | \--- MimeInlineTextEnriched
| | |
| | +--- MimeInlineTextVCard
| | |
| | \--- MimeInlineTextCalendar
| |
| +--- MimeInlineImage
| |