|
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 virtual phonebook operation class that reads a contact |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 #ifndef VPBKSIMSTORE_CCONTACTRETRIEVER_H |
|
21 #define VPBKSIMSTORE_CCONTACTRETRIEVER_H |
|
22 |
|
23 // INCLUDES |
|
24 #include <e32base.h> |
|
25 #include <MVPbkContactOperation.h> |
|
26 #include <MVPbkContactObserver.h> |
|
27 |
|
28 // FORWARD DECLARATIONS |
|
29 class MVPbkSingleContactOperationObserver; |
|
30 |
|
31 namespace VPbkSimStore { |
|
32 |
|
33 // FORWARD DECLARATIONS |
|
34 class CContactStore; |
|
35 |
|
36 // CLASS DECLARATION |
|
37 |
|
38 /** |
|
39 * A virtual phonebook operation class that reads a contact |
|
40 * |
|
41 */ |
|
42 NONSHARABLE_CLASS( CContactRetriever ): |
|
43 public CActive, |
|
44 public MVPbkContactOperation |
|
45 { |
|
46 public: // Constructors and destructor |
|
47 |
|
48 /** |
|
49 * Two-phased constructor. |
|
50 * |
|
51 * @param aStore The store to read from. |
|
52 * @param aSimIndex The sim index of the contact to read. |
|
53 * @return A new instance of this class. |
|
54 */ |
|
55 static CContactRetriever* NewL( CContactStore& aStore, |
|
56 TInt aSimIndex, MVPbkSingleContactOperationObserver& aObserver ); |
|
57 |
|
58 /** |
|
59 * Destructor. |
|
60 */ |
|
61 virtual ~CContactRetriever(); |
|
62 |
|
63 public: // Functions from base classes |
|
64 |
|
65 /** |
|
66 * From CActive |
|
67 */ |
|
68 void RunL(); |
|
69 |
|
70 /** |
|
71 * From CActive |
|
72 */ |
|
73 void DoCancel(); |
|
74 |
|
75 /** |
|
76 * From CActive |
|
77 */ |
|
78 TInt RunError(TInt aError); |
|
79 |
|
80 /** |
|
81 * From MVPbkContactOperation |
|
82 */ |
|
83 void StartL(); |
|
84 |
|
85 /** |
|
86 * From MVPbkContactOperation |
|
87 */ |
|
88 void Cancel(); |
|
89 |
|
90 private: // Construction |
|
91 |
|
92 /** |
|
93 * C++ constructor. |
|
94 */ |
|
95 CContactRetriever( |
|
96 TInt aSimIndex, |
|
97 CContactStore& aStore, |
|
98 MVPbkSingleContactOperationObserver& aObserver ); |
|
99 |
|
100 /** |
|
101 * By default Symbian 2nd phase constructor is private. |
|
102 */ |
|
103 void ConstructL(); |
|
104 |
|
105 private: // Data |
|
106 /// Own: The SIM index from where to retrieve the contact |
|
107 TInt iSimIndex; |
|
108 /// Ref: The store to read from |
|
109 CContactStore& iStore; |
|
110 /// Ref: The observer for the operation |
|
111 MVPbkSingleContactOperationObserver& iObserver; |
|
112 }; |
|
113 |
|
114 } // namespace VPbkSimStore |
|
115 |
|
116 #endif // VPBKSIMSTORE_CCONTACTRETRIEVER_H |
|
117 |
|
118 // End of File |