mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-09 19:35:51 +00:00
work in progress
This commit is contained in:
parent
8ab9979d90
commit
6b7d665360
@ -36,10 +36,40 @@ public:
|
||||
|
||||
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);
|
||||
|
||||
/**
|
||||
* Perform all the queued fetches.
|
||||
* @param pID the returned ID number associated with this set of fetches.
|
||||
*/
|
||||
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);
|
||||
|
||||
/**
|
||||
* 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);
|
||||
|
||||
/**
|
||||
* 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);
|
||||
};
|
||||
|
||||
|
@ -44,4 +44,9 @@
|
||||
{ 0xfd439e90, 0x4e67, 0x11d2, \
|
||||
{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
|
||||
|
@ -21,10 +21,10 @@
|
||||
#include "nsISupports.h"
|
||||
#include "nsCalNetFetchVals.h"
|
||||
|
||||
//ea7225c0-6313-11d2-b564-0060088a4b1d
|
||||
//09176270-638f-11d2-b566-0060088a4b1d
|
||||
#define NS_ICAL_NET_FETCH_COLLECTOR_IID \
|
||||
{ 0xea7225c0, 0x6313, 0x11d2, \
|
||||
{ 0xb5, 0x64, 0x00, 0x60, 0x08, 0x8a, 0x4b, 0x1d } }
|
||||
{ 0x09176270, 0x638f, 0x11d2, \
|
||||
{ 0xb5, 0x66, 0x00, 0x60, 0x08, 0x8a, 0x4b, 0x1d } }
|
||||
|
||||
class nsICalNetFetchCollector : public nsISupports
|
||||
{
|
||||
@ -32,11 +32,45 @@ class nsICalNetFetchCollector : public nsISupports
|
||||
public:
|
||||
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 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();
|
||||
};
|
||||
|
||||
|
||||
|
@ -20,14 +20,22 @@
|
||||
#include "nsCoreCIID.h"
|
||||
#include "nsxpfcCIID.h"
|
||||
|
||||
static PRInt32 gsiID = 0;
|
||||
|
||||
PRInt32 nsCalNetFetchCollector::GetNextID()
|
||||
{
|
||||
return gsiID++;
|
||||
}
|
||||
|
||||
nsCalNetFetchCollector::nsCalNetFetchCollector(nsISupports* outer)
|
||||
{
|
||||
NS_INIT_REFCNT();
|
||||
mpFetchList = nsnull;
|
||||
}
|
||||
|
||||
NS_IMPL_ADDREF(nsLayerCollection)
|
||||
NS_IMPL_RELEASE(nsLayerCollection)
|
||||
// is this needed for a singleton?
|
||||
NS_IMPL_ADDREF(nsCalNetFetchCollector)
|
||||
NS_IMPL_RELEASE(nsCalNetFetchCollector)
|
||||
|
||||
nsCalNetFetchCollector::~nsCalNetFetchCollector()
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user