|
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 operation for importing the card to the contact(s) |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 #ifndef CVPBKIMPORTTOCONTACTSOPERATION_H |
|
21 #define CVPBKIMPORTTOCONTACTSOPERATION_H |
|
22 |
|
23 #include "MVPbkImportOperationImpl.h" |
|
24 #include <e32base.h> |
|
25 #include <MVPbkContactOperation.h> |
|
26 |
|
27 class CVPbkVCardData; |
|
28 class MVPbkStoreContact; |
|
29 class MVPbkContactStore; |
|
30 class MVPbkSingleContactOperationObserver; |
|
31 |
|
32 /** |
|
33 * An operation for importing and saving a contact to the store |
|
34 */ |
|
35 NONSHARABLE_CLASS(CVPbkImportToContactsOperation) |
|
36 : public CBase, |
|
37 public MVPbkContactOperation, |
|
38 private MVPbkImportOperationObserver |
|
39 { |
|
40 public: |
|
41 |
|
42 static CVPbkImportToContactsOperation* NewL( |
|
43 TVPbkImportCardType aType, |
|
44 CVPbkVCardData& aData, |
|
45 RPointerArray<MVPbkStoreContact>& aImportedContacts, |
|
46 MVPbkContactStore& aTargetStore, |
|
47 RReadStream &aSourceStream, |
|
48 MVPbkSingleContactOperationObserver& aObserver ); |
|
49 |
|
50 virtual ~CVPbkImportToContactsOperation(); |
|
51 |
|
52 |
|
53 // from base class MVPbkContactOperation |
|
54 |
|
55 void StartL(); |
|
56 void Cancel(); |
|
57 |
|
58 // from base class MVPbkImportOperationObserver |
|
59 void ContactsImported(); |
|
60 void ContactImportingFailed( TInt aError ); |
|
61 void ContactsImportingCompleted(); |
|
62 |
|
63 private: |
|
64 |
|
65 CVPbkImportToContactsOperation( |
|
66 MVPbkSingleContactOperationObserver& aObserver ); |
|
67 void ConstructL( TVPbkImportCardType aType, |
|
68 CVPbkVCardData& aData, |
|
69 RPointerArray<MVPbkStoreContact>& aImportedContacts, |
|
70 MVPbkContactStore& aTargetStore, |
|
71 RReadStream &aSourceStream ); |
|
72 |
|
73 private: // data |
|
74 /// Ref: the client that is observing importing |
|
75 MVPbkSingleContactOperationObserver& iObserver; |
|
76 /// Own: the implementation of the import operation |
|
77 MVPbkImportOperationImpl* iOperationImpl; |
|
78 }; |
|
79 |
|
80 #endif // CVPBKIMPORTTOCONTACTSOPERATION_H |