63
|
1 |
/*
|
|
2 |
* Copyright (c) 2006-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: An ECOM class for loading implementation of the policy
|
|
15 |
*
|
|
16 |
*/
|
|
17 |
|
|
18 |
|
|
19 |
#ifndef CVPBKCONTACTDUPLICATEPOLICY_H
|
|
20 |
#define CVPBKCONTACTDUPLICATEPOLICY_H
|
|
21 |
|
|
22 |
// INCLUDES
|
|
23 |
#include <e32base.h>
|
|
24 |
#include <ecom/ecom.h>
|
|
25 |
#include <MVPbkContactDuplicatePolicy.h>
|
|
26 |
#include <VPbkPolicyUid.h>
|
|
27 |
|
|
28 |
// FORWARD DECLARATIONS
|
|
29 |
class CVPbkContactManager;
|
|
30 |
class MVPbkFieldTypeList;
|
|
31 |
|
|
32 |
|
|
33 |
/**
|
|
34 |
* An ECOM class for loading implementation of the policy
|
|
35 |
*/
|
|
36 |
class CVPbkContactDuplicatePolicy :
|
|
37 |
public CBase,
|
|
38 |
public MVPbkContactDuplicatePolicy
|
|
39 |
{
|
|
40 |
public:
|
|
41 |
struct TParam
|
|
42 |
{
|
|
43 |
inline TParam( CVPbkContactManager& aContactManager );
|
|
44 |
|
|
45 |
///Ref: A contact manager containing a list of available field types.
|
|
46 |
CVPbkContactManager& iContactManager;
|
|
47 |
/// Ref: An optional list of types that should be used to
|
|
48 |
/// find duplicates. If NULL then the policy defines the types.
|
|
49 |
const MVPbkFieldTypeList* iFieldTypesForFind;
|
|
50 |
///Own: Reserve for future extension
|
|
51 |
TAny* iSpare;
|
|
52 |
};
|
|
53 |
|
|
54 |
/**
|
|
55 |
* Returns the policy implementation.
|
|
56 |
* @return the policy implementation.
|
|
57 |
*/
|
|
58 |
static CVPbkContactDuplicatePolicy* NewL( TParam& aParam );
|
|
59 |
|
|
60 |
/**
|
|
61 |
* Destructor
|
|
62 |
*/
|
|
63 |
virtual ~CVPbkContactDuplicatePolicy();
|
|
64 |
|
|
65 |
private: // data
|
|
66 |
/// Own: ID key for destructor
|
|
67 |
TUid iDtorIDKey;
|
|
68 |
};
|
|
69 |
|
|
70 |
|
|
71 |
//INLINE FUNCTIONS
|
|
72 |
|
|
73 |
inline CVPbkContactDuplicatePolicy::TParam::TParam(
|
|
74 |
CVPbkContactManager& aContactManager) :
|
|
75 |
iContactManager(aContactManager),
|
|
76 |
iFieldTypesForFind( NULL ),
|
|
77 |
iSpare( NULL )
|
|
78 |
{
|
|
79 |
}
|
|
80 |
|
|
81 |
inline CVPbkContactDuplicatePolicy* CVPbkContactDuplicatePolicy::NewL(
|
|
82 |
TParam& aParam )
|
|
83 |
{
|
|
84 |
// Instantiate the correct ECom plugin
|
|
85 |
TAny* ptr = NULL;
|
|
86 |
ptr = REComSession::CreateImplementationL(
|
|
87 |
TUid::Uid( KVPbkContactDuplicatePolicyImplementationUID ),
|
|
88 |
_FOFF( CVPbkContactDuplicatePolicy, iDtorIDKey ),
|
|
89 |
&aParam );
|
|
90 |
|
|
91 |
return reinterpret_cast<CVPbkContactDuplicatePolicy*>( ptr );
|
|
92 |
}
|
|
93 |
|
|
94 |
inline CVPbkContactDuplicatePolicy::~CVPbkContactDuplicatePolicy()
|
|
95 |
{
|
|
96 |
REComSession::DestroyedImplementation( iDtorIDKey );
|
|
97 |
}
|
|
98 |
|
|
99 |
#endif // CVPBKCONTACTDUPLICATEPOLICY_H
|
|
100 |
|
|
101 |
// End of file
|