author | Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> |
Tue, 25 May 2010 13:38:11 +0300 | |
branch | RCL_3 |
changeset 59 | 1aa6688bfd6b |
parent 33 | 50974a8b132e |
permissions | -rw-r--r-- |
19 | 1 |
/* |
2 |
* Copyright (c) 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 the License "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: Observer for exporting a contact from the contact store. |
|
15 |
* |
|
16 |
*/ |
|
17 |
||
18 |
||
19 |
#ifndef C_EXPORTSTORELISTOBSERVER_H |
|
20 |
#define C_EXPORTSTORELISTOBSERVER_H |
|
21 |
||
22 |
||
23 |
#include <s32file.h> // Used for RFileWriteStream |
|
33
50974a8b132e
Revision: 200945
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
19
diff
changeset
|
24 |
#include <MVPbkContactStoreListObserver.h> //base class for vCardEng |
50974a8b132e
Revision: 200945
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
19
diff
changeset
|
25 |
#include <MVPbkContactObserver.h> //base class for vCardEng |
50974a8b132e
Revision: 200945
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
19
diff
changeset
|
26 |
#include <MVPbkSingleContactOperationObserver.h> //base class for vCardEng |
19 | 27 |
#include <CVPbkVCardEng.h> |
28 |
#include <MVPbkContactStore.h> |
|
29 |
#include "contactcallback.h" |
|
30 |
#include "storelistobserver.h" |
|
31 |
#include "contactservice.h" |
|
32 |
#include "cancelasyncrquest.h" |
|
33 |
||
34 |
class CVPbkVCardEng; |
|
35 |
class CVPbkContactManager; |
|
36 |
class MVPbkStoreContact; |
|
37 |
class MVPbkFieldType; |
|
38 |
class MVPbkContactLink; |
|
39 |
class CContactCopyObserver; |
|
40 |
class CContactService; |
|
41 |
||
42 |
class CExportStoreListObserver; |
|
43 |
class CExportStoreListObserver: public CBase, |
|
44 |
public MContactStoreListObserver, |
|
45 |
public MVPbkSingleContactOperationObserver, |
|
46 |
public MCancelAsync |
|
47 |
{ |
|
48 |
public: |
|
49 |
/* |
|
50 |
* called for creating an instace of delete contact observer |
|
51 |
*/ |
|
52 |
static CExportStoreListObserver* NewL(CContactService* aContactService, |
|
53 |
RFs &aFs, |
|
54 |
const TFileName& aFileName, |
|
55 |
const TDesC8& aContactId, |
|
56 |
MContactCallback *aCallback, |
|
57 |
TInt aTransId ); |
|
58 |
||
59 |
/* |
|
60 |
* Destructor |
|
61 |
*/ |
|
62 |
~CExportStoreListObserver(); |
|
63 |
/* |
|
64 |
* sets vcard engine |
|
65 |
*/ |
|
66 |
void SetEngine(CVPbkVCardEng* aEngine); |
|
67 |
/* |
|
68 |
* sets contact store |
|
69 |
*/ |
|
70 |
void SetContactStore(MVPbkContactStore* aContactStore); |
|
71 |
||
72 |
/* |
|
73 |
* sets contact service |
|
74 |
*/ |
|
75 |
void SetContactService(CContactService* aContactService); |
|
76 |
||
77 |
/* |
|
78 |
* Implementation of Cancel of MCancelAsync |
|
79 |
*/ |
|
80 |
void Cancel(); |
|
81 |
||
82 |
private: // from MVPbkContactStoreListObserver |
|
83 |
||
84 |
/** |
|
85 |
* An indication that the contact store is ready. |
|
86 |
* |
|
87 |
* @param aContactStore A reference to the store sending the indication. |
|
88 |
* @return None. |
|
89 |
*/ |
|
90 |
void StoreReady( MVPbkContactStore& aContactStore ); |
|
91 |
||
92 |
/** |
|
93 |
* An indication that the contact store is not ready. |
|
94 |
* |
|
95 |
* @param aContactStore A reference to the store sending the indication. |
|
96 |
* @param aReason An error code defining the reason for unavailability. |
|
97 |
* @return None. |
|
98 |
*/ |
|
99 |
void StoreUnavailable( MVPbkContactStore& aContactStore, |
|
100 |
TInt aReason ); |
|
101 |
||
102 |
/** |
|
103 |
* An indication for a contact store event. |
|
104 |
* |
|
105 |
* @param aContactStore A reference to the store sending the indication. |
|
106 |
* @param aStoreEvent The contact store event. |
|
107 |
* @return None. |
|
108 |
*/ |
|
109 |
void HandleStoreEventL( MVPbkContactStore& aContactStore, |
|
110 |
TVPbkContactStoreEvent aStoreEvent ); |
|
111 |
||
112 |
/** |
|
113 |
* An indication that the contact store is openned successfully. |
|
114 |
* |
|
115 |
* @return None. |
|
116 |
*/ |
|
117 |
void OpenComplete(); |
|
118 |
||
119 |
private: // from MVPbkSingleContactOperationObserver |
|
120 |
||
121 |
/** |
|
122 |
* An indication that a contact operation has been completed. |
|
123 |
* |
|
124 |
* @param aOperation A reference to the operation instance. |
|
125 |
* @param aContact A pointer to the contact object used in the operation. |
|
126 |
* @return None. |
|
127 |
*/ |
|
128 |
void VPbkSingleContactOperationComplete( |
|
129 |
MVPbkContactOperationBase& aOperation, |
|
130 |
MVPbkStoreContact* aContact ); |
|
131 |
||
132 |
/** |
|
133 |
* An indication that a contact operation has failed. |
|
134 |
* |
|
135 |
* @param aOperation A reference to the operation instance. |
|
136 |
* @param aError The error code for the operation. |
|
137 |
* @return None. |
|
138 |
*/ |
|
139 |
void VPbkSingleContactOperationFailed( |
|
140 |
MVPbkContactOperationBase& aOperation, TInt aError ); |
|
141 |
||
142 |
private: |
|
143 |
/* |
|
144 |
* Constructor |
|
145 |
*/ |
|
146 |
CExportStoreListObserver(); |
|
147 |
||
148 |
/* |
|
149 |
* Symbian second-phase constructor |
|
150 |
*/ |
|
151 |
void ConstructL(CContactService* aContactService, |
|
152 |
RFs &aFs, |
|
153 |
const TFileName& aFileName, |
|
154 |
const TDesC8& aContactId, |
|
155 |
MContactCallback *aCallback, |
|
156 |
TInt aTransId); |
|
157 |
||
158 |
private: // Data members |
|
159 |
/** |
|
160 |
* A pointer to the Virtual Phonebook Engine instance. |
|
161 |
* Own. |
|
162 |
*/ |
|
163 |
CVPbkVCardEng* iEngine; |
|
164 |
/* |
|
165 |
* File session. |
|
166 |
*/ |
|
167 |
RFs iFs; |
|
168 |
/* |
|
169 |
* File name |
|
170 |
*/ |
|
171 |
TFileName iFileName; |
|
172 |
/* |
|
173 |
* Pointer to a callback instance. |
|
174 |
*/ |
|
175 |
MContactCallback* iCallback; |
|
176 |
/* |
|
177 |
* Pointer to contact link instance. |
|
178 |
*/ |
|
179 |
const MVPbkContactLink* iContactLink; |
|
180 |
/* |
|
181 |
* Pointer to contact store instance. |
|
182 |
*/ |
|
183 |
MVPbkContactStore* iContactStore; |
|
184 |
/* |
|
185 |
* Transaction Id. |
|
186 |
*/ |
|
187 |
TInt32 iTransId; |
|
188 |
/* |
|
189 |
* File write stream instance. |
|
190 |
*/ |
|
191 |
RFileWriteStream iDest; |
|
192 |
||
193 |
MVPbkContactLinkArray* iLinkArray; |
|
194 |
||
195 |
CContactService* iContactService; |
|
196 |
/* |
|
197 |
* Handle for underlying Export call |
|
198 |
*/ |
|
199 |
MVPbkContactOperationBase* iOp; |
|
200 |
}; |
|
201 |
||
202 |
#endif //// C_EXPORTSTORELISTOBSERVER_H |