зеркало из https://github.com/mozilla/pjs.git
Adding nsIMessage. Updating SMTPService to take an nsIMessage to send
This commit is contained in:
Родитель
aff71eeb1d
Коммит
68536a8408
|
@ -221,6 +221,10 @@
|
|||
{ 0x57c616d0, 0x6f90, 0x11d2, \
|
||||
{0x8d, 0xbc, 0x00, 0x80, 0x5f, 0x8a, 0x7a, 0xb6} }
|
||||
|
||||
//1887e710-6f9a-11d2-8dbc-00805f8a7ab6
|
||||
#define NS_MESSAGE_CID \
|
||||
{ 0x1887e710, 0x6f9a, 0x11d2, \
|
||||
{0x8d, 0xbc, 0x00, 0x80, 0x5f, 0x8a, 0x7a, 0xb6} }
|
||||
|
||||
#endif
|
||||
|
||||
|
|
|
@ -53,6 +53,7 @@
|
|||
#include "nsXPFCObserverManager.h"
|
||||
#include "nsSMTPService.h"
|
||||
#include "nsMIMEService.h"
|
||||
#include "nsMessage.h"
|
||||
#include "nsXPFCSubject.h"
|
||||
#include "nsXPFCCommand.h"
|
||||
#include "nsXPFCCanvas.h"
|
||||
|
@ -110,6 +111,7 @@ static NS_DEFINE_IID(kCXPFCCommandServerCID, NS_XPFC_COMMAND_SERVER_CID);
|
|||
static NS_DEFINE_IID(kCXPFCActionCommand, NS_XPFC_ACTION_COMMAND_CID);
|
||||
static NS_DEFINE_IID(kCUserCID, NS_USER_CID);
|
||||
static NS_DEFINE_IID(kCSMTPServiceCID, NS_SMTP_SERVICE_CID);
|
||||
static NS_DEFINE_IID(kCMessageCID, NS_MESSAGE_CID);
|
||||
static NS_DEFINE_IID(kCMIMEServiceCID, NS_MIME_SERVICE_CID);
|
||||
|
||||
class nsxpfcFactory : public nsIFactory
|
||||
|
|
|
@ -160,6 +160,8 @@ nsresult nsxpfcFactory::CreateInstance(nsISupports *aOuter,
|
|||
inst = (nsISupports *)new nsSMTPService();
|
||||
} else if (mClassID.Equals(kCMIMEServiceCID)) {
|
||||
inst = (nsISupports *)new nsMIMEService();
|
||||
} else if (mClassID.Equals(kCMessageCID)) {
|
||||
inst = (nsISupports *)new nsMessage();
|
||||
}
|
||||
|
||||
if (inst == NULL) {
|
||||
|
|
|
@ -15,6 +15,7 @@ EXPORTS = \
|
|||
PRIVATE_EXPORTS = \
|
||||
nsSMTPService.h \
|
||||
nsMIMEService.h \
|
||||
nsMessage.h \
|
||||
$(NULL)
|
||||
|
||||
MODULE = xpfc
|
||||
|
|
|
@ -0,0 +1,48 @@
|
|||
/* -*- 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 nsMessage_h___
|
||||
#define nsMessage_h___
|
||||
|
||||
#include "nsIMessage.h"
|
||||
|
||||
class nsMessage : public nsIMessage
|
||||
{
|
||||
public:
|
||||
nsMessage();
|
||||
|
||||
NS_DECL_ISUPPORTS
|
||||
|
||||
NS_IMETHOD Init() ;
|
||||
|
||||
NS_IMETHOD SetSender(nsString& aSender);
|
||||
NS_IMETHOD AddRecipient(nsString& aRecipient);
|
||||
NS_IMETHOD SetSubject(nsString& aSubject);
|
||||
NS_IMETHOD SetBody(nsString& aBody);
|
||||
|
||||
NS_IMETHOD GetSender(nsString& aSender);
|
||||
NS_IMETHOD GetReciepients(nsString& aRecipients);
|
||||
NS_IMETHOD GetSubject(nsString& aSubject);
|
||||
NS_IMETHOD GetBody(nsString& aBody);
|
||||
|
||||
protected:
|
||||
~nsMessage();
|
||||
|
||||
};
|
||||
|
||||
#endif /* nsMessage_h___ */
|
|
@ -29,7 +29,10 @@ public:
|
|||
NS_DECL_ISUPPORTS
|
||||
|
||||
NS_IMETHOD Init() ;
|
||||
|
||||
NS_IMETHOD SendMail(nsString& aServer, nsString& aFrom, nsString& aTo, nsString& aSubject, nsString& aBody) ;
|
||||
NS_IMETHOD SendMail(nsString& aServer, nsIMessage& aMessage) ;
|
||||
|
||||
|
||||
protected:
|
||||
~nsSMTPService();
|
||||
|
|
|
@ -13,6 +13,7 @@ DEPTH = ../../..
|
|||
EXPORTS = \
|
||||
nsISMTPService.h \
|
||||
nsIMIMEService.h \
|
||||
nsIMessage.h \
|
||||
$(NULL)
|
||||
|
||||
PRIVATE_EXPORTS = \
|
||||
|
|
|
@ -0,0 +1,50 @@
|
|||
/* -*- 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 nsIMessage_h___
|
||||
#define nsIMessage_h___
|
||||
|
||||
#include "nsISupports.h"
|
||||
#include "nsString.h"
|
||||
|
||||
//4ecb61a0-6f98-11d2-8dbc-00805f8a7ab6
|
||||
#define NS_IMESSAGE_IID \
|
||||
{ 0x4ecb61a0, 0x6f98, 0x11d2, \
|
||||
{ 0x8d, 0xbc, 0x00, 0x80, 0x5f, 0x8a, 0x7a, 0xb6 } }
|
||||
|
||||
class nsIMessage : public nsISupports
|
||||
{
|
||||
|
||||
public:
|
||||
|
||||
NS_IMETHOD Init() = 0;
|
||||
|
||||
|
||||
NS_IMETHOD SetSender(nsString& aSender) = 0;
|
||||
NS_IMETHOD AddRecipient(nsString& aRecipient) = 0;
|
||||
NS_IMETHOD SetSubject(nsString& aSubject) = 0;
|
||||
NS_IMETHOD SetBody(nsString& aBody) = 0;
|
||||
|
||||
NS_IMETHOD GetSender(nsString& aSender) = 0;
|
||||
NS_IMETHOD GetReciepients(nsString& aRecipients) = 0;
|
||||
NS_IMETHOD GetSubject(nsString& aSubject) = 0;
|
||||
NS_IMETHOD GetBody(nsString& aBody) = 0;
|
||||
|
||||
};
|
||||
|
||||
#endif /* nsIMessage_h___ */
|
|
@ -21,6 +21,7 @@
|
|||
|
||||
#include "nsISupports.h"
|
||||
#include "nsString.h"
|
||||
#include "nsIMessage.h"
|
||||
|
||||
//b64f8b50-6f77-11d2-8dbc-00805f8a7ab6
|
||||
#define NS_ISMTP_SERVICE_IID \
|
||||
|
@ -35,6 +36,7 @@ public:
|
|||
NS_IMETHOD Init() = 0;
|
||||
|
||||
NS_IMETHOD SendMail(nsString& aServer, nsString& aFrom, nsString& aTo, nsString& aSubject, nsString& aBody) = 0;
|
||||
NS_IMETHOD SendMail(nsString& aServer, nsIMessage& aMessage) = 0;
|
||||
|
||||
};
|
||||
|
||||
|
|
|
@ -20,6 +20,7 @@ MODULE = xpfc
|
|||
CPPSRCS = \
|
||||
nsSMTPService.cpp \
|
||||
nsMIMEService.cpp \
|
||||
nsMessage.cpp \
|
||||
$(NULL)
|
||||
|
||||
REQUIRES = xpcom raptor netlib msgsdk
|
||||
|
|
|
@ -0,0 +1,84 @@
|
|||
/* -*- 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 "nsMessage.h"
|
||||
#include "nsxpfcCIID.h"
|
||||
|
||||
static NS_DEFINE_IID(kISupportsIID, NS_ISUPPORTS_IID);
|
||||
static NS_DEFINE_IID(kMessageIID, NS_IMESSAGE_IID);
|
||||
|
||||
nsMessage :: nsMessage()
|
||||
{
|
||||
NS_INIT_REFCNT();
|
||||
}
|
||||
|
||||
nsMessage :: ~nsMessage()
|
||||
{
|
||||
}
|
||||
|
||||
NS_IMPL_ADDREF(nsMessage)
|
||||
NS_IMPL_RELEASE(nsMessage)
|
||||
NS_IMPL_QUERY_INTERFACE(nsMessage, kMessageIID)
|
||||
|
||||
nsresult nsMessage::Init()
|
||||
{
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
nsresult nsMessage::SetSender(nsString& aSender)
|
||||
{
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
nsresult nsMessage::AddRecipient(nsString& aRecipient)
|
||||
{
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
nsresult nsMessage::SetSubject(nsString& aSubject)
|
||||
{
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
nsresult nsMessage::SetBody(nsString& aBody)
|
||||
{
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
nsresult nsMessage::GetSender(nsString& aSender)
|
||||
{
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
nsresult nsMessage::GetReciepients(nsString& aRecipients)
|
||||
{
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
nsresult nsMessage::GetSubject(nsString& aSubject)
|
||||
{
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
nsresult nsMessage::GetBody(nsString& aBody)
|
||||
{
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -67,6 +67,11 @@ nsresult nsSMTPService::Init()
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
nsresult nsSMTPService::SendMail(nsString& aServer, nsIMessage& aMessage)
|
||||
{
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
nsresult nsSMTPService::SendMail(nsString& aServer,
|
||||
nsString& aFrom,
|
||||
nsString& aTo,
|
||||
|
|
Загрузка…
Ссылка в новой задаче