From d5852852d6b5e60440c4c5f4d296e2d7739ce831 Mon Sep 17 00:00:00 2001 From: "spider%netscape.com" Date: Thu, 3 Sep 1998 19:38:52 +0000 Subject: [PATCH] First pass at XPFC migration to Free Source repo --- xpfc/command/Makefile | 53 ++++++++++++++ xpfc/command/inc/Makefile | 53 ++++++++++++++ xpfc/command/inc/manifest.mn | 23 ++++++ xpfc/command/inc/nsXPFCActionCommand.h | 42 +++++++++++ xpfc/command/inc/nsXPFCCommand.h | 46 ++++++++++++ xpfc/command/inc/nsXPFCMethodInvokerCommand.h | 44 +++++++++++ xpfc/command/manifest.mn | 15 ++++ xpfc/command/public/Makefile | 53 ++++++++++++++ xpfc/command/public/manifest.mn | 23 ++++++ xpfc/command/public/nsIXPFCCommand.h | 48 ++++++++++++ xpfc/command/public/nsIXPFCCommandReceiver.h | 43 +++++++++++ xpfc/command/src/Makefile | 54 ++++++++++++++ xpfc/command/src/config.mk | 25 +++++++ xpfc/command/src/manifest.mn | 27 +++++++ xpfc/command/src/nsXPFCActionCommand.cpp | 72 ++++++++++++++++++ xpfc/command/src/nsXPFCCommand.cpp | 61 ++++++++++++++++ .../src/nsXPFCMethodInvokerCommand.cpp | 73 +++++++++++++++++++ 17 files changed, 755 insertions(+) create mode 100644 xpfc/command/Makefile create mode 100644 xpfc/command/inc/Makefile create mode 100644 xpfc/command/inc/manifest.mn create mode 100644 xpfc/command/inc/nsXPFCActionCommand.h create mode 100644 xpfc/command/inc/nsXPFCCommand.h create mode 100644 xpfc/command/inc/nsXPFCMethodInvokerCommand.h create mode 100644 xpfc/command/manifest.mn create mode 100644 xpfc/command/public/Makefile create mode 100644 xpfc/command/public/manifest.mn create mode 100644 xpfc/command/public/nsIXPFCCommand.h create mode 100644 xpfc/command/public/nsIXPFCCommandReceiver.h create mode 100644 xpfc/command/src/Makefile create mode 100644 xpfc/command/src/config.mk create mode 100644 xpfc/command/src/manifest.mn create mode 100644 xpfc/command/src/nsXPFCActionCommand.cpp create mode 100644 xpfc/command/src/nsXPFCCommand.cpp create mode 100644 xpfc/command/src/nsXPFCMethodInvokerCommand.cpp diff --git a/xpfc/command/Makefile b/xpfc/command/Makefile new file mode 100644 index 000000000000..61267ebf4158 --- /dev/null +++ b/xpfc/command/Makefile @@ -0,0 +1,53 @@ +#! gmake +# +# CONFIDENTIAL AND PROPRIETARY SOURCE CODE OF +# NETSCAPE COMMUNICATIONS CORPORATION +# Copyright © 1996, 1997 Netscape Communications Corporation. All Rights +# Reserved. Use of this Source Code is subject to the terms of the +# applicable license agreement from Netscape Communications Corporation. +# The copyright notice(s) in this Source Code does not indicate actual or +# intended publication of this Source Code. +# + +####################################################################### +# (1) Include initial platform-independent assignments (MANDATORY). # +####################################################################### + +include manifest.mn + +####################################################################### +# (2) Include "global" configuration information. (OPTIONAL) # +####################################################################### + +include $(GDEPTH)/gconfig/config.mk + +####################################################################### +# (3) Include "component" configuration information. (OPTIONAL) # +####################################################################### + + + +####################################################################### +# (4) Include "local" platform-dependent assignments (OPTIONAL). # +####################################################################### + + + +####################################################################### +# (5) Execute "global" rules. (OPTIONAL) # +####################################################################### + +include $(GDEPTH)/gconfig/rules.mk + +####################################################################### +# (6) Execute "component" rules. (OPTIONAL) # +####################################################################### + + + +####################################################################### +# (7) Execute "local" rules. (OPTIONAL). # +####################################################################### + + + diff --git a/xpfc/command/inc/Makefile b/xpfc/command/inc/Makefile new file mode 100644 index 000000000000..61267ebf4158 --- /dev/null +++ b/xpfc/command/inc/Makefile @@ -0,0 +1,53 @@ +#! gmake +# +# CONFIDENTIAL AND PROPRIETARY SOURCE CODE OF +# NETSCAPE COMMUNICATIONS CORPORATION +# Copyright © 1996, 1997 Netscape Communications Corporation. All Rights +# Reserved. Use of this Source Code is subject to the terms of the +# applicable license agreement from Netscape Communications Corporation. +# The copyright notice(s) in this Source Code does not indicate actual or +# intended publication of this Source Code. +# + +####################################################################### +# (1) Include initial platform-independent assignments (MANDATORY). # +####################################################################### + +include manifest.mn + +####################################################################### +# (2) Include "global" configuration information. (OPTIONAL) # +####################################################################### + +include $(GDEPTH)/gconfig/config.mk + +####################################################################### +# (3) Include "component" configuration information. (OPTIONAL) # +####################################################################### + + + +####################################################################### +# (4) Include "local" platform-dependent assignments (OPTIONAL). # +####################################################################### + + + +####################################################################### +# (5) Execute "global" rules. (OPTIONAL) # +####################################################################### + +include $(GDEPTH)/gconfig/rules.mk + +####################################################################### +# (6) Execute "component" rules. (OPTIONAL) # +####################################################################### + + + +####################################################################### +# (7) Execute "local" rules. (OPTIONAL). # +####################################################################### + + + diff --git a/xpfc/command/inc/manifest.mn b/xpfc/command/inc/manifest.mn new file mode 100644 index 000000000000..40fc98613a9f --- /dev/null +++ b/xpfc/command/inc/manifest.mn @@ -0,0 +1,23 @@ +# +# CONFIDENTIAL AND PROPRIETARY SOURCE CODE OF +# NETSCAPE COMMUNICATIONS CORPORATION +# Copyright (C) 1996 Netscape Communications Corporation. All Rights +# Reserved. Use of this Source Code is subject to the terms of the +# applicable license agreement from Netscape Communications Corporation. +# The copyright notice(s) in this Source Code does not indicate actual or +# intended publication of this Source Code. +# +GDEPTH = ../../../../.. + +EXPORTS = \ + nsXPFCCommand.h \ + nsXPFCActionCommand.h \ + nsXPFCMethodInvokerCommand.h \ + $(NULL) + +PRIVATE_EXPORTS = \ + $(NULL) + +MODULE = xpfc + +REQUIRES = raptor diff --git a/xpfc/command/inc/nsXPFCActionCommand.h b/xpfc/command/inc/nsXPFCActionCommand.h new file mode 100644 index 000000000000..b31f296e3f00 --- /dev/null +++ b/xpfc/command/inc/nsXPFCActionCommand.h @@ -0,0 +1,42 @@ +/* -*- 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 nsXPFCActionCommand_h___ +#define nsXPFCActionCommand_h___ + +#include "nsXPFCCommand.h" +#include "nsString.h" + +class nsXPFCActionCommand : public nsXPFCCommand +{ +public: + nsXPFCActionCommand(); + + NS_DECL_ISUPPORTS + + NS_IMETHOD Init() ; + +public: + nsString mAction; + +protected: + ~nsXPFCActionCommand(); + +}; + +#endif /* nsXPFCActionCommand_h___ */ diff --git a/xpfc/command/inc/nsXPFCCommand.h b/xpfc/command/inc/nsXPFCCommand.h new file mode 100644 index 000000000000..3df8389fca87 --- /dev/null +++ b/xpfc/command/inc/nsXPFCCommand.h @@ -0,0 +1,46 @@ +/* -*- 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 nsXPFCCommand_h___ +#define nsXPFCCommand_h___ + +#include "nsIXPFCCommand.h" + +CLASS_EXPORT_XPFC nsXPFCCommand : public nsIXPFCCommand +{ +public: + nsXPFCCommand(); + + NS_DECL_ISUPPORTS + + NS_IMETHOD Init() ; + + NS_IMETHOD Execute() ; + + NS_IMETHOD SetReceiver(nsIXPFCCommandReceiver * aReceiver); + NS_IMETHOD_(nsIXPFCCommandReceiver *) GetReceiver(); + +protected: + ~nsXPFCCommand(); + +private: + nsIXPFCCommandReceiver * mReceiver; + +}; + +#endif /* nsXPFCCommand_h___ */ diff --git a/xpfc/command/inc/nsXPFCMethodInvokerCommand.h b/xpfc/command/inc/nsXPFCMethodInvokerCommand.h new file mode 100644 index 000000000000..f430954d384f --- /dev/null +++ b/xpfc/command/inc/nsXPFCMethodInvokerCommand.h @@ -0,0 +1,44 @@ +/* -*- 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 nsXPFCMethodInvokerCommand_h___ +#define nsXPFCMethodInvokerCommand_h___ + +#include "nsXPFCCommand.h" +#include "nsString.h" + +class nsXPFCMethodInvokerCommand : public nsXPFCCommand +{ +public: + nsXPFCMethodInvokerCommand(); + + NS_DECL_ISUPPORTS + + NS_IMETHOD Init() ; + +public: + nsString mMethod; + nsString mParams; + nsString mReply; + +protected: + ~nsXPFCMethodInvokerCommand(); + +}; + +#endif /* nsXPFCMethodInvokerCommand_h___ */ diff --git a/xpfc/command/manifest.mn b/xpfc/command/manifest.mn new file mode 100644 index 000000000000..ce741a53d392 --- /dev/null +++ b/xpfc/command/manifest.mn @@ -0,0 +1,15 @@ +# +# CONFIDENTIAL AND PROPRIETARY SOURCE CODE OF +# NETSCAPE COMMUNICATIONS CORPORATION +# Copyright (C) 1996 Netscape Communications Corporation. All Rights +# Reserved. Use of this Source Code is subject to the terms of the +# applicable license agreement from Netscape Communications Corporation. +# The copyright notice(s) in this Source Code does not indicate actual or +# intended publication of this Source Code. +# +GDEPTH = ../../../.. +DEPTH = ../../../.. + +DIRS_EXPORT = public inc +DIRS_LIBS = src + diff --git a/xpfc/command/public/Makefile b/xpfc/command/public/Makefile new file mode 100644 index 000000000000..61267ebf4158 --- /dev/null +++ b/xpfc/command/public/Makefile @@ -0,0 +1,53 @@ +#! gmake +# +# CONFIDENTIAL AND PROPRIETARY SOURCE CODE OF +# NETSCAPE COMMUNICATIONS CORPORATION +# Copyright © 1996, 1997 Netscape Communications Corporation. All Rights +# Reserved. Use of this Source Code is subject to the terms of the +# applicable license agreement from Netscape Communications Corporation. +# The copyright notice(s) in this Source Code does not indicate actual or +# intended publication of this Source Code. +# + +####################################################################### +# (1) Include initial platform-independent assignments (MANDATORY). # +####################################################################### + +include manifest.mn + +####################################################################### +# (2) Include "global" configuration information. (OPTIONAL) # +####################################################################### + +include $(GDEPTH)/gconfig/config.mk + +####################################################################### +# (3) Include "component" configuration information. (OPTIONAL) # +####################################################################### + + + +####################################################################### +# (4) Include "local" platform-dependent assignments (OPTIONAL). # +####################################################################### + + + +####################################################################### +# (5) Execute "global" rules. (OPTIONAL) # +####################################################################### + +include $(GDEPTH)/gconfig/rules.mk + +####################################################################### +# (6) Execute "component" rules. (OPTIONAL) # +####################################################################### + + + +####################################################################### +# (7) Execute "local" rules. (OPTIONAL). # +####################################################################### + + + diff --git a/xpfc/command/public/manifest.mn b/xpfc/command/public/manifest.mn new file mode 100644 index 000000000000..0a6117794b63 --- /dev/null +++ b/xpfc/command/public/manifest.mn @@ -0,0 +1,23 @@ +# +# CONFIDENTIAL AND PROPRIETARY SOURCE CODE OF +# NETSCAPE COMMUNICATIONS CORPORATION +# Copyright (C) 1996 Netscape Communications Corporation. All Rights +# Reserved. Use of this Source Code is subject to the terms of the +# applicable license agreement from Netscape Communications Corporation. +# The copyright notice(s) in this Source Code does not indicate actual or +# intended publication of this Source Code. +# +GDEPTH = ../../../../.. +DEPTH = ../../../../.. + +EXPORTS = \ + nsIXPFCCommand.h \ + nsIXPFCCommandReceiver.h \ + $(NULL) + +PRIVATE_EXPORTS = \ + $(NULL) + +MODULE = xpfc + +REQUIRES = raptor diff --git a/xpfc/command/public/nsIXPFCCommand.h b/xpfc/command/public/nsIXPFCCommand.h new file mode 100644 index 000000000000..56f718c7a861 --- /dev/null +++ b/xpfc/command/public/nsIXPFCCommand.h @@ -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 nsIXPFCCommand_h___ +#define nsIXPFCCommand_h___ + +#include "nsxpfc.h" +#include "nsISupports.h" + +class nsIXPFCCommandReceiver; + +//2cfc9370-1f46-11d2-bed9-00805f8a8dbd +#define NS_IXPFC_COMMAND_IID \ +{ 0x2cfc9370, 0x1f46, 0x11d2, \ +{ 0xbe, 0xd9, 0x00, 0x80, 0x5f, 0x8a, 0x8d, 0xbd } } + + +CLASS_EXPORT_XPFC nsIXPFCCommand : public nsISupports + +{ + +public: + + NS_IMETHOD Init() = 0; + + NS_IMETHOD Execute() = 0; + + NS_IMETHOD SetReceiver(nsIXPFCCommandReceiver * aReceiver) = 0; + NS_IMETHOD_(nsIXPFCCommandReceiver *) GetReceiver() = 0; + +}; + +#endif /* nsIXPFCCommand_h___ */ diff --git a/xpfc/command/public/nsIXPFCCommandReceiver.h b/xpfc/command/public/nsIXPFCCommandReceiver.h new file mode 100644 index 000000000000..dd75b1fb8c48 --- /dev/null +++ b/xpfc/command/public/nsIXPFCCommandReceiver.h @@ -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. + */ + +#ifndef nsIXPFCCommandReceiver_h___ +#define nsIXPFCCommandReceiver_h___ + +#include "nsISupports.h" +#include "nsIXPFCCommand.h" + +class nsIXPFCCommand; + +//2c4b94b0-1f48-11d2-bed9-00805f8a8dbd +#define NS_IXPFC_COMMANDRECEIVER_IID \ +{ 0x2c4b94b0, 0x1f48, 0x11d2, \ +{ 0xbe, 0xd9, 0x00, 0x80, 0x5f, 0x8a, 0x8d, 0xbd } } + +class nsIXPFCCommandReceiver : public nsISupports +{ + +public: + + NS_IMETHOD Init() = 0; + + NS_IMETHOD Action(nsIXPFCCommand * aCommand) = 0; + +}; + +#endif /* nsIXPFCCommandReceiver_h___ */ diff --git a/xpfc/command/src/Makefile b/xpfc/command/src/Makefile new file mode 100644 index 000000000000..60df328e33a1 --- /dev/null +++ b/xpfc/command/src/Makefile @@ -0,0 +1,54 @@ +#! gmake +# +# CONFIDENTIAL AND PROPRIETARY SOURCE CODE OF +# NETSCAPE COMMUNICATIONS CORPORATION +# Copyright © 1996, 1997 Netscape Communications Corporation. All Rights +# Reserved. Use of this Source Code is subject to the terms of the +# applicable license agreement from Netscape Communications Corporation. +# The copyright notice(s) in this Source Code does not indicate actual or +# intended publication of this Source Code. +# + +####################################################################### +# (1) Include initial platform-independent assignments (MANDATORY). # +####################################################################### + +include manifest.mn + +####################################################################### +# (2) Include "global" configuration information. (OPTIONAL) # +####################################################################### + +include $(GDEPTH)/gconfig/config.mk + +####################################################################### +# (3) Include "component" configuration information. (OPTIONAL) # +####################################################################### + + + +####################################################################### +# (4) Include "local" platform-dependent assignments (OPTIONAL). # +####################################################################### + +include config.mk + +####################################################################### +# (5) Execute "global" rules. (OPTIONAL) # +####################################################################### + +include $(GDEPTH)/gconfig/ruleset.mk +include $(GDEPTH)/gconfig/rules.mk + +####################################################################### +# (6) Execute "component" rules. (OPTIONAL) # +####################################################################### + + + +####################################################################### +# (7) Execute "local" rules. (OPTIONAL). # +####################################################################### + + + diff --git a/xpfc/command/src/config.mk b/xpfc/command/src/config.mk new file mode 100644 index 000000000000..fbfc6933fd2a --- /dev/null +++ b/xpfc/command/src/config.mk @@ -0,0 +1,25 @@ +# +# CONFIDENTIAL AND PROPRIETARY SOURCE CODE OF +# NETSCAPE COMMUNICATIONS CORPORATION +# Copyright © 1996, 1997 Netscape Communications Corporation. All Rights +# Reserved. Use of this Source Code is subject to the terms of the +# applicable license agreement from Netscape Communications Corporation. +# The copyright notice(s) in this Source Code does not indicate actual or +# intended publication of this Source Code. +# + +# +# Override TARGETS variable so that only static libraries +# are specifed as dependencies within rules.mk. +# + +CFLAGS +=-D_IMPL_NS_XPFC -DNSPR20 +INCLUDES +=-I../inc -I$(GDEPTH)/include + +LIBRARY_NAME = command +LIBRARY_VERSION = 10 + +ARCHIVE_ONLY = 1 + +TARGETS = $(LIBRARY) + diff --git a/xpfc/command/src/manifest.mn b/xpfc/command/src/manifest.mn new file mode 100644 index 000000000000..f897ce5489fa --- /dev/null +++ b/xpfc/command/src/manifest.mn @@ -0,0 +1,27 @@ +# +# CONFIDENTIAL AND PROPRIETARY SOURCE CODE OF +# NETSCAPE COMMUNICATIONS CORPORATION +# Copyright (C) 1996 Netscape Communications Corporation. All Rights +# Reserved. Use of this Source Code is subject to the terms of the +# applicable license agreement from Netscape Communications Corporation. +# The copyright notice(s) in this Source Code does not indicate actual or +# intended publication of this Source Code. +# +GDEPTH = ../../../../.. + +EXPORTS = \ + $(NULL) + +PRIVATE_EXPORTS = \ + $(NULL) + +MODULE = xpfc + +CPPSRCS = \ + nsXPFCCommand.cpp \ + nsXPFCActionCommand.cpp \ + nsXPFCMethodInvokerCommand.cpp \ + $(NULL) + +REQUIRES = xpcom raptor + diff --git a/xpfc/command/src/nsXPFCActionCommand.cpp b/xpfc/command/src/nsXPFCActionCommand.cpp new file mode 100644 index 000000000000..04f25dfa9834 --- /dev/null +++ b/xpfc/command/src/nsXPFCActionCommand.cpp @@ -0,0 +1,72 @@ +/* -*- 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 "nscore.h" +#include "nsXPFCActionCommand.h" +#include "nsxpfcCIID.h" + +static NS_DEFINE_IID(kISupportsIID, NS_ISUPPORTS_IID); +static NS_DEFINE_IID(kXPFCCommandIID, NS_IXPFC_COMMAND_IID); + +nsXPFCActionCommand :: nsXPFCActionCommand() +{ + NS_INIT_REFCNT(); +} + +nsXPFCActionCommand :: ~nsXPFCActionCommand() +{ +} + +NS_IMPL_ADDREF(nsXPFCActionCommand) +NS_IMPL_RELEASE(nsXPFCActionCommand) + +nsresult nsXPFCActionCommand::QueryInterface(REFNSIID aIID, void** aInstancePtr) +{ + + if (NULL == aInstancePtr) { + return NS_ERROR_NULL_POINTER; + } + static NS_DEFINE_IID(kISupportsIID, NS_ISUPPORTS_IID); + static NS_DEFINE_IID(kClassIID, kXPFCCommandIID); + static NS_DEFINE_IID(kXPFCActionCommandCID, NS_XPFC_ACTION_COMMAND_CID); + + if (aIID.Equals(kClassIID)) { + *aInstancePtr = (void*) this; + AddRef(); + return NS_OK; + } + if (aIID.Equals(kISupportsIID)) { + *aInstancePtr = (void*) (this); + AddRef(); + return NS_OK; + } + if (aIID.Equals(kXPFCActionCommandCID)) { + *aInstancePtr = (void*)(nsXPFCActionCommand *) (this); + AddRef(); + return NS_OK; + } + + return (NS_NOINTERFACE); + +} + +nsresult nsXPFCActionCommand::Init() +{ + return NS_OK; +} + diff --git a/xpfc/command/src/nsXPFCCommand.cpp b/xpfc/command/src/nsXPFCCommand.cpp new file mode 100644 index 000000000000..7b9ea1a26730 --- /dev/null +++ b/xpfc/command/src/nsXPFCCommand.cpp @@ -0,0 +1,61 @@ +/* -*- 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 "nscore.h" +#include "nsXPFCCommand.h" +#include "nsxpfcCIID.h" +#include "nsIXPFCCommandReceiver.h" + +static NS_DEFINE_IID(kISupportsIID, NS_ISUPPORTS_IID); +static NS_DEFINE_IID(kXPFCCommandIID, NS_IXPFC_COMMAND_IID); + +nsXPFCCommand :: nsXPFCCommand() +{ + NS_INIT_REFCNT(); + mReceiver = nsnull; +} + +nsXPFCCommand :: ~nsXPFCCommand() +{ + mReceiver = nsnull; +} + +NS_IMPL_ADDREF(nsXPFCCommand) +NS_IMPL_RELEASE(nsXPFCCommand) +NS_IMPL_QUERY_INTERFACE(nsXPFCCommand, kXPFCCommandIID) + +nsresult nsXPFCCommand::Init() +{ + return NS_OK; +} + +nsresult nsXPFCCommand::Execute() +{ + return (mReceiver->Action(this)); +} + +nsIXPFCCommandReceiver * nsXPFCCommand::GetReceiver() +{ + return (mReceiver); +} + +nsresult nsXPFCCommand::SetReceiver(nsIXPFCCommandReceiver * aReceiver) +{ + mReceiver = aReceiver; + return (NS_OK); +} diff --git a/xpfc/command/src/nsXPFCMethodInvokerCommand.cpp b/xpfc/command/src/nsXPFCMethodInvokerCommand.cpp new file mode 100644 index 000000000000..995fcdbeb94d --- /dev/null +++ b/xpfc/command/src/nsXPFCMethodInvokerCommand.cpp @@ -0,0 +1,73 @@ +/* -*- 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 "nscore.h" +#include "nsXPFCMethodInvokerCommand.h" +#include "nsxpfcCIID.h" + +static NS_DEFINE_IID(kISupportsIID, NS_ISUPPORTS_IID); +static NS_DEFINE_IID(kXPFCCommandIID, NS_IXPFC_COMMAND_IID); + +nsXPFCMethodInvokerCommand :: nsXPFCMethodInvokerCommand() +{ + NS_INIT_REFCNT(); + mReply.Truncate(0); +} + +nsXPFCMethodInvokerCommand :: ~nsXPFCMethodInvokerCommand() +{ +} + +NS_IMPL_ADDREF(nsXPFCMethodInvokerCommand) +NS_IMPL_RELEASE(nsXPFCMethodInvokerCommand) + +nsresult nsXPFCMethodInvokerCommand::QueryInterface(REFNSIID aIID, void** aInstancePtr) +{ + + if (NULL == aInstancePtr) { + return NS_ERROR_NULL_POINTER; + } + static NS_DEFINE_IID(kISupportsIID, NS_ISUPPORTS_IID); + static NS_DEFINE_IID(kClassIID, kXPFCCommandIID); + static NS_DEFINE_IID(kXPFCMethodInvokerCommandCID, NS_XPFC_METHODINVOKER_COMMAND_CID); + + if (aIID.Equals(kClassIID)) { + *aInstancePtr = (void*) this; + AddRef(); + return NS_OK; + } + if (aIID.Equals(kISupportsIID)) { + *aInstancePtr = (void*) (this); + AddRef(); + return NS_OK; + } + if (aIID.Equals(kXPFCMethodInvokerCommandCID)) { + *aInstancePtr = (void*)(nsXPFCMethodInvokerCommand *) (this); + AddRef(); + return NS_OK; + } + + return (NS_NOINTERFACE); + +} + +nsresult nsXPFCMethodInvokerCommand::Init() +{ + return NS_OK; +} +