phonebookui/Phonebook2/CommandsExtension/inc/CPbk2MergeConflict.h
changeset 0 e686773b3f54
child 17 2666d9724c76
equal deleted inserted replaced
-1:000000000000 0:e686773b3f54
       
     1 /*
       
     2  * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
       
     3  * All rights reserved.
       
     4  * This component and the accompanying materials are made available
       
     5  * under the terms of "Eclipse Public License v1.0"
       
     6  * which accompanies this distribution, and is available
       
     7  * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8  *
       
     9  * Initial Contributors:
       
    10  * Nokia Corporation - initial contribution.
       
    11  *
       
    12  * Contributors:
       
    13  *
       
    14  * Description:  Phonebook 2 merge conflict.
       
    15  *
       
    16  */
       
    17 
       
    18 #ifndef CPBK2MERGECONFLICT_H_
       
    19 #define CPBK2MERGECONFLICT_H_
       
    20 
       
    21 #include <e32base.h>
       
    22 #include <MVPbkStoreContactField.h>
       
    23 #include <Pbk2FieldProperty.hrh>
       
    24 #include <MPbk2MergeConflict.h>
       
    25 
       
    26 // FORWARD DECLARATIONS
       
    27 class CPbk2PresentationContact;
       
    28 
       
    29 // CLASS DECLARATION
       
    30 
       
    31 /**
       
    32  * Phonebook 2 merge conflict.
       
    33  */
       
    34 class CPbk2MergeConflict : public CBase,
       
    35                             public MPbk2MergeConflict
       
    36     {
       
    37 public: // Construction and destruction
       
    38     /**
       
    39      * Creates a new instance of this class.
       
    40      *
       
    41      * @return  A new instance of this class.
       
    42      */
       
    43     static CPbk2MergeConflict* NewL();
       
    44     
       
    45 private: // Construction
       
    46     CPbk2MergeConflict();
       
    47     
       
    48 public: // Implementation
       
    49     /**
       
    50      * Adds fields into conflict.
       
    51      *
       
    52      * @param aFieldFirst     First field.
       
    53      * @param aFieldSecond    Second field.
       
    54      */
       
    55     void AddFields(  
       
    56             const MVPbkStoreContactField& aFieldFirst, 
       
    57             const MVPbkStoreContactField& aFieldSecond );
       
    58     
       
    59     /**
       
    60      * Gets fields from conflict.
       
    61      *
       
    62      * @param aFieldFirst     First field.
       
    63      * @param aFieldSecond    Second field.
       
    64      */
       
    65     void GetFieldsL(  
       
    66             const MVPbkStoreContactField*& aFieldFirst, 
       
    67             const MVPbkStoreContactField*& aFieldSecond );
       
    68     
       
    69 public: // CPbk2MergeConflictBase
       
    70     EPbk2ConflictType GetConflictType();
       
    71     HBufC* GetLabelLC();
       
    72     HBufC* GetTextLC( EPbk2ConflictedNumber aNumber );
       
    73     void ResolveConflict( EPbk2ConflictedNumber aNumber );
       
    74     void GetChosenFieldsL( RPointerArray<MVPbkStoreContactField>& aAddressFields );
       
    75 
       
    76 private: // methods
       
    77     void CustomizeTextValueL( const MVPbkStoreContactField& aField, TDes& aBuf );
       
    78     
       
    79 private: //Data
       
    80     // Not own: First field
       
    81     const MVPbkStoreContactField* iFieldFirst;
       
    82     // Not own: Second field
       
    83     const MVPbkStoreContactField* iFieldSecond;
       
    84     // Not own: Chosen field
       
    85     const MVPbkStoreContactField* iChosenField;
       
    86     // Own: Conflict type
       
    87     EPbk2ConflictType iConflictType;
       
    88     };
       
    89 
       
    90 /**
       
    91  * Phonebook 2 merge addresses conflict.
       
    92  */
       
    93 class CPbk2MergeConflictAddress : public CBase,
       
    94                             public MPbk2MergeConflict
       
    95     {
       
    96 public: // Construction and destruction
       
    97     /**
       
    98      * Creates a new instance of this class.
       
    99      *
       
   100      * @return  A new instance of this class.
       
   101      */
       
   102     static CPbk2MergeConflictAddress* NewL();
       
   103     
       
   104 private: // Construction
       
   105     CPbk2MergeConflictAddress();
       
   106     
       
   107 public: // Implementation
       
   108     /**
       
   109      * Adds addresses into conflict.
       
   110      *
       
   111      * @param aContactFirst     First contact.
       
   112      * @param aContactSecond    Second contact.
       
   113      * @param aAddressGroup     Address group.
       
   114      */
       
   115     void AddAddress( 
       
   116             CPbk2PresentationContact& aContactFirst, 
       
   117             CPbk2PresentationContact& aContactSecond, 
       
   118             TPbk2FieldGroupId aAddressGroup );
       
   119     
       
   120 public: // CPbk2MergeConflictBase
       
   121     EPbk2ConflictType GetConflictType();
       
   122     HBufC* GetLabelLC();
       
   123     HBufC* GetTextLC( EPbk2ConflictedNumber aNumber );
       
   124     void ResolveConflict( EPbk2ConflictedNumber aNumber );
       
   125     void GetChosenFieldsL( RPointerArray<MVPbkStoreContactField>& aAddressFields );
       
   126     
       
   127 private: //Data
       
   128     // Own: Address group
       
   129     TPbk2FieldGroupId iAddressGroup;
       
   130     // Not Own: First contact
       
   131     CPbk2PresentationContact* iContactFirst;
       
   132     // Not Own: Second contact
       
   133     CPbk2PresentationContact* iContactSecond;
       
   134     // Not own: Contact who owns chosen address
       
   135     const CPbk2PresentationContact* iContactChosenAddress;
       
   136     // Own: Conflict type
       
   137     EPbk2ConflictType iConflictType;
       
   138     };
       
   139 
       
   140 
       
   141 #endif /* CPBK2MERGECONFLICT_H_ */