work in progress

This commit is contained in:
sman%netscape.com 1998-10-15 01:26:44 +00:00
parent 8ab9979d90
commit 6b7d665360
4 changed files with 86 additions and 9 deletions

View File

@ -36,10 +36,40 @@ public:
NS_DECL_ISUPPORTS NS_DECL_ISUPPORTS
/**
* Register a fetch by range, but don't perform it yet.
* @param nsIUser user making the request
* @param d1 start date/time of range
* @param d2 end date/time of range
*/
NS_IMETHOD QueueFetchByRange(nsIUser* pUser, nsILayer* pLayer, DateTime d1, DateTime d2); NS_IMETHOD QueueFetchByRange(nsIUser* pUser, nsILayer* pLayer, DateTime d1, DateTime d2);
/**
* Perform all the queued fetches.
* @param pID the returned ID number associated with this set of fetches.
*/
NS_IMETHOD FlushFetchByRange(PRInt32* pID); NS_IMETHOD FlushFetchByRange(PRInt32* pID);
/**
* Set the priority of the fetches belonging to the supplied ID number
* @param id the ID number of the fetches as returned by FlushFetchByRange.
* @param iPri the priority for their threads
*/
NS_IMETHOD SetPriority(PRInt32 id, PRInt32 iPri); NS_IMETHOD SetPriority(PRInt32 id, PRInt32 iPri);
/**
* Get the state associated with the ID'd fetches
* @param id the id of the fetch
* @param d1 its current state
*/
NS_IMETHOD GetState(PRInt32 ID, eCalNetFetchState *pState); NS_IMETHOD GetState(PRInt32 ID, eCalNetFetchState *pState);
/**
* Cancel everything associated with the fetch
* @param nsIUser user making the request
* @param d1 start date/time of range
* @param d2 end date/time of range
*/
NS_IMETHOD Cancel(nsILayer * aLayer); NS_IMETHOD Cancel(nsILayer * aLayer);
}; };

View File

@ -44,4 +44,9 @@
{ 0xfd439e90, 0x4e67, 0x11d2, \ { 0xfd439e90, 0x4e67, 0x11d2, \
{0x92, 0x4a, 0x00, 0x80, 0x5f, 0x8a, 0x7a, 0xb6} } {0x92, 0x4a, 0x00, 0x80, 0x5f, 0x8a, 0x7a, 0xb6} }
//ea7225c0-6313-11d2-b564-0060088a4b1d
#define NS_CAL_NET_FETCH_COLLECTOR_CID \
{ 0xea7225c0, 0x6313, 0x11d2, \
{ 0xb5, 0x64, 0x00, 0x60, 0x08, 0x8a, 0x4b, 0x1d } }
#endif #endif

View File

@ -21,10 +21,10 @@
#include "nsISupports.h" #include "nsISupports.h"
#include "nsCalNetFetchVals.h" #include "nsCalNetFetchVals.h"
//ea7225c0-6313-11d2-b564-0060088a4b1d //09176270-638f-11d2-b566-0060088a4b1d
#define NS_ICAL_NET_FETCH_COLLECTOR_IID \ #define NS_ICAL_NET_FETCH_COLLECTOR_IID \
{ 0xea7225c0, 0x6313, 0x11d2, \ { 0x09176270, 0x638f, 0x11d2, \
{ 0xb5, 0x64, 0x00, 0x60, 0x08, 0x8a, 0x4b, 0x1d } } { 0xb5, 0x66, 0x00, 0x60, 0x08, 0x8a, 0x4b, 0x1d } }
class nsICalNetFetchCollector : public nsISupports class nsICalNetFetchCollector : public nsISupports
{ {
@ -32,11 +32,45 @@ class nsICalNetFetchCollector : public nsISupports
public: public:
NS_IMETHOD Init() = 0; NS_IMETHOD Init() = 0;
NS_IMETHOD QueueFetchByRange(nsIUser* pUser, nsILayer* pLayer, DateTime d1, DateTime d2) = 0; /**
NS_IMETHOD FlushFetchByRange(PRInt32* pID) = 0; * Register a fetch by range, but don't perform it yet.
* @param nsIUser user making the request
* @param pLayer
* @param d1 start date/time of range
* @param d2 end date/time of range
*/
NS_IMETHOD QueueFetchEventsByRange(nsILayer* pLayer, DateTime d1, DateTime d2) = 0;
/**
* Perform all the queued fetches.
* @param pID the returned ID number associated with this set of fetches.
*/
NS_IMETHOD FlushFetchEventsByRange(PRInt32* pID) = 0;
/**
* Set the priority of the fetches belonging to the supplied ID number
* @param id the ID number of the fetches as returned by FlushFetchByRange.
* @param iPri the priority for their threads
*/
NS_IMETHOD SetPriority(PRInt32 id, PRInt32 iPri) = 0; NS_IMETHOD SetPriority(PRInt32 id, PRInt32 iPri) = 0;
NS_IMETHOD GetState(PRInt32 ID, eCalNetFetchState *pState) = 0;
NS_IMETHOD Cancel(nsILayer * aLayer) = 0; /**
* Get the state associated with the ID'd fetches
* @param id the id of the fetch
* @param d1 its current state
*/
NS_IMETHOD GetState(PRInt32 id, eCalNetFetchState *pState) = 0;
/**
* Cancel everything associated with the fetch
* @param nsIUser user making the request
* @param d1 start date/time of range
* @param d2 end date/time of range
*/
NS_IMETHOD Cancel(PRInt32 id) = 0;
private:
PRInt32 GetNextID();
}; };

View File

@ -20,14 +20,22 @@
#include "nsCoreCIID.h" #include "nsCoreCIID.h"
#include "nsxpfcCIID.h" #include "nsxpfcCIID.h"
static PRInt32 gsiID = 0;
PRInt32 nsCalNetFetchCollector::GetNextID()
{
return gsiID++;
}
nsCalNetFetchCollector::nsCalNetFetchCollector(nsISupports* outer) nsCalNetFetchCollector::nsCalNetFetchCollector(nsISupports* outer)
{ {
NS_INIT_REFCNT(); NS_INIT_REFCNT();
mpFetchList = nsnull; mpFetchList = nsnull;
} }
NS_IMPL_ADDREF(nsLayerCollection) // is this needed for a singleton?
NS_IMPL_RELEASE(nsLayerCollection) NS_IMPL_ADDREF(nsCalNetFetchCollector)
NS_IMPL_RELEASE(nsCalNetFetchCollector)
nsCalNetFetchCollector::~nsCalNetFetchCollector() nsCalNetFetchCollector::~nsCalNetFetchCollector()
{ {