|
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: A contact copy inspector. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef CPSU2CONTACTCOPYINSPECTOR_H |
|
20 #define CPSU2CONTACTCOPYINSPECTOR_H |
|
21 |
|
22 // INCLUDES |
|
23 #include <e32base.h> |
|
24 |
|
25 // FORWARD DECLARATIONS |
|
26 class MVPbkStoreContact; |
|
27 class MPbk2ContactNameFormatter; |
|
28 class CVPbkBaseContactFieldTypeListIterator; |
|
29 |
|
30 /** |
|
31 * The class inspects if the phone contact was copied completely to |
|
32 * sim contact(s). |
|
33 */ |
|
34 class CPsu2ContactCopyInspector : public CBase |
|
35 { |
|
36 public: |
|
37 /** |
|
38 * Static constructor for this class |
|
39 * |
|
40 * @param aNameFormatter Name formatter |
|
41 * @return New instance of this class |
|
42 */ |
|
43 static CPsu2ContactCopyInspector* NewL( |
|
44 MPbk2ContactNameFormatter& aNameFormatter ); |
|
45 |
|
46 /** |
|
47 * Destructor |
|
48 */ |
|
49 ~CPsu2ContactCopyInspector(); |
|
50 |
|
51 public: // Interface |
|
52 |
|
53 /** |
|
54 * Inspects if all the fields from aSourceContact where copied to |
|
55 * aTargetContacts. |
|
56 * @param aSourceContact the contact to copy to sim |
|
57 * @param aSimContacts an array into which sim contacts are appended. |
|
58 * Client owns contacts. |
|
59 * @return ETrue if all fields were copied otherwise EFalse. |
|
60 */ |
|
61 TBool IsCopiedCompletelyL( MVPbkStoreContact& aSourceContact, |
|
62 RPointerArray<MVPbkStoreContact>& aSimContacts ); |
|
63 |
|
64 private: // Implementation |
|
65 CPsu2ContactCopyInspector( MPbk2ContactNameFormatter& aNameFormatter ); |
|
66 void ConstructL(); |
|
67 TBool CheckDataFieldsL( MVPbkStoreContact& aSourceContact, |
|
68 RPointerArray<MVPbkStoreContact>& aSimContacts ); |
|
69 TInt ExpectedSimContactCountL( MVPbkStoreContact& aSourceContact ); |
|
70 TBool HasReadingFields( CVPbkBaseContactFieldTypeListIterator& aTitleFields, |
|
71 MVPbkStoreContact& aSourceContact ); |
|
72 |
|
73 private: // Data |
|
74 /// Ref: Phonebook2 name formatter |
|
75 MPbk2ContactNameFormatter& iNameFormatter; |
|
76 /// Ref: Reference to the source contact |
|
77 MVPbkStoreContact* iSourceContact; |
|
78 /// Ref: Reference to the target contacts |
|
79 RPointerArray<MVPbkStoreContact>* iSimContacts; |
|
80 }; |
|
81 |
|
82 #endif // CPSU2CONTACTCOPYINSPECTOR_H |
|
83 |
|
84 // End of file |