messagingfw/msgsrvnstore/server/inc/MSVDELET.H
changeset 0 8e480a14352b
equal deleted inserted replaced
-1:000000000000 0:8e480a14352b
       
     1 // Copyright (c) 1998-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 #if !defined(__MSVDELET_H__)
       
    17 #define __MSVDELET_H__
       
    18 
       
    19 #if !defined(__E32BASE_H__)
       
    20 #include <e32base.h>
       
    21 #endif
       
    22 
       
    23 #if !defined(__MSVSTD_H__)
       
    24 #include <msvstd.h>
       
    25 #endif
       
    26 
       
    27 class CMsvServer;
       
    28 
       
    29 //**********************************
       
    30 // CMsvDelete
       
    31 //**********************************
       
    32 //
       
    33 //
       
    34 //
       
    35 
       
    36 class CMsvDelete : public CActive
       
    37 /**
       
    38 @internalComponent
       
    39 @released
       
    40 */
       
    41 	{
       
    42 public:
       
    43 	static CMsvDelete* NewL(CMsvServer& aServer);
       
    44 	~CMsvDelete();
       
    45 	//
       
    46 	void StartL(TMsvId aEntryId, CMsvEntrySelection& aDeletedEntries, CMsvEntrySelection& aMovedEntries, TRequestStatus& aObserverStatus, TBool aPCSyncOverride=EFalse);
       
    47 	void StartL(TMsvId aEntryId, CMsvEntrySelection& aDeletedEntries, CMsvEntrySelection& aMovedEntries, TBool aPCSyncOverride=EFalse);
       
    48 	//
       
    49 	
       
    50 private:
       
    51 	CMsvDelete(CMsvServer& aServer);
       
    52 	void ConstructL();
       
    53 	void Complete(TInt aError);
       
    54 	void DoRunL();
       
    55 	void CheckEntriesL();
       
    56 	void DeleteFilesL();
       
    57 	void DeleteAllIndexEntries();
       
    58 	void DeleteIndividualIndexEntries();	
       
    59 	void FindParent();
       
    60 	void DoStartL(TMsvId aId, CMsvEntrySelection& aDeletedEntries, CMsvEntrySelection& aMovedEntries, TBool aPCSyncOverride);
       
    61 	// from CActive
       
    62 	void RunL();
       
    63 	void DoCancel();
       
    64 	//
       
    65 private:
       
    66 	enum TState {ECheck, EFiles, EIndex, EIndexIndividually, ECompleted};
       
    67 private:
       
    68 	class TMsvDelete
       
    69 		{
       
    70 		public:
       
    71 			TMsvDelete(TMsvId aEntryId, TBool aOwner, TInt aPcSyncCount, TUid aType, TBool aComplete)
       
    72 			:iEntryId(aEntryId), iOwner(aOwner), iPcSyncCount(aPcSyncCount), iType(aType), iIsComplete(aComplete) {}
       
    73 			TMsvId iEntryId;
       
    74 			TBool iOwner;
       
    75 			TInt iPcSyncCount;
       
    76 			TUid iType;
       
    77 			TBool iIsComplete;
       
    78 		};
       
    79 	CMsvServer& iServer;
       
    80 	TRequestStatus* iObserverStatus;
       
    81 	TMsvId iId;
       
    82 	CMsvEntrySelection* iDeletedEntries;
       
    83 	CMsvEntrySelection* iMovedEntries;
       
    84 	CMsvEntrySelection* iDescendents;
       
    85 	TState iState;
       
    86 	TInt iLockedIndex;
       
    87 	TInt iDeletionIndex;
       
    88 	TBool iPCSynced;
       
    89 	TBool iPCSyncOverride;
       
    90 	TInt iError;
       
    91 	CFileMan *iFileMan;
       
    92 	RArray<TMsvDelete> iDeleteArray;
       
    93 	};
       
    94 
       
    95 
       
    96 
       
    97 #endif