24
|
1 |
// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
|
|
2 |
// All rights reserved.
|
|
3 |
// This component and the accompanying materials are made available
|
|
4 |
// under the terms of "Eclipse Public License v1.0"
|
|
5 |
// which accompanies this distribution, and is available
|
|
6 |
// at the URL "http://www.eclipse.org/legal/epl-v10.html".
|
|
7 |
//
|
|
8 |
// Initial Contributors:
|
|
9 |
// Nokia Corporation - initial contribution.
|
|
10 |
//
|
|
11 |
// Contributors:
|
|
12 |
//
|
|
13 |
// Description:
|
|
14 |
//
|
|
15 |
|
|
16 |
#include "cphonebookondispatcher.h"
|
|
17 |
|
|
18 |
#include <ctsy/ltsy/mltsydispatchphonebookoninterface.h>
|
|
19 |
#include <ctsy/pluginapi/mmmessagemanagercallback.h>
|
|
20 |
#include <ctsy/serviceapi/mmtsy_ipcdefs.h>
|
|
21 |
|
|
22 |
#include <ctsy/ltsy/ltsylogger.h>
|
|
23 |
#include "ctsydispatcherpanic.h"
|
|
24 |
#include "tdispatcherholder.h"
|
|
25 |
|
|
26 |
CPhonebookOnDispatcher::CPhonebookOnDispatcher(
|
|
27 |
MLtsyDispatchFactoryV1& aLtsyFactory,
|
|
28 |
MmMessageManagerCallback& aMessageManagerCallback,
|
|
29 |
CRequestQueueOneShot& aRequestAsyncOneShot)
|
|
30 |
: iLtsyFactoryV1(aLtsyFactory),
|
|
31 |
iMessageManagerCallback(aMessageManagerCallback),
|
|
32 |
iRequestAsyncOneShot(aRequestAsyncOneShot)
|
|
33 |
{
|
|
34 |
} // CPhonebookOnDispatcher::CPhonebookOnDispatcher
|
|
35 |
|
|
36 |
|
|
37 |
CPhonebookOnDispatcher::~CPhonebookOnDispatcher()
|
|
38 |
{
|
|
39 |
} // CPhonebookOnDispatcher::~CPhonebookOnDispatcher
|
|
40 |
|
|
41 |
|
|
42 |
CPhonebookOnDispatcher* CPhonebookOnDispatcher::NewLC(
|
|
43 |
MLtsyDispatchFactoryV1& aLtsyFactory,
|
|
44 |
MmMessageManagerCallback& aMessageManagerCallback,
|
|
45 |
CRequestQueueOneShot& aRequestAsyncOneShot)
|
|
46 |
{
|
|
47 |
TSYLOGENTRYEXIT;
|
|
48 |
CPhonebookOnDispatcher* self =
|
|
49 |
new (ELeave) CPhonebookOnDispatcher(aLtsyFactory, aMessageManagerCallback, aRequestAsyncOneShot);
|
|
50 |
CleanupStack::PushL(self);
|
|
51 |
self->ConstructL();
|
|
52 |
return self;
|
|
53 |
} // CPhonebookOnDispatcher::NewLC
|
|
54 |
|
|
55 |
|
|
56 |
CPhonebookOnDispatcher* CPhonebookOnDispatcher::NewL(
|
|
57 |
MLtsyDispatchFactoryV1& aLtsyFactory,
|
|
58 |
MmMessageManagerCallback& aMessageManagerCallback,
|
|
59 |
CRequestQueueOneShot& aRequestAsyncOneShot)
|
|
60 |
{
|
|
61 |
TSYLOGENTRYEXIT;
|
|
62 |
CPhonebookOnDispatcher* self =
|
|
63 |
CPhonebookOnDispatcher::NewLC(aLtsyFactory, aMessageManagerCallback, aRequestAsyncOneShot);
|
|
64 |
CleanupStack::Pop (self);
|
|
65 |
return self;
|
|
66 |
} // CPhonebookOnDispatcher::NewL
|
|
67 |
|
|
68 |
|
|
69 |
void CPhonebookOnDispatcher::ConstructL()
|
|
70 |
/**
|
|
71 |
* Second phase constructor.
|
|
72 |
*/
|
|
73 |
{
|
|
74 |
TSYLOGENTRYEXIT;
|
|
75 |
|
|
76 |
// Get the Licensee LTSY interfaces related to PhonebookOn functionality
|
|
77 |
// from the factory
|
|
78 |
if(iLtsyFactoryV1.IsDispatchInterfaceSupported(KDispatchPhonebookOnFuncUnitId, MLtsyDispatchPhonebookOnStoreRead::KLtsyDispatchPhonebookOnStoreReadApiId))
|
|
79 |
{
|
|
80 |
TAny* storeReadInterface = NULL;
|
|
81 |
iLtsyFactoryV1.GetDispatchHandler(
|
|
82 |
MLtsyDispatchPhonebookOnStoreRead::KLtsyDispatchPhonebookOnStoreReadApiId,
|
|
83 |
storeReadInterface);
|
|
84 |
iLtsyDispatchPhonebookOnStoreRead =
|
|
85 |
static_cast<MLtsyDispatchPhonebookOnStoreRead*>(storeReadInterface);
|
|
86 |
__ASSERT_DEBUG(iLtsyDispatchPhonebookOnStoreRead, CtsyDispatcherPanic(EInvalidNullPtr));
|
|
87 |
}
|
|
88 |
|
|
89 |
if(iLtsyFactoryV1.IsDispatchInterfaceSupported(KDispatchPhonebookOnFuncUnitId, MLtsyDispatchPhonebookOnStoreDeleteAll::KLtsyDispatchPhonebookOnStoreDeleteAllApiId))
|
|
90 |
{
|
|
91 |
TAny* storeDeleteAllInterface = NULL;
|
|
92 |
iLtsyFactoryV1.GetDispatchHandler(
|
|
93 |
MLtsyDispatchPhonebookOnStoreDeleteAll::KLtsyDispatchPhonebookOnStoreDeleteAllApiId,
|
|
94 |
storeDeleteAllInterface);
|
|
95 |
iLtsyDispatchPhonebookOnStoreDeleteAll =
|
|
96 |
static_cast<MLtsyDispatchPhonebookOnStoreDeleteAll*>(storeDeleteAllInterface);
|
|
97 |
__ASSERT_DEBUG(iLtsyDispatchPhonebookOnStoreDeleteAll, CtsyDispatcherPanic(EInvalidNullPtr));
|
|
98 |
}
|
|
99 |
|
|
100 |
if(iLtsyFactoryV1.IsDispatchInterfaceSupported(KDispatchPhonebookOnFuncUnitId, MLtsyDispatchPhonebookOnStoreReadEntry::KLtsyDispatchPhonebookOnStoreReadEntryApiId))
|
|
101 |
{
|
|
102 |
TAny* storeReadEntryInterface = NULL;
|
|
103 |
iLtsyFactoryV1.GetDispatchHandler(
|
|
104 |
MLtsyDispatchPhonebookOnStoreReadEntry::KLtsyDispatchPhonebookOnStoreReadEntryApiId,
|
|
105 |
storeReadEntryInterface);
|
|
106 |
iLtsyDispatchPhonebookOnStoreReadEntry =
|
|
107 |
static_cast<MLtsyDispatchPhonebookOnStoreReadEntry*>(storeReadEntryInterface);
|
|
108 |
__ASSERT_DEBUG(iLtsyDispatchPhonebookOnStoreReadEntry, CtsyDispatcherPanic(EInvalidNullPtr));
|
|
109 |
}
|
|
110 |
|
|
111 |
if(iLtsyFactoryV1.IsDispatchInterfaceSupported(KDispatchPhonebookOnFuncUnitId, MLtsyDispatchPhonebookOnStoreGetInfo::KLtsyDispatchPhonebookOnStoreGetInfoApiId))
|
|
112 |
{
|
|
113 |
TAny* storeGetInfoInterface = NULL;
|
|
114 |
iLtsyFactoryV1.GetDispatchHandler(
|
|
115 |
MLtsyDispatchPhonebookOnStoreGetInfo::KLtsyDispatchPhonebookOnStoreGetInfoApiId,
|
|
116 |
storeGetInfoInterface);
|
|
117 |
iLtsyDispatchPhonebookOnStoreGetInfo =
|
|
118 |
static_cast<MLtsyDispatchPhonebookOnStoreGetInfo*>(storeGetInfoInterface);
|
|
119 |
__ASSERT_DEBUG(iLtsyDispatchPhonebookOnStoreGetInfo, CtsyDispatcherPanic(EInvalidNullPtr));
|
|
120 |
}
|
|
121 |
|
|
122 |
if(iLtsyFactoryV1.IsDispatchInterfaceSupported(KDispatchPhonebookOnFuncUnitId, MLtsyDispatchPhonebookOnStoreGetReadStoreSize::KLtsyDispatchPhonebookOnStoreGetReadStoreSizeApiId))
|
|
123 |
{
|
|
124 |
TAny* storeGetReadStoreSizeInterface = NULL;
|
|
125 |
iLtsyFactoryV1.GetDispatchHandler(
|
|
126 |
MLtsyDispatchPhonebookOnStoreGetReadStoreSize::KLtsyDispatchPhonebookOnStoreGetReadStoreSizeApiId,
|
|
127 |
storeGetReadStoreSizeInterface);
|
|
128 |
iLtsyDispatchPhonebookOnStoreGetReadStoreSize =
|
|
129 |
static_cast<MLtsyDispatchPhonebookOnStoreGetReadStoreSize*>(storeGetReadStoreSizeInterface);
|
|
130 |
__ASSERT_DEBUG(iLtsyDispatchPhonebookOnStoreGetReadStoreSize, CtsyDispatcherPanic(EInvalidNullPtr));
|
|
131 |
}
|
|
132 |
|
|
133 |
if(iLtsyFactoryV1.IsDispatchInterfaceSupported(KDispatchPhonebookOnFuncUnitId, MLtsyDispatchPhonebookOnStoreDeleteEntry::KLtsyDispatchPhonebookOnStoreDeleteEntryApiId))
|
|
134 |
{
|
|
135 |
TAny* storeDeleteEntryInterface = NULL;
|
|
136 |
iLtsyFactoryV1.GetDispatchHandler(
|
|
137 |
MLtsyDispatchPhonebookOnStoreDeleteEntry::KLtsyDispatchPhonebookOnStoreDeleteEntryApiId,
|
|
138 |
storeDeleteEntryInterface);
|
|
139 |
iLtsyDispatchPhonebookOnStoreDeleteEntry =
|
|
140 |
static_cast<MLtsyDispatchPhonebookOnStoreDeleteEntry*>(storeDeleteEntryInterface);
|
|
141 |
__ASSERT_DEBUG(iLtsyDispatchPhonebookOnStoreDeleteEntry, CtsyDispatcherPanic(EInvalidNullPtr));
|
|
142 |
}
|
|
143 |
|
|
144 |
if(iLtsyFactoryV1.IsDispatchInterfaceSupported(KDispatchPhonebookOnFuncUnitId, MLtsyDispatchPhonebookOnStoreWriteEntry::KLtsyDispatchPhonebookOnStoreWriteEntryApiId))
|
|
145 |
{
|
|
146 |
TAny* storeWriteEntryInterface = NULL;
|
|
147 |
iLtsyFactoryV1.GetDispatchHandler(
|
|
148 |
MLtsyDispatchPhonebookOnStoreWriteEntry::KLtsyDispatchPhonebookOnStoreWriteEntryApiId,
|
|
149 |
storeWriteEntryInterface);
|
|
150 |
iLtsyDispatchPhonebookOnStoreWriteEntry =
|
|
151 |
static_cast<MLtsyDispatchPhonebookOnStoreWriteEntry*>(storeWriteEntryInterface);
|
|
152 |
__ASSERT_DEBUG(iLtsyDispatchPhonebookOnStoreWriteEntry, CtsyDispatcherPanic(EInvalidNullPtr));
|
|
153 |
}
|
|
154 |
|
|
155 |
if(iLtsyFactoryV1.IsDispatchInterfaceSupported(KDispatchPhonebookOnFuncUnitId, MLtsyDispatchPhonebookOnStoreWrite::KLtsyDispatchPhonebookOnStoreWriteApiId))
|
|
156 |
{
|
|
157 |
TAny* storeWriteInterface = NULL;
|
|
158 |
iLtsyFactoryV1.GetDispatchHandler(
|
|
159 |
MLtsyDispatchPhonebookOnStoreWrite::KLtsyDispatchPhonebookOnStoreWriteApiId,
|
|
160 |
storeWriteInterface);
|
|
161 |
iLtsyDispatchPhonebookOnStoreWrite =
|
|
162 |
static_cast<MLtsyDispatchPhonebookOnStoreWrite*>(storeWriteInterface);
|
|
163 |
__ASSERT_DEBUG(iLtsyDispatchPhonebookOnStoreWrite, CtsyDispatcherPanic(EInvalidNullPtr));
|
|
164 |
}
|
|
165 |
|
|
166 |
if(iLtsyFactoryV1.IsDispatchInterfaceSupported(KDispatchPhonebookOnFuncUnitId, MLtsyDispatchPhonebookOnStoreGetStoreSize::KLtsyDispatchPhonebookOnStoreGetStoreSizeApiId))
|
|
167 |
{
|
|
168 |
TAny* storeGetStoreSizeInterface = NULL;
|
|
169 |
iLtsyFactoryV1.GetDispatchHandler(
|
|
170 |
MLtsyDispatchPhonebookOnStoreGetStoreSize::KLtsyDispatchPhonebookOnStoreGetStoreSizeApiId,
|
|
171 |
storeGetStoreSizeInterface);
|
|
172 |
iLtsyDispatchPhonebookOnStoreGetStoreSize =
|
|
173 |
static_cast<MLtsyDispatchPhonebookOnStoreGetStoreSize*>(storeGetStoreSizeInterface);
|
|
174 |
__ASSERT_DEBUG(iLtsyDispatchPhonebookOnStoreGetStoreSize, CtsyDispatcherPanic(EInvalidNullPtr));
|
|
175 |
}
|
|
176 |
|
|
177 |
} // CPhonebookOnDispatcher::ConstructL
|
|
178 |
|
|
179 |
void CPhonebookOnDispatcher::SetDispatcherHolder(TDispatcherHolder& aDispatcherHolder)
|
|
180 |
/**
|
|
181 |
* Set the dispatcher holder.
|
|
182 |
*
|
|
183 |
* @param aDispatcherHolder Reference to dispatcher holder.
|
|
184 |
*/
|
|
185 |
{
|
|
186 |
TSYLOGENTRYEXIT;
|
|
187 |
|
|
188 |
iDispatcherHolder = &aDispatcherHolder;
|
|
189 |
} // CPhonebookOnDispatcher::SetDispatcherHolder
|
|
190 |
|
|
191 |
TInt CPhonebookOnDispatcher::DispatchStoreReadL(const CMmDataPackage* aDataPackage)
|
|
192 |
/**
|
|
193 |
* Unpack data related to EMmTsyONStoreReadIPC
|
|
194 |
* and pass request on to Licensee LTSY.
|
|
195 |
*
|
|
196 |
* @return Returns error code returned by the Licensee LTSY or KErrNotSupported if
|
|
197 |
* the Licensee LTSY does not support this request.
|
|
198 |
*/
|
|
199 |
{
|
|
200 |
TSYLOGENTRYEXIT;
|
|
201 |
TInt ret = KErrNotSupported;
|
|
202 |
|
|
203 |
__ASSERT_DEBUG(aDataPackage, CtsyDispatcherPanic(EInvalidNullPtr));
|
|
204 |
|
|
205 |
TInt index = 0;
|
|
206 |
aDataPackage->UnPackData(index);
|
|
207 |
|
|
208 |
// Call Handle... method in Licensee LTSY
|
|
209 |
if (iLtsyDispatchPhonebookOnStoreRead)
|
|
210 |
{
|
|
211 |
ret = iLtsyDispatchPhonebookOnStoreRead->HandleStoreReadReqL(index);
|
|
212 |
}
|
|
213 |
|
|
214 |
return TSYLOGSETEXITERR(ret);
|
|
215 |
} // CPhonebookOnDispatcher::DispatchStoreReadL
|
|
216 |
|
|
217 |
TInt CPhonebookOnDispatcher::DispatchStoreDeleteAllL()
|
|
218 |
/**
|
|
219 |
* Pass request on to Licensee LTSY.
|
|
220 |
*
|
|
221 |
* @return Returns error code returned by the Licensee LTSY or KErrNotSupported if
|
|
222 |
* the Licensee LTSY does not support this request.
|
|
223 |
*/
|
|
224 |
{
|
|
225 |
TSYLOGENTRYEXIT;
|
|
226 |
TInt ret = KErrNotSupported;
|
|
227 |
|
|
228 |
// Call Handle... method in Licensee LTSY
|
|
229 |
if (iLtsyDispatchPhonebookOnStoreDeleteAll)
|
|
230 |
{
|
|
231 |
ret = iLtsyDispatchPhonebookOnStoreDeleteAll->HandleStoreDeleteAllReqL();
|
|
232 |
}
|
|
233 |
|
|
234 |
return TSYLOGSETEXITERR(ret);
|
|
235 |
} // CPhonebookOnDispatcher::DispatchStoreDeleteAllL
|
|
236 |
|
|
237 |
TInt CPhonebookOnDispatcher::DispatchStoreReadEntryL(const CMmDataPackage* aDataPackage)
|
|
238 |
/**
|
|
239 |
* Unpack data related to EMmTsyONStoreReadEntryIPC
|
|
240 |
* and pass request on to Licensee LTSY.
|
|
241 |
*
|
|
242 |
* @return Returns error code returned by the Licensee LTSY or KErrNotSupported if
|
|
243 |
* the Licensee LTSY does not support this request.
|
|
244 |
*/
|
|
245 |
{
|
|
246 |
TSYLOGENTRYEXIT;
|
|
247 |
TInt ret = KErrNotSupported;
|
|
248 |
|
|
249 |
__ASSERT_DEBUG(aDataPackage, CtsyDispatcherPanic(EInvalidNullPtr));
|
|
250 |
|
|
251 |
TInt index = 0;
|
|
252 |
aDataPackage->UnPackData(index);
|
|
253 |
|
|
254 |
// Call Handle... method in Licensee LTSY
|
|
255 |
if (iLtsyDispatchPhonebookOnStoreReadEntry)
|
|
256 |
{
|
|
257 |
ret = iLtsyDispatchPhonebookOnStoreReadEntry->HandleStoreReadEntryReqL(index);
|
|
258 |
}
|
|
259 |
|
|
260 |
return TSYLOGSETEXITERR(ret);
|
|
261 |
} // CPhonebookOnDispatcher::DispatchStoreReadEntryL
|
|
262 |
|
|
263 |
TInt CPhonebookOnDispatcher::DispatchStoreGetInfoL()
|
|
264 |
/**
|
|
265 |
* Pass request on to Licensee LTSY.
|
|
266 |
*
|
|
267 |
* @return Returns error code returned by the Licensee LTSY or KErrNotSupported if
|
|
268 |
* the Licensee LTSY does not support this request.
|
|
269 |
*
|
|
270 |
*/
|
|
271 |
{
|
|
272 |
TSYLOGENTRYEXIT;
|
|
273 |
TInt ret = KErrNotSupported;
|
|
274 |
|
|
275 |
// Call Handle... method in Licensee LTSY
|
|
276 |
if (iLtsyDispatchPhonebookOnStoreGetInfo)
|
|
277 |
{
|
|
278 |
ret = iLtsyDispatchPhonebookOnStoreGetInfo->HandleStoreGetInfoReqL();
|
|
279 |
}
|
|
280 |
|
|
281 |
return TSYLOGSETEXITERR(ret);
|
|
282 |
} // CPhonebookOnDispatcher::DispatchStoreGetInfoL
|
|
283 |
|
|
284 |
TInt CPhonebookOnDispatcher::DispatchStoreGetReadStoreSizeL()
|
|
285 |
/**
|
|
286 |
* Pass request on to Licensee LTSY to retrieve the number of entries that are stored in the storage.
|
|
287 |
*
|
|
288 |
* @return Returns error code returned by the Licensee LTSY or KErrNotSupported if
|
|
289 |
* the Licensee LTSY does not support this request.
|
|
290 |
*/
|
|
291 |
{
|
|
292 |
TSYLOGENTRYEXIT;
|
|
293 |
TInt ret = KErrNotSupported;
|
|
294 |
|
|
295 |
// Call Handle... method in Licensee LTSY
|
|
296 |
if (iLtsyDispatchPhonebookOnStoreGetReadStoreSize)
|
|
297 |
{
|
|
298 |
ret = iLtsyDispatchPhonebookOnStoreGetReadStoreSize->HandleStoreGetReadStoreSizeReqL();
|
|
299 |
}
|
|
300 |
|
|
301 |
return TSYLOGSETEXITERR(ret);
|
|
302 |
} // CPhonebookOnDispatcher::DispatchStoreGetReadStoreSizeL
|
|
303 |
|
|
304 |
TInt CPhonebookOnDispatcher::DispatchStoreDeleteEntryL(const CMmDataPackage* aDataPackage)
|
|
305 |
/**
|
|
306 |
* Unpack data related to EMmTsyONStoreDeleteIPC
|
|
307 |
* and pass request on to Licensee LTSY.
|
|
308 |
*
|
|
309 |
* @return Returns error code returned by the Licensee LTSY or KErrNotSupported if
|
|
310 |
* the Licensee LTSY does not support this request.
|
|
311 |
*/
|
|
312 |
{
|
|
313 |
TSYLOGENTRYEXIT;
|
|
314 |
TInt ret = KErrNotSupported;
|
|
315 |
|
|
316 |
__ASSERT_DEBUG(aDataPackage, CtsyDispatcherPanic(EInvalidNullPtr));
|
|
317 |
|
|
318 |
TInt index = 0;
|
|
319 |
aDataPackage->UnPackData(index);
|
|
320 |
|
|
321 |
// Call Handle... method in Licensee LTSY
|
|
322 |
if (iLtsyDispatchPhonebookOnStoreDeleteEntry)
|
|
323 |
{
|
|
324 |
ret = iLtsyDispatchPhonebookOnStoreDeleteEntry->HandleStoreDeleteEntryReqL(index);
|
|
325 |
}
|
|
326 |
|
|
327 |
return TSYLOGSETEXITERR(ret);
|
|
328 |
} // CPhonebookOnDispatcher::DispatchStoreDeleteEntryL
|
|
329 |
|
|
330 |
TInt CPhonebookOnDispatcher::DispatchStoreWriteEntryL(const CMmDataPackage* aDataPackage)
|
|
331 |
/**
|
|
332 |
* Unpack data related to EMmTsyONStoreWriteEntryIPC
|
|
333 |
* and pass request on to Licensee LTSY.
|
|
334 |
*
|
|
335 |
* @return Returns error code returned by the Licensee LTSY or KErrNotSupported if
|
|
336 |
* the Licensee LTSY does not support this request.
|
|
337 |
*/
|
|
338 |
{
|
|
339 |
TSYLOGENTRYEXIT;
|
|
340 |
TInt ret = KErrNotSupported;
|
|
341 |
|
|
342 |
__ASSERT_DEBUG(aDataPackage, CtsyDispatcherPanic(EInvalidNullPtr));
|
|
343 |
|
|
344 |
RMobileONStore::TMobileONEntryV1* mobileOnEntry = NULL;
|
|
345 |
aDataPackage->UnPackData(&mobileOnEntry);
|
|
346 |
|
|
347 |
__ASSERT_DEBUG(mobileOnEntry, CtsyDispatcherPanic(EInvalidNullPtr));
|
|
348 |
|
|
349 |
// Call Handle... method in Licensee LTSY
|
|
350 |
if (iLtsyDispatchPhonebookOnStoreWriteEntry)
|
|
351 |
{
|
|
352 |
ret = iLtsyDispatchPhonebookOnStoreWriteEntry->HandleStoreWriteEntryReqL(*mobileOnEntry);
|
|
353 |
}
|
|
354 |
|
|
355 |
return TSYLOGSETEXITERR(ret);
|
|
356 |
} // CPhonebookOnDispatcher::DispatchStoreWriteEntryL
|
|
357 |
|
|
358 |
TInt CPhonebookOnDispatcher::DispatchStoreWriteL(const CMmDataPackage* aDataPackage)
|
|
359 |
/**
|
|
360 |
* Unpack data related to EMmTsyONStoreWriteIPC
|
|
361 |
* and pass request on to Licensee LTSY.
|
|
362 |
*
|
|
363 |
* @return Returns error code returned by the Licensee LTSY or KErrNotSupported if
|
|
364 |
* the Licensee LTSY does not support this request.
|
|
365 |
*/
|
|
366 |
{
|
|
367 |
TSYLOGENTRYEXIT;
|
|
368 |
TInt ret = KErrNotSupported;
|
|
369 |
|
|
370 |
__ASSERT_DEBUG(aDataPackage, CtsyDispatcherPanic(EInvalidNullPtr));
|
|
371 |
|
|
372 |
RMobileONStore::TMobileONEntryV1Pckg* data = NULL;
|
|
373 |
aDataPackage->UnPackData(data);
|
|
374 |
RMobileONStore::TMobileONEntryV1& mobileOnEntry = (*data)();
|
|
375 |
|
|
376 |
// Call Handle... method in Licensee LTSY
|
|
377 |
if (iLtsyDispatchPhonebookOnStoreWrite)
|
|
378 |
{
|
|
379 |
ret = iLtsyDispatchPhonebookOnStoreWrite->HandleStoreWriteReqL(mobileOnEntry);
|
|
380 |
}
|
|
381 |
|
|
382 |
return TSYLOGSETEXITERR(ret);
|
|
383 |
} // CPhonebookOnDispatcher::DispatchStoreWriteL
|
|
384 |
|
|
385 |
TInt CPhonebookOnDispatcher::DispatchStoreGetStoreSizeL()
|
|
386 |
/**
|
|
387 |
* Pass request on to Licensee LTSY to retrieve the number of entries that can be stored in the storage.
|
|
388 |
*
|
|
389 |
* @return Returns error code returned by the Licensee LTSY or KErrNotSupported if
|
|
390 |
* the Licensee LTSY does not support this request.
|
|
391 |
*/
|
|
392 |
{
|
|
393 |
TSYLOGENTRYEXIT;
|
|
394 |
TInt ret = KErrNotSupported;
|
|
395 |
|
|
396 |
// Call Handle... method in Licensee LTSY
|
|
397 |
if (iLtsyDispatchPhonebookOnStoreGetStoreSize)
|
|
398 |
{
|
|
399 |
ret = iLtsyDispatchPhonebookOnStoreGetStoreSize->HandleStoreGetStoreSizeReqL();
|
|
400 |
}
|
|
401 |
|
|
402 |
return TSYLOGSETEXITERR(ret);
|
|
403 |
} // CPhonebookOnDispatcher::DispatchStoreGetStoreSizeL
|
|
404 |
|
|
405 |
|
|
406 |
//
|
|
407 |
// Callback handlers follow
|
|
408 |
//
|
|
409 |
|
|
410 |
void CPhonebookOnDispatcher::CallbackStoreRead(TInt aError, TInt aIndex, const TDesC& aName, const TDesC& aNumber)
|
|
411 |
/**
|
|
412 |
* Callback function to be used by the request to complete
|
|
413 |
* CCtsyDispatcherCallback::CallbackPhonebookOnStoreReadComp()
|
|
414 |
*
|
|
415 |
* @param aError KErrNone on success, or another error code indicating the error otherwise.
|
|
416 |
* @param aIndex The index of the entry.
|
|
417 |
* @param aName The name stored in the entry. The length of this should not be more than 20.
|
|
418 |
* @param aNumber The number stored in the ON entry. The length of this should not be more than 100.
|
|
419 |
*
|
|
420 |
* @see RMobileONStore::Read()
|
|
421 |
*/
|
|
422 |
{
|
|
423 |
TSYLOGENTRYEXITARGS(_L8("aError=%d, aIndex=%d"), aError, aIndex);
|
|
424 |
|
|
425 |
// Pack the data to return to the Common TSY
|
|
426 |
TONStoreMsg onStoreMsg;
|
|
427 |
|
|
428 |
onStoreMsg.iLocation = aIndex;
|
|
429 |
onStoreMsg.iName.Copy(aName);
|
|
430 |
onStoreMsg.iTelNumber.Copy(aNumber);
|
|
431 |
|
|
432 |
TONStoreMsg* onStoreMsgPtr = &onStoreMsg;
|
|
433 |
|
|
434 |
CMmDataPackage dataPackage;
|
|
435 |
dataPackage.PackData(&onStoreMsgPtr);
|
|
436 |
|
|
437 |
iMessageManagerCallback.Complete(EMmTsyONStoreReadIPC, &dataPackage, aError);
|
|
438 |
} // CPhonebookOnDispatcher::CallbackStoreRead
|
|
439 |
|
|
440 |
void CPhonebookOnDispatcher::CallbackStoreDeleteAll(TInt aError)
|
|
441 |
/**
|
|
442 |
* Callback function to be used by the request to complete
|
|
443 |
* CCtsyDispatcherCallback::CallbackPhonebookOnStoreDeleteAllComp()
|
|
444 |
*
|
|
445 |
* @param aError The error code to be returned to the CTSY Dispatcher.
|
|
446 |
*
|
|
447 |
* @see RMobileONStore::DeleteAll()
|
|
448 |
*/
|
|
449 |
{
|
|
450 |
TSYLOGENTRYEXITARGS(_L8("aError=%d"), aError);
|
|
451 |
|
|
452 |
iMessageManagerCallback.Complete(EMmTsyONStoreDeleteAllIPC, aError);
|
|
453 |
|
|
454 |
} // CPhonebookOnDispatcher::CallbackStoreDeleteAll
|
|
455 |
|
|
456 |
void CPhonebookOnDispatcher::CallbackStoreReadEntry(TInt aError, TInt aIndex, const TDesC& aName, const TDesC& aNumber)
|
|
457 |
/**
|
|
458 |
* Callback function to be used by the request to complete
|
|
459 |
* CCtsyDispatcherCallback::CallbackPhonebookOnStoreReadEntryComp()
|
|
460 |
*
|
|
461 |
* @param aError KErrNone on success, or another error code indicating the error otherwise.
|
|
462 |
* @param aIndex The index of the entry.
|
|
463 |
* @param aName The name stored in the entry. The length of this should not be more than 20.
|
|
464 |
* @param aNumber The number stored in the ON entry. The length of this should not be more than 100.
|
|
465 |
*
|
|
466 |
* @see RMobileONStore::Read()
|
|
467 |
*/
|
|
468 |
{
|
|
469 |
TSYLOGENTRYEXITARGS(_L8("aError=%d, aIndex=%d"), aError, aIndex);
|
|
470 |
|
|
471 |
TONStoreMsg onStoreMsg;
|
|
472 |
|
|
473 |
// Pack the data to return to the Common TSY
|
|
474 |
onStoreMsg.iLocation = aIndex;
|
|
475 |
onStoreMsg.iName.Copy(aName);
|
|
476 |
onStoreMsg.iTelNumber.Copy(aNumber);
|
|
477 |
|
|
478 |
CMmDataPackage dataPackage;
|
|
479 |
dataPackage.PackData(&onStoreMsg);
|
|
480 |
|
|
481 |
iMessageManagerCallback.Complete(EMmTsyONStoreReadEntryIPC, &dataPackage, aError);
|
|
482 |
|
|
483 |
} // CPhonebookOnDispatcher::CallbackStoreReadEntry
|
|
484 |
|
|
485 |
void CPhonebookOnDispatcher::CallbackStoreGetInfo(
|
|
486 |
TInt aError, TInt aNumOfEntries, TInt aUsedEntries, TInt aMaxNameLength, TInt aMaxNumberLength)
|
|
487 |
/**
|
|
488 |
* Callback function to be used by the request to complete
|
|
489 |
* CCtsyDispatcherCallback::CallbackPhonebookOnStoreGetInfoComp()
|
|
490 |
*
|
|
491 |
* @param aError KErrNone on success, or another error code indicating the error otherwise.
|
|
492 |
* @param aNumOfEntries The number of entries.
|
|
493 |
* @param aUsedEntries The number of used entries.
|
|
494 |
* @param aMaxNameLength The length of a name.
|
|
495 |
* @param aMaxNumberLength The length of a number.
|
|
496 |
*
|
|
497 |
* @see RMobileONStore::GetInfo()
|
|
498 |
*/
|
|
499 |
{
|
|
500 |
TSYLOGENTRYEXITARGS(_L8("aError=%d, aNumOfEntries=%d, aUsedEntries=%d, aMaxNameLength=%d, aMaxNumberLength=%d"), aError, aNumOfEntries, aUsedEntries, aMaxNameLength, aMaxNumberLength);
|
|
501 |
|
|
502 |
// Pack the data to return to the Common TSY
|
|
503 |
TServiceType serviceType;
|
|
504 |
serviceType.iNumOfEntries = aNumOfEntries;
|
|
505 |
serviceType.iUsedEntries = aUsedEntries;
|
|
506 |
serviceType.iNameLen = aMaxNameLength;
|
|
507 |
serviceType.iNumLen = aMaxNumberLength;
|
|
508 |
|
|
509 |
CMmDataPackage dataPackage;
|
|
510 |
dataPackage.PackData(&serviceType);
|
|
511 |
|
|
512 |
iMessageManagerCallback.Complete(EMmTsyONStoreGetInfoIPC, &dataPackage, aError);
|
|
513 |
|
|
514 |
} // CPhonebookOnDispatcher::CallbackStoreGetInfo
|
|
515 |
|
|
516 |
void CPhonebookOnDispatcher::CallbackStoreGetReadStoreSize(TInt aError, TInt aSize)
|
|
517 |
/**
|
|
518 |
* Callback function to be used by the request to complete
|
|
519 |
* CCtsyDispatcherCallback::CallbackPhonebookOnStoreGetReadStoreSizeComp()
|
|
520 |
*
|
|
521 |
* @param aError The error code to be returned to the CTSY Dispatcher.
|
|
522 |
* @param aSize The number of entries stored in the storage.
|
|
523 |
*
|
|
524 |
* @see CRetrieveMobilePhoneONList::Start()
|
|
525 |
*/
|
|
526 |
{
|
|
527 |
TSYLOGENTRYEXITARGS(_L8("aError=%d, aSize=%d"), aError, aSize);
|
|
528 |
|
|
529 |
// Pack the data to return to the Common TSY
|
|
530 |
CMmDataPackage dataPackage;
|
|
531 |
dataPackage.PackData(&aSize);
|
|
532 |
|
|
533 |
iMessageManagerCallback.Complete(EMmTsyONStoreReadSizeIPC, &dataPackage, aError);
|
|
534 |
|
|
535 |
} // CPhonebookOnDispatcher::CallbackStoreGetReadStoreSize
|
|
536 |
|
|
537 |
void CPhonebookOnDispatcher::CallbackStoreDeleteEntry(TInt aError)
|
|
538 |
/**
|
|
539 |
* Callback function to be used by the request to complete
|
|
540 |
* CCtsyDispatcherCallback::CallbackPhonebookOnStoreDeleteEntryComp()
|
|
541 |
*
|
|
542 |
* @param aError The error code to be returned to the CTSY Dispatcher.
|
|
543 |
*
|
|
544 |
* @see RMobileONStore::Delete()
|
|
545 |
*/
|
|
546 |
{
|
|
547 |
TSYLOGENTRYEXITARGS(_L8("aError=%d"), aError);
|
|
548 |
|
|
549 |
iMessageManagerCallback.Complete(EMmTsyONStoreDeleteIPC, aError);
|
|
550 |
|
|
551 |
} // CPhonebookOnDispatcher::CallbackStoreDeleteEntry
|
|
552 |
|
|
553 |
void CPhonebookOnDispatcher::CallbackStoreWriteEntry(TInt aError)
|
|
554 |
/**
|
|
555 |
* Callback function to be used by the request to complete
|
|
556 |
* CCtsyDispatcherCallback::CallbackPhonebookOnStoreWriteEntryComp()
|
|
557 |
*
|
|
558 |
* @param aError The error code to be returned to the CTSY Dispatcher.
|
|
559 |
*
|
|
560 |
* @see RMobileONStore::StoreAllL()
|
|
561 |
*/
|
|
562 |
{
|
|
563 |
TSYLOGENTRYEXITARGS(_L8("aError=%d"), aError);
|
|
564 |
|
|
565 |
iMessageManagerCallback.Complete(EMmTsyONStoreWriteEntryIPC, aError);
|
|
566 |
|
|
567 |
} // CPhonebookOnDispatcher::CallbackStoreWriteEntry
|
|
568 |
|
|
569 |
void CPhonebookOnDispatcher::CallbackStoreWrite(TInt aError, TInt aLocation)
|
|
570 |
/**
|
|
571 |
* Callback function to be used by the request to complete
|
|
572 |
* CCtsyDispatcherCallback::CallbackPhonebookOnStoreWriteComp()
|
|
573 |
*
|
|
574 |
* @param aError The error code to be returned to the CTSY Dispatcher.
|
|
575 |
* @param aLocation The location where the ON entry was stored.
|
|
576 |
*
|
|
577 |
* @see RMobileONStore::Write()
|
|
578 |
*/
|
|
579 |
{
|
|
580 |
TSYLOGENTRYEXITARGS(_L8("aError=%d, aLocation=%d"), aError, aLocation);
|
|
581 |
|
|
582 |
// Pack the data to return to the Common TSY
|
|
583 |
CMmDataPackage dataPackage;
|
|
584 |
dataPackage.PackData(&aLocation);
|
|
585 |
|
|
586 |
iMessageManagerCallback.Complete(EMmTsyONStoreWriteIPC, &dataPackage, aError);
|
|
587 |
|
|
588 |
} // CPhonebookOnDispatcher::CallbackStoreWrite
|
|
589 |
|
|
590 |
void CPhonebookOnDispatcher::CallbackStoreGetStoreSize(TInt aError, TInt aSize)
|
|
591 |
/**
|
|
592 |
* Callback function to be used by the request to complete
|
|
593 |
* CCtsyDispatcherCallback::CallbackPhonebookOnStoreGetStoreSizeComp()
|
|
594 |
*
|
|
595 |
* @param aError The error code to be returned to the CTSY Dispatcher.
|
|
596 |
* @param aSize The number of entries that can be stored in the storage.
|
|
597 |
*
|
|
598 |
* @see RMobileONStore::StoreAllL()
|
|
599 |
*/
|
|
600 |
{
|
|
601 |
TSYLOGENTRYEXITARGS(_L8("aError=%d, aSize=%d"), aError, aSize);
|
|
602 |
|
|
603 |
CMmDataPackage dataPackage;
|
|
604 |
dataPackage.PackData(&aSize);
|
|
605 |
|
|
606 |
iMessageManagerCallback.Complete(EMmTsyONStoreWriteSizeIPC, &dataPackage, aError);
|
|
607 |
|
|
608 |
} // CPhonebookOnDispatcher::CallbackStoreGetStoreSize
|
|
609 |
|
|
610 |
void CPhonebookOnDispatcher::CallbackSync(CRequestQueueOneShot::TIpcDataPackage& aIpcDataPackage)
|
|
611 |
/**
|
|
612 |
* Part of the MDispatcherCallback interface. Used to complete requests handled
|
|
613 |
* synchronously by the Licensee LTSY asynchronously back to the Common TSY.
|
|
614 |
*
|
|
615 |
* @param aIpcDataPackage Package encapsulating the request.
|
|
616 |
*
|
|
617 |
* @see MDispatcherCallback::CallbackSync
|
|
618 |
*/
|
|
619 |
{
|
|
620 |
TSYLOGENTRYEXIT;
|
|
621 |
|
|
622 |
switch (aIpcDataPackage.iIpc)
|
|
623 |
{
|
|
624 |
|
|
625 |
default:
|
|
626 |
LOG(_L8("WARNING: CPhonebookOnDispatcher::CallbackSync unhandled IPC=%d"), aIpcDataPackage.iIpc);
|
|
627 |
__ASSERT_DEBUG(NULL, CtsyDispatcherPanic(EUnhandledCtsyIpc));
|
|
628 |
break;
|
|
629 |
} // switch (aIpcDataPackage.iIpc)
|
|
630 |
|
|
631 |
} // CPhonebookOnDispatcher::CallbackSync
|
|
632 |
|
|
633 |
|
|
634 |
|