diff --git a/mozilla/mailnews/news/public/nsINntpIncomingServer.h b/mozilla/mailnews/news/public/nsINntpIncomingServer.h new file mode 100644 index 00000000000..d2cda929050 --- /dev/null +++ b/mozilla/mailnews/news/public/nsINntpIncomingServer.h @@ -0,0 +1,37 @@ +/* + * DO NOT EDIT. THIS FILE IS GENERATED FROM nsINntpIncomingServer.idl + */ + +#ifndef __gen_nsINntpIncomingServer_h__ +#define __gen_nsINntpIncomingServer_h__ + +#include "nsISupports.h" /* interface nsISupports */ +#include "nsID.h" /* interface nsID */ + +#ifdef XPIDL_JS_STUBS +#include "jsapi.h" +#endif + +/* starting interface: nsINntpIncomingServer */ + +/* {21ea0654-f773-11d2-8aec-004005263078} */ +#define NS_INNTPINCOMINGSERVER_IID_STR "21ea0654-f773-11d2-8aec-004005263078" +#define NS_INNTPINCOMINGSERVER_IID \ + {0x21ea0654, 0xf773, 0x11d2, \ + { 0x8a, 0xec, 0x00, 0x40, 0x05, 0x26, 0x30, 0x78 }} + +class nsINntpIncomingServer : public nsISupports { + public: + NS_DEFINE_STATIC_IID_ACCESSOR(NS_INNTPINCOMINGSERVER_IID) + + /* attribute string rootFolderPath; */ + NS_IMETHOD GetRootFolderPath(char * *aRootFolderPath) = 0; + NS_IMETHOD SetRootFolderPath(char * aRootFolderPath) = 0; + +#ifdef XPIDL_JS_STUBS + static NS_EXPORT_(JSObject *) InitJSClass(JSContext *cx); + static NS_EXPORT_(JSObject *) GetJSObject(JSContext *cx, nsINntpIncomingServer *priv); +#endif +}; + +#endif /* __gen_nsINntpIncomingServer_h__ */ diff --git a/mozilla/mailnews/news/public/nsINntpIncomingServer.idl b/mozilla/mailnews/news/public/nsINntpIncomingServer.idl new file mode 100644 index 00000000000..cf2115df90e --- /dev/null +++ b/mozilla/mailnews/news/public/nsINntpIncomingServer.idl @@ -0,0 +1,28 @@ +/* -*- 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" + +[object, uuid(21ea0654-f773-11d2-8aec-004005263078)] +interface nsINntpIncomingServer : nsISupports { + + attribute string rootFolderPath; + +}; + + diff --git a/mozilla/mailnews/news/src/nsNntpIncomingServer.cpp b/mozilla/mailnews/news/src/nsNntpIncomingServer.cpp new file mode 100644 index 00000000000..461c7728bab --- /dev/null +++ b/mozilla/mailnews/news/src/nsNntpIncomingServer.cpp @@ -0,0 +1,78 @@ +/* -*- Mode: C++; 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 "nsINntpIncomingServer.h" +#include "nsNntpIncomingServer.h" +#include "nsMsgIncomingServer.h" + +#include "nsIPref.h" + +#include "prmem.h" +#include "plstr.h" + + +/* get some implementation from nsMsgIncomingServer */ +class nsNntpIncomingServer : public nsMsgIncomingServer, + public nsINntpIncomingServer + +{ +public: + NS_DECL_ISUPPORTS_INHERITED + + nsNntpIncomingServer(); + virtual ~nsNntpIncomingServer(); + + NS_IMETHOD GetRootFolderPath(char **); + NS_IMETHOD SetRootFolderPath(char *); + +private: + char *m_rootFolderPath; +}; + +NS_IMPL_ISUPPORTS_INHERITED(nsNntpIncomingServer, + nsMsgIncomingServer, + nsINntpIncomingServer); + + + +nsNntpIncomingServer::nsNntpIncomingServer() : + m_rootFolderPath(0) +{ + NS_INIT_REFCNT(); +} + +nsNntpIncomingServer::~nsNntpIncomingServer() +{ + PR_FREEIF(m_rootFolderPath); +} + +NS_IMPL_SERVERPREF_STR(nsNntpIncomingServer, + RootFolderPath, + "directory") + +nsresult NS_NewNntpIncomingServer(const nsIID& iid, + void **result) +{ + nsNntpIncomingServer *server; + if (!result) return NS_ERROR_NULL_POINTER; + server = new nsNntpIncomingServer(); + + return server->QueryInterface(iid, result); +} + + diff --git a/mozilla/mailnews/news/src/nsNntpIncomingServer.h b/mozilla/mailnews/news/src/nsNntpIncomingServer.h new file mode 100644 index 00000000000..42657c12963 --- /dev/null +++ b/mozilla/mailnews/news/src/nsNntpIncomingServer.h @@ -0,0 +1,32 @@ +/* -*- Mode: C++; 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. + */ + +#ifndef __nsNntpIncomingServer_h +#define __nsNntpIncomingServer_h + +#include "nsINntpIncomingServer.h" +#include "nscore.h" + +NS_BEGIN_EXTERN_C + +nsresult +NS_NewNntpIncomingServer(const nsIID& iid, void **result); + +NS_END_EXTERN_C + +#endif