|
1 /* |
|
2 * Copyright (c) 2005-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: The virtual phonebook contact id converter |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef CCONTACTIDCONVERTER_H |
|
20 #define CCONTACTIDCONVERTER_H |
|
21 |
|
22 #include <CVPbkContactIdConverter.h> |
|
23 |
|
24 class CPbkContactEngine; |
|
25 |
|
26 namespace VPbkCntModel { |
|
27 |
|
28 class CContactStore; |
|
29 |
|
30 /** |
|
31 * Contact ID converter |
|
32 * |
|
33 * Provides ID conversion services between contact model contact |
|
34 * and virtual phonebook contact |
|
35 * |
|
36 */ |
|
37 NONSHARABLE_CLASS( CContactIdConverter ): public CVPbkContactIdConverter |
|
38 { |
|
39 public: |
|
40 /** |
|
41 * Creates a new instance of this class. |
|
42 * |
|
43 * @param aParam CContactStore of symbian contact model store |
|
44 * |
|
45 * @return a new instance of this class |
|
46 */ |
|
47 static CContactIdConverter* NewL(TAny* aParam); |
|
48 ~CContactIdConverter(); |
|
49 |
|
50 public: // From CVPbkContactIdConverter |
|
51 TInt32 LinkToIdentifier(const MVPbkContactLink& aLink) const; |
|
52 MVPbkContactLink* IdentifierToLinkLC(TInt32 aIdentifier) const; |
|
53 TInt PbkEngFieldIndexL(const MVPbkStoreContactField& aField) const; |
|
54 CPbkContactItem* LinkToPbkContactItemLC(const MVPbkContactLink& aLink) const; |
|
55 CPbkContactItem* LinkToOpenPbkContactItemLCX(const MVPbkContactLink& aLink) const; |
|
56 void CommitOpenContactItemL(CPbkContactItem& aContactItem); |
|
57 |
|
58 private: // Implementation |
|
59 CContactIdConverter(MVPbkContactStore& aContactStore); |
|
60 CPbkContactEngine* PbkEngineL() const; |
|
61 |
|
62 private: // Data |
|
63 /// Not Own: Symbian contact model store |
|
64 CContactStore& iContactStore; |
|
65 /// Own: Phonebook engine |
|
66 mutable CPbkContactEngine* iPbkEngine; |
|
67 }; |
|
68 |
|
69 } // namespace VPbkCntModel |
|
70 |
|
71 #endif // CCONTACTIDCONVERTER_H |
|
72 |
|
73 // End of File |