pimappservices/calendar/server/inc/agsasyncdelete.h
changeset 0 f979ecb2b13e
equal deleted inserted replaced
-1:000000000000 0:f979ecb2b13e
       
     1 // Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     2 // All rights reserved.
       
     3 // This component and the accompanying materials are made available
       
     4 // under the terms of "Eclipse Public License v1.0"
       
     5 // which accompanies this distribution, and is available
       
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 //
       
    15 
       
    16 #ifndef __AGSASYNCDELETE_H__
       
    17 #define __AGSASYNCDELETE_H__
       
    18 
       
    19 #include <e32base.h>
       
    20 
       
    21 class CAgnEntryModel;
       
    22 class CAgnSimpleEntry;
       
    23 class CAgnSimpleEntryTable;
       
    24 class TAgnChangeFilter;
       
    25 class TAgnEntryDateIterator;
       
    26 class TAgnEntryId;
       
    27 class TAgnFilter;
       
    28 
       
    29 class CCalAsyncDelete : public CBase
       
    30 	{
       
    31 public:
       
    32 	static CCalAsyncDelete* NewL(CAgnEntryModel& aModel, TAgnChangeFilter& aChangeFilter, CAgnSimpleEntryTable& aEntryTable);
       
    33 	~CCalAsyncDelete();
       
    34 
       
    35 	TBool SetUpDeleteL(const TAgnFilter& aFilter, const TTime& aTodaysDate, const TTime& aStartDate, const TTime& aEndDate);
       
    36 	TInt DoDeleteStepL();
       
    37 	
       
    38 private:
       
    39 	class TStreamIdKey : public TKeyArrayFix
       
    40 		{
       
    41 	public:
       
    42 		inline TStreamIdKey() : TKeyArrayFix(0,ECmpTUint32) {};
       
    43 		virtual TInt Compare(TInt aLeft, TInt aRight) const;	
       
    44 		};
       
    45 		
       
    46 	CCalAsyncDelete(CAgnEntryModel& aModel, TAgnChangeFilter& aChangeFilter, CAgnSimpleEntryTable& aEntryTable);
       
    47 	void ConstructL();
       
    48 
       
    49 	void TidyEntryL(const CAgnSimpleEntry& aSimpleEntry);
       
    50 	TBool FallInTimeRangeL(const CAgnSimpleEntry& aSimpleEntry);
       
    51 	TBool CheckDateIteratorEnd() const;
       
    52 	void DeleteTidiedEntriesL();
       
    53 	TBool IsEntryValidToTidyL(const CAgnSimpleEntry& aSimpleEntry);
       
    54 
       
    55 private:
       
    56 	CArrayFixFlat<TAgnEntryId>*		iTidyDeleteArray; 
       
    57 	CArrayFixFlat<TAgnEntryId>*		iAlreadyTidied;
       
    58 	TAgnEntryDateIterator*			iTidyIter;
       
    59 	TTime							iTidyStartDate;
       
    60 	TTime							iTidyEndDate;
       
    61 	TTime							iTidyDate;
       
    62 	TInt							iNumEntriesProcessed;
       
    63 	TInt							iNumEntriesToProcess;
       
    64 	CAgnEntryModel&					iModel;
       
    65 	TAgnChangeFilter&				iChangeFilter;
       
    66 	CAgnSimpleEntryTable& 			iEntryTable;
       
    67  	};
       
    68 
       
    69 #endif
       
    70 
       
    71