Scott Putterman's changes to make the folder pane work.

This commit is contained in:
warren%netscape.com 1999-02-17 05:32:08 +00:00
Родитель 9f4e08c3ba
Коммит e69b078636
14 изменённых файлов: 97 добавлений и 41 удалений

Просмотреть файл

@ -17,19 +17,9 @@
*/
#include "nsISupportsArray.idl"
#include "nsISupports.idl"
#include "nsIMsg.idl"
/* XXX replaced by QueryInterface for nsIMsgFolder subtypes:
enum FolderType {
FOLDER_MAIL,
FOLDER_IMAPMAIL,
FOLDER_NEWSGROUP,
FOLDER_CONTAINERONLY,
FOLDER_CATEGORYCONTAINER,
FOLDER_IMAPSERVERCONTAINER,
FOLDER_UNKNOWN
};
*/
[uuid(85e39ff0-b248-11d2-b7ef-00805f05ffa5)]
interface nsIMsgFolder : nsISupports {
@ -43,7 +33,6 @@ interface nsIMsgFolder : nsISupports {
string GetNameFromPathName(in string pathName);
// Accessing sub-folders:
boolean HasSubFolders();
unsigned long GetNumSubFolders() ;
unsigned long GetNumSubFoldersToDisplay();
@ -52,7 +41,6 @@ interface nsIMsgFolder : nsISupports {
void AddSubFolder(in nsIMsgFolder folder);
void RemoveSubFolder(in nsIMsgFolder folder);
// Accessing messages:
boolean HasMessages();
unsigned long GetNumMessages() ;
unsigned long GetNumMessagesToDisplay();
@ -130,17 +118,16 @@ interface nsIMsgFolder : nsISupports {
};
////////////////////////////////////////////////////////////////////////////////
[uuid(27D2DE40-BAF1-11d2-9578-00805F8AC615)]
interface nsIMsgLocalMailFolder : nsISupports {
attribute string pathName;
};
////////////////////////////////////////////////////////////////////////////////
[uuid(FBFEBE79-C1DD-11d2-8A40-0060B0FC04D2)]
interface nsIMsgImapMailFolder : nsISupports {
};

Просмотреть файл

@ -17,9 +17,6 @@
{ 0xB7, 0xED, 0x00, 0x80, 0x5F, 0x05, 0xFF, 0xA5 }}
class nsIMsgHost : public nsISupports {
private:
void operator delete(void *); // NOT TO BE IMPLEMENTED
public:
static const nsIID& IID() {
static nsIID iid = NS_IMSGHOST_IID;

Просмотреть файл

@ -34,7 +34,6 @@ CPPSRCS= \
nsMsgLocalMailFolder.cpp \
nsMsgImapMailFolder.cpp \
nsMsgGroupRecord.cpp \
nsMsgRDFFolder.cpp \
nsLocalFolderSummarySpec.cpp \
nsMsgLineBuffer.cpp \
nsNewsSet.cpp \
@ -49,12 +48,10 @@ CPP_OBJS= \
.\$(OBJDIR)\nsMsgLocalMailFolder.obj \
.\$(OBJDIR)\nsMsgImapMailFolder.obj \
.\$(OBJDIR)\nsMsgGroupRecord.obj \
.\$(OBJDIR)\nsMsgRDFFolder.obj \
.\$(OBJDIR)\nsNewsSet.obj \
.\$(OBJDIR)\nsMsgLineBuffer.obj \
$(NULL)
EXPORTS= \
nsMsgRFC822Parser.h \
nsUInt32Array.h \

Просмотреть файл

@ -28,6 +28,7 @@
#include "msgCore.h"
#include "nsIMsgFolder.h" /* include the interface we are going to support */
#include "nsRDFResource.h"
#include "nsIRDFResourceFactory.h"
/*
* MsgFolder
@ -303,4 +304,6 @@ protected:
};
PR_EXTERN(nsresult) NS_NewRDFMsgFolderResourceFactory(nsIRDFResourceFactory** aResult);
#endif

Просмотреть файл

@ -21,10 +21,12 @@
#include "nsMsgLocalMailFolder.h"
#include "nsMsgFolderFlags.h"
#include "prprf.h"
#include "nsIRDFResourceFactory.h"
nsMsgLocalMailFolder::nsMsgLocalMailFolder(const char* uri)
:nsMsgFolder(uri)
:nsMsgFolder(uri)
{
NS_INIT_REFCNT();
mHaveReadNameFromDB = PR_FALSE;
mPathName = nsnull;
}
@ -661,3 +663,59 @@ NS_IMETHODIMP nsMsgLocalMailFolder::SetPathName(char * aPathName)
return NS_OK;
}
/**
* This class creates resources for message folder URIs. It should be
* registered for the "mailnewsfolder:" prefix.
*/
class nsMsgFolderResourceFactoryImpl : public nsIRDFResourceFactory
{
public:
nsMsgFolderResourceFactoryImpl(void);
virtual ~nsMsgFolderResourceFactoryImpl(void);
NS_DECL_ISUPPORTS
NS_IMETHOD CreateResource(const char* aURI, nsIRDFResource** aResult);
};
nsMsgFolderResourceFactoryImpl::nsMsgFolderResourceFactoryImpl(void)
{
NS_INIT_REFCNT();
}
nsMsgFolderResourceFactoryImpl::~nsMsgFolderResourceFactoryImpl(void)
{
}
NS_IMPL_ISUPPORTS(nsMsgFolderResourceFactoryImpl, nsIRDFResourceFactory::IID());
NS_IMETHODIMP
nsMsgFolderResourceFactoryImpl::CreateResource(const char* aURI, nsIRDFResource** aResult)
{
if (! aResult)
return NS_ERROR_NULL_POINTER;
nsMsgLocalMailFolder *folder = new nsMsgLocalMailFolder(aURI);
if (! folder)
return NS_ERROR_OUT_OF_MEMORY;
folder->QueryInterface(nsIRDFResource::IID(), (void**)aResult);
return NS_OK;
}
nsresult
NS_NewRDFMsgFolderResourceFactory(nsIRDFResourceFactory** aResult)
{
if (! aResult)
return NS_ERROR_NULL_POINTER;
nsMsgFolderResourceFactoryImpl* factory =
new nsMsgFolderResourceFactoryImpl();
if (! factory)
return NS_ERROR_OUT_OF_MEMORY;
NS_ADDREF(factory);
*aResult = factory;
return NS_OK;
}

Просмотреть файл

@ -22,6 +22,7 @@
#include "nsIMsgRFC822Parser.h"
#include "nsMsgRFC822Parser.h"
#include "libi18n.h"
#include "prmem.h"
// the following three functions are only here for test purposes.....because I18N stuff is not getting built
// yet!!!!

Просмотреть файл

@ -195,7 +195,7 @@ NS_IMETHODIMP nsMSGFolderDataSource::Init(const char* uri)
{
rootFolder->SetName("Mail and News");
rootFolder->SetDepth(0);
nsNativeFileSpec startPath("your mail path here", PR_FALSE);
nsNativeFileSpec startPath("d:\\users\\warren\\Mail", PR_FALSE);
if (NS_FAILED(rv = InitLocalFolders(rootFolder, startPath, 1)))
return rv;
@ -437,7 +437,7 @@ nsMSGFolderDataSource::InitLocalFolders(nsIMsgFolder* aParentFolder, nsNativeFil
char *fileurl = (char*)PR_Malloc( fileurlSize + 1);
nsIRDFResource* resource;
PR_snprintf(fileurl, fileurlSize, "mailbox:%s", pathStr);
PR_snprintf(fileurl, fileurlSize + 1, "mailbox:%s", pathStr);
gRDFService->GetResource(fileurl, (nsIRDFResource**)&resource);
PR_Free(fileurl);
@ -476,7 +476,7 @@ nsMSGFolderDataSource::InitLocalFolders(nsIMsgFolder* aParentFolder, nsNativeFil
char *fileurl = (char*)PR_Malloc( fileurlSize + 1);
nsIRDFResource* resource;
PR_snprintf(fileurl, fileurlSize, "mailbox:%s", pathStr);
PR_snprintf(fileurl, fileurlSize + 1, "mailbox:%s", pathStr);
gRDFService->GetResource(fileurl, (nsIRDFResource**)&resource);
PR_Free(fileurl);

Просмотреть файл

@ -88,8 +88,8 @@ char *xpFileTypeToName(XP_FileType type) {
return PL_strdup("%USER%%COOKIE_F%");
case (xpHTTPCookiePermission):
return PL_strdup("%USER%%COOKIE_PERMISSION_F%");
case (xpHTTPSingleSignon):
return PL_strdup("%USER%%SIGNON_F%");
// case (xpHTTPSingleSignon):
// return PL_strdup("%USER%%SIGNON_F%");
default:
break;

Просмотреть файл

@ -41,7 +41,7 @@ class nsIDOMMsgAppCore : public nsIDOMBaseAppCore {
extern "C" NS_DOM
nsresult
NS_InitMsgAppCoreClass(nsIScriptContext *aContext, void **aPrototype);
NS_InitMsgAppCoreClass(nsIScriptContext *aContext, void **aPrototype, JSObject* parentProto);
#endif /* __gen_nsIDOMMsgAppCore_h__ */

Просмотреть файл

@ -7,7 +7,7 @@
<window xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
xmlns:html="http://www.w3.org/TR/REC-html40">
<xul:tree>
<xul:tree xul:datasources="rdf:bookmarks rdf:mail">
<xul:treehead>
<xul:treerow>
<xul:treecell>Name</xul:treecell>

Просмотреть файл

@ -3,8 +3,8 @@
<FRAMESET COLS="30%,70%">
<FRAME NAME=folder SRC="folder.xml">
<FRAMESET ROWS="50%,50%">
<FRAME NAME=folder SRC="sidebar.xul">
<FRAMESET ROWS="50%,50%">
<FRAME NAME=thread SRC="thread.xml">
<FRAME NAME=message SRC="message.html">

Просмотреть файл

@ -23,14 +23,17 @@ MAKE_OBJ_TYPE = DLL
MODULE=messenger
EXPORTS = \
nsMsgAppCore.h \
nsJSMsgAppCore.h \
$(NULL)
DLL=.\$(OBJDIR)\$(MODULE).dll
DLLNAME=messenger.dll
LIBNAME=messenger.lib
DLL=.\$(OBJDIR)\$(DLLNAME)
DEFINES=-D_IMPL_NS_DOM -DWIN32_LEAN_AND_MEAN
OBJS = \
.\$(OBJDIR)\nsMessengerFactory.obj \
.\$(OBJDIR)\nsMessengerFactory.obj \
.\$(OBJDIR)\nsJSMsgAppCore.obj \
.\$(OBJDIR)\nsMsgAppCore.obj \
$(NULL)
@ -52,6 +55,8 @@ LINCS= \
-I$(XPDIST)\public\pref \
-I$(XPDIST)\public\raptor \
-I$(XPDIST)\public\appcores \
-I$(XPDIST)\public\mailnews \
-I$(XPDIST)\public\security \
$(NULL)
LLIBS = \
@ -65,15 +70,17 @@ LLIBS = \
$(DIST)\lib\raptorgfxwin.lib \
$(LIBNSPR) \
$(DIST)\lib\libplc21.lib \
$(DIST)\lib\nntp.lib \
$(DIST)\lib\msgCore.lib \
$(NULL)
include <$(DEPTH)\config\rules.mak>
clobber::
rm -f $(DIST)\lib\$(MODULE).lib
rm -f $(DIST)\bin\$(MODULE).dll
rm -f $(DIST)\lib\$(LIBNAME)
rm -f $(DIST)\bin\$(DLLNAME)
install:: $(DLL)
$(MAKE_INSTALL) .\$(OBJDIR)\$(MODULE).dll $(DIST)\bin
$(MAKE_INSTALL) .\$(OBJDIR)\$(MODULE).lib $(DIST)\lib
$(MAKE_INSTALL) .\$(OBJDIR)\$(DLLNAME) $(DIST)\bin
$(MAKE_INSTALL) .\$(OBJDIR)\$(LIBNAME) $(DIST)\lib
$(MAKE_INSTALL) $(DLL) $(DIST)\bin

Просмотреть файл

@ -324,12 +324,13 @@ MsgAppCore(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
//
// MsgAppCore class initialization
//
nsresult NS_InitMsgAppCoreClass(nsIScriptContext *aContext, void **aPrototype)
extern "C" NS_DOM nsresult
NS_InitMsgAppCoreClass(nsIScriptContext *aContext, void **aPrototype, JSObject * aParentProto)
{
JSContext *jscontext = (JSContext *)aContext->GetNativeContext();
JSObject *proto = nsnull;
JSObject *constructor = nsnull;
JSObject *parent_proto = nsnull;
JSObject *parent_proto = aParentProto;
JSObject *global = JS_GetGlobalObject(jscontext);
jsval vp;
@ -339,9 +340,12 @@ nsresult NS_InitMsgAppCoreClass(nsIScriptContext *aContext, void **aPrototype)
(PR_TRUE != JS_LookupProperty(jscontext, JSVAL_TO_OBJECT(vp), "prototype", &vp)) ||
!JSVAL_IS_OBJECT(vp)) {
#if 0
if (NS_OK != NS_InitBaseAppCoreClass(aContext, (void **)&parent_proto)) {
return NS_ERROR_FAILURE;
}
#endif
proto = JS_InitClass(jscontext, // context
global, // global object
parent_proto, // parent proto
@ -398,7 +402,7 @@ extern "C" NS_DOM nsresult NS_NewScriptMsgAppCore(nsIScriptContext *aContext, ns
return NS_ERROR_FAILURE;
}
if (NS_OK != NS_InitMsgAppCoreClass(aContext, (void **)&proto)) {
if (NS_OK != NS_InitMsgAppCoreClass(aContext, (void **)&proto, parent)) {
return NS_ERROR_FAILURE;
}

Просмотреть файл

@ -274,6 +274,8 @@ nsMsgAppCore::OpenURL(nsAutoString& url)
{
// here's where we call mscott's LoadURL
// LoadURL(mWebShell, url);
NS_ASSERTION(0, "not implemented");
return NS_ERROR_NOT_IMPLEMENTED;
}
// to load the webshell!