зеркало из https://github.com/mozilla/gecko-dev.git
Objects needed for background data loading.
This commit is contained in:
Родитель
2ad03dd76f
Коммит
da5f9a3a0c
|
@ -13,6 +13,9 @@ EXPORTS = \
|
|||
$(NULL)
|
||||
|
||||
PRIVATE_EXPORTS = \
|
||||
nsCalNetFetchCollector.h \
|
||||
nsCalNetFetchCommand.h \
|
||||
nsCalNetFetchVals.h \
|
||||
nsLayer.h \
|
||||
nsLayerCollection.h \
|
||||
nsCoreCIID.h \
|
||||
|
|
|
@ -20,14 +20,15 @@
|
|||
#define nsCalNetFetchCollector_h__
|
||||
|
||||
#include "nscalexport.h"
|
||||
#include "nsCalNetFetchVals.h"
|
||||
#include "nsICalNetFetchCollector.h"
|
||||
#include "nsIVector.h"
|
||||
|
||||
|
||||
class NS_CALENDAR nsCalNetFetchCollector : public nsICalNetFetchCollector
|
||||
{
|
||||
|
||||
JulianString msCurl;
|
||||
NSCalendar* mpCal;
|
||||
nsCalendarShell* mpShell;
|
||||
nsIVector * mpFetchList ;
|
||||
|
||||
public:
|
||||
nsCalNetFetchCollector(nsISupports* outer);
|
||||
|
@ -35,11 +36,11 @@ public:
|
|||
|
||||
NS_DECL_ISUPPORTS
|
||||
|
||||
NS_IMETHOD QueueFetchByRange(nsIUser* pUser, nsILayer* pLayer, DateTime d1, DateTime d2) = 0;
|
||||
NS_IMETHOD FlushFetchByRange(PRInt32* pID) = 0;
|
||||
NS_IMETHOD SetPriority(PRInt32 id, PRInt32 iPri) = 0;
|
||||
NS_IMETHOD GetState(PRInt32 ID, EState *pState) = 0;
|
||||
NS_IMETHOD Cancel(nsILayer * aLayer) = 0;
|
||||
NS_IMETHOD QueueFetchByRange(nsIUser* pUser, nsILayer* pLayer, DateTime d1, DateTime d2);
|
||||
NS_IMETHOD FlushFetchByRange(PRInt32* pID);
|
||||
NS_IMETHOD SetPriority(PRInt32 id, PRInt32 iPri);
|
||||
NS_IMETHOD GetState(PRInt32 ID, eCalNetFetchState *pState);
|
||||
NS_IMETHOD Cancel(nsILayer * aLayer);
|
||||
};
|
||||
|
||||
#endif //nsCalNetFetchCollector_h__
|
||||
|
|
|
@ -0,0 +1,45 @@
|
|||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||
*
|
||||
* 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 nsCalNetFetchCommand_h__
|
||||
#define nsCalNetFetchCommand_h__
|
||||
|
||||
#include "nscalexport.h"
|
||||
#include "nsCalNetFetchVals.h"
|
||||
#include "nsICalNetFetchCommand.h"
|
||||
#include "nsIVector.h"
|
||||
|
||||
|
||||
class NS_CALENDAR nsCalNetFetchCommand
|
||||
{
|
||||
|
||||
nsIVector * mpLayerList ; // all the layers that need the events from this range
|
||||
|
||||
public:
|
||||
nsCalNetFetchCommand(nsISupports* outer);
|
||||
~nsCalNetFetchCommand();
|
||||
|
||||
NS_DECL_ISUPPORTS
|
||||
|
||||
NS_IMETHOD UpdateRange(DateTime d1, DateTime d2);
|
||||
NS_IMETHOD AddLayer(nsILayer* pLayer);
|
||||
NS_IMETHOD Execute(PRInt32 iPri);
|
||||
NS_IMETHOD Cancel();
|
||||
};
|
||||
|
||||
#endif //nsCalNetFetchCommand_h__
|
|
@ -0,0 +1,26 @@
|
|||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||
*
|
||||
* 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 nsCalNetFetchVals_h___
|
||||
#define nsCalNetFetchVals_h___
|
||||
|
||||
enum eCalNetFetchState { eCALNETFETCH_PAUSED,
|
||||
eCALNETFETCH_COLLECTING,
|
||||
eCALNETFETCH_EXECUTING,
|
||||
eCALNETFETCH_COMPLETED };
|
||||
|
||||
#endif /* nsCalNetFetchVals_h___ */
|
|
@ -19,6 +19,7 @@
|
|||
#define nsICalNetFetchCollector_h___
|
||||
|
||||
#include "nsISupports.h"
|
||||
#include "nsCalNetFetchVals.h"
|
||||
|
||||
//ea7225c0-6313-11d2-b564-0060088a4b1d
|
||||
#define NS_ICAL_NET_FETCH_COLLECTOR_IID \
|
||||
|
@ -27,7 +28,6 @@
|
|||
|
||||
class nsICalNetFetchCollector : public nsISupports
|
||||
{
|
||||
enum EState { ePAUSED, eCOLLECTING, eEXECUTING, eCOMPLETED };
|
||||
|
||||
public:
|
||||
NS_IMETHOD Init() = 0;
|
||||
|
@ -35,7 +35,7 @@ public:
|
|||
NS_IMETHOD QueueFetchByRange(nsIUser* pUser, nsILayer* pLayer, DateTime d1, DateTime d2) = 0;
|
||||
NS_IMETHOD FlushFetchByRange(PRInt32* pID) = 0;
|
||||
NS_IMETHOD SetPriority(PRInt32 id, PRInt32 iPri) = 0;
|
||||
NS_IMETHOD GetState(PRInt32 ID, EState *pState) = 0;
|
||||
NS_IMETHOD GetState(PRInt32 ID, eCalNetFetchState *pState) = 0;
|
||||
NS_IMETHOD Cancel(nsILayer * aLayer) = 0;
|
||||
};
|
||||
|
||||
|
|
|
@ -0,0 +1,76 @@
|
|||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||
*
|
||||
* 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 <stdio.h>
|
||||
#include "nscore.h"
|
||||
#include "nsCoreCIID.h"
|
||||
#include "nsxpfcCIID.h"
|
||||
|
||||
nsCalNetFetchCollector::nsCalNetFetchCollector(nsISupports* outer)
|
||||
{
|
||||
NS_INIT_REFCNT();
|
||||
mpFetchList = nsnull;
|
||||
}
|
||||
|
||||
NS_IMPL_ADDREF(nsLayerCollection)
|
||||
NS_IMPL_RELEASE(nsLayerCollection)
|
||||
|
||||
nsCalNetFetchCollector::~nsCalNetFetchCollector()
|
||||
{
|
||||
/*
|
||||
* destroy anything in the list...
|
||||
*/
|
||||
NS_IF_RELEASE(mpFetchList);
|
||||
}
|
||||
|
||||
nsresult nsCalNetFetchCollector::Init()
|
||||
{
|
||||
static NS_DEFINE_IID(kCVectorCID, NS_VECTOR_CID);
|
||||
|
||||
nsresult res = nsRepository::CreateInstance(kCVectorCID, nsnull, kCVectorCID, (void **)&mpFetchList);
|
||||
if (NS_OK != res)
|
||||
return res ;
|
||||
mpFetchList->Init();
|
||||
return (NS_OK);
|
||||
}
|
||||
|
||||
nsresult nsCalNetFetchCollector::QueueFetchByRange(nsIUser* pUser, nsILayer* pLayer, DateTime d1, DateTime d2)
|
||||
{
|
||||
return (NS_OK);
|
||||
}
|
||||
|
||||
nsresult nsCalNetFetchCollector::FlushFetchByRange(PRInt32* pID)
|
||||
{
|
||||
return (NS_OK);
|
||||
}
|
||||
|
||||
nsresult nsCalNetFetchCollector::SetPriority(PRInt32 id, PRInt32 iPri)
|
||||
{
|
||||
return (NS_OK);
|
||||
}
|
||||
|
||||
nsresult nsCalNetFetchCollector::GetState(PRInt32 ID, eCalNetFetchState *pState)
|
||||
{
|
||||
return (NS_OK);
|
||||
}
|
||||
|
||||
nsresult nsCalNetFetchCollector::Cancel(nsILayer * aLayer)
|
||||
{
|
||||
return (NS_OK);
|
||||
}
|
||||
|
||||
|
Загрузка…
Ссылка в новой задаче