From 17bfd03a090321c4e53cb052260e34b954e269c4 Mon Sep 17 00:00:00 2001 From: "alecf%netscape.com" Date: Thu, 11 Mar 1999 21:06:31 +0000 Subject: [PATCH] rev this interface - remove unnecessary functions --- .../compose/public/nsIDOMComposeAppCore.h | 24 +++++++++---------- .../compose/public/nsIDOMComposeAppCore.idl | 11 +++++---- mailnews/compose/public/nsIMsgCompose.h | 17 ------------- mailnews/compose/public/nsIMsgCompose.idl | 4 +++- mailnews/compose/src/nsComposeAppCore.cpp | 21 ++++++++-------- 5 files changed, 32 insertions(+), 45 deletions(-) diff --git a/mailnews/compose/public/nsIDOMComposeAppCore.h b/mailnews/compose/public/nsIDOMComposeAppCore.h index ea58243a40d..d3c46522f59 100644 --- a/mailnews/compose/public/nsIDOMComposeAppCore.h +++ b/mailnews/compose/public/nsIDOMComposeAppCore.h @@ -7,20 +7,20 @@ #include "nsISupports.h" /* interface nsISupports */ #include "nsIDOMWindow.h" /* interface nsIDOMWindow */ +#include "nsID.h" /* interface nsID */ #include "nsIDOMBaseAppCore.h" /* interface nsIDOMBaseAppCore */ #ifdef XPIDL_JS_STUBS #include "jsapi.h" #endif - /* starting interface nsIDOMComposeAppCore */ /* {D4779C9A-CAA6-11d2-A6F2-0060B0EB39B5} */ #define NS_IDOMCOMPOSEAPPCORE_IID_STR "D4779C9A-CAA6-11d2-A6F2-0060B0EB39B5" #define NS_IDOMCOMPOSEAPPCORE_IID \ - {0xd4779c9a, 0xcaa6, 0x11d2, \ - { 0xa6, 0xf2, 0x0, 0x60, 0xb0, 0xeb, 0x39, 0xb5 }} + {0xD4779C9A, 0xCAA6, 0x11d2, \ + { 0xA6, 0xF2, 0x00, 0x60, 0xB0, 0xEB, 0x39, 0xB5 }} class nsIDOMComposeAppCore : public nsIDOMBaseAppCore { public: @@ -32,25 +32,23 @@ class nsIDOMComposeAppCore : public nsIDOMBaseAppCore { /* void SetWindow (in nsIDOMWindow ptr); */ NS_IMETHOD SetWindow(nsIDOMWindow *ptr) = 0; - /* void MailCompleteCallback (); */ - NS_IMETHOD CompleteCallback(const nsString& aScript) = 0; + /* void CompleteCallback (in nsAutoString script); */ + NS_IMETHOD CompleteCallback(nsAutoString& script) = 0; - /* void NewMessage (); */ - NS_IMETHOD NewMessage(const nsString& aUrl) = 0; + /* void NewMessage (in nsAutoString url); */ + NS_IMETHOD NewMessage(nsAutoString& url) = 0; - /* void SendMessage (); */ - NS_IMETHOD SendMessage(const nsString& aAddrTo, const nsString& aAddrCc, const nsString& aAddrBcc, - const nsString& aSubject, const nsString& aMsg) = 0; + /* void SendMessage (in nsAutoString addrTo, in nsAutoString addrCc, in nsAutoString addrBcc, in nsAutoString subject, in nsAutoString msg); */ + NS_IMETHOD SendMessage(nsAutoString& addrTo, nsAutoString& addrCc, nsAutoString& addrBcc, nsAutoString& subject, nsAutoString& msg) = 0; #ifdef XPIDL_JS_STUBS static NS_EXPORT_(JSObject *) InitJSClass(JSContext *cx); - static NS_EXPORT_(JSObject *) GetJSObject(JSContext *cx, nsIDOMMsgAppCore *priv); + static NS_EXPORT_(JSObject *) GetJSObject(JSContext *cx, nsIDOMComposeAppCore *priv); #endif }; - extern "C" nsresult NS_InitComposeAppCoreClass(nsIScriptContext *aContext, void **aPrototype); + #endif /* __gen_nsIDOMComposeAppCore_h__ */ - diff --git a/mailnews/compose/public/nsIDOMComposeAppCore.idl b/mailnews/compose/public/nsIDOMComposeAppCore.idl index 906244bb4c1..ef81aa69bb0 100644 --- a/mailnews/compose/public/nsIDOMComposeAppCore.idl +++ b/mailnews/compose/public/nsIDOMComposeAppCore.idl @@ -23,14 +23,17 @@ #include "nsIDOMBaseAppCore.idl" #include "nsIDOMWindow.idl" +native nsString(nsString*); + [object, uuid(D4779C9A-CAA6-11d2-A6F2-0060B0EB39B5)] interface nsIDOMComposeAppCore : nsIDOMBaseAppCore { void SetWindow(in nsIDOMWindow ptr); - void CompleteCallback(in wstring script); - void NewMessage(in wstring url); - void SendMessage(in wstring addrTo, in wstring addrCc, in wstring addrBcc, - in wstring subject, in wstring msg); + void CompleteCallback(in nsString script); + void NewMessage(in nsString url); + void SendMessage(in nsString addrTo, in nsString addrCc, + in nsString addrBcc, + in nsString subject, in nsString msg); }; /* hack to make MsgAppCore visible from AppCore */ diff --git a/mailnews/compose/public/nsIMsgCompose.h b/mailnews/compose/public/nsIMsgCompose.h index 68ed08b2b33..eb0da46994c 100644 --- a/mailnews/compose/public/nsIMsgCompose.h +++ b/mailnews/compose/public/nsIMsgCompose.h @@ -12,11 +12,6 @@ #ifdef XPIDL_JS_STUBS #include "jsapi.h" #endif -#include "nsDebug.h" -#include "nsTraceRefcnt.h" -#include "nsID.h" -#include "nsError.h" - /* starting interface nsIMsgCompose */ @@ -33,18 +28,6 @@ class nsIMsgCompose : public nsISupports { return iid; } - /* void CreateAndInitialize (in long a_context, in long old_context, in long prefs, in nsIMsgCompFields initfields, in long master); */ - NS_IMETHOD CreateAndInitialize(PRInt32 a_context, PRInt32 old_context, PRInt32 prefs, nsIMsgCompFields *initfields, PRInt32 master) = 0; - - /* void Create (in long a_context, in long prefs, in long master); */ - NS_IMETHOD Create(PRInt32 a_context, PRInt32 prefs, PRInt32 master) = 0; - - /* void Initialize (in long old_context, in nsIMsgCompFields initfields); */ - NS_IMETHOD Initialize(PRInt32 old_context, nsIMsgCompFields *initfields) = 0; - - /* void Dispose (); */ - NS_IMETHOD Dispose() = 0; - #ifdef XPIDL_JS_STUBS static NS_EXPORT_(JSObject *) InitJSClass(JSContext *cx); static NS_EXPORT_(JSObject *) GetJSObject(JSContext *cx, nsIMsgCompose *priv); diff --git a/mailnews/compose/public/nsIMsgCompose.idl b/mailnews/compose/public/nsIMsgCompose.idl index d897fd16664..ceb68564b54 100644 --- a/mailnews/compose/public/nsIMsgCompose.idl +++ b/mailnews/compose/public/nsIMsgCompose.idl @@ -23,9 +23,11 @@ [object, uuid(4E606270-B588-11D2-8289-00805F2A0107)] interface nsIMsgCompose : nsISupports { - void CreateAndInitialize(in long a_context, in long old_context, in long prefs, in nsIMsgCompFields initfields, in long master); + /* + void CreateAndInit(in long a_context, in long old_context, in long prefs, in nsIMsgCompFields initfields, in long master); void Create(in long a_context, in long prefs, in long master); void Initialize(in long old_context, in nsIMsgCompFields initfields); void Dispose(); + */ }; diff --git a/mailnews/compose/src/nsComposeAppCore.cpp b/mailnews/compose/src/nsComposeAppCore.cpp index 3ca44af884a..e2864997cb5 100644 --- a/mailnews/compose/src/nsComposeAppCore.cpp +++ b/mailnews/compose/src/nsComposeAppCore.cpp @@ -80,11 +80,11 @@ public: NS_IMETHOD SetScriptObject(void* aScriptObject); // nsIComposeAppCore - NS_IMETHOD CompleteCallback(const nsString& aScript); + NS_IMETHOD CompleteCallback(nsAutoString& aScript); NS_IMETHOD SetWindow(nsIDOMWindow* aWin); - NS_IMETHOD NewMessage(const nsString& aUrl); - NS_IMETHOD SendMessage(const nsString& aAddrTo, const nsString& aAddrCc, - const nsString& aAddrBcc, const nsString& aSubject, const nsString& aMsg); + NS_IMETHOD NewMessage(nsAutoString& aUrl); + NS_IMETHOD SendMessage(nsAutoString& aAddrTo, nsAutoString& aAddrCc, + nsAutoString& aAddrBcc, nsAutoString& aSubject, nsAutoString& aMsg); protected: @@ -274,14 +274,14 @@ nsComposeAppCore::SetWindow(nsIDOMWindow* aWin) NS_IMETHODIMP -nsComposeAppCore::CompleteCallback(const nsString& aScript) +nsComposeAppCore::CompleteCallback(nsAutoString& aScript) { - mScript = aScript; + mScript = *aScript; return NS_OK; } NS_IMETHODIMP -nsComposeAppCore::NewMessage(const nsString& aUrl) +nsComposeAppCore::NewMessage(nsAutoString& aUrl) { static NS_DEFINE_CID(kAppShellServiceCID, NS_APPSHELL_SERVICE_CID); @@ -318,8 +318,8 @@ done: return NS_OK; } -NS_IMETHODIMP nsComposeAppCore::SendMessage(const nsString& aAddrTo, const nsString& aAddrCc, - const nsString& aAddrBcc, const nsString& aSubject, const nsString& aMsg) +NS_IMETHODIMP nsComposeAppCore::SendMessage(nsAutoString& aAddrTo, nsAutoString& aAddrCc, + nsAutoString& aAddrBcc, nsAutoString& aSubject, nsAutoString& aMsg) { if (nsnull == mScriptContext) return NS_ERROR_FAILURE; @@ -371,7 +371,8 @@ NS_IMETHODIMP nsComposeAppCore::SendMessage(const nsString& aAddrTo, const nsStr NULL, kIMsgCompFieldsIID, (void **) &pMsgCompFields); - if (res == NS_OK && pMsgCompFields) { + if (res == NS_OK && pMsgCompFields) { + pMsgCompFields->SetFrom("qatest02@netscape.com", NULL); //JFD Need to use the prefs pMsgCompFields->SetTo(aAddrTo.ToNewCString(), NULL); pMsgCompFields->SetCc(aAddrCc.ToNewCString(), NULL);