diff -r 000000000000 -r 094583676ce7 PECengine/ListLibrary2/ContactListSrc/CPEngStartSyncTransaction.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/PECengine/ListLibrary2/ContactListSrc/CPEngStartSyncTransaction.h Thu Dec 17 08:41:52 2009 +0200 @@ -0,0 +1,224 @@ +/* +* Copyright (c) 2005 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: Transction handler to do basic synchronization +* +*/ + +#ifndef __CPENGSTARTSYNCTRANSACTION_H__ +#define __CPENGSTARTSYNCTRANSACTION_H__ + + +// INCLUDES +#include "MPEngOutgoingTransactionHandler.h" +#include "PEngWVCspVersion.h" +#include +#include + + + +// FORWARD DECLARATIONS +class MPEngStorageManager; +class CPEngTransactionStatus; +class MPEngXMLParser; +class MPEngContactListTransactionManager; +class MPEngXMLSerializer; + + +// CLASS DECLARATION +/** + * Transction handler to do basic synchronization + * + * @lib PEngListLib2 + * @since 3.0 + */ +NONSHARABLE_CLASS( CPEngStartSyncTransaction ): + public CBase, + public MPEngOutgoingTransactionHandler + { +private: + + /** + * Private enumerations. + */ + enum TPEngSyncStartState + { + EPEngGetListOfLists = 0, + EPEngUnSubscribe, + EPEngTransactionCompleted + }; + +public: + + /** + * Two-phased constructor. + */ + static CPEngStartSyncTransaction* NewLC( + MPEngContactListTransactionManager& aCntLstSettingsManager, + TPEngWVCspVersion& aCSPVersion, + TInt aOperationId, + TBool aNeedToUnsubscribe ); + + /** + * Destructor. + */ + virtual ~CPEngStartSyncTransaction(); + + +public: // Functions from MPEngOutgoingTransactionHandler + + /** + * Synchronous method, get Outgoing transaction request + * @see + */ + void RequestL( TDes8& aSendBuffer ); + + + /** + * Signals to the transaction handler that this it is last one + * @see + */ + void LastRunningTransactionHandler(); + + + /** + * Process the response to the request. + * @see + */ + void ProcessResponseL( const TDesC8& aResponse, + TRequestStatus& aStatus ); + + /** + * Cancels asynchronous processing of the request + * @see + */ + void CancelProcessing(); + + + /** + * Support for simultaneous transaction handling + * @see + */ + void NewTransactionHandlersL( + RPointerArray& aHandlers ); + + + /** + * Function to signal completing of the transaction + * @see + */ + TBool TransactionCompleted(); + + + /** + * Gets transaction status result class + * @see + */ + CPEngTransactionStatus* TransactionResult(); + + + /** + * Releases the handler + * @see + */ + void ReleaseHandler(); + + + +private: ///New functions + + /** + * Create XML message to retrieve all contact lists of the wv server + * + * @since 3.0 + * @param aXmlSerializer XML serializer + */ + void GetXMLGetListOfContactListsL( MPEngXMLSerializer& aXmlSerializer ); + + /** + * Create XML message to unsubscribe all contact lists of the wv server + * @since 3.0 + * @param aXmlSerializer XML serializer + */ + void GetXMLUnsubscribeAllL( MPEngXMLSerializer& aXmlSerializer ); + + + /** + * Parse XML Get list of server contact lists response + * + * @since 3.0 + * @param aResponse response buffer + * @return aXMLparser XML parser + */ + void ParseGetListOfListsResponseL( const TDesC8& aResponse, + MPEngXMLParser* aXMLparser ); + + /** + * Parse XML Unsunbscribe all response + * + * @since 3.0 + * @param aResponse response buffer + * @return aXMLparser XML parser + */ + void ParseUnsubscreAllResponseL( const TDesC8& aResponse, + MPEngXMLParser* aXMLparser ); + +private: // Constructors + + /** + * C++ constructor. + */ + CPEngStartSyncTransaction( + MPEngContactListTransactionManager& aCntLstSettingsManager, + TPEngWVCspVersion& aCSPVersion, + TInt aOperationId, + TBool aNeedToUnsubscribe ); + + + /** + * Symbian constructor + */ + void ConstructL(); + + +private: // Data + + // REF: Contact list manager + MPEngContactListTransactionManager& iContactListManager; + + // OWN: Transaction status class + CPEngTransactionStatus* iTransactionStatus; + + // OWN: State of the start of the synchronization + TInt iSynchronizationState; + + // OWN: List of server contact lists + CDesC16ArrayFlat iServerCntLists; + + /// OWN: Server default contact list + HBufC* iDefaultCntList; + + /// OWN: CPS Version + TPEngWVCspVersion& iCSPVersion; + + /// Operation Id + TInt iOperationId; + + // + TBool iUnsubscribe; + }; + +#endif // __CPENGSTARTSYNCTRANSACTION_H__ + +// End of File +