From 7db1f7033f5da15b4b30f45fa27af52693b2788b Mon Sep 17 00:00:00 2001 From: "ducarroz%netscape.com" Date: Tue, 23 Feb 1999 03:26:08 +0000 Subject: [PATCH] Initial check in git-svn-id: svn://10.0.0.236/trunk@21557 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/mailnews/ui/compose/Makefile.in | 2 + mozilla/mailnews/ui/compose/Makefile.win | 22 + .../mailnews/ui/compose/public/makefile.in | 33 ++ .../mailnews/ui/compose/public/makefile.win | 27 + .../ui/compose/public/nsIDOMComposeAppCore.h | 47 ++ .../compose/public/nsIDOMComposeAppCore.idl | 34 ++ .../ui/compose/resources/ComposeFrame.html | 77 +++ .../ui/compose/resources/ComposeToolbar.xml | 95 ++++ .../mailnews/ui/compose/resources/Makefile.in | 37 ++ .../ui/compose/resources/Makefile.win | 34 ++ .../ui/compose/resources/compose.html | 30 ++ mozilla/mailnews/ui/compose/src/Makefile.in | 40 ++ mozilla/mailnews/ui/compose/src/Makefile.win | 89 ++++ .../ui/compose/src/nsComposeAppCore.cpp | 362 +++++++++++++ .../ui/compose/src/nsComposeAppCore.h | 38 ++ .../ui/compose/src/nsComposeFactory.cpp | 175 +++++++ .../ui/compose/src/nsComposeFactory.h | 32 ++ .../ui/compose/src/nsJSComposeAppCore.cpp | 475 ++++++++++++++++++ .../ui/compose/src/nsJSComposeAppCore.h | 27 + 19 files changed, 1676 insertions(+) create mode 100644 mozilla/mailnews/ui/compose/Makefile.win create mode 100644 mozilla/mailnews/ui/compose/public/makefile.in create mode 100644 mozilla/mailnews/ui/compose/public/makefile.win create mode 100644 mozilla/mailnews/ui/compose/public/nsIDOMComposeAppCore.h create mode 100644 mozilla/mailnews/ui/compose/public/nsIDOMComposeAppCore.idl create mode 100644 mozilla/mailnews/ui/compose/resources/ComposeFrame.html create mode 100644 mozilla/mailnews/ui/compose/resources/ComposeToolbar.xml create mode 100644 mozilla/mailnews/ui/compose/resources/Makefile.in create mode 100644 mozilla/mailnews/ui/compose/resources/Makefile.win create mode 100644 mozilla/mailnews/ui/compose/resources/compose.html create mode 100644 mozilla/mailnews/ui/compose/src/Makefile.in create mode 100644 mozilla/mailnews/ui/compose/src/Makefile.win create mode 100644 mozilla/mailnews/ui/compose/src/nsComposeAppCore.cpp create mode 100644 mozilla/mailnews/ui/compose/src/nsComposeAppCore.h create mode 100644 mozilla/mailnews/ui/compose/src/nsComposeFactory.cpp create mode 100644 mozilla/mailnews/ui/compose/src/nsComposeFactory.h create mode 100644 mozilla/mailnews/ui/compose/src/nsJSComposeAppCore.cpp create mode 100644 mozilla/mailnews/ui/compose/src/nsJSComposeAppCore.h diff --git a/mozilla/mailnews/ui/compose/Makefile.in b/mozilla/mailnews/ui/compose/Makefile.in index 920b93a97ab..627fb52e802 100644 --- a/mozilla/mailnews/ui/compose/Makefile.in +++ b/mozilla/mailnews/ui/compose/Makefile.in @@ -22,6 +22,8 @@ srcdir = @srcdir@ include $(DEPTH)/config/autoconf.mk +DIRS = public src resources + include $(topsrcdir)/config/config.mk include $(topsrcdir)/config/rules.mk diff --git a/mozilla/mailnews/ui/compose/Makefile.win b/mozilla/mailnews/ui/compose/Makefile.win new file mode 100644 index 00000000000..32cfaf4a2cd --- /dev/null +++ b/mozilla/mailnews/ui/compose/Makefile.win @@ -0,0 +1,22 @@ +#!nmake +# +# 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. + +DEPTH=..\..\.. + +DIRS=public src resources + +include <$(DEPTH)\config\rules.mak> diff --git a/mozilla/mailnews/ui/compose/public/makefile.in b/mozilla/mailnews/ui/compose/public/makefile.in new file mode 100644 index 00000000000..473206485d0 --- /dev/null +++ b/mozilla/mailnews/ui/compose/public/makefile.in @@ -0,0 +1,33 @@ +#!gmake +# +# 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. + +DEPTH = ../../../.. +topsrcdir = @top_srcdir@ +VPATH = @srcdir@ +srcdir = @srcdir@ + +include $(DEPTH)/config/autoconf.mk + +EXPORTS = \ + nsIDOMComposeAppCore.h \ + $(NULL) + + +include $(topsrcdir)/config/config.mk + +include $(topsrcdir)/config/rules.mk + diff --git a/mozilla/mailnews/ui/compose/public/makefile.win b/mozilla/mailnews/ui/compose/public/makefile.win new file mode 100644 index 00000000000..4c00e556735 --- /dev/null +++ b/mozilla/mailnews/ui/compose/public/makefile.win @@ -0,0 +1,27 @@ +#!nmake +# +# 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. + +DEPTH=..\..\..\.. +MODULE=compose +IGNORE_MANIFEST=1 + +EXPORTS= \ + nsIDOMComposeAppCore.h \ + $(NULL) + +include <$(DEPTH)\config\rules.mak> + diff --git a/mozilla/mailnews/ui/compose/public/nsIDOMComposeAppCore.h b/mozilla/mailnews/ui/compose/public/nsIDOMComposeAppCore.h new file mode 100644 index 00000000000..e8a60e55167 --- /dev/null +++ b/mozilla/mailnews/ui/compose/public/nsIDOMComposeAppCore.h @@ -0,0 +1,47 @@ +/* + * DO NOT EDIT. THIS FILE IS GENERATED FROM nsIDOMComposeAppCore.idl + */ + +#ifndef __gen_nsIDOMComposeAppCore_h__ +#define __gen_nsIDOMComposeAppCore_h__ + +#include "nsISupports.h" /* interface nsISupports */ +#include "nsIDOMWindow.h" /* interface nsIDOMWindow */ +#include "nsIDOMBaseAppCore.h" /* interface nsIDOMBaseAppCore */ + + +/* 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 }} + +class nsIDOMComposeAppCore : public nsIDOMBaseAppCore { + public: + static const nsIID& IID() { + static nsIID iid = NS_IDOMCOMPOSEAPPCORE_IID; + return iid; + } + + /* void SetWindow (in nsIDOMWindow ptr); */ + NS_IMETHOD SetWindow(nsIDOMWindow *ptr) = 0; + + /* void MailCompleteCallback (); */ + NS_IMETHOD CompleteCallback(const nsString& aScript) = 0; + + /* void NewMessage (); */ + NS_IMETHOD NewMessage() = 0; + + /* void SendMessage (); */ + NS_IMETHOD SendMessage(const nsString& aAddrTo, const nsString& aSubject, const nsString& aMsg) = 0; +}; + + +extern "C" NS_DOM +nsresult +NS_InitComposeAppCoreClass(nsIScriptContext *aContext, void **aPrototype, JSObject * aParentProto); + +#endif /* __gen_nsIDOMComposeAppCore_h__ */ + diff --git a/mozilla/mailnews/ui/compose/public/nsIDOMComposeAppCore.idl b/mozilla/mailnews/ui/compose/public/nsIDOMComposeAppCore.idl new file mode 100644 index 00000000000..60a3cf5d297 --- /dev/null +++ b/mozilla/mailnews/ui/compose/public/nsIDOMComposeAppCore.idl @@ -0,0 +1,34 @@ +/* -*- Mode: IDL; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * + * 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 "nsISupports.idl" + +/* this should eventually derive from some sort of BaseAppCore */ + +#include "nsIDOMBaseAppCore.idl" +#include "nsIDOMWindow.idl" + +[object, uuid(D4779C9A-CAA6-11d2-A6F2-0060B0EB39B5)] +interface nsIDOMComposeAppCore : nsIDOMBaseAppCore { + + void SetWindow(in nsIDOMWindow ptr); + void CompleteCallback(in wstring script); + void NewMessage(); + void SendMessage(in wstring addrTo, in wstring subject, in wstring msg); +}; + diff --git a/mozilla/mailnews/ui/compose/resources/ComposeFrame.html b/mozilla/mailnews/ui/compose/resources/ComposeFrame.html new file mode 100644 index 00000000000..9446cab6fa9 --- /dev/null +++ b/mozilla/mailnews/ui/compose/resources/ComposeFrame.html @@ -0,0 +1,77 @@ + + + + + + +
+

+ + + + + + +
+
+ Info  + + + + + + + + + +
Address:
Subject:
+
+
+
+  Message  + +
+
+ + + + + diff --git a/mozilla/mailnews/ui/compose/resources/ComposeToolbar.xml b/mozilla/mailnews/ui/compose/resources/ComposeToolbar.xml new file mode 100644 index 00000000000..61df2ddee20 --- /dev/null +++ b/mozilla/mailnews/ui/compose/resources/ComposeToolbar.xml @@ -0,0 +1,95 @@ + + + + + + + + + var appCore = null; + + function StartUp() + { + appCore = XPAppCoresManager.Find("ComposeAppCore"); + if (appCore==null) { + appCore = new ComposeAppCore(); + if (appCore != null) { + dump("ComposeAppCore was created!\n"); + appCore.Init("ComposeAppCore"); + appCore.SetWindow(window); + appCore.CompleteCallback("MessageSent();"); + } + } + } + + function SendMessage() + { + dump("SendMessage!\n"); + if (appCore != null) { + dump("Mail was sent!\n"); + appCore.SendMessage(window.parent.frames[1].document.forms[0].elements[1].value, + window.parent.frames[1].document.forms[0].elements[2].value, + window.parent.frames[1].document.forms[0].elements[4].value); + } + + } + + function MessageSent() + { + dump("MessageSent Callback!\n"); + + // Clear Them + window.parent.frames[1].document.forms[0].elements[1].value = ""; + window.parent.frames[1].document.forms[0].elements[2].value = ""; + window.parent.frames[1].document.forms[0].elements[4].value = ""; + + window.close(); + } + + + + + + + + + + + + + + Send + + + GetMsg + + + New Msg + + + Reply + + + Forward + + + Print + + + + + + + + + + INBOX + + + + + + + + diff --git a/mozilla/mailnews/ui/compose/resources/Makefile.in b/mozilla/mailnews/ui/compose/resources/Makefile.in new file mode 100644 index 00000000000..b34bd599003 --- /dev/null +++ b/mozilla/mailnews/ui/compose/resources/Makefile.in @@ -0,0 +1,37 @@ +#!gmake +# +# 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. + +DEPTH = ../../../.. +topsrcdir = @top_srcdir@ +VPATH = @srcdir@ +srcdir = @srcdir@ + +include $(DEPTH)/config/autoconf.mk + +include $(topsrcdir)/config/config.mk + +include $(topsrcdir)/config/rules.mk + + +EXPORT_RESOURCE_SAMPLES = \ + ./Compose.html \ + ./ComposeToobar.xml \ + ./ComposeFrame.html \ + $(NULL) + +install:: + $(INSTALL) $(EXPORT_RESOURCE_SAMPLES) $(DIST)/bin/res/samples diff --git a/mozilla/mailnews/ui/compose/resources/Makefile.win b/mozilla/mailnews/ui/compose/resources/Makefile.win new file mode 100644 index 00000000000..de50864cb3b --- /dev/null +++ b/mozilla/mailnews/ui/compose/resources/Makefile.win @@ -0,0 +1,34 @@ +#!nmake +# +# 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. + +DEPTH=..\..\..\.. +MODULE=compose +IGNORE_MANIFEST=1 + +include <$(DEPTH)\config\rules.mak> + +install:: $(DLL) + $(MAKE_INSTALL) Compose.html $(DIST)\bin\res\samples + $(MAKE_INSTALL) ComposeToolbar.xml $(DIST)\bin\res\samples + $(MAKE_INSTALL) ComposeFrame.html $(DIST)\bin\res\samples + +clobber:: + rm -f $(DIST)\bin\$(DLLNAME) + rm -f $(DIST)\bin\res\samples\Compose.html + rm -f $(DIST)\bin\res\samples\ComposeToolbar.xml + rm -f $(DIST)\bin\res\samples\ComposeFrame.html + diff --git a/mozilla/mailnews/ui/compose/resources/compose.html b/mozilla/mailnews/ui/compose/resources/compose.html new file mode 100644 index 00000000000..2ea157d73b9 --- /dev/null +++ b/mozilla/mailnews/ui/compose/resources/compose.html @@ -0,0 +1,30 @@ + + +Mozilla Browser + + + + + +