зеркало из https://github.com/mozilla/pjs.git
more changes to get nntpTest (and eventually news) working
This commit is contained in:
Родитель
d16e31e6e7
Коммит
58fc853664
|
@ -85,7 +85,6 @@ LLIBS= \
|
|||
$(DIST)\lib\plc3.lib \
|
||||
$(DIST)\lib\msgcoreutil.lib \
|
||||
$(DIST)\lib\nntp.lib \
|
||||
$(DIST)\lib\nntpTest.lib \
|
||||
$(DIST)\lib\netlib.lib \
|
||||
$(DIST)\lib\rdfutil_s.lib \
|
||||
$(LIBNSPR) \
|
||||
|
|
|
@ -14,6 +14,8 @@
|
|||
#include "jsapi.h"
|
||||
#endif
|
||||
|
||||
#include "prtime.h"
|
||||
|
||||
/* starting interface: nsINNTPHost */
|
||||
|
||||
/* {6b128da0-d74f-11d2-b7f9-00805f05ffa5} */
|
||||
|
@ -34,7 +36,7 @@ class nsINNTPHost : public nsISupports {
|
|||
NS_IMETHOD AddExtension(const char *extension) = 0;
|
||||
|
||||
/* boolean QueryExtension (in string extension); */
|
||||
NS_IMETHOD QueryExtension(const char *extension, PRBool *_retval) = 0;
|
||||
NS_IMETHOD QueryExtension(const char *extension, PRBool *retval) = 0;
|
||||
|
||||
/* attribute boolean postingAllowed; */
|
||||
NS_IMETHOD GetPostingAllowed(PRBool *aPostingAllowed) = 0;
|
||||
|
@ -44,72 +46,72 @@ class nsINNTPHost : public nsISupports {
|
|||
NS_IMETHOD GetPushAuth(PRBool *aPushAuth) = 0;
|
||||
NS_IMETHOD SetPushAuth(PRBool aPushAuth) = 0;
|
||||
|
||||
/* attribute long long lastUpdatedTime; */
|
||||
NS_IMETHOD GetLastUpdatedTime(PRInt64 *aLastUpdatedTime) = 0;
|
||||
NS_IMETHOD SetLastUpdatedTime(PRInt64 aLastUpdatedTime) = 0;
|
||||
/* attribute PRTime lastUpdatedTime; */
|
||||
NS_IMETHOD GetLastUpdatedTime(PRTime *aLastUpdatedTime) = 0;
|
||||
NS_IMETHOD SetLastUpdatedTime(PRTime aLastUpdatedTime) = 0;
|
||||
|
||||
/* nsINNTPNewsgroupList GetNewsgroupList (in string groupname); */
|
||||
NS_IMETHOD GetNewsgroupList(const char *groupname, nsINNTPNewsgroupList **_retval) = 0;
|
||||
/* nsINNTPNewsgroupList GetNewsgroupList (in string name); */
|
||||
NS_IMETHOD GetNewsgroupList(const char *name, nsINNTPNewsgroupList **retval) = 0;
|
||||
|
||||
/* nsINNTPNewsgroup FindNewsgroup (in string groupname, in boolean create); */
|
||||
NS_IMETHOD FindNewsgroup(const char *groupname, PRBool create, nsINNTPNewsgroup **_retval) = 0;
|
||||
/* nsINNTPNewsgroup FindNewsgroup (in string name, in boolean create); */
|
||||
NS_IMETHOD FindNewsgroup(const char *name, PRBool create, nsINNTPNewsgroup **retval) = 0;
|
||||
|
||||
/* void AddPropertyForGet (in string name, in string value); */
|
||||
NS_IMETHOD AddPropertyForGet(const char *name, const char *value) = 0;
|
||||
|
||||
/* string QueryPropertyForGet (in string name); */
|
||||
NS_IMETHOD QueryPropertyForGet(const char *name, char **_retval) = 0;
|
||||
NS_IMETHOD QueryPropertyForGet(const char *name, char **retval) = 0;
|
||||
|
||||
/* void AddSearchableGroup (in string groupname); */
|
||||
NS_IMETHOD AddSearchableGroup(const char *groupname) = 0;
|
||||
/* void AddSearchableGroup (in string name); */
|
||||
NS_IMETHOD AddSearchableGroup(const char *name) = 0;
|
||||
|
||||
/* boolean QuerySearchableGroup (in string groupname); */
|
||||
NS_IMETHOD QuerySearchableGroup(const char *groupname, PRBool *_retval) = 0;
|
||||
/* boolean QuerySearchableGroup (in string name); */
|
||||
NS_IMETHOD QuerySearchableGroup(const char *name, PRBool *retval) = 0;
|
||||
|
||||
/* void AddVirtualGroup (in string responseText); */
|
||||
NS_IMETHOD AddVirtualGroup(const char *responseText) = 0;
|
||||
|
||||
/* void SetIsVirtualGroup (in string groupname, in boolean isVirtual); */
|
||||
NS_IMETHOD SetIsVirtualGroup(const char *groupname, PRBool isVirtual) = 0;
|
||||
/* void SetIsVirtualGroup (in string name, in boolean isVirtual); */
|
||||
NS_IMETHOD SetIsVirtualGroup(const char *name, PRBool isVirtual) = 0;
|
||||
|
||||
/* boolean GetIsVirtualGroup (in string groupname); */
|
||||
NS_IMETHOD GetIsVirtualGroup(const char *groupname, PRBool *_retval) = 0;
|
||||
/* boolean GetIsVirtualGroup (in string name); */
|
||||
NS_IMETHOD GetIsVirtualGroup(const char *name, PRBool *retval) = 0;
|
||||
|
||||
/* void AddSearchableHeader (in string headerName); */
|
||||
NS_IMETHOD AddSearchableHeader(const char *headerName) = 0;
|
||||
|
||||
/* boolean QuerySearchableHeader (in string headerName); */
|
||||
NS_IMETHOD QuerySearchableHeader(const char *headerName, PRBool *_retval) = 0;
|
||||
NS_IMETHOD QuerySearchableHeader(const char *headerName, PRBool *retval) = 0;
|
||||
|
||||
/* void GroupNotFound (in string group, in boolean opening); */
|
||||
NS_IMETHOD GroupNotFound(const char *group, PRBool opening) = 0;
|
||||
|
||||
/* void AddNewNewsgroup (in string groupname, in long first, in long last, in string flags, in boolean xactiveFlags); */
|
||||
NS_IMETHOD AddNewNewsgroup(const char *groupname, PRInt32 first, PRInt32 last, const char *flags, PRBool xactiveFlags) = 0;
|
||||
/* void AddNewNewsgroup (in string name, in long first, in long last, in string flags, in boolean xactiveFlags); */
|
||||
NS_IMETHOD AddNewNewsgroup(const char *name, PRInt32 first, PRInt32 last, const char *flags, PRBool xactiveFlags) = 0;
|
||||
|
||||
/* long GetNumGroupsNeedingCounts (); */
|
||||
NS_IMETHOD GetNumGroupsNeedingCounts(PRInt32 *_retval) = 0;
|
||||
NS_IMETHOD GetNumGroupsNeedingCounts(PRInt32 *retval) = 0;
|
||||
|
||||
/* string GetFirstGroupNeedingCounts (); */
|
||||
NS_IMETHOD GetFirstGroupNeedingCounts(char **_retval) = 0;
|
||||
NS_IMETHOD GetFirstGroupNeedingCounts(char **retval) = 0;
|
||||
|
||||
/* void DisplaySubscribedGroup (in string groupname, in long first_message, in long last_message, in long total_messages, in boolean visit_now); */
|
||||
NS_IMETHOD DisplaySubscribedGroup(const char *groupname, PRInt32 first_message, PRInt32 last_message, PRInt32 total_messages, PRBool visit_now) = 0;
|
||||
/* void DisplaySubscribedGroup (in string name, in long first_message, in long last_message, in long total_messages, in boolean visit_now); */
|
||||
NS_IMETHOD DisplaySubscribedGroup(const char *name, PRInt32 first_message, PRInt32 last_message, PRInt32 total_messages, PRBool visit_now) = 0;
|
||||
|
||||
/* string GetFirstGroupNeedingExtraInfo (); */
|
||||
NS_IMETHOD GetFirstGroupNeedingExtraInfo(char **_retval) = 0;
|
||||
NS_IMETHOD GetFirstGroupNeedingExtraInfo(char **retval) = 0;
|
||||
|
||||
/* void SetGroupNeedsExtraInfo (in string groupname, in boolean needsExtraInfo); */
|
||||
NS_IMETHOD SetGroupNeedsExtraInfo(const char *groupname, PRBool needsExtraInfo) = 0;
|
||||
/* void SetGroupNeedsExtraInfo (in string name, in boolean needsExtraInfo); */
|
||||
NS_IMETHOD SetGroupNeedsExtraInfo(const char *name, PRBool needsExtraInfo) = 0;
|
||||
|
||||
/* void GetNewsgroupAndNumberOfID (in string message_id, out nsINNTPNewsgroup group, out unsigned long message_number); */
|
||||
NS_IMETHOD GetNewsgroupAndNumberOfID(const char *message_id, nsINNTPNewsgroup **group, PRUint32 *message_number) = 0;
|
||||
|
||||
/* void SetPrettyName (in string groupName, in string prettyName); */
|
||||
NS_IMETHOD SetPrettyName(const char *groupName, const char *prettyName) = 0;
|
||||
/* void SetPrettyName (in string name, in string prettyName); */
|
||||
NS_IMETHOD SetPrettyName(const char *name, const char *prettyName) = 0;
|
||||
|
||||
/* void LoadNewsrc (); */
|
||||
NS_IMETHOD LoadNewsrc() = 0;
|
||||
NS_IMETHOD LoadNewsrc(const char *uri) = 0;
|
||||
|
||||
/* void WriteNewsrc (); */
|
||||
NS_IMETHOD WriteNewsrc() = 0;
|
||||
|
@ -125,13 +127,13 @@ class nsINNTPHost : public nsISupports {
|
|||
NS_IMETHOD SetNewsRCFilename(char * aNewsRCFilename) = 0;
|
||||
|
||||
/* nsINNTPNewsgroup FindGroup (in string name); */
|
||||
NS_IMETHOD FindGroup(const char *name, nsINNTPNewsgroup **_retval) = 0;
|
||||
NS_IMETHOD FindGroup(const char *name, nsINNTPNewsgroup **retval) = 0;
|
||||
|
||||
/* nsINNTPNewsgroup AddGroup (in string groupname); */
|
||||
NS_IMETHOD AddGroup(const char *groupname, nsINNTPNewsgroup **_retval) = 0;
|
||||
/* nsINNTPNewsgroup AddGroup (in string name); */
|
||||
NS_IMETHOD AddGroup(const char *name, nsINNTPNewsgroup **retval) = 0;
|
||||
|
||||
/* void RemoveGroupByName (in string groupName); */
|
||||
NS_IMETHOD RemoveGroupByName(const char *groupName) = 0;
|
||||
/* void RemoveGroupByName (in string name); */
|
||||
NS_IMETHOD RemoveGroupByName(const char *name) = 0;
|
||||
|
||||
/* void RemoveGroup (in nsINNTPNewsgroup group); */
|
||||
NS_IMETHOD RemoveGroup(nsINNTPNewsgroup *group) = 0;
|
||||
|
@ -140,7 +142,7 @@ class nsINNTPHost : public nsISupports {
|
|||
NS_IMETHOD GetDbDirName(char * *aDbDirName) = 0;
|
||||
|
||||
/* string GetGroupList (); */
|
||||
NS_IMETHOD GetGroupList(char **_retval) = 0;
|
||||
NS_IMETHOD GetGroupList(char **retval) = 0;
|
||||
|
||||
#ifdef XPIDL_JS_STUBS
|
||||
static NS_EXPORT_(JSObject *) InitJSClass(JSContext *cx);
|
||||
|
|
|
@ -19,6 +19,10 @@
|
|||
#include "nsINNTPNewsgroupList.idl"
|
||||
#include "nsINNTPNewsgroup.idl"
|
||||
|
||||
%{ C++
|
||||
#include prtime.h
|
||||
%}
|
||||
|
||||
[object, uuid(6b128da0-d74f-11d2-b7f9-00805f05ffa5)]
|
||||
interface nsINNTPHost : nsISupports {
|
||||
|
||||
|
@ -28,13 +32,13 @@ interface nsINNTPHost : nsISupports {
|
|||
|
||||
attribute boolean postingAllowed;
|
||||
attribute boolean pushAuth;
|
||||
attribute long long lastUpdatedTime;
|
||||
attribute PRTime lastUpdatedTime;
|
||||
|
||||
/* look up the newsgroup list for the given name */
|
||||
nsINNTPNewsgroupList GetNewsgroupList(in string groupname);
|
||||
nsINNTPNewsgroupList GetNewsgroupList(in string name);
|
||||
|
||||
/* given a newsgroup name, find or create the given groupname */
|
||||
nsINNTPNewsgroup FindNewsgroup(in string groupname, in boolean create);
|
||||
/* given a newsgroup name, find or create the given name */
|
||||
nsINNTPNewsgroup FindNewsgroup(in string name, in boolean create);
|
||||
|
||||
/* libnet callbacks for Dredd NNTP extensions
|
||||
* please document if you know how these work
|
||||
|
@ -42,12 +46,12 @@ interface nsINNTPHost : nsISupports {
|
|||
void AddPropertyForGet(in string name, in string value);
|
||||
string QueryPropertyForGet(in string name);
|
||||
|
||||
void AddSearchableGroup(in string groupname);
|
||||
boolean QuerySearchableGroup(in string groupname);
|
||||
void AddSearchableGroup(in string name);
|
||||
boolean QuerySearchableGroup(in string name);
|
||||
|
||||
void AddVirtualGroup(in string responseText);
|
||||
void SetIsVirtualGroup(in string groupname, in boolean isVirtual);
|
||||
boolean GetIsVirtualGroup(in string groupname
|
||||
void SetIsVirtualGroup(in string name, in boolean isVirtual);
|
||||
boolean GetIsVirtualGroup(in string name
|
||||
/*, nsIMsgGroupRecord inGroupRecord */);
|
||||
|
||||
|
||||
|
@ -64,7 +68,7 @@ interface nsINNTPHost : nsISupports {
|
|||
|
||||
/* Tell the subscribe pane about a new newsgroup we noticed. */
|
||||
/* XXX should xactive flags be a long? */
|
||||
void AddNewNewsgroup(in string groupname,
|
||||
void AddNewNewsgroup(in string name,
|
||||
in long first, in long last,
|
||||
in string flags, in boolean xactiveFlags);
|
||||
|
||||
|
@ -89,13 +93,13 @@ interface nsINNTPHost : nsISupports {
|
|||
group (the user clicks on the newsgroup line), in case the data has
|
||||
changed since the initial passthrough. The "nowvisiting" parameter
|
||||
is TRUE in the latter case, FALSE otherwise. */
|
||||
void DisplaySubscribedGroup(in string groupname,
|
||||
void DisplaySubscribedGroup(in string name,
|
||||
in long first_message, in long last_message,
|
||||
in long total_messages,
|
||||
in boolean visit_now);
|
||||
|
||||
string GetFirstGroupNeedingExtraInfo();
|
||||
void SetGroupNeedsExtraInfo(in string groupname, in boolean needsExtraInfo);
|
||||
void SetGroupNeedsExtraInfo(in string name, in boolean needsExtraInfo);
|
||||
|
||||
|
||||
/* News servers work better if you ask for message numbers instead of IDs.
|
||||
|
@ -108,11 +112,11 @@ interface nsINNTPHost : nsISupports {
|
|||
out unsigned long message_number);
|
||||
|
||||
|
||||
void SetPrettyName(in string groupName, in string prettyName);
|
||||
void SetPrettyName(in string name, in string prettyName);
|
||||
|
||||
/* Go load the newsrc for this host. Creates the subscribed hosts as
|
||||
children of the given nsIMsgFolder. */
|
||||
void LoadNewsrc();
|
||||
void LoadNewsrc(in string uri);
|
||||
/* Write out the newsrc for this host right now. In general, either
|
||||
MarkDirty() or WriteIfDirty() should be called instead. */
|
||||
void WriteNewsrc();
|
||||
|
@ -128,14 +132,14 @@ interface nsINNTPHost : nsISupports {
|
|||
attribute string newsRCFilename;
|
||||
|
||||
nsINNTPNewsgroup FindGroup(in string name);
|
||||
nsINNTPNewsgroup AddGroup(in string groupname
|
||||
nsINNTPNewsgroup AddGroup(in string name
|
||||
/* , msg_GroupRecord *inGroupRecord */ );
|
||||
void RemoveGroupByName(in string groupName);
|
||||
void RemoveGroupByName(in string name);
|
||||
void RemoveGroup(in nsINNTPNewsgroup group);
|
||||
|
||||
/* Name of directory to store newsgroup
|
||||
databases in. This needs to have
|
||||
"/groupname" appended to it, and the
|
||||
"/name" appended to it, and the
|
||||
whole thing can be passed to the XP_File
|
||||
stuff with a type of xpXoverCache.
|
||||
*/
|
||||
|
|
|
@ -34,7 +34,7 @@ class nsINNTPNewsgroupList : public nsISupports {
|
|||
NS_IMETHOD InitXOVER(PRInt32 first_message, PRInt32 last_message) = 0;
|
||||
|
||||
/* void ProcessXOVER (in string line, out long status); */
|
||||
NS_IMETHOD ProcessXOVER(const char *line, PRUint32 *status) = 0;
|
||||
NS_IMETHOD ProcessXOVERLINE(const char *line, PRUint32 *status) = 0;
|
||||
|
||||
/* void ProcessNonXOVER (in string line); */
|
||||
NS_IMETHOD ProcessNonXOVER(const char *line) = 0;
|
||||
|
@ -43,11 +43,14 @@ class nsINNTPNewsgroupList : public nsISupports {
|
|||
NS_IMETHOD ResetXOVER() = 0;
|
||||
|
||||
/* void FinishXOVER (in long status, out long newstatus); */
|
||||
NS_IMETHOD FinishXOVER(PRInt32 status, PRInt32 *newstatus) = 0;
|
||||
NS_IMETHOD FinishXOVERLINE(PRInt32 status, PRInt32 *newstatus) = 0;
|
||||
|
||||
/* void ClearXOVERState (); */
|
||||
NS_IMETHOD ClearXOVERState() = 0;
|
||||
|
||||
/* string GetGroupName (); */
|
||||
NS_IMETHOD GetGroupName(char **retval) = 0;
|
||||
|
||||
#ifdef XPIDL_JS_STUBS
|
||||
static NS_EXPORT_(JSObject *) InitJSClass(JSContext *cx);
|
||||
static NS_EXPORT_(JSObject *) GetJSObject(JSContext *cx, nsINNTPNewsgroupList *priv);
|
||||
|
|
|
@ -51,11 +51,12 @@ interface nsINNTPNewsgroupList : nsISupports {
|
|||
*/
|
||||
/* the XOVER Sink should maintain the ListNewsGroupState */
|
||||
void InitXOVER(in long first_message, in long last_message);
|
||||
void ProcessXOVER(in string line, out long status);
|
||||
void ProcessXOVERLINE(in string line, out long status);
|
||||
void ProcessNonXOVER(in string line);
|
||||
void ResetXOVER();
|
||||
void FinishXOVER(in long status, out long newstatus);
|
||||
void FinishXOVERLINE(in long status, out long newstatus);
|
||||
void ClearXOVERState();
|
||||
string GetGroupName();
|
||||
|
||||
};
|
||||
|
||||
|
|
|
@ -45,7 +45,10 @@ class nsIUrlListener;
|
|||
class nsINntpService : public nsISupports
|
||||
{
|
||||
public:
|
||||
static const nsIID& GetIID() { static nsIID iid = NS_INNTPSERVICE_IID; return iid; }
|
||||
static const nsIID& GetIID() {
|
||||
static nsIID iid = NS_INNTPSERVICE_IID;
|
||||
return iid;
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////////////
|
||||
// We should have separate interface methods for each type of desired nntp action
|
||||
|
@ -54,7 +57,9 @@ public:
|
|||
// groups for a host, etc.....
|
||||
/////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
NS_IMETHOD RunNewsUrl (const nsString& urlString, nsISupports * aConsumer,
|
||||
NS_IMETHOD PostMessage (nsFilePath &pathToFile, const char *subject, const char *newsgroup, nsIUrlListener * aUrlListener, nsIURL ** aURL) = 0;
|
||||
|
||||
NS_IMETHOD RunNewsUrl (const nsString& urlString, nsISupports * aConsumer,
|
||||
nsIUrlListener * aUrlListener, nsIURL ** aURL) = 0;
|
||||
};
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче