diff -r 000000000000 -r e686773b3f54 phonebookui/Phonebook2/CommandsExtension/inc/CPbk2MergeConflict.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/phonebookui/Phonebook2/CommandsExtension/inc/CPbk2MergeConflict.h Tue Feb 02 10:12:17 2010 +0200 @@ -0,0 +1,141 @@ +/* + * Copyright (c) 2009 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: Phonebook 2 merge conflict. + * + */ + +#ifndef CPBK2MERGECONFLICT_H_ +#define CPBK2MERGECONFLICT_H_ + +#include +#include +#include +#include + +// FORWARD DECLARATIONS +class CPbk2PresentationContact; + +// CLASS DECLARATION + +/** + * Phonebook 2 merge conflict. + */ +class CPbk2MergeConflict : public CBase, + public MPbk2MergeConflict + { +public: // Construction and destruction + /** + * Creates a new instance of this class. + * + * @return A new instance of this class. + */ + static CPbk2MergeConflict* NewL(); + +private: // Construction + CPbk2MergeConflict(); + +public: // Implementation + /** + * Adds fields into conflict. + * + * @param aFieldFirst First field. + * @param aFieldSecond Second field. + */ + void AddFields( + const MVPbkStoreContactField& aFieldFirst, + const MVPbkStoreContactField& aFieldSecond ); + + /** + * Gets fields from conflict. + * + * @param aFieldFirst First field. + * @param aFieldSecond Second field. + */ + void GetFieldsL( + const MVPbkStoreContactField*& aFieldFirst, + const MVPbkStoreContactField*& aFieldSecond ); + +public: // CPbk2MergeConflictBase + EPbk2ConflictType GetConflictType(); + HBufC* GetLabelLC(); + HBufC* GetTextLC( EPbk2ConflictedNumber aNumber ); + void ResolveConflict( EPbk2ConflictedNumber aNumber ); + void GetChosenFieldsL( RPointerArray& aAddressFields ); + +private: // methods + void CustomizeTextValueL( const MVPbkStoreContactField& aField, TDes& aBuf ); + +private: //Data + // Not own: First field + const MVPbkStoreContactField* iFieldFirst; + // Not own: Second field + const MVPbkStoreContactField* iFieldSecond; + // Not own: Chosen field + const MVPbkStoreContactField* iChosenField; + // Own: Conflict type + EPbk2ConflictType iConflictType; + }; + +/** + * Phonebook 2 merge addresses conflict. + */ +class CPbk2MergeConflictAddress : public CBase, + public MPbk2MergeConflict + { +public: // Construction and destruction + /** + * Creates a new instance of this class. + * + * @return A new instance of this class. + */ + static CPbk2MergeConflictAddress* NewL(); + +private: // Construction + CPbk2MergeConflictAddress(); + +public: // Implementation + /** + * Adds addresses into conflict. + * + * @param aContactFirst First contact. + * @param aContactSecond Second contact. + * @param aAddressGroup Address group. + */ + void AddAddress( + CPbk2PresentationContact& aContactFirst, + CPbk2PresentationContact& aContactSecond, + TPbk2FieldGroupId aAddressGroup ); + +public: // CPbk2MergeConflictBase + EPbk2ConflictType GetConflictType(); + HBufC* GetLabelLC(); + HBufC* GetTextLC( EPbk2ConflictedNumber aNumber ); + void ResolveConflict( EPbk2ConflictedNumber aNumber ); + void GetChosenFieldsL( RPointerArray& aAddressFields ); + +private: //Data + // Own: Address group + TPbk2FieldGroupId iAddressGroup; + // Not Own: First contact + CPbk2PresentationContact* iContactFirst; + // Not Own: Second contact + CPbk2PresentationContact* iContactSecond; + // Not own: Contact who owns chosen address + const CPbk2PresentationContact* iContactChosenAddress; + // Own: Conflict type + EPbk2ConflictType iConflictType; + }; + + +#endif /* CPBK2MERGECONFLICT_H_ */