diff -r dcf0eedfc1a3 -r d189ee25cf9d ipsservices/ipssosplugin/inc/ipsplgdeleteoperation.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/ipsservices/ipssosplugin/inc/ipsplgdeleteoperation.h Tue Aug 31 15:04:17 2010 +0300 @@ -0,0 +1,176 @@ +/* +* Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Deletes messages first locally and then from server +* +*/ +// class renamed +#ifndef IPSPLGDELETEOPERATION_H +#define IPSPLGDELETEOPERATION_H +// +// INCLUDES +#include +#include // TDesC8 + +class CMsvOperation; +class CMsvEntry; +class CMsvEntrySelection; +class CMsvSession; +class TRequestStatus; + +/** +* class CIpsPlgDeleteOperation +* Encapsulates delete locally operation and delete from server operation. +* First deletes message locally and after it has been completed, deletes from the server +*/ +// +NONSHARABLE_CLASS ( CIpsPlgDeleteOperation ) : public CMsvOperation +// + { + public: + // + /** + * Two-phased constructor + * + * @param aMsvSession client/server session to MsvServer + * @param aObserverRequestStatus operations observer status + * @param aEntriesToDelete Message entries to be deleted from server and locally + * + * @return CIpsPlgCreateForwardMessageOperation* self pointer + */ + static CIpsPlgDeleteOperation* NewL( + CMsvSession& aMsvSession, + TRequestStatus& aObserverRequestStatus, + CMsvEntrySelection* aEntriesToDelete ); + + /** + * Two-phased constructor + * + * @param aMsvSession client/server session to MsvServer + * @param aObserverRequestStatus operations observer status + * @param aEntriesToDelete Message entries to be deleted from server and locally + * @param aOperationObserver observes the progress of this operation + * @param aRequestId identifier for this instance of operation, + * assigned by the client + * @return CIpsPlgCreateForwardMessageOperation* self pointer + */ + static CIpsPlgDeleteOperation* NewL( + CMsvSession& aMsvSession, + TRequestStatus& aObserverRequestStatus, + CMsvEntrySelection* aEntriesToDelete, + MFSMailRequestObserver& aOperationObserver, + const TInt aRequestId); + // +// class renamed + comments removed + virtual ~CIpsPlgDeleteOperation(); + + virtual const TDesC8& ProgressL(); +// + +// + protected: + void SignalFSObserver( TInt aStatus ); +// + + private: + // + enum TIpsPlgDeleteMessagesState + { + ESetFlags = 0, + ELocally, + EFromServer + }; + // + + /** + * Constructor. + */ + // class renamed + CIpsPlgDeleteOperation( + CMsvSession& aMsvSession, + TRequestStatus& aObserverRequestStatus ); + // + // + CIpsPlgDeleteOperation( + CMsvSession& aMsvSession, + TRequestStatus& aObserverRequestStatus, + MFSMailRequestObserver& aOperationObserver, + const TInt aRequestId); + // + // + /** + * 2nd phase constructor + */ + void ConstructL( CMsvEntrySelection* aEntriesToDelete ); + // + + /** + * From CActive + */ + void DoCancel(); + + /** + * From CActive + */ + void RunL(); + + /** + * Starts new local delete progress + */ + void StartNextDeleteLocally(); + // + /** + * Creates object of CIpsPlgDeleteLocal + */ + void MakeNextDeleteLocallyL(); + // + + /** + * Starts entry delete after local delete is completed. + */ + void StartDeleteFromServer(); + + /** + * Creates delete operation + */ + void MakeDeleteFromServerL(); + + // + /** + * Sets the locally deleted flag for the next item (iSetFlagIndex) + * return true if operation started successfully, otherwise false + */ + TBool SetNextLocallyDeletedFlagL(); + // + + private: + // + CMsvOperation* iOperation; // owned + CMsvEntry* iEntry; // owned + CMsvEntrySelection* iEntrySelection; // owned + MFSMailRequestObserver* iOperationObserver; // not owned + TFSProgress iFSProgress; + TInt iFSRequestId; + // removed member iEntryCount + TInt iSetFlagIndex; + CMsvEntry* iSetFlagEntry; // owned + // removed member iBlank + // enum renamed + TIpsPlgDeleteMessagesState iState; + // + + }; + +#endif // IPSPLGDELETEREMOTE_H + +// End of File