63
|
1 |
/*
|
|
2 |
* Copyright (c) 2002-2007 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 contact duplicate policy.
|
|
15 |
*
|
|
16 |
*/
|
|
17 |
|
|
18 |
|
|
19 |
|
|
20 |
#ifndef CPBK2CONTACTDUPLICATEPOLICY_H
|
|
21 |
#define CPBK2CONTACTDUPLICATEPOLICY_H
|
|
22 |
|
|
23 |
// INCLUDE FILES
|
|
24 |
#include <CVPbkContactDuplicatePolicy.h>
|
|
25 |
|
|
26 |
// FORWARD DECLARATIONS
|
|
27 |
class MPbk2ContactNameFormatter;
|
|
28 |
class CPbk2SortOrderManager;
|
|
29 |
class CPbk2DuplicateContactFinder;
|
|
30 |
|
|
31 |
// CLASS DECLARATION
|
|
32 |
|
|
33 |
/**
|
|
34 |
* Phonebook 2 contact duplicate policy.
|
|
35 |
* Responsible for implementing Virtual Phonebook defined contact
|
|
36 |
* duplication policy by following rules specied for contact duplication
|
|
37 |
* in UI level specifications.
|
|
38 |
*/
|
|
39 |
NONSHARABLE_CLASS(CPbk2ContactDuplicatePolicy)
|
|
40 |
: public CVPbkContactDuplicatePolicy
|
|
41 |
{
|
|
42 |
public: // Construction and destruction
|
|
43 |
|
|
44 |
/**
|
|
45 |
* Creates a new instance of this class.
|
|
46 |
*
|
|
47 |
* @param aParam Virtual Phonebook duplicate policy.
|
|
48 |
* @return A new instance of this class.
|
|
49 |
*/
|
|
50 |
static CPbk2ContactDuplicatePolicy* NewL(
|
|
51 |
TParam* aParam );
|
|
52 |
|
|
53 |
/**
|
|
54 |
* Destructor.
|
|
55 |
*/
|
|
56 |
~CPbk2ContactDuplicatePolicy();
|
|
57 |
|
|
58 |
public: // From CVPbkContactDuplicatePolicy
|
|
59 |
MVPbkContactOperationBase* FindDuplicatesL(
|
|
60 |
const MVPbkBaseContact& aContact,
|
|
61 |
MVPbkContactStore& aTargetStore,
|
|
62 |
RPointerArray<MVPbkStoreContact>& aDuplicates,
|
|
63 |
MVPbkContactFindObserver& aObserver,
|
|
64 |
TInt aMaxDuplicatesToFind );
|
|
65 |
|
|
66 |
private: // Implementation
|
|
67 |
CPbk2ContactDuplicatePolicy(
|
|
68 |
CVPbkContactManager& aContactManager );
|
|
69 |
void ConstructL(
|
|
70 |
const MVPbkFieldTypeList* aFieldTypeForFind );
|
|
71 |
|
|
72 |
/**
|
|
73 |
* Creates field type list for find.
|
|
74 |
*
|
|
75 |
* @param aContactManager Virtual Phonebook Contact Manager.
|
|
76 |
* @return A field type list.
|
|
77 |
*/
|
|
78 |
MVPbkFieldTypeList* CreateFieldTypesForFindL
|
|
79 |
(CVPbkContactManager& aContactManager) const;
|
|
80 |
private: // Data
|
|
81 |
/// Ref: Contact manager
|
|
82 |
CVPbkContactManager& iContactManager;
|
|
83 |
/// Own: Name formatter
|
|
84 |
MPbk2ContactNameFormatter* iNameFormatter;
|
|
85 |
/// Own: Sort order
|
|
86 |
CPbk2SortOrderManager* iSortOrderManager;
|
|
87 |
/// Own: Duplicate manager
|
|
88 |
CPbk2DuplicateContactFinder* iDuplicateFinder;
|
|
89 |
/// Own: Duplicate contacts
|
|
90 |
RPointerArray<MVPbkStoreContact> iDuplicates;
|
|
91 |
/// Own: These are the field types that are used for find
|
|
92 |
MVPbkFieldTypeList* iFieldTypeRefsList;
|
|
93 |
};
|
|
94 |
|
|
95 |
#endif // CPBK2CONTACTDUPLICATEPOLICY_H
|
|
96 |
|
|
97 |
// End of File
|