remove signstub: bug 75767 r=ducarroz sr=sspitzer

This commit is contained in:
jgmyers%netscape.com 2001-05-04 23:58:59 +00:00
Родитель 3b4afaffe7
Коммит 34d3a07da4
19 изменённых файлов: 2 добавлений и 1163 удалений

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

@ -1878,7 +1878,6 @@ sub BuildMailNewsProjects()
BuildOneProject(":mozilla:mailnews:mime:emitters:macbuild:mimeEmitter.mcp", "mimeEmitter$D.shlb", 1, $main::ALIAS_SYM_FILES, 1);
BuildOneProject(":mozilla:mailnews:mime:cthandlers:vcard:macbuild:vcard.mcp", "vcard$D.shlb", 1, $main::ALIAS_SYM_FILES, 1);
BuildOneProject(":mozilla:mailnews:mime:cthandlers:smimestub:macbuild:smime.mcp", "smime$D.shlb", 1, $main::ALIAS_SYM_FILES, 1);
BuildOneProject(":mozilla:mailnews:mime:cthandlers:signstub:macbuild:signed.mcp", "signed$D.shlb", 1, $main::ALIAS_SYM_FILES, 1);
# BuildOneProject(":mozilla:mailnews:mime:cthandlers:calendar:macbuild:calendar.mcp", "calendar$D.shlb", 1, $main::ALIAS_SYM_FILES, 1);
BuildOneProject(":mozilla:mailnews:import:macbuild:msgImport.mcp", "msgImport$D.shlb", 1, $main::ALIAS_SYM_FILES, 1);
BuildOneProject(":mozilla:mailnews:import:text:macbuild:msgImportText.mcp", "msgImportText$D.shlb", 1, $main::ALIAS_SYM_FILES, 1);

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

@ -26,7 +26,7 @@ VPATH = @srcdir@
include $(DEPTH)/config/autoconf.mk
DIRS = vcard smimestub signstub
DIRS = vcard smimestub
include $(topsrcdir)/config/rules.mk

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

@ -22,6 +22,6 @@
DEPTH=..\..\..
DIRS=vcard smimestub signstub resources
DIRS=vcard smimestub resources
include <$(DEPTH)\config\rules.mak>

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

@ -1 +0,0 @@
Makefile

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

@ -1,51 +0,0 @@
#
# 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 Netscape are
# Copyright (C) 1998 Netscape Communications Corporation. All
# Rights Reserved.
#
# Contributor(s):
#
DEPTH = ../../../..
topsrcdir = @top_srcdir@
srcdir = @srcdir@
VPATH = @srcdir@
include $(DEPTH)/config/autoconf.mk
MODULE = signed
LIBRARY_NAME = signed
EXPORT_LIBRARY = 1
IS_COMPONENT = 1
HAS_EXTRAEXPORTS = 1
REQUIRES = xpcom string mime msgbase pref necko uconv intl locale
CPPSRCS = \
mimexpcom.cpp \
nsSignedStub.cpp \
nsMimeContentTypeHandler.cpp \
nsSignedStubFactory.cpp \
$(NULL)
EXTRA_DSO_LDOPTS = \
-L$(DIST)/bin \
-L$(DIST)/lib \
$(XPCOM_LIBS) \
$(NSPR_LIBS) \
$(NULL)
include $(topsrcdir)/config/rules.mk

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

@ -1,102 +0,0 @@
# 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 Netscape are
# Copyright (C) 1998 Netscape Communications Corporation. All
# Rights Reserved.
#
# Contributor(s):
#
#//------------------------------------------------------------------------
#//
#// Specify the depth of the current directory relative to the
#// root of NS
#//
#//------------------------------------------------------------------------
DEPTH=..\..\..\..
#//------------------------------------------------------------------------
#//
# New build system where zip dll is build indepenant of java stubs.
#//
#//------------------------------------------------------------------------
MODULE = signed
#EXPORTS =
# Exported headers here!!!
# $(NULL)
DEFINES= -DEBUG_rhp -D_IMPL_NS_HTML
#//------------------------------------------------------------------------
#//
#// Define the files necessary to build the target (ie. OBJS)
#//
#//------------------------------------------------------------------------
OBJS= \
.\$(OBJDIR)\nsSignedStub.obj \
.\$(OBJDIR)\mimexpcom.obj \
.\$(OBJDIR)\nsMimeContentTypeHandler.obj \
.\$(OBJDIR)\nsSignedStubFactory.obj \
$(NULL)
#//------------------------------------------------------------------------
#//
#// Define any Public Make Variables here: (ie. PDFFILE, MAPFILE, ...)
#//
#//------------------------------------------------------------------------
DLLNAME=$(MODULE)
MAPFILE=$(MODULE).map
DEFFILE=$(MODULE).def
#//------------------------------------------------------------------------
#//
#// Define any Public Targets here (ie. PROGRAM, LIBRARY, DLL, ...)
#// (these must be defined before the common makefiles are included)
#//
#//------------------------------------------------------------------------
#
DLL=.\$(OBJDIR)\$(DLLNAME).dll
#//------------------------------------------------------------------------
#//
#// Define any local options for the make tools
#// (ie. LCFLAGS, LLFLAGS, LLIBS, LINCS)
#//
#//------------------------------------------------------------------------
LCFLAGS=-DNETSCAPE
MSGLIBS= \
$(NULL)
# These are the libraries we need to link with to create the dll
LLIBS= \
$(LLIBS) \
$(LIBNSPR) \
$(DIST)\lib\xpcom.lib \
$(NULL)
#//------------------------------------------------------------------------
#//
#// Include the common makefile rules
#//
#//------------------------------------------------------------------------
include <$(DEPTH)/config/rules.mak>
install:: $(DLL)
$(MAKE_INSTALL) .\$(OBJDIR)\$(DLLNAME).dll $(DIST)\bin\components
clobber::
rm -f $(DIST)\bin\$(DLLNAME).dll

Двоичный файл не отображается.

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

@ -1,25 +0,0 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* 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 Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All
* Rights Reserved.
*
* Contributor(s):
*/
#include "MacPrefix.h"

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

@ -1,25 +0,0 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* 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 Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All
* Rights Reserved.
*
* Contributor(s):
*/
#include "MacPrefix_debug.h"

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

@ -1,143 +0,0 @@
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* 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 Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All
* Rights Reserved.
*
* Contributor(s):
* Pierre Phaneuf <pp@ludusdesign.com>
*/
#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<nsIMimeObjectClassAccess> 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<nsIMimeObjectClassAccess> 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<nsIMimeObjectClassAccess> 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<nsIMimeObjectClassAccess> 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<nsIMimeObjectClassAccess> 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<nsIMimeObjectClassAccess> 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<nsIMimeObjectClassAccess> 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;
}

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

@ -1,111 +0,0 @@
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* 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 Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All
* Rights Reserved.
*
* Contributor(s):
*/
/*
* 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_ */

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

@ -1,94 +0,0 @@
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* 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 Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All
* Rights Reserved.
*
* Contributor(s):
* Pierre Phaneuf <pp@ludusdesign.com>
*/
#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;
}

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

@ -1,60 +0,0 @@
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* 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 Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All
* Rights Reserved.
*
* Contributor(s):
*/
/*
* 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_ */

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

@ -1,242 +0,0 @@
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* 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 Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All
* Rights Reserved.
*
* Contributor(s):
*/
#include "nsSignedStub.h"
#include "prlog.h"
#include "prmem.h"
#include "plstr.h"
#include "mimexpcom.h"
#include "mimecth.h"
#include "mimeobj.h"
#include "nsCRT.h"
#include "prprf.h"
#include "nsIStringBundle.h"
#include "nsIPref.h"
#define SIGNED_NOT_SUPPORTED 1100
// String bundles...
#ifndef XP_MAC
static nsCOMPtr<nsIStringBundle> stringBundle = nsnull;
#endif
/* This is the next generation string retrieval call */
static NS_DEFINE_CID(kPrefCID, NS_PREF_CID);
static NS_DEFINE_CID(kStringBundleServiceCID, NS_STRINGBUNDLESERVICE_CID);
extern "C" char *SignedGetStringByID(PRInt32 aMsgId);
#define SIGNED_PROP_URL "chrome://messenger/locale/mime.properties"
static int MimeInlineTextSIGNEDStub_parse_line (char *, PRInt32, MimeObject *);
static int MimeInlineTextSIGNEDStub_parse_eof (MimeObject *, PRBool);
static int MimeInlineTextSIGNEDStub_parse_begin (MimeObject *obj);
/* This is the object definition. Note: we will set the superclass
to NULL and manually set this on the class creation */
MimeDefClass(MimeInlineTextSIGNEDStub, MimeInlineTextSIGNEDStubClass, mimeInlineTextSIGNEDStubClass, NULL);
extern "C" char *
MIME_GetContentType(void)
{
return SIGNED_CONTENT_TYPE;
}
extern "C" MimeObjectClass *
MIME_CreateContentTypeHandlerClass(const char *content_type,
contentTypeHandlerInitStruct *initStruct)
{
MimeObjectClass *clazz = (MimeObjectClass *)&mimeInlineTextSIGNEDStubClass;
/*
* Must set the superclass by hand.
*/
if (!COM_GetmimeInlineTextClass())
return NULL;
clazz->superclass = (MimeObjectClass *)COM_GetmimeInlineTextClass();
initStruct->force_inline_display = PR_TRUE;
return clazz;
}
static int
MimeInlineTextSIGNEDStubClassInitialize(MimeInlineTextSIGNEDStubClass *clazz)
{
MimeObjectClass *oclass = (MimeObjectClass *) clazz;
PR_ASSERT(!oclass->class_initialized);
oclass->parse_begin = MimeInlineTextSIGNEDStub_parse_begin;
oclass->parse_line = MimeInlineTextSIGNEDStub_parse_line;
oclass->parse_eof = MimeInlineTextSIGNEDStub_parse_eof;
return 0;
}
int
GenerateMessage(char** html)
{
char *msg = nsnull;
char *wrapper = "\
<BR><text=\"#000000\" bgcolor=\"#FFFFFF\" link=\"#FF0000\" vlink=\"#800080\" alink=\"#0000FF\">\
<center><table BORDER=1 ><tr>\
<td><CENTER>\
%s\
</CENTER></td>\
</tr>\
</table></center><BR>";
msg = SignedGetStringByID(SIGNED_NOT_SUPPORTED);
if (!msg)
{
*html = PR_smprintf(wrapper, "This message is possibly signed and/or encrypted. This application does not currently support signed or encrypted messages.");
}
else
{
*html = PR_smprintf(wrapper, msg);
PR_FREEIF(msg);
}
return 0;
}
static int
MimeInlineTextSIGNEDStub_parse_begin(MimeObject *obj)
{
MimeInlineTextSIGNEDStubClass *clazz;
int status = ((MimeObjectClass*)COM_GetmimeLeafClass())->parse_begin(obj);
if (status < 0)
return status;
if (!obj->output_p)
return 0;
if (!obj->options || !obj->options->write_html_p)
return 0;
/* This is a fine place to write out any HTML before the real meat begins. */
// Initialize the clazz variable...
clazz = ((MimeInlineTextSIGNEDStubClass *) obj->clazz);
return 0;
}
static int
MimeInlineTextSIGNEDStub_parse_line(char *line, PRInt32 length, MimeObject *obj)
{
/*
* This routine gets fed each line of data, one at a time. We just buffer
* it all up, to be dealt with all at once at the end.
*/
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, PR_TRUE);
}
return 0;
}
static int
MimeInlineTextSIGNEDStub_parse_eof (MimeObject *obj, PRBool abort_p)
{
int status = 0;
char* html = NULL;
if (obj->closed_p)
return 0;
/* Run parent method first, to flush out any buffered data. */
status = ((MimeObjectClass*)COM_GetmimeInlineTextClass())->parse_eof(obj, abort_p);
if (status < 0)
return status;
if ( (obj->options) &&
((obj->options->format_out == nsMimeOutput::nsMimeMessageQuoting) ||
(obj->options->format_out == nsMimeOutput::nsMimeMessageBodyQuoting))
)
return 0;
status = GenerateMessage(&html);
if (status < 0)
return status;
status = COM_MimeObject_write(obj, html, PL_strlen(html), PR_TRUE);
PR_FREEIF(html);
if (status < 0)
return status;
return 0;
}
//
// This is the next generation string retrieval call
//
extern "C"
char *
SignedGetStringByID(PRInt32 aMsgId)
{
char *tempString = nsnull;
nsresult res = NS_OK;
#ifdef XP_MAC
nsCOMPtr<nsIStringBundle> stringBundle = nsnull;
#endif
if (!stringBundle)
{
char* propertyURL = NULL;
propertyURL = SIGNED_PROP_URL;
NS_WITH_SERVICE(nsIStringBundleService, sBundleService, kStringBundleServiceCID, &res);
if (NS_SUCCEEDED(res) && (nsnull != sBundleService))
{
res = sBundleService->CreateBundle(propertyURL, getter_AddRefs(stringBundle));
}
}
if (stringBundle)
{
PRUnichar *ptrv = nsnull;
res = stringBundle->GetStringFromID(aMsgId, &ptrv);
if (NS_FAILED(res))
return nsCRT::strdup("???");
else
{
nsAutoString v;
v.Append(ptrv);
tempString = v.ToNewUTF8String();
PR_FREEIF(ptrv);
}
}
if (!tempString)
return nsCRT::strdup("???");
else
return tempString;
}

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

@ -1,54 +0,0 @@
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* 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 Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All
* Rights Reserved.
*
* Contributor(s):
*/
#ifndef _MIMESIGNED_H_
#define _MIMESIGNED_H_
#include "mimetext.h"
/*
* These functions are the public interface for this content type
* handler and will be called in by the mime component.
*/
#define SIGNED_CONTENT_TYPE "application/x-pkcs7-signature"
/* The MimeInlineTextSIGNEDStub class implements the "application/x-pkcs7-mime"2
MIME content types.
*/
typedef struct MimeInlineTextSIGNEDStubClass MimeInlineTextSIGNEDStubClass;
typedef struct MimeInlineTextSIGNEDStub MimeInlineTextSIGNEDStub;
struct MimeInlineTextSIGNEDStubClass {
MimeInlineTextClass text;
char* buffer;
PRInt32 bufferlen;
PRInt32 buffermax;
};
extern MimeInlineTextSIGNEDStubClass mimeInlineTextSIGNEDStubClass;
struct MimeInlineTextSIGNEDStub {
MimeInlineText text;
};
#endif /* _MIMESIGNED_H_ */

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

@ -1,221 +0,0 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* 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 Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All
* Rights Reserved.
*
* Contributor(s):
* Pierre Phaneuf <pp@ludusdesign.com>
*/
#include "nsIFactory.h"
#include "nsISupports.h"
#include "msgCore.h"
#include "nsCOMPtr.h"
#include "pratom.h"
#include "nsSignedStub.h"
/* Include all of the interfaces our factory can generate components for */
#include "nsIMimeContentTypeHandler.h"
#include "nsMimeContentTypeHandler.h"
static NS_DEFINE_CID(kComponentManagerCID, NS_COMPONENTMANAGER_CID);
static NS_DEFINE_CID(kMimeContentTypeHandlerCID, NS_SIGNED_CONTENT_TYPE_HANDLER_CID);
////////////////////////////////////////////////////////////
//
////////////////////////////////////////////////////////////
static PRInt32 g_InstanceCount = 0;
static PRInt32 g_LockCount = 0;
class nsSignedStubFactory : public nsIFactory
{
public:
// nsISupports methods
NS_DECL_ISUPPORTS
nsSignedStubFactory(const nsCID &aClass,
const char* aClassName,
const char* aContractID,
nsISupports*);
// nsIFactory methods
NS_IMETHOD CreateInstance(nsISupports *aOuter, const nsIID &aIID, void **aResult);
NS_IMETHOD LockFactory(PRBool aLock);
protected:
virtual ~nsSignedStubFactory();
nsCID mClassID;
char* mClassName;
char* mContractID;
nsIServiceManager* mServiceManager;
};
nsSignedStubFactory::nsSignedStubFactory(const nsCID &aClass,
const char* aClassName,
const char* aContractID,
nsISupports *compMgrSupports)
: mClassID(aClass),
mClassName(nsCRT::strdup(aClassName)),
mContractID(nsCRT::strdup(aContractID))
{
NS_INIT_REFCNT();
// store a copy of the
compMgrSupports->QueryInterface(NS_GET_IID(nsIServiceManager),
(void **)&mServiceManager);
}
nsSignedStubFactory::~nsSignedStubFactory()
{
NS_IF_RELEASE(mServiceManager);
PL_strfree(mClassName);
PL_strfree(mContractID);
}
nsresult
nsSignedStubFactory::QueryInterface(const nsIID &aIID, void **aResult)
{
if (aResult == NULL)
return NS_ERROR_NULL_POINTER;
// Always NULL result, in case of failure
*aResult = NULL;
// we support two interfaces....nsISupports and nsFactory.....
if (aIID.Equals(NS_GET_IID(nsISupports)))
*aResult = (void *)(nsISupports*)this;
else if (aIID.Equals(NS_GET_IID(nsIFactory)))
*aResult = (void *)(nsIFactory*)this;
if (*aResult == NULL)
return NS_NOINTERFACE;
AddRef(); // Increase reference count for caller
return NS_OK;
}
NS_IMPL_ADDREF(nsSignedStubFactory)
NS_IMPL_RELEASE(nsSignedStubFactory)
nsresult
nsSignedStubFactory::CreateInstance(nsISupports *aOuter,
const nsIID &aIID,
void **aResult)
{
nsresult res = NS_OK;
if (aResult == NULL)
return NS_ERROR_NULL_POINTER;
*aResult = NULL;
nsCOMPtr <nsIMimeContentTypeHandler> inst;
// ClassID check happens here
// Whenever you add a new class that supports an interface, plug it in here!!!
// do they want a mime emitter interface ?
if (mClassID.Equals(kMimeContentTypeHandlerCID))
{
res = NS_NewMimeContentTypeHandler(getter_AddRefs(inst));
if (NS_FAILED(res)) // was there a problem creating the object ?
return res;
}
// End of checking the interface ID code....
if (inst)
{
// so we now have the class that supports the desired interface...we need to turn around and
// query for our desired interface.....
res = inst->QueryInterface(aIID, aResult);
}
else
res = NS_ERROR_OUT_OF_MEMORY;
return res;
}
nsresult
nsSignedStubFactory::LockFactory(PRBool aLock)
{
if (aLock)
PR_AtomicIncrement(&g_LockCount);
else
PR_AtomicDecrement(&g_LockCount);
return NS_OK;
}
////////////////////////////////////////////////////////////////////////////////
// return the proper factory to the caller.
extern "C" NS_EXPORT nsresult NSGetFactory(nsISupports* aServMgr,
const nsCID &aClass,
const char *aClassName,
const char *aContractID,
nsIFactory **aFactory)
{
if (nsnull == aFactory)
return NS_ERROR_NULL_POINTER;
*aFactory = new nsSignedStubFactory(aClass, aClassName, aContractID, aServMgr);
if (aFactory)
return (*aFactory)->QueryInterface(NS_GET_IID(nsIFactory),
(void**)aFactory);
else
return NS_ERROR_OUT_OF_MEMORY;
}
extern "C" NS_EXPORT PRBool NSCanUnload(nsISupports* aServMgr)
{
return PRBool(g_InstanceCount == 0 && g_LockCount == 0);
}
////////////////////////////////////////////////////////////////////////////////
extern "C" NS_EXPORT nsresult
NSRegisterSelf(nsISupports* aServMgr, const char* path)
{
nsresult rv = NS_OK;
NS_WITH_SERVICE1(nsIComponentManager, compMgr, aServMgr, kComponentManagerCID, &rv);
if (NS_FAILED(rv)) return rv;
char *cType = {"@mozilla.org/mimecth;1?type="SIGNED_CONTENT_TYPE};
rv = compMgr->RegisterComponent(kMimeContentTypeHandlerCID,
"MIME SignedStubed Mail Handler",
cType,
path, PR_TRUE, PR_TRUE);
return rv;
}
extern "C" NS_EXPORT nsresult
NSUnregisterSelf(nsISupports* aServMgr, const char* path)
{
nsresult rv;
NS_WITH_SERVICE1(nsIComponentManager, compMgr, aServMgr, kComponentManagerCID, &rv);
if (NS_FAILED(rv)) return rv;
rv = compMgr->UnregisterComponent(kMimeContentTypeHandlerCID, path);
return rv;
}
////////////////////////////////////////////////////////////////////////////////

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

@ -1,22 +0,0 @@
; 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 Netscape are
; Copyright (C) 1998 Netscape Communications Corporation. All
; Rights Reserved.
;
; Contributor(s):
LIBRARY signed.dll
EXPORTS

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

@ -1,3 +0,0 @@
??0?$nsCOMPtr@VnsIServiceManager@@@@QAE@ABVnsCOMPtr_helper@@@Z ; 1
_NSRegisterSelf ; 1
_NSCanUnload ; 1

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

@ -268,9 +268,3 @@
## @name MIME_FORWARDED_MESSAGE_USER_WROTE
## @loc
1041=-------- Original Message --------
# Unsupported Message for Signed Messages
## @name SIGNED_NOT_SUPPORTED
## @loc
1100=This message is possibly signed and/or encrypted. This application does not currently support signed or encrypted messages.