author | Mikko Sunikka <mikko.sunikka@nokia.com> |
Fri, 06 Nov 2009 13:05:00 +0200 | |
changeset 19 | 8d692d9f828f |
parent 10 | fc9cf246af83 |
child 23 | 50974a8b132e |
permissions | -rw-r--r-- |
5 | 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 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: Provides interface between the AIW FrameWork and Service Provider. |
|
15 |
* |
|
16 |
*/ |
|
17 |
||
18 |
#ifndef C_CCONTACTINTERFACE_H |
|
19 |
#define C_CCONTACTINTERFACE_H |
|
20 |
||
21 |
//System includes |
|
22 |
#include <LiwVariant.h> |
|
23 |
||
24 |
// User Includes |
|
25 |
#include "contactinterface.hrh" |
|
26 |
#include "singlecontact.h" |
|
27 |
#include "contactcallbackmap.h" |
|
28 |
// Forward Declarations |
|
29 |
class CContactService; |
|
30 |
class CContactInterfaceCallback; |
|
31 |
||
32 |
/** |
|
33 |
* CContactInterface - Provides interface between the AIW FrameWork |
|
34 |
* and Service Provider. |
|
35 |
*/ |
|
36 |
class CContactInterface : public CBase, public MLiwInterface |
|
37 |
{ |
|
38 |
public:// Construction and destruction |
|
39 |
/** |
|
40 |
* Two-phased constructor. |
|
41 |
* @return CCntactInterface* |
|
42 |
*/ |
|
43 |
IMPORT_C static CContactInterface* NewL(); |
|
44 |
/** |
|
45 |
* Destructor |
|
46 |
*/ |
|
47 |
virtual ~CContactInterface(); |
|
48 |
/** |
|
49 |
* Gets the max length of the field |
|
50 |
* @return TInt Max Length for the field. |
|
51 |
*/ |
|
52 |
static TInt GetFieldMaxLength( TInt aFieldKeyID, TDesC& aDbUri ); |
|
53 |
||
54 |
private: |
|
55 |
/** |
|
56 |
* Default constructor. |
|
57 |
*/ |
|
58 |
CContactInterface(); |
|
59 |
/** |
|
60 |
* Symbian OS constructor. |
|
61 |
* @return void |
|
62 |
*/ |
|
63 |
void ConstructL(); |
|
64 |
||
65 |
public: |
|
66 |
/** |
|
67 |
* provides a concrete implementation for the supported service |
|
68 |
* command aCmdName. |
|
69 |
* |
|
70 |
* @param aCmdName the name of the service command which the consumer wants to invoke |
|
71 |
* @param aInParamList the input parameter list, can be empty list |
|
72 |
* @param [in,out] aOutParamList the output parameter list.Return Code is |
|
73 |
* passed through this list |
|
74 |
* @param aCmdOptions Options for the command, see TLiwServiceCmdOptions in LiwCommon.hrh. |
|
75 |
* @param aCallback callback to be registered by consumer application |
|
76 |
* |
|
77 |
* |
|
78 |
* |
|
79 |
* @see TLiwServiceCmdOptions |
|
80 |
* @see CLiwGenericParamList |
|
81 |
* @see MLiwNotifyCallback |
|
82 |
* @return void |
|
83 |
*/ |
|
84 |
virtual void ExecuteCmdL(const TDesC8& aCmdName, |
|
85 |
const CLiwGenericParamList& aInParamList, |
|
86 |
CLiwGenericParamList& aOutParamList, |
|
87 |
TUint aCmdOptions = 0, |
|
88 |
MLiwNotifyCallback* aCallback = 0); |
|
89 |
/** |
|
90 |
* provides a concrete implementation |
|
91 |
* for this method.Deletes the interface handle. |
|
92 |
* The consumer application should call this method if there |
|
93 |
* are no more service commands to be executed on the interface. |
|
94 |
* @return void |
|
95 |
*/ |
|
96 |
virtual void Close(); |
|
97 |
||
98 |
/** |
|
99 |
* SapiError |
|
100 |
* This function maps sapi error. |
|
101 |
* @param aSymbianErr symbian error code. |
|
102 |
* @return integer error code. |
|
103 |
*/ |
|
104 |
static TInt SapiError(TInt aSymbianErr); |
|
105 |
||
106 |
private: |
|
107 |
||
108 |
/** |
|
109 |
* ContactIDUTFToStream :Converts the UTF ID back to stream |
|
110 |
* @param aContactIDUTF the id to be converted. |
|
111 |
*/ |
|
112 |
HBufC8* ContactIDUTFToStreamL(TDesC& aContactIDUTF); |
|
113 |
/** |
|
114 |
* ProcessAddDataL : This function retrieves the data from the map and |
|
115 |
* constructs singleContact |
|
116 |
* @param aMap a map containing the contact data to be added. |
|
117 |
* @param aContact a CSingleContact class pointer which is to be constructed. |
|
118 |
*/ |
|
119 |
void ProcessAddDataL(const CLiwMap* aMap, |
|
120 |
CSingleContact* aContact, |
|
121 |
CLiwGenericParamList& aOutParamList); |
|
122 |
/** |
|
123 |
* Processes the command and calls the corresponding service command. |
|
124 |
* |
|
125 |
* @param aCmdName the name of the service command which the consumer wants to invoke |
|
126 |
* @param aInParamList the input parameter list, can be empty list |
|
127 |
* @param [in,out] aOutParamList the output parameter list.Return Code is |
|
128 |
* passed through this list |
|
129 |
* @param aCmdOptions Options for the command, see TLiwServiceCmdOptions in LiwCommon.hrh. |
|
130 |
* @param aCallback callback to be registered by consumer application |
|
131 |
* @return void |
|
132 |
*/ |
|
133 |
void ProcessCmdL(const TDesC8& aCmdName, |
|
134 |
const CLiwGenericParamList& aInParamList, |
|
135 |
CLiwGenericParamList& aOutParamList, |
|
136 |
TUint aCmdOptions, |
|
137 |
MLiwNotifyCallback* aCallback); |
|
138 |
||
139 |
/** |
|
140 |
* Parses the input list and calls the Cancel on the given transaction id |
|
141 |
* |
|
142 |
* @param aInParamList the input parameter list, can be empty list |
|
143 |
* @param [in,out] aOutParamList the output parameter list.Return Code is |
|
144 |
* passed through this list |
|
145 |
* @param aCallback callback to be registered by consumer application. |
|
146 |
* @param aCmdOptions Options for the command, see TLiwServiceCmdOptions in LiwCommon.hrh. |
|
147 |
* @param aTransId the transaction id for this call. |
|
148 |
* @return void. |
|
149 |
*/ |
|
150 |
TInt CancelCommandL(const CLiwGenericParamList& aInParamList, |
|
151 |
CLiwGenericParamList& aOutParamList); |
|
152 |
||
153 |
/** |
|
154 |
* Parses the input list and calls the Getlist API. |
|
155 |
* |
|
156 |
* @param aInParamList the input parameter list, can be empty list |
|
157 |
* @param [in,out] aOutParamList the output parameter list.Return Code is |
|
158 |
* passed through this list |
|
159 |
* @param aCallback callback to be registered by consumer application. |
|
160 |
* @param aCmdOptions Options for the command, see TLiwServiceCmdOptions in LiwCommon.hrh. |
|
161 |
* @param aTransId the transaction id for this call. |
|
162 |
* @return void. |
|
163 |
*/ |
|
164 |
void GetListCommandL(const CLiwGenericParamList& aInParamList, |
|
165 |
CLiwGenericParamList& aOutParamList, |
|
166 |
MLiwNotifyCallback* aCallback, |
|
167 |
TUint aCmdOptions, |
|
10
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
168 |
TInt aTransId, |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
169 |
TCmdType aVal); |
5 | 170 |
/** |
171 |
* Parses the input list and calls the Add API. |
|
172 |
* |
|
173 |
* @param aInParamList the input parameter list, can be empty list |
|
174 |
* passed through this list |
|
175 |
* @param aCallback callback to be registered by consumer application. |
|
176 |
* @param aCmdOptions Options for the command, see TLiwServiceCmdOptions in LiwCommon.hrh. |
|
177 |
* @param aTransId the transaction id for this call. |
|
178 |
* @return integer error code. |
|
179 |
*/ |
|
180 |
void AddCommandL(const CLiwGenericParamList& aInParamList, |
|
181 |
CLiwGenericParamList& aOutParamList, |
|
182 |
MLiwNotifyCallback* aCallback, |
|
183 |
TUint aCmdOptions, |
|
184 |
TInt aTransId); |
|
185 |
/** |
|
186 |
* Parses the input list and calls the Import API. |
|
187 |
* |
|
188 |
* @param aInParamList the input parameter list, can be empty list. |
|
189 |
* @param aCallback callback to be registered by consumer application. |
|
190 |
* @param aCmdOptions Options for the command, see TLiwServiceCmdOptions in LiwCommon.hrh. |
|
191 |
* @param aTransId the transaction id for this call. |
|
192 |
* @return integer error code. |
|
193 |
*/ |
|
194 |
void ImportCommandL(const CLiwGenericParamList& aInParamList, |
|
195 |
CLiwGenericParamList& aOutParamList, |
|
196 |
MLiwNotifyCallback* aCallback, |
|
197 |
TUint aCmdOptions, |
|
198 |
TInt aTransId); |
|
199 |
/** |
|
200 |
* Parses the input list and calls the Export API. |
|
201 |
* |
|
202 |
* @param aInParamList the input parameter list, can be empty list. |
|
203 |
* @param aCallback callback to be registered by consumer application. |
|
204 |
* @param aCmdOptions Options for the command, see TLiwServiceCmdOptions in LiwCommon.hrh. |
|
205 |
* @param aTransId the transaction id for this call. |
|
206 |
* @return integer error code. |
|
207 |
*/ |
|
208 |
void ExportCommandL(const CLiwGenericParamList& aInParamList, |
|
209 |
CLiwGenericParamList& aOutParamList, |
|
210 |
MLiwNotifyCallback* aCallback, |
|
211 |
TUint aCmdOptions, |
|
212 |
TInt aTransId); |
|
213 |
||
214 |
/** |
|
215 |
* Parses the input list and calls the Organise API. |
|
216 |
* |
|
217 |
* @param aInParamList the input parameter list, can be empty list. |
|
218 |
* @param aCallback callback to be registered by consumer application. |
|
219 |
* @param aCmdOptions Options for the command, see TLiwServiceCmdOptions in LiwCommon.hrh. |
|
220 |
* @param aTransId the transaction id for this call. |
|
221 |
* @return integer error code. |
|
222 |
*/ |
|
223 |
void OrganiseGroupCommandL(const CLiwGenericParamList& aInParamList, |
|
224 |
CLiwGenericParamList& aOutParamList, |
|
225 |
MLiwNotifyCallback* aCallback, |
|
226 |
TUint aCmdOptions, |
|
227 |
TInt aTransId); |
|
228 |
/** |
|
229 |
* Parses the input list and calls the Delete API. |
|
230 |
* |
|
231 |
* @param aInParamList the input parameter list, can be empty list |
|
232 |
* @param aCallback callback to be registered by consumer application. |
|
233 |
* @param aCmdOptions Options for the command, see TLiwServiceCmdOptions in LiwCommon.hrh. |
|
234 |
* @param aTransId the transaction id for this call. |
|
235 |
* @return integer error code. |
|
236 |
*/ |
|
237 |
void DeleteCommandL(const CLiwGenericParamList& aInParamList, |
|
238 |
CLiwGenericParamList& aOutParamList, |
|
239 |
MLiwNotifyCallback* aCallback, |
|
240 |
TUint aCmdOptions, |
|
241 |
TInt aTransId); |
|
242 |
||
243 |
MLiwNotifyCallback* Callback( TInt32 aTransactionId ); |
|
244 |
private: |
|
245 |
// POINTER MEMBER |
|
246 |
/** |
|
247 |
* contact service implementation object. |
|
248 |
* OWN. |
|
249 |
*/ |
|
250 |
CContactService* iContactService; |
|
251 |
||
252 |
/** |
|
253 |
* iCallbackMap |
|
254 |
* Array of objects. |
|
255 |
*/ |
|
256 |
RPointerArray<CContactCallbackMap> iCallbackMap; |
|
257 |
||
258 |
HBufC* iErrorMess; |
|
259 |
//this is used only for add api due to reset problem with TLiwVariant |
|
260 |
HBufC* iDburi; |
|
261 |
||
262 |
}; |
|
263 |
||
264 |
#endif // C_CCONTACTINTERFACE_H |