From 5d4dcb30215144fa189da6ad7fb0413ff4e2136e Mon Sep 17 00:00:00 2001 From: "spider%netscape.com" Date: Sat, 31 Oct 1998 00:47:25 +0000 Subject: [PATCH] Adding MIME Basic Part interface git-svn-id: svn://10.0.0.236/trunk@13774 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/xpfc/core/inc/nsxpfcCIID.h | 4 ++ mozilla/xpfc/core/inc/nsxpfcFactory.h | 2 + mozilla/xpfc/core/src/nsxpfcFactory.cpp | 2 + mozilla/xpfc/msg/inc/manifest.mn | 1 + mozilla/xpfc/msg/inc/nsMIMEBasicBodyPart.h | 38 +++++++++++++++++ mozilla/xpfc/msg/src/manifest.mn | 1 + mozilla/xpfc/msg/src/nsMIMEBasicBodyPart.cpp | 43 ++++++++++++++++++++ 7 files changed, 91 insertions(+) create mode 100644 mozilla/xpfc/msg/inc/nsMIMEBasicBodyPart.h create mode 100644 mozilla/xpfc/msg/src/nsMIMEBasicBodyPart.cpp diff --git a/mozilla/xpfc/core/inc/nsxpfcCIID.h b/mozilla/xpfc/core/inc/nsxpfcCIID.h index 06f44d4ffb3..ebed0b00059 100644 --- a/mozilla/xpfc/core/inc/nsxpfcCIID.h +++ b/mozilla/xpfc/core/inc/nsxpfcCIID.h @@ -236,6 +236,10 @@ { 0xa30f09f0, 0x703a, 0x11d2, \ {0x8d, 0xbc, 0x00, 0x80, 0x5f, 0x8a, 0x7a, 0xb6} } +//3d336b60-7059-11d2-8dbc-00805f8a7ab6 +#define NS_MIME_BASIC_BODY_PART_CID \ + { 0x3d336b60, 0x7059 , 0x11d2, \ + {0x8d, 0xbc, 0x00, 0x80, 0x5f, 0x8a, 0x7a, 0xb6} } #endif diff --git a/mozilla/xpfc/core/inc/nsxpfcFactory.h b/mozilla/xpfc/core/inc/nsxpfcFactory.h index d8af0e471bf..b27e58ac902 100644 --- a/mozilla/xpfc/core/inc/nsxpfcFactory.h +++ b/mozilla/xpfc/core/inc/nsxpfcFactory.h @@ -56,6 +56,7 @@ #include "nsMessage.h" #include "nsMIMEMessage.h" #include "nsMIMEBodyPart.h" +#include "nsMIMEBasicBodyPart.h" #include "nsXPFCSubject.h" #include "nsXPFCCommand.h" #include "nsXPFCCanvas.h" @@ -117,6 +118,7 @@ static NS_DEFINE_IID(kCMessageCID, NS_MESSAGE_CID); static NS_DEFINE_IID(kCMIMEMessageCID, NS_MIME_MESSAGE_CID); static NS_DEFINE_IID(kCMIMEServiceCID, NS_MIME_SERVICE_CID); static NS_DEFINE_IID(kCMIMEBodyPartCID, NS_MIME_BODY_PART_CID); +static NS_DEFINE_IID(kCMIMEBasicBodyPartCID, NS_MIME_BASIC_BODY_PART_CID); class nsxpfcFactory : public nsIFactory { diff --git a/mozilla/xpfc/core/src/nsxpfcFactory.cpp b/mozilla/xpfc/core/src/nsxpfcFactory.cpp index a15d585b3dd..f3ef12ec6d8 100644 --- a/mozilla/xpfc/core/src/nsxpfcFactory.cpp +++ b/mozilla/xpfc/core/src/nsxpfcFactory.cpp @@ -166,6 +166,8 @@ nsresult nsxpfcFactory::CreateInstance(nsISupports *aOuter, inst = (nsISupports *)(nsIMIMEMessage*) new nsMIMEMessage(); } else if (mClassID.Equals(kCMIMEBodyPartCID)) { inst = (nsISupports *)(nsIMIMEBodyPart*) new nsMIMEBodyPart(); + } else if (mClassID.Equals(kCMIMEBasicBodyPartCID)) { + inst = (nsISupports *)(nsIMIMEBodyPart*) new nsMIMEBasicBodyPart(); } if (inst == NULL) { diff --git a/mozilla/xpfc/msg/inc/manifest.mn b/mozilla/xpfc/msg/inc/manifest.mn index 00b73d84ab5..d8ec179b1a9 100644 --- a/mozilla/xpfc/msg/inc/manifest.mn +++ b/mozilla/xpfc/msg/inc/manifest.mn @@ -19,6 +19,7 @@ PRIVATE_EXPORTS = \ nsMIMEMessage.h \ nsSMTPServerCallback.h \ nsMIMEBodyPart.h \ + nsMIMEBasicBodyPart.h \ $(NULL) MODULE = xpfc diff --git a/mozilla/xpfc/msg/inc/nsMIMEBasicBodyPart.h b/mozilla/xpfc/msg/inc/nsMIMEBasicBodyPart.h new file mode 100644 index 00000000000..c37bc48c781 --- /dev/null +++ b/mozilla/xpfc/msg/inc/nsMIMEBasicBodyPart.h @@ -0,0 +1,38 @@ +/* -*- 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.0 (the "NPL"); you may not use this file except in + * compliance with the NPL. You may obtain a copy of the NPL at + * http://www.mozilla.org/NPL/ + * + * Software distributed under the NPL is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL + * for the specific language governing rights and limitations under the + * NPL. + * + * The Initial Developer of this code under the NPL is Netscape + * Communications Corporation. Portions created by Netscape are + * Copyright (C) 1998 Netscape Communications Corporation. All Rights + * Reserved. + */ + +#ifndef nsMIMEBasicBodyPart_h___ +#define nsMIMEBasicBodyPart_h___ + +#include "nsMIMEBodyPart.h" + +class nsMIMEBasicBodyPart : public nsMIMEBodyPart +{ +public: + nsMIMEBasicBodyPart(); + + NS_DECL_ISUPPORTS + + NS_IMETHOD Init() ; + +protected: + ~nsMIMEBasicBodyPart(); + +}; + +#endif /* nsMIMEBasicBodyPart_h___ */ diff --git a/mozilla/xpfc/msg/src/manifest.mn b/mozilla/xpfc/msg/src/manifest.mn index 4212a6e37f9..49c4180b1e7 100644 --- a/mozilla/xpfc/msg/src/manifest.mn +++ b/mozilla/xpfc/msg/src/manifest.mn @@ -24,6 +24,7 @@ CPPSRCS = \ nsMIMEMessage.cpp \ nsSMTPServerCallback.cpp \ nsMIMEBodyPart.cpp \ + nsMIMEBasicBodyPart.cpp \ $(NULL) REQUIRES = xpcom raptor netlib msgsdk diff --git a/mozilla/xpfc/msg/src/nsMIMEBasicBodyPart.cpp b/mozilla/xpfc/msg/src/nsMIMEBasicBodyPart.cpp new file mode 100644 index 00000000000..18320758a51 --- /dev/null +++ b/mozilla/xpfc/msg/src/nsMIMEBasicBodyPart.cpp @@ -0,0 +1,43 @@ +/* -*- 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.0 (the "NPL"); you may not use this file except in + * compliance with the NPL. You may obtain a copy of the NPL at + * http://www.mozilla.org/NPL/ + * + * Software distributed under the NPL is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL + * for the specific language governing rights and limitations under the + * NPL. + * + * The Initial Developer of this code under the NPL is Netscape + * Communications Corporation. Portions created by Netscape are + * Copyright (C) 1998 Netscape Communications Corporation. All Rights + * Reserved. + */ + +#include "nsMIMEBasicBodyPart.h" +#include "nsxpfcCIID.h" + +static NS_DEFINE_IID(kISupportsIID, NS_ISUPPORTS_IID); +static NS_DEFINE_IID(kMIMEBodyPartIID, NS_IMIME_BODY_PART_IID); + +nsMIMEBasicBodyPart :: nsMIMEBasicBodyPart() : nsMIMEBodyPart() +{ + NS_INIT_REFCNT(); + +} + +nsMIMEBasicBodyPart :: ~nsMIMEBasicBodyPart() +{ +} + +NS_IMPL_ADDREF(nsMIMEBasicBodyPart) +NS_IMPL_RELEASE(nsMIMEBasicBodyPart) +NS_IMPL_QUERY_INTERFACE(nsMIMEBasicBodyPart, kMIMEBodyPartIID) + +nsresult nsMIMEBasicBodyPart::Init() +{ + return (nsMIMEBodyPart::Init()); +} +