19
|
1 |
/*
|
|
2 |
* Copyright (c) 2002 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: ?Description
|
|
15 |
*
|
|
16 |
*/
|
|
17 |
|
|
18 |
|
|
19 |
|
|
20 |
|
|
21 |
// INCLUDE FILES
|
|
22 |
#include <e32svr.h>
|
|
23 |
#include <StifParser.h>
|
|
24 |
//#include <SAPI_TEST\testprg.h>
|
|
25 |
#include <Stiftestinterface.h>
|
|
26 |
#include<LiwCommon.h>
|
|
27 |
#include<LiwVariant.h>
|
|
28 |
#include<LiwServiceHandler.h>
|
|
29 |
#include "tcalendaraddtest.h"
|
|
30 |
#include "calendarheader.h"
|
|
31 |
#include "calendarconstants.h"
|
|
32 |
TInt doAddTest();
|
|
33 |
_LIT8(KTestInterface, "IDataSource");
|
|
34 |
_LIT8(KTestContent, "Service.Calendar");
|
|
35 |
_LIT(KCalFileName1,"C:CalendarFileA");
|
|
36 |
_LIT(KCalFileName2,"C:CalendarFile1");
|
|
37 |
|
|
38 |
TInt AddProvAppointmentDailyRepeatAndAttendees(CLiwGenericParamList* inparam, CLiwGenericParamList* outparam, MLiwInterface* interface, const TDesC& aCalendar, TUIDSet*& uidset);
|
|
39 |
TInt AddProvCalendar(CLiwGenericParamList* inparam, CLiwGenericParamList* outparam, MLiwInterface* interface, const TDesC& aCalendar);
|
|
40 |
TInt RemoveProvCalendar(CLiwGenericParamList* inparam, CLiwGenericParamList* outparam, MLiwInterface* interface, const TDesC& aCalendar);
|
|
41 |
TInt AddProvToDo(CLiwGenericParamList* inparam, CLiwGenericParamList* outparam, MLiwInterface* interface, const TDesC& aCalendar, TUIDSet*& uidset);
|
|
42 |
TInt AddProvDayEvent(CLiwGenericParamList* inparam, CLiwGenericParamList* outparam, MLiwInterface* interface, const TDesC& aCalendar, TUIDSet*& uidset);
|
|
43 |
TInt AddProvAppointmentDailyRepeat(CLiwGenericParamList* inparam, CLiwGenericParamList* outparam, MLiwInterface* interface, const TDesC& aCalendar, TUIDSet*& uidset);
|
|
44 |
TInt AddProvAppointmentWeeklyRepeat(CLiwGenericParamList* inparam, CLiwGenericParamList* outparam, MLiwInterface* interface, const TDesC& aCalendar, TUIDSet*& uidset);
|
|
45 |
TInt AddProvAppointmentMonthlyRepeat(CLiwGenericParamList* inparam, CLiwGenericParamList* outparam, MLiwInterface* interface, const TDesC& aCalendar, TUIDSet*& uidset);
|
|
46 |
TInt AddProvAnni(CLiwGenericParamList* inparam, CLiwGenericParamList* outparam, MLiwInterface* interface, const TDesC& aCalendar, TUIDSet*& uidset);
|
|
47 |
TInt AddProvReminder(CLiwGenericParamList* inparam, CLiwGenericParamList* outparam, MLiwInterface* interface, const TDesC& aCalendar, TUIDSet*& uidset);
|
|
48 |
TInt AddNewCalendar();
|
|
49 |
class CTestAddSync : public CBase
|
|
50 |
{
|
|
51 |
public:
|
|
52 |
static CTestAddSync* NewL();
|
|
53 |
int AddNewCalendar();
|
|
54 |
int AddNewApptWithDailyRepeat();
|
|
55 |
int AddNewApptWithWeeklyRepeat();
|
|
56 |
int AddNewApptWithMonthlyRepeat();
|
|
57 |
int AddNewApptWithAttendees();
|
|
58 |
int AddNewAnniversary();
|
|
59 |
int AddNewReminder();
|
|
60 |
int AddNewDayEvent();
|
|
61 |
int AddNewTodo();
|
|
62 |
int AddInvalidCalendar(TPtrC calname);
|
|
63 |
|
|
64 |
CTestAddSync();
|
|
65 |
~CTestAddSync();
|
|
66 |
|
|
67 |
private:
|
|
68 |
void ConstructL();
|
|
69 |
|
|
70 |
|
|
71 |
|
|
72 |
private:
|
|
73 |
CLiwServiceHandler* iServiceHandler;
|
|
74 |
TInt iResult;
|
|
75 |
MLiwInterface* interface ;
|
|
76 |
};
|
|
77 |
|
|
78 |
|
|
79 |
CTestAddSync* CTestAddSync::NewL()
|
|
80 |
{
|
|
81 |
CTestAddSync* self = new (ELeave) CTestAddSync();
|
|
82 |
self->ConstructL();
|
|
83 |
return self;
|
|
84 |
}
|
|
85 |
|
|
86 |
CTestAddSync::~CTestAddSync()
|
|
87 |
{
|
|
88 |
if( interface )
|
|
89 |
interface->Close();
|
|
90 |
|
|
91 |
delete iServiceHandler;
|
|
92 |
}
|
|
93 |
|
|
94 |
|
|
95 |
void CTestAddSync::ConstructL()
|
|
96 |
{
|
|
97 |
}
|
|
98 |
|
|
99 |
|
|
100 |
CTestAddSync::CTestAddSync()
|
|
101 |
{
|
|
102 |
interface = NULL ;
|
|
103 |
}
|
|
104 |
|
|
105 |
|
|
106 |
// ============================ MEMBER FUNCTIONS ===============================
|
|
107 |
|
|
108 |
// -----------------------------------------------------------------------------
|
|
109 |
// CTCalendarAddTest::Delete
|
|
110 |
// Delete here all resources allocated and opened from test methods.
|
|
111 |
// Called from destructor.
|
|
112 |
// -----------------------------------------------------------------------------
|
|
113 |
//
|
|
114 |
void CTCalendarAddTest::Delete()
|
|
115 |
{
|
|
116 |
|
|
117 |
}
|
|
118 |
|
|
119 |
// -----------------------------------------------------------------------------
|
|
120 |
// CTChangeStatusTest::RunMethodL
|
|
121 |
// Run specified method. Contains also table of test mothods and their names.
|
|
122 |
// -----------------------------------------------------------------------------
|
|
123 |
//
|
|
124 |
TInt CTCalendarAddTest::RunMethodL(
|
|
125 |
CStifItemParser& aItem )
|
|
126 |
{
|
|
127 |
|
|
128 |
static TStifFunctionInfo const KFunctions[] =
|
|
129 |
{
|
|
130 |
// Copy this line for every implemented function.
|
|
131 |
// First string is the function name used in TestScripter script file.
|
|
132 |
// Second is the actual implementation member function.
|
|
133 |
//TRY( "SendMessage", CTDeleteMessageTest::SendMessage ),
|
|
134 |
|
|
135 |
ENTRY( "AddCalendarIter3", CTCalendarAddTest::AddNewCalendar ),
|
|
136 |
ENTRY( "AddAppointmentWithDailyRepeat", CTCalendarAddTest::AddApptWithDailyRepeat),
|
|
137 |
ENTRY( "AddAppointmentWithWeeklyRepeat", CTCalendarAddTest::AddApptWithWeeklyRepeat),
|
|
138 |
ENTRY( "AddAppointmentWithMonthlyRepeat", CTCalendarAddTest::AddApptWithMonthlyRepeat),
|
|
139 |
ENTRY( "AddAppointmentWithAttendees", CTCalendarAddTest::AddApptWithAttendees),
|
|
140 |
ENTRY( "AddAnniversary", CTCalendarAddTest::AddNewAnniversary),
|
|
141 |
ENTRY( "AddDayEvent", CTCalendarAddTest::AddNewDayEvent),
|
|
142 |
ENTRY( "AddReminder", CTCalendarAddTest::AddNewReminder),
|
|
143 |
ENTRY( "AddTodo", CTCalendarAddTest::AddNewTodo),
|
|
144 |
ENTRY( "AddAllAttributes", CTCalendarAddTest::AddAll),
|
|
145 |
ENTRY( "ModifyRepeat", CTCalendarAddTest::ModifyRepeat),
|
|
146 |
ENTRY( "AddMonthlyRepeatingEntry", CTCalendarAddTest::AddEntryWithMonthlyRpt),
|
|
147 |
ENTRY( "AddCalendarNegative", CTCalendarAddTest::InterfaceClassL ),
|
|
148 |
ENTRY( "AddCalendarInZDrive", CTCalendarAddTest::InterfaceClassL ),
|
|
149 |
ENTRY( "AddCalendarWithFullPath", CTCalendarAddTest::InterfaceClassL ),
|
|
150 |
ENTRY( "AddCalendarWithInvalidPath", CTCalendarAddTest::InterfaceClassL ),
|
|
151 |
ENTRY( "UpdateInstanceWithRepeat", CTCalendarAddTest::UpdateInstanceWithRepeat ),
|
|
152 |
ENTRY( "UpdateEntryWithRepeatDates", CTCalendarAddTest::UpdateEntryWithRepeatDates ),
|
|
153 |
ENTRY( "TestForLongStringsInEntry", CTCalendarAddTest::TestForLongStringsInEntry ),
|
|
154 |
};
|
|
155 |
|
|
156 |
const TInt count = sizeof( KFunctions ) /
|
|
157 |
sizeof( TStifFunctionInfo );
|
|
158 |
|
|
159 |
return RunInternalL( KFunctions, count, aItem );
|
|
160 |
|
|
161 |
}
|
|
162 |
|
|
163 |
TInt CTCalendarAddTest::InterfaceClassL( CStifItemParser& aItem )
|
|
164 |
{
|
|
165 |
struct ParamPass* arg1 = new ParamPass();
|
|
166 |
arg1->it = &aItem;
|
|
167 |
TPtrC calname;
|
|
168 |
int res = 0;
|
|
169 |
int errorcode = 0;
|
|
170 |
if( arg1->it->GetNextString ( calname ) != KErrNone )
|
|
171 |
{
|
|
172 |
return KErrGeneral;
|
|
173 |
}
|
|
174 |
_LIT(KNull,"NULL");
|
|
175 |
_LIT(KCalNameLong,"C:shfwhfhjeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeekkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnlllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll");
|
|
176 |
if( 0 == calname.CompareF(KNull) )
|
|
177 |
calname.Set(KCalNameLong);
|
|
178 |
__UHEAP_MARK;
|
|
179 |
CTestAddSync* test = CTestAddSync::NewL();
|
|
180 |
res = test->AddInvalidCalendar( calname );
|
|
181 |
delete test;
|
|
182 |
__UHEAP_MARKEND;
|
|
183 |
|
|
184 |
if( arg1->it->GetNextInt ( errorcode ) != KErrNone )
|
|
185 |
{
|
|
186 |
return KErrGeneral;
|
|
187 |
}
|
|
188 |
if( errorcode = res )
|
|
189 |
res = KErrNone;
|
|
190 |
return res;
|
|
191 |
|
|
192 |
}
|
|
193 |
|
|
194 |
|
|
195 |
// -----------------------------------------------------------------------------
|
|
196 |
// CTCalendarAddTest::Import
|
|
197 |
// Test Method to test the Import(Synchronous)
|
|
198 |
// Functionality of CalenderService
|
|
199 |
// -----------------------------------------------------------------------------
|
|
200 |
//
|
|
201 |
TInt CTCalendarAddTest::AddNewCalendar(CStifItemParser& /*aItem*/)
|
|
202 |
{
|
|
203 |
//__UHEAP_MARK;
|
|
204 |
|
|
205 |
TInt result=KErrNone;
|
|
206 |
|
|
207 |
result = doAddTest();
|
|
208 |
|
|
209 |
|
|
210 |
// __UHEAP_MARKEND;
|
|
211 |
return result;
|
|
212 |
}
|
|
213 |
TInt CTCalendarAddTest::AddApptWithDailyRepeat(CStifItemParser& /*aItem*/)
|
|
214 |
{
|
|
215 |
//__UHEAP_MARK;
|
|
216 |
|
|
217 |
TInt result=KErrNone;
|
|
218 |
|
|
219 |
__UHEAP_MARK;
|
|
220 |
CTestAddSync* test = CTestAddSync::NewL();
|
|
221 |
int res = test->AddNewApptWithDailyRepeat();
|
|
222 |
delete test;
|
|
223 |
__UHEAP_MARKEND;
|
|
224 |
return res;
|
|
225 |
|
|
226 |
|
|
227 |
// __UHEAP_MARKEND;
|
|
228 |
return result;
|
|
229 |
}
|
|
230 |
TInt CTCalendarAddTest::AddApptWithWeeklyRepeat(CStifItemParser& /*aItem*/)
|
|
231 |
{
|
|
232 |
//__UHEAP_MARK;
|
|
233 |
|
|
234 |
TInt result=KErrNone;
|
|
235 |
|
|
236 |
__UHEAP_MARK;
|
|
237 |
CTestAddSync* test = CTestAddSync::NewL();
|
|
238 |
int res = test->AddNewApptWithWeeklyRepeat();
|
|
239 |
delete test;
|
|
240 |
__UHEAP_MARKEND;
|
|
241 |
return res;
|
|
242 |
|
|
243 |
|
|
244 |
// __UHEAP_MARKEND;
|
|
245 |
return result;
|
|
246 |
}
|
|
247 |
TInt CTCalendarAddTest::AddApptWithMonthlyRepeat(CStifItemParser& /*aItem*/)
|
|
248 |
{
|
|
249 |
//__UHEAP_MARK;
|
|
250 |
|
|
251 |
TInt result=KErrNone;
|
|
252 |
|
|
253 |
__UHEAP_MARK;
|
|
254 |
CTestAddSync* test = CTestAddSync::NewL();
|
|
255 |
int res = test->AddNewApptWithMonthlyRepeat();
|
|
256 |
delete test;
|
|
257 |
__UHEAP_MARKEND;
|
|
258 |
return res;
|
|
259 |
|
|
260 |
|
|
261 |
// __UHEAP_MARKEND;
|
|
262 |
return result;
|
|
263 |
}
|
|
264 |
TInt CTCalendarAddTest::AddApptWithAttendees(CStifItemParser& /*aItem*/)
|
|
265 |
{
|
|
266 |
//__UHEAP_MARK;
|
|
267 |
|
|
268 |
TInt result=KErrNone;
|
|
269 |
|
|
270 |
__UHEAP_MARK;
|
|
271 |
CTestAddSync* test = CTestAddSync::NewL();
|
|
272 |
int res = test->AddNewApptWithAttendees();
|
|
273 |
delete test;
|
|
274 |
__UHEAP_MARKEND;
|
|
275 |
return res;
|
|
276 |
|
|
277 |
|
|
278 |
// __UHEAP_MARKEND;
|
|
279 |
return result;
|
|
280 |
}
|
|
281 |
TInt CTCalendarAddTest::AddNewAnniversary(CStifItemParser& /*aItem*/)
|
|
282 |
{
|
|
283 |
//__UHEAP_MARK;
|
|
284 |
|
|
285 |
TInt result=KErrNone;
|
|
286 |
|
|
287 |
__UHEAP_MARK;
|
|
288 |
CTestAddSync* test = CTestAddSync::NewL();
|
|
289 |
int res = test->AddNewAnniversary();
|
|
290 |
delete test;
|
|
291 |
__UHEAP_MARKEND;
|
|
292 |
return res;
|
|
293 |
|
|
294 |
|
|
295 |
// __UHEAP_MARKEND;
|
|
296 |
return result;
|
|
297 |
}
|
|
298 |
TInt CTCalendarAddTest::AddNewDayEvent(CStifItemParser& /*aItem*/)
|
|
299 |
{
|
|
300 |
//__UHEAP_MARK;
|
|
301 |
|
|
302 |
TInt result=KErrNone;
|
|
303 |
|
|
304 |
__UHEAP_MARK;
|
|
305 |
CTestAddSync* test = CTestAddSync::NewL();
|
|
306 |
int res = test->AddNewDayEvent();
|
|
307 |
delete test;
|
|
308 |
__UHEAP_MARKEND;
|
|
309 |
return res;
|
|
310 |
|
|
311 |
|
|
312 |
// __UHEAP_MARKEND;
|
|
313 |
return result;
|
|
314 |
}
|
|
315 |
TInt CTCalendarAddTest::AddNewReminder(CStifItemParser& /*aItem*/)
|
|
316 |
{
|
|
317 |
//__UHEAP_MARK;
|
|
318 |
|
|
319 |
TInt result=KErrNone;
|
|
320 |
|
|
321 |
__UHEAP_MARK;
|
|
322 |
CTestAddSync* test = CTestAddSync::NewL();
|
|
323 |
int res = test->AddNewReminder();
|
|
324 |
delete test;
|
|
325 |
__UHEAP_MARKEND;
|
|
326 |
return res;
|
|
327 |
|
|
328 |
|
|
329 |
// __UHEAP_MARKEND;
|
|
330 |
return result;
|
|
331 |
}
|
|
332 |
TInt CTCalendarAddTest::AddNewTodo(CStifItemParser& /*aItem*/)
|
|
333 |
{
|
|
334 |
//__UHEAP_MARK;
|
|
335 |
|
|
336 |
TInt result=KErrNone;
|
|
337 |
|
|
338 |
__UHEAP_MARK;
|
|
339 |
CTestAddSync* test = CTestAddSync::NewL();
|
|
340 |
int res = test->AddNewTodo();
|
|
341 |
delete test;
|
|
342 |
__UHEAP_MARKEND;
|
|
343 |
return res;
|
|
344 |
|
|
345 |
|
|
346 |
// __UHEAP_MARKEND;
|
|
347 |
return result;
|
|
348 |
}
|
|
349 |
|
|
350 |
TInt CTCalendarAddTest::AddAll(CStifItemParser& aItem)
|
|
351 |
{
|
|
352 |
__UHEAP_MARK;
|
|
353 |
|
|
354 |
TInt result=KErrNone;
|
|
355 |
|
|
356 |
result = AddEntryWithAllAttributes();
|
|
357 |
|
|
358 |
|
|
359 |
__UHEAP_MARKEND;
|
|
360 |
return result;
|
|
361 |
}
|
|
362 |
|
|
363 |
TInt CTCalendarAddTest::ModifyRepeat(CStifItemParser& aItem)
|
|
364 |
{
|
|
365 |
__UHEAP_MARK;
|
|
366 |
|
|
367 |
TInt result=KErrNone;
|
|
368 |
|
|
369 |
result = ModifyRepeatRule();
|
|
370 |
|
|
371 |
|
|
372 |
__UHEAP_MARKEND;
|
|
373 |
return result;
|
|
374 |
}
|
|
375 |
TInt CTCalendarAddTest::UpdateInstanceWithRepeat(CStifItemParser& aItem)
|
|
376 |
{
|
|
377 |
__UHEAP_MARK;
|
|
378 |
|
|
379 |
TInt result=KErrNone;
|
|
380 |
|
|
381 |
result = UpdateApptInstanceWithRepeat();
|
|
382 |
if( result = 1000 )
|
|
383 |
result = KErrNone;
|
|
384 |
__UHEAP_MARKEND;
|
|
385 |
return result;
|
|
386 |
}
|
|
387 |
|
|
388 |
|
|
389 |
TInt CTCalendarAddTest::UpdateEntryWithRepeatDates(CStifItemParser& aItem)
|
|
390 |
{
|
|
391 |
__UHEAP_MARK;
|
|
392 |
|
|
393 |
TInt result=KErrNone;
|
|
394 |
|
|
395 |
result = UpdateEntryWithRDates();
|
|
396 |
if( result = 1000 )
|
|
397 |
result = KErrNone;
|
|
398 |
__UHEAP_MARKEND;
|
|
399 |
return result;
|
|
400 |
}
|
|
401 |
|
|
402 |
TInt CTCalendarAddTest::AddEntryWithMonthlyRpt(CStifItemParser& aItem)
|
|
403 |
{
|
|
404 |
__UHEAP_MARK;
|
|
405 |
|
|
406 |
TInt result=KErrNone;
|
|
407 |
|
|
408 |
result = AddMonthlyRepeatingEntry();
|
|
409 |
|
|
410 |
|
|
411 |
__UHEAP_MARKEND;
|
|
412 |
return result;
|
|
413 |
}
|
|
414 |
|
|
415 |
|
|
416 |
TInt CTCalendarAddTest::TestForLongStringsInEntry(CStifItemParser& aItem)
|
|
417 |
{
|
|
418 |
__UHEAP_MARK;
|
|
419 |
|
|
420 |
TInt result=KErrNone;
|
|
421 |
|
|
422 |
result = TestForLongStrings();
|
|
423 |
|
|
424 |
|
|
425 |
__UHEAP_MARKEND;
|
|
426 |
return result;
|
|
427 |
}
|
|
428 |
|
|
429 |
|
|
430 |
TInt CTestAddSync::AddInvalidCalendar( TPtrC calname) //cbinding stuff
|
|
431 |
{
|
|
432 |
iServiceHandler = CLiwServiceHandler::NewL();
|
|
433 |
|
|
434 |
CLiwGenericParamList* inparam = &(iServiceHandler->InParamListL());
|
|
435 |
CLiwGenericParamList* outparam = &(iServiceHandler->OutParamListL());
|
|
436 |
|
|
437 |
|
|
438 |
TInt err =0;
|
|
439 |
RCriteriaArray interest;
|
|
440 |
CleanupClosePushL(interest);
|
|
441 |
|
|
442 |
CLiwCriteriaItem* crit = CLiwCriteriaItem::NewL(1, KTestInterface,KTestContent);
|
|
443 |
crit->SetServiceClass(TUid::Uid(KLiwClassBase));
|
|
444 |
CleanupStack::PushL(crit);
|
|
445 |
interest.AppendL(crit);
|
|
446 |
|
|
447 |
iServiceHandler->AttachL(interest);
|
|
448 |
iServiceHandler->ExecuteServiceCmdL(*crit, *inparam, *outparam);
|
|
449 |
|
|
450 |
TInt pos = 0;
|
|
451 |
|
|
452 |
outparam->FindFirst( pos, KTestInterface );
|
|
453 |
if(pos != KErrNotFound)
|
|
454 |
{
|
|
455 |
interface = (*outparam)[pos].Value().AsInterface();
|
|
456 |
}
|
|
457 |
CleanupStack::PopAndDestroy(crit);
|
|
458 |
CleanupStack::PopAndDestroy(&interest);
|
|
459 |
|
|
460 |
outparam->Reset();
|
|
461 |
inparam->Reset();
|
|
462 |
|
|
463 |
AddProvCalendar(inparam, outparam, interface, calname);
|
|
464 |
pos = 0 ;
|
|
465 |
|
|
466 |
const TLiwGenericParam* output = outparam->FindFirst( pos,_L8("ErrorCode"));
|
|
467 |
|
|
468 |
if(output)
|
|
469 |
{
|
|
470 |
err = output->Value().AsTInt32();
|
|
471 |
}
|
|
472 |
|
|
473 |
inparam->Reset();
|
|
474 |
outparam->Reset();
|
|
475 |
return err;
|
|
476 |
}
|
|
477 |
|
|
478 |
// -----------------------------------------------------------------------------
|
|
479 |
// CTCalendarAddTest::ImportAsync
|
|
480 |
// Test Method to test the ImportAsync(ASynchronous)
|
|
481 |
// Functionality of CalenderService
|
|
482 |
// -----------------------------------------------------------------------------
|
|
483 |
//
|
|
484 |
|
|
485 |
// -----------------------------------------------------------------------------
|
|
486 |
// CTCalendarAddTest::ICALImport
|
|
487 |
// Test Method to test the ICALImport(Synchronous)
|
|
488 |
// Functionality of CalenderService
|
|
489 |
// -----------------------------------------------------------------------------
|
|
490 |
//
|
|
491 |
|
|
492 |
|
|
493 |
// -----------------------------------------------------------------------------
|
|
494 |
// CTCalendarAddTest::ICALImportAsync
|
|
495 |
// Test Method to test the ICALImportAsync(ASynchronous)
|
|
496 |
// Functionality of CalenderService
|
|
497 |
// -----------------------------------------------------------------------------
|
|
498 |
//
|
|
499 |
|
|
500 |
|
|
501 |
TInt CTestAddSync::AddNewAnniversary()
|
|
502 |
{
|
|
503 |
iServiceHandler = CLiwServiceHandler::NewL();
|
|
504 |
|
|
505 |
CLiwGenericParamList* inparam = &(iServiceHandler->InParamListL());
|
|
506 |
CLiwGenericParamList* outparam = &(iServiceHandler->OutParamListL());
|
|
507 |
|
|
508 |
|
|
509 |
TInt err;
|
|
510 |
RCriteriaArray interest;
|
|
511 |
CleanupClosePushL(interest);
|
|
512 |
|
|
513 |
CLiwCriteriaItem* crit = CLiwCriteriaItem::NewL(1, KTestInterface,KTestContent);
|
|
514 |
crit->SetServiceClass(TUid::Uid(KLiwClassBase));
|
|
515 |
CleanupStack::PushL(crit);
|
|
516 |
interest.AppendL(crit);
|
|
517 |
|
|
518 |
iServiceHandler->AttachL(interest);
|
|
519 |
iServiceHandler->ExecuteServiceCmdL(*crit, *inparam, *outparam);
|
|
520 |
|
|
521 |
TInt pos = 0;
|
|
522 |
|
|
523 |
outparam->FindFirst( pos, KTestInterface );
|
|
524 |
if(pos != KErrNotFound)
|
|
525 |
{
|
|
526 |
interface = (*outparam)[pos].Value().AsInterface();
|
|
527 |
}
|
|
528 |
CleanupStack::PopAndDestroy(crit);
|
|
529 |
CleanupStack::PopAndDestroy(&interest);
|
|
530 |
|
|
531 |
outparam->Reset();
|
|
532 |
inparam->Reset();
|
|
533 |
|
|
534 |
AddProvCalendar(inparam, outparam, interface, KCalFileName1);
|
|
535 |
TUIDSet* uidset1;
|
|
536 |
TBuf<50> globaluid;
|
|
537 |
AddProvAnni(inparam, outparam, interface, KCalFileName1 ,uidset1);
|
|
538 |
//localuid.Num(TInt64(uidset1->iLocalUID));
|
|
539 |
globaluid.Copy(uidset1->iGlobalUID->Des());
|
|
540 |
|
|
541 |
TLiwGenericParam dsNameParam(KContentType, TLiwVariant(_L("CalendarEntry")));
|
|
542 |
inparam->AppendL(dsNameParam);
|
|
543 |
|
|
544 |
CLiwDefaultMap *filterMap = CLiwDefaultMap::NewL();
|
|
545 |
TLiwGenericParam filterParam(KFilter, TLiwVariant(filterMap));
|
|
546 |
inparam->AppendL(filterParam);
|
|
547 |
filterMap->DecRef();
|
|
548 |
|
|
549 |
filterMap->InsertL(KCalendarName,TLiwVariant(_L("C:CalendarFileA")));
|
|
550 |
filterMap->InsertL(_L8("id"),TLiwVariant(globaluid));
|
|
551 |
|
|
552 |
TRAP(err,interface->ExecuteCmdL( _L8("GetList") ,*inparam ,*outparam));
|
|
553 |
|
|
554 |
pos = 0 ;
|
|
555 |
|
|
556 |
const TLiwGenericParam* finaloutput = outparam->FindFirst( pos,_L8("ReturnValue"));
|
|
557 |
TInt count = 0;
|
|
558 |
CLiwMap* map;
|
|
559 |
TInt retvalue = KErrNone;
|
|
560 |
if ( finaloutput )
|
|
561 |
{
|
|
562 |
CLiwIterable* iterlist = finaloutput->Value().AsIterable();
|
|
563 |
if(iterlist)
|
|
564 |
{
|
|
565 |
TLiwVariant data1;
|
|
566 |
while(iterlist->NextL(data1) )
|
|
567 |
{
|
|
568 |
const CLiwMap* res = data1.AsMap();
|
|
569 |
if ( res )
|
|
570 |
{
|
|
571 |
TLiwVariant data;
|
|
572 |
if(res->FindL(_L8("Description"), data))
|
|
573 |
{
|
|
574 |
TPtrC rep = data.AsDes();
|
|
575 |
if(rep.CompareF(_L("Anniversary")) != 0 )
|
|
576 |
{
|
|
577 |
retvalue = KErrGeneral;
|
|
578 |
break;
|
|
579 |
}
|
|
580 |
}
|
|
581 |
|
|
582 |
data.Reset();
|
|
583 |
}
|
|
584 |
}
|
|
585 |
data1.Reset();
|
|
586 |
}
|
|
587 |
}
|
|
588 |
|
|
589 |
inparam->Reset();
|
|
590 |
outparam->Reset();
|
|
591 |
delete uidset1;
|
|
592 |
RemoveProvCalendar(inparam, outparam, interface, KCalFileName1);
|
|
593 |
return retvalue;
|
|
594 |
|
|
595 |
}
|
|
596 |
|
|
597 |
TInt CTestAddSync::AddNewDayEvent()
|
|
598 |
{
|
|
599 |
iServiceHandler = CLiwServiceHandler::NewL();
|
|
600 |
|
|
601 |
CLiwGenericParamList* inparam = &(iServiceHandler->InParamListL());
|
|
602 |
CLiwGenericParamList* outparam = &(iServiceHandler->OutParamListL());
|
|
603 |
|
|
604 |
|
|
605 |
TInt err;
|
|
606 |
RCriteriaArray interest;
|
|
607 |
CleanupClosePushL(interest);
|
|
608 |
|
|
609 |
CLiwCriteriaItem* crit = CLiwCriteriaItem::NewL(1, KTestInterface,KTestContent);
|
|
610 |
crit->SetServiceClass(TUid::Uid(KLiwClassBase));
|
|
611 |
CleanupStack::PushL(crit);
|
|
612 |
interest.AppendL(crit);
|
|
613 |
|
|
614 |
iServiceHandler->AttachL(interest);
|
|
615 |
iServiceHandler->ExecuteServiceCmdL(*crit, *inparam, *outparam);
|
|
616 |
|
|
617 |
TInt pos = 0;
|
|
618 |
|
|
619 |
outparam->FindFirst( pos, KTestInterface );
|
|
620 |
if(pos != KErrNotFound)
|
|
621 |
{
|
|
622 |
interface = (*outparam)[pos].Value().AsInterface();
|
|
623 |
}
|
|
624 |
CleanupStack::PopAndDestroy(crit);
|
|
625 |
CleanupStack::PopAndDestroy(&interest);
|
|
626 |
|
|
627 |
outparam->Reset();
|
|
628 |
inparam->Reset();
|
|
629 |
|
|
630 |
AddProvCalendar(inparam, outparam, interface, KCalFileName1);
|
|
631 |
TUIDSet* uidset1;
|
|
632 |
TBuf<50> globaluid;
|
|
633 |
AddProvDayEvent(inparam, outparam, interface, KCalFileName1 ,uidset1);
|
|
634 |
//localuid.Num(TInt64(uidset1->iLocalUID));
|
|
635 |
globaluid.Copy(uidset1->iGlobalUID->Des());
|
|
636 |
|
|
637 |
TLiwGenericParam dsNameParam(KContentType, TLiwVariant(_L("CalendarEntry")));
|
|
638 |
inparam->AppendL(dsNameParam);
|
|
639 |
|
|
640 |
CLiwDefaultMap *filterMap = CLiwDefaultMap::NewL();
|
|
641 |
TLiwGenericParam filterParam(KFilter, TLiwVariant(filterMap));
|
|
642 |
inparam->AppendL(filterParam);
|
|
643 |
filterMap->DecRef();
|
|
644 |
|
|
645 |
filterMap->InsertL(KCalendarName,TLiwVariant(_L("C:CalendarFileA")));
|
|
646 |
filterMap->InsertL(_L8("id"),TLiwVariant(globaluid));
|
|
647 |
|
|
648 |
TRAP(err,interface->ExecuteCmdL( _L8("GetList") ,*inparam ,*outparam));
|
|
649 |
|
|
650 |
pos = 0 ;
|
|
651 |
|
|
652 |
const TLiwGenericParam* finaloutput = outparam->FindFirst( pos,_L8("ReturnValue"));
|
|
653 |
TInt count = 0;
|
|
654 |
CLiwMap* map;
|
|
655 |
TInt retvalue = KErrNone;
|
|
656 |
if ( finaloutput )
|
|
657 |
{
|
|
658 |
CLiwIterable* iterlist = finaloutput->Value().AsIterable();
|
|
659 |
if(iterlist)
|
|
660 |
{
|
|
661 |
TLiwVariant data1;
|
|
662 |
while(iterlist->NextL(data1) )
|
|
663 |
{
|
|
664 |
const CLiwMap* res = data1.AsMap();
|
|
665 |
if ( res )
|
|
666 |
{
|
|
667 |
TLiwVariant data;
|
|
668 |
if(res->FindL(_L8("Description"), data))
|
|
669 |
{
|
|
670 |
TPtrC rep = data.AsDes();
|
|
671 |
if(rep.CompareF(_L("New Event entry created")) != 0 )
|
|
672 |
{
|
|
673 |
retvalue = KErrGeneral;
|
|
674 |
break;
|
|
675 |
}
|
|
676 |
}
|
|
677 |
|
|
678 |
if(res->FindL(_L8("RepeatRule"), data))
|
|
679 |
{
|
|
680 |
const CLiwMap* map = data.AsMap();
|
|
681 |
TLiwVariant rdata;
|
|
682 |
if(map->FindL(_L8("Type"), rdata))
|
|
683 |
{
|
|
684 |
TInt type = rdata.AsTInt32();
|
|
685 |
if( type != 1 )
|
|
686 |
{
|
|
687 |
retvalue = KErrGeneral;
|
|
688 |
rdata.Reset();
|
|
689 |
break;
|
|
690 |
}
|
|
691 |
}
|
|
692 |
rdata.Reset();
|
|
693 |
}
|
|
694 |
|
|
695 |
data.Reset();
|
|
696 |
}
|
|
697 |
}
|
|
698 |
data1.Reset();
|
|
699 |
}
|
|
700 |
}
|
|
701 |
|
|
702 |
inparam->Reset();
|
|
703 |
outparam->Reset();
|
|
704 |
delete uidset1;
|
|
705 |
RemoveProvCalendar(inparam, outparam, interface, KCalFileName1);
|
|
706 |
return retvalue;
|
|
707 |
|
|
708 |
}
|
|
709 |
|
|
710 |
TInt CTestAddSync::AddNewReminder()
|
|
711 |
{
|
|
712 |
iServiceHandler = CLiwServiceHandler::NewL();
|
|
713 |
|
|
714 |
CLiwGenericParamList* inparam = &(iServiceHandler->InParamListL());
|
|
715 |
CLiwGenericParamList* outparam = &(iServiceHandler->OutParamListL());
|
|
716 |
|
|
717 |
|
|
718 |
TInt err;
|
|
719 |
RCriteriaArray interest;
|
|
720 |
CleanupClosePushL(interest);
|
|
721 |
|
|
722 |
CLiwCriteriaItem* crit = CLiwCriteriaItem::NewL(1, KTestInterface,KTestContent);
|
|
723 |
crit->SetServiceClass(TUid::Uid(KLiwClassBase));
|
|
724 |
CleanupStack::PushL(crit);
|
|
725 |
interest.AppendL(crit);
|
|
726 |
|
|
727 |
iServiceHandler->AttachL(interest);
|
|
728 |
iServiceHandler->ExecuteServiceCmdL(*crit, *inparam, *outparam);
|
|
729 |
|
|
730 |
TInt pos = 0;
|
|
731 |
|
|
732 |
outparam->FindFirst( pos, KTestInterface );
|
|
733 |
if(pos != KErrNotFound)
|
|
734 |
{
|
|
735 |
interface = (*outparam)[pos].Value().AsInterface();
|
|
736 |
}
|
|
737 |
CleanupStack::PopAndDestroy(crit);
|
|
738 |
CleanupStack::PopAndDestroy(&interest);
|
|
739 |
|
|
740 |
outparam->Reset();
|
|
741 |
inparam->Reset();
|
|
742 |
|
|
743 |
AddProvCalendar(inparam, outparam, interface, KCalFileName1);
|
|
744 |
TUIDSet* uidset1;
|
|
745 |
TBuf<50> globaluid;
|
|
746 |
AddProvReminder(inparam, outparam, interface, KCalFileName1 ,uidset1);
|
|
747 |
//localuid.Num(TInt64(uidset1->iLocalUID));
|
|
748 |
globaluid.Copy(uidset1->iGlobalUID->Des());
|
|
749 |
|
|
750 |
TLiwGenericParam dsNameParam(KContentType, TLiwVariant(_L("CalendarEntry")));
|
|
751 |
inparam->AppendL(dsNameParam);
|
|
752 |
|
|
753 |
CLiwDefaultMap *filterMap = CLiwDefaultMap::NewL();
|
|
754 |
TLiwGenericParam filterParam(KFilter, TLiwVariant(filterMap));
|
|
755 |
inparam->AppendL(filterParam);
|
|
756 |
filterMap->DecRef();
|
|
757 |
|
|
758 |
filterMap->InsertL(KCalendarName,TLiwVariant(_L("C:CalendarFileA")));
|
|
759 |
filterMap->InsertL(_L8("id"),TLiwVariant(globaluid));
|
|
760 |
|
|
761 |
TRAP(err,interface->ExecuteCmdL( _L8("GetList") ,*inparam ,*outparam));
|
|
762 |
|
|
763 |
pos = 0 ;
|
|
764 |
|
|
765 |
const TLiwGenericParam* finaloutput = outparam->FindFirst( pos,_L8("ReturnValue"));
|
|
766 |
TInt count = 0;
|
|
767 |
CLiwMap* map;
|
|
768 |
TInt retvalue = KErrNone;
|
|
769 |
if ( finaloutput )
|
|
770 |
{
|
|
771 |
CLiwIterable* iterlist = finaloutput->Value().AsIterable();
|
|
772 |
if(iterlist)
|
|
773 |
{
|
|
774 |
TLiwVariant data1;
|
|
775 |
while(iterlist->NextL(data1) )
|
|
776 |
{
|
|
777 |
const CLiwMap* res = data1.AsMap();
|
|
778 |
if ( res )
|
|
779 |
{
|
|
780 |
TLiwVariant data;
|
|
781 |
if(res->FindL(_L8("Description"), data))
|
|
782 |
{
|
|
783 |
TPtrC rep = data.AsDes();
|
|
784 |
if(rep.CompareF(_L("New Reminder entry created")) != 0 )
|
|
785 |
{
|
|
786 |
retvalue = KErrGeneral;
|
|
787 |
break;
|
|
788 |
}
|
|
789 |
}
|
|
790 |
|
|
791 |
if(res->FindL(_L8("RepeatRule"), data))
|
|
792 |
{
|
|
793 |
const CLiwMap* map = data.AsMap();
|
|
794 |
TLiwVariant rdata;
|
|
795 |
if(map->FindL(_L8("Type"), rdata))
|
|
796 |
{
|
|
797 |
TInt type = rdata.AsTInt32();
|
|
798 |
if( type != 1 )
|
|
799 |
{
|
|
800 |
retvalue = KErrGeneral;
|
|
801 |
rdata.Reset();
|
|
802 |
break;
|
|
803 |
}
|
|
804 |
}
|
|
805 |
rdata.Reset();
|
|
806 |
}
|
|
807 |
|
|
808 |
data.Reset();
|
|
809 |
}
|
|
810 |
}
|
|
811 |
data1.Reset();
|
|
812 |
}
|
|
813 |
}
|
|
814 |
|
|
815 |
inparam->Reset();
|
|
816 |
outparam->Reset();
|
|
817 |
delete uidset1;
|
|
818 |
RemoveProvCalendar(inparam, outparam, interface, KCalFileName1);
|
|
819 |
return retvalue;
|
|
820 |
|
|
821 |
}
|
|
822 |
|
|
823 |
TInt CTestAddSync::AddNewTodo()
|
|
824 |
{
|
|
825 |
iServiceHandler = CLiwServiceHandler::NewL();
|
|
826 |
|
|
827 |
CLiwGenericParamList* inparam = &(iServiceHandler->InParamListL());
|
|
828 |
CLiwGenericParamList* outparam = &(iServiceHandler->OutParamListL());
|
|
829 |
|
|
830 |
|
|
831 |
TInt err;
|
|
832 |
RCriteriaArray interest;
|
|
833 |
CleanupClosePushL(interest);
|
|
834 |
|
|
835 |
CLiwCriteriaItem* crit = CLiwCriteriaItem::NewL(1, KTestInterface,KTestContent);
|
|
836 |
crit->SetServiceClass(TUid::Uid(KLiwClassBase));
|
|
837 |
CleanupStack::PushL(crit);
|
|
838 |
interest.AppendL(crit);
|
|
839 |
|
|
840 |
iServiceHandler->AttachL(interest);
|
|
841 |
iServiceHandler->ExecuteServiceCmdL(*crit, *inparam, *outparam);
|
|
842 |
|
|
843 |
TInt pos = 0;
|
|
844 |
|
|
845 |
outparam->FindFirst( pos, KTestInterface );
|
|
846 |
if(pos != KErrNotFound)
|
|
847 |
{
|
|
848 |
interface = (*outparam)[pos].Value().AsInterface();
|
|
849 |
}
|
|
850 |
CleanupStack::PopAndDestroy(crit);
|
|
851 |
CleanupStack::PopAndDestroy(&interest);
|
|
852 |
|
|
853 |
outparam->Reset();
|
|
854 |
inparam->Reset();
|
|
855 |
|
|
856 |
AddProvCalendar(inparam, outparam, interface, KCalFileName1);
|
|
857 |
TUIDSet* uidset1;
|
|
858 |
TBuf<50> globaluid;
|
|
859 |
AddProvToDo(inparam, outparam, interface, KCalFileName1 ,uidset1);
|
|
860 |
//localuid.Num(TInt64(uidset1->iLocalUID));
|
|
861 |
globaluid.Copy(uidset1->iGlobalUID->Des());
|
|
862 |
|
|
863 |
|
|
864 |
TLiwGenericParam dsNameParam(KContentType, TLiwVariant(_L("CalendarEntry")));
|
|
865 |
inparam->AppendL(dsNameParam);
|
|
866 |
|
|
867 |
CLiwDefaultMap *filterMap = CLiwDefaultMap::NewL();
|
|
868 |
TLiwGenericParam filterParam(KFilter, TLiwVariant(filterMap));
|
|
869 |
inparam->AppendL(filterParam);
|
|
870 |
filterMap->DecRef();
|
|
871 |
|
|
872 |
filterMap->InsertL(KCalendarName,TLiwVariant(_L("C:CalendarFileA")));
|
|
873 |
filterMap->InsertL(_L8("id"),TLiwVariant(globaluid));
|
|
874 |
|
|
875 |
TRAP(err,interface->ExecuteCmdL( _L8("GetList") ,*inparam ,*outparam));
|
|
876 |
|
|
877 |
pos = 0 ;
|
|
878 |
|
|
879 |
const TLiwGenericParam* finaloutput = outparam->FindFirst( pos,_L8("ReturnValue"));
|
|
880 |
TInt count = 0;
|
|
881 |
CLiwMap* map;
|
|
882 |
TInt retvalue = KErrNone;
|
|
883 |
if ( finaloutput )
|
|
884 |
{
|
|
885 |
CLiwIterable* iterlist = finaloutput->Value().AsIterable();
|
|
886 |
if(iterlist)
|
|
887 |
{
|
|
888 |
TLiwVariant data1;
|
|
889 |
while(iterlist->NextL(data1) )
|
|
890 |
{
|
|
891 |
const CLiwMap* res = data1.AsMap();
|
|
892 |
if ( res )
|
|
893 |
{
|
|
894 |
TLiwVariant data;
|
|
895 |
if(res->FindL(_L8("Description"), data))
|
|
896 |
{
|
|
897 |
TPtrC rep = data.AsDes();
|
|
898 |
if(rep.CompareF(_L("New todo entry created")) != 0 )
|
|
899 |
{
|
|
900 |
retvalue = KErrGeneral;
|
|
901 |
break;
|
|
902 |
}
|
|
903 |
}
|
|
904 |
|
|
905 |
data.Reset();
|
|
906 |
}
|
|
907 |
}
|
|
908 |
data1.Reset();
|
|
909 |
}
|
|
910 |
}
|
|
911 |
|
|
912 |
inparam->Reset();
|
|
913 |
outparam->Reset();
|
|
914 |
delete uidset1;
|
|
915 |
RemoveProvCalendar(inparam, outparam, interface, KCalFileName1);
|
|
916 |
return retvalue;
|
|
917 |
|
|
918 |
}
|
|
919 |
|
|
920 |
|
|
921 |
int doAddTest()
|
|
922 |
{
|
|
923 |
__UHEAP_MARK;
|
|
924 |
CTestAddSync* test = CTestAddSync::NewL();
|
|
925 |
int res = test->AddNewCalendar();
|
|
926 |
delete test;
|
|
927 |
__UHEAP_MARKEND;
|
|
928 |
return res;
|
|
929 |
|
|
930 |
}
|
|
931 |
|
|
932 |
TInt CTestAddSync::AddNewCalendar() //cbinding stuff
|
|
933 |
{
|
|
934 |
iServiceHandler = CLiwServiceHandler::NewL();
|
|
935 |
|
|
936 |
CLiwGenericParamList* inparam = &(iServiceHandler->InParamListL());
|
|
937 |
CLiwGenericParamList* outparam = &(iServiceHandler->OutParamListL());
|
|
938 |
|
|
939 |
|
|
940 |
TInt err =0;
|
|
941 |
RCriteriaArray interest;
|
|
942 |
CleanupClosePushL(interest);
|
|
943 |
|
|
944 |
CLiwCriteriaItem* crit = CLiwCriteriaItem::NewL(1, KTestInterface,KTestContent);
|
|
945 |
crit->SetServiceClass(TUid::Uid(KLiwClassBase));
|
|
946 |
CleanupStack::PushL(crit);
|
|
947 |
interest.AppendL(crit);
|
|
948 |
|
|
949 |
iServiceHandler->AttachL(interest);
|
|
950 |
iServiceHandler->ExecuteServiceCmdL(*crit, *inparam, *outparam);
|
|
951 |
|
|
952 |
TInt pos = 0;
|
|
953 |
|
|
954 |
outparam->FindFirst( pos, KTestInterface );
|
|
955 |
if(pos != KErrNotFound)
|
|
956 |
{
|
|
957 |
interface = (*outparam)[pos].Value().AsInterface();
|
|
958 |
}
|
|
959 |
CleanupStack::PopAndDestroy(crit);
|
|
960 |
CleanupStack::PopAndDestroy(&interest);
|
|
961 |
|
|
962 |
outparam->Reset();
|
|
963 |
inparam->Reset();
|
|
964 |
|
|
965 |
err = AddProvCalendar(inparam, outparam, interface, KCalFileName2);
|
|
966 |
/*pos = 0 ;
|
|
967 |
|
|
968 |
const TLiwGenericParam* output = outparam->FindFirst( pos,_L8("ErrorCode"));
|
|
969 |
|
|
970 |
if(output)
|
|
971 |
{
|
|
972 |
err = output->Value().AsTInt32();
|
|
973 |
}
|
|
974 |
|
|
975 |
inparam->Reset();
|
|
976 |
outparam->Reset();*/
|
|
977 |
int ret = KErrGeneral;
|
|
978 |
if( err == KErrNone )
|
|
979 |
{
|
|
980 |
TLiwGenericParam dsNameParam(KContentType, TLiwVariant(_L("Calendar")));
|
|
981 |
inparam->AppendL(dsNameParam);
|
|
982 |
|
|
983 |
TInt err = 0;
|
|
984 |
TRAP(err,interface->ExecuteCmdL( _L8("GetList") ,*inparam ,*outparam));
|
|
985 |
|
|
986 |
pos = 0 ;
|
|
987 |
|
|
988 |
const TLiwGenericParam* finaloutput = outparam->FindFirst( pos,_L8("ReturnValue"));
|
|
989 |
TInt count = 0;
|
|
990 |
CLiwMap* map;
|
|
991 |
|
|
992 |
if ( finaloutput )
|
|
993 |
{
|
|
994 |
CLiwIterable* iterlist = finaloutput->Value().AsIterable();
|
|
995 |
|
|
996 |
if(iterlist)
|
|
997 |
{
|
|
998 |
TLiwVariant data;
|
|
999 |
while(iterlist->NextL(data) )
|
|
1000 |
{
|
|
1001 |
TPtrC cal = data.AsDes();
|
|
1002 |
if(cal.CompareF(_L("C:CalendarFile1")) == 0)
|
|
1003 |
{
|
|
1004 |
ret = KErrNone;
|
|
1005 |
break;
|
|
1006 |
}
|
|
1007 |
count++;
|
|
1008 |
}
|
|
1009 |
data.Reset();
|
|
1010 |
}
|
|
1011 |
}
|
|
1012 |
|
|
1013 |
inparam->Reset();
|
|
1014 |
outparam->Reset();
|
|
1015 |
RemoveProvCalendar(inparam, outparam, interface, KCalFileName2);
|
|
1016 |
}
|
|
1017 |
return ret;
|
|
1018 |
}
|
|
1019 |
|
|
1020 |
|
|
1021 |
TInt CTestAddSync::AddNewApptWithDailyRepeat()
|
|
1022 |
{
|
|
1023 |
iServiceHandler = CLiwServiceHandler::NewL();
|
|
1024 |
|
|
1025 |
CLiwGenericParamList* inparam = &(iServiceHandler->InParamListL());
|
|
1026 |
CLiwGenericParamList* outparam = &(iServiceHandler->OutParamListL());
|
|
1027 |
|
|
1028 |
|
|
1029 |
TInt err;
|
|
1030 |
RCriteriaArray interest;
|
|
1031 |
CleanupClosePushL(interest);
|
|
1032 |
|
|
1033 |
CLiwCriteriaItem* crit = CLiwCriteriaItem::NewL(1, KTestInterface,KTestContent);
|
|
1034 |
crit->SetServiceClass(TUid::Uid(KLiwClassBase));
|
|
1035 |
CleanupStack::PushL(crit);
|
|
1036 |
interest.AppendL(crit);
|
|
1037 |
|
|
1038 |
iServiceHandler->AttachL(interest);
|
|
1039 |
iServiceHandler->ExecuteServiceCmdL(*crit, *inparam, *outparam);
|
|
1040 |
|
|
1041 |
TInt pos = 0;
|
|
1042 |
|
|
1043 |
outparam->FindFirst( pos, KTestInterface );
|
|
1044 |
if(pos != KErrNotFound)
|
|
1045 |
{
|
|
1046 |
interface = (*outparam)[pos].Value().AsInterface();
|
|
1047 |
}
|
|
1048 |
CleanupStack::PopAndDestroy(crit);
|
|
1049 |
CleanupStack::PopAndDestroy(&interest);
|
|
1050 |
|
|
1051 |
outparam->Reset();
|
|
1052 |
inparam->Reset();
|
|
1053 |
|
|
1054 |
AddProvCalendar(inparam, outparam, interface, KCalFileName1);
|
|
1055 |
TUIDSet* uidset1;
|
|
1056 |
TBuf<50> globaluid;
|
|
1057 |
AddProvAppointmentDailyRepeat(inparam, outparam, interface, KCalFileName1 ,uidset1);
|
|
1058 |
//localuid.Num(TInt64(uidset1->iLocalUID));
|
|
1059 |
globaluid.Copy(uidset1->iGlobalUID->Des());
|
|
1060 |
|
|
1061 |
TLiwGenericParam dsNameParam(KContentType, TLiwVariant(_L("CalendarEntry")));
|
|
1062 |
inparam->AppendL(dsNameParam);
|
|
1063 |
|
|
1064 |
CLiwDefaultMap *filterMap = CLiwDefaultMap::NewL();
|
|
1065 |
TLiwGenericParam filterParam(KFilter, TLiwVariant(filterMap));
|
|
1066 |
inparam->AppendL(filterParam);
|
|
1067 |
filterMap->DecRef();
|
|
1068 |
|
|
1069 |
filterMap->InsertL(KCalendarName,TLiwVariant(_L("C:CalendarFileA")));
|
|
1070 |
filterMap->InsertL(_L8("id"),TLiwVariant(globaluid));
|
|
1071 |
|
|
1072 |
TRAP(err,interface->ExecuteCmdL( _L8("GetList") ,*inparam ,*outparam));
|
|
1073 |
|
|
1074 |
pos = 0 ;
|
|
1075 |
|
|
1076 |
const TLiwGenericParam* finaloutput = outparam->FindFirst( pos,_L8("ReturnValue"));
|
|
1077 |
TInt count = 0;
|
|
1078 |
CLiwMap* map;
|
|
1079 |
TInt retvalue = KErrNone;
|
|
1080 |
if ( finaloutput )
|
|
1081 |
{
|
|
1082 |
CLiwIterable* iterlist = finaloutput->Value().AsIterable();
|
|
1083 |
if(iterlist)
|
|
1084 |
{
|
|
1085 |
TLiwVariant data1;
|
|
1086 |
while(iterlist->NextL(data1) )
|
|
1087 |
{
|
|
1088 |
const CLiwMap* res = data1.AsMap();
|
|
1089 |
if ( res )
|
|
1090 |
{
|
|
1091 |
TLiwVariant data;
|
|
1092 |
if(res->FindL(_L8("Description"), data))
|
|
1093 |
{
|
|
1094 |
TPtrC rep = data.AsDes();
|
|
1095 |
if(rep.CompareF(_L("Meeting")) != 0 )
|
|
1096 |
{
|
|
1097 |
retvalue = KErrGeneral;
|
|
1098 |
break;
|
|
1099 |
}
|
|
1100 |
}
|
|
1101 |
|
|
1102 |
if(res->FindL(_L8("RepeatRule"), data))
|
|
1103 |
{
|
|
1104 |
const CLiwMap* map = data.AsMap();
|
|
1105 |
TLiwVariant rdata;
|
|
1106 |
if(map->FindL(_L8("Type"), rdata))
|
|
1107 |
{
|
|
1108 |
TInt type = rdata.AsTInt32();
|
|
1109 |
if( type != 1 )
|
|
1110 |
{
|
|
1111 |
retvalue = KErrGeneral;
|
|
1112 |
rdata.Reset();
|
|
1113 |
break;
|
|
1114 |
}
|
|
1115 |
}
|
|
1116 |
rdata.Reset();
|
|
1117 |
}
|
|
1118 |
|
|
1119 |
data.Reset();
|
|
1120 |
}
|
|
1121 |
}
|
|
1122 |
data1.Reset();
|
|
1123 |
}
|
|
1124 |
}
|
|
1125 |
|
|
1126 |
inparam->Reset();
|
|
1127 |
outparam->Reset();
|
|
1128 |
delete uidset1;
|
|
1129 |
RemoveProvCalendar(inparam, outparam, interface, KCalFileName1);
|
|
1130 |
return retvalue;
|
|
1131 |
|
|
1132 |
}
|
|
1133 |
TInt CTestAddSync::AddNewApptWithWeeklyRepeat()
|
|
1134 |
{
|
|
1135 |
iServiceHandler = CLiwServiceHandler::NewL();
|
|
1136 |
|
|
1137 |
CLiwGenericParamList* inparam = &(iServiceHandler->InParamListL());
|
|
1138 |
CLiwGenericParamList* outparam = &(iServiceHandler->OutParamListL());
|
|
1139 |
|
|
1140 |
|
|
1141 |
TInt err;
|
|
1142 |
RCriteriaArray interest;
|
|
1143 |
CleanupClosePushL(interest);
|
|
1144 |
|
|
1145 |
CLiwCriteriaItem* crit = CLiwCriteriaItem::NewL(1, KTestInterface,KTestContent);
|
|
1146 |
crit->SetServiceClass(TUid::Uid(KLiwClassBase));
|
|
1147 |
CleanupStack::PushL(crit);
|
|
1148 |
interest.AppendL(crit);
|
|
1149 |
|
|
1150 |
iServiceHandler->AttachL(interest);
|
|
1151 |
iServiceHandler->ExecuteServiceCmdL(*crit, *inparam, *outparam);
|
|
1152 |
|
|
1153 |
TInt pos = 0;
|
|
1154 |
|
|
1155 |
outparam->FindFirst( pos, KTestInterface );
|
|
1156 |
if(pos != KErrNotFound)
|
|
1157 |
{
|
|
1158 |
interface = (*outparam)[pos].Value().AsInterface();
|
|
1159 |
}
|
|
1160 |
CleanupStack::PopAndDestroy(crit);
|
|
1161 |
CleanupStack::PopAndDestroy(&interest);
|
|
1162 |
|
|
1163 |
outparam->Reset();
|
|
1164 |
inparam->Reset();
|
|
1165 |
|
|
1166 |
AddProvCalendar(inparam, outparam, interface, KCalFileName1);
|
|
1167 |
TUIDSet* uidset1;
|
|
1168 |
TBuf<50> globaluid;
|
|
1169 |
//AddProvAppointmentDailyRepeatAndAttendees(inparam, outparam, interface, KCalFileName1 ,uidset1 );
|
|
1170 |
AddProvAppointmentWeeklyRepeat(inparam, outparam, interface, KCalFileName1 ,uidset1);
|
|
1171 |
//localuid.Num(TInt64(uidset1->iLocalUID));
|
|
1172 |
globaluid.Copy(uidset1->iGlobalUID->Des());
|
|
1173 |
|
|
1174 |
TLiwGenericParam dsNameParam(KContentType, TLiwVariant(_L("CalendarEntry")));
|
|
1175 |
inparam->AppendL(dsNameParam);
|
|
1176 |
|
|
1177 |
CLiwDefaultMap *filterMap = CLiwDefaultMap::NewL();
|
|
1178 |
TLiwGenericParam filterParam(KFilter, TLiwVariant(filterMap));
|
|
1179 |
inparam->AppendL(filterParam);
|
|
1180 |
filterMap->DecRef();
|
|
1181 |
|
|
1182 |
filterMap->InsertL(KCalendarName,TLiwVariant(_L("C:CalendarFileA")));
|
|
1183 |
filterMap->InsertL(_L8("LocalUid"),TLiwVariant(globaluid));
|
|
1184 |
|
|
1185 |
TRAP(err,interface->ExecuteCmdL( _L8("GetList") ,*inparam ,*outparam));
|
|
1186 |
|
|
1187 |
pos = 0 ;
|
|
1188 |
|
|
1189 |
const TLiwGenericParam* finaloutput = outparam->FindFirst( pos,_L8("ReturnValue"));
|
|
1190 |
TInt count = 0;
|
|
1191 |
CLiwMap* map;
|
|
1192 |
TInt retvalue = KErrNone;
|
|
1193 |
if ( finaloutput )
|
|
1194 |
{
|
|
1195 |
CLiwIterable* iterlist = finaloutput->Value().AsIterable();
|
|
1196 |
if(iterlist)
|
|
1197 |
{
|
|
1198 |
TLiwVariant data1;
|
|
1199 |
while(iterlist->NextL(data1) )
|
|
1200 |
{
|
|
1201 |
const CLiwMap* res = data1.AsMap();
|
|
1202 |
if ( res )
|
|
1203 |
{
|
|
1204 |
TLiwVariant data;
|
|
1205 |
if(res->FindL(_L8("Description"), data))
|
|
1206 |
{
|
|
1207 |
TPtrC rep = data.AsDes();
|
|
1208 |
if(rep.CompareF(_L("Meeting")) != 0 )
|
|
1209 |
{
|
|
1210 |
retvalue = KErrGeneral;
|
|
1211 |
break;
|
|
1212 |
}
|
|
1213 |
}
|
|
1214 |
|
|
1215 |
|
|
1216 |
if(res->FindL(_L8("RepeatRule"), data))
|
|
1217 |
{
|
|
1218 |
const CLiwMap* map = data.AsMap();
|
|
1219 |
TLiwVariant rdata;
|
|
1220 |
if(map->FindL(_L8("Type"), rdata))
|
|
1221 |
{
|
|
1222 |
TInt type = rdata.AsTInt32();
|
|
1223 |
if( type != 2 )
|
|
1224 |
{
|
|
1225 |
retvalue = KErrGeneral;
|
|
1226 |
rdata.Reset();
|
|
1227 |
break;
|
|
1228 |
}
|
|
1229 |
}
|
|
1230 |
rdata.Reset();
|
|
1231 |
}
|
|
1232 |
|
|
1233 |
data.Reset();
|
|
1234 |
}
|
|
1235 |
}
|
|
1236 |
data1.Reset();
|
|
1237 |
}
|
|
1238 |
}
|
|
1239 |
|
|
1240 |
inparam->Reset();
|
|
1241 |
outparam->Reset();
|
|
1242 |
delete uidset1;
|
|
1243 |
RemoveProvCalendar(inparam, outparam, interface, KCalFileName1);
|
|
1244 |
return retvalue;
|
|
1245 |
}
|
|
1246 |
TInt CTestAddSync::AddNewApptWithMonthlyRepeat()
|
|
1247 |
{
|
|
1248 |
iServiceHandler = CLiwServiceHandler::NewL();
|
|
1249 |
|
|
1250 |
CLiwGenericParamList* inparam = &(iServiceHandler->InParamListL());
|
|
1251 |
CLiwGenericParamList* outparam = &(iServiceHandler->OutParamListL());
|
|
1252 |
|
|
1253 |
|
|
1254 |
TInt err;
|
|
1255 |
RCriteriaArray interest;
|
|
1256 |
CleanupClosePushL(interest);
|
|
1257 |
|
|
1258 |
CLiwCriteriaItem* crit = CLiwCriteriaItem::NewL(1, KTestInterface,KTestContent);
|
|
1259 |
crit->SetServiceClass(TUid::Uid(KLiwClassBase));
|
|
1260 |
CleanupStack::PushL(crit);
|
|
1261 |
interest.AppendL(crit);
|
|
1262 |
|
|
1263 |
iServiceHandler->AttachL(interest);
|
|
1264 |
iServiceHandler->ExecuteServiceCmdL(*crit, *inparam, *outparam);
|
|
1265 |
|
|
1266 |
TInt pos = 0;
|
|
1267 |
|
|
1268 |
outparam->FindFirst( pos, KTestInterface );
|
|
1269 |
if(pos != KErrNotFound)
|
|
1270 |
{
|
|
1271 |
interface = (*outparam)[pos].Value().AsInterface();
|
|
1272 |
}
|
|
1273 |
CleanupStack::PopAndDestroy(crit);
|
|
1274 |
CleanupStack::PopAndDestroy(&interest);
|
|
1275 |
|
|
1276 |
outparam->Reset();
|
|
1277 |
inparam->Reset();
|
|
1278 |
|
|
1279 |
AddProvCalendar(inparam, outparam, interface, KCalFileName1);
|
|
1280 |
TUIDSet* uidset1;
|
|
1281 |
TBuf<50> globaluid;
|
|
1282 |
//AddProvAppointmentDailyRepeatAndAttendees(inparam, outparam, interface, KCalFileName1 ,uidset1 );
|
|
1283 |
AddProvAppointmentMonthlyRepeat(inparam, outparam, interface, KCalFileName1 ,uidset1);
|
|
1284 |
//localuid.Num(TInt64(uidset1->iLocalUID));
|
|
1285 |
globaluid.Copy(uidset1->iGlobalUID->Des());
|
|
1286 |
|
|
1287 |
TLiwGenericParam dsNameParam(KContentType, TLiwVariant(_L("CalendarEntry")));
|
|
1288 |
inparam->AppendL(dsNameParam);
|
|
1289 |
|
|
1290 |
CLiwDefaultMap *filterMap = CLiwDefaultMap::NewL();
|
|
1291 |
TLiwGenericParam filterParam(KFilter, TLiwVariant(filterMap));
|
|
1292 |
inparam->AppendL(filterParam);
|
|
1293 |
filterMap->DecRef();
|
|
1294 |
|
|
1295 |
filterMap->InsertL(KCalendarName,TLiwVariant(_L("C:CalendarFileA")));
|
|
1296 |
filterMap->InsertL(_L8("id"),TLiwVariant(globaluid));
|
|
1297 |
|
|
1298 |
TRAP(err,interface->ExecuteCmdL( _L8("GetList") ,*inparam ,*outparam));
|
|
1299 |
|
|
1300 |
pos = 0 ;
|
|
1301 |
|
|
1302 |
const TLiwGenericParam* finaloutput = outparam->FindFirst( pos,_L8("ReturnValue"));
|
|
1303 |
TInt count = 0;
|
|
1304 |
CLiwMap* map;
|
|
1305 |
TInt retvalue = KErrNone;
|
|
1306 |
if ( finaloutput )
|
|
1307 |
{
|
|
1308 |
CLiwIterable* iterlist = finaloutput->Value().AsIterable();
|
|
1309 |
if(iterlist)
|
|
1310 |
{
|
|
1311 |
TLiwVariant data1;
|
|
1312 |
while(iterlist->NextL(data1) )
|
|
1313 |
{
|
|
1314 |
const CLiwMap* res = data1.AsMap();
|
|
1315 |
if ( res )
|
|
1316 |
{
|
|
1317 |
TLiwVariant data;
|
|
1318 |
if(res->FindL(_L8("Description"), data))
|
|
1319 |
{
|
|
1320 |
TPtrC rep = data.AsDes();
|
|
1321 |
if(rep.CompareF(_L("Meeting")) != 0 )
|
|
1322 |
{
|
|
1323 |
retvalue = KErrGeneral;
|
|
1324 |
break;
|
|
1325 |
}
|
|
1326 |
}
|
|
1327 |
|
|
1328 |
|
|
1329 |
if(res->FindL(_L8("RepeatRule"), data))
|
|
1330 |
{
|
|
1331 |
const CLiwMap* map = data.AsMap();
|
|
1332 |
TLiwVariant rdata;
|
|
1333 |
if(map->FindL(_L8("Type"), rdata))
|
|
1334 |
{
|
|
1335 |
TInt type = rdata.AsTInt32();
|
|
1336 |
if( type != 3 )
|
|
1337 |
{
|
|
1338 |
retvalue = KErrGeneral;
|
|
1339 |
rdata.Reset();
|
|
1340 |
break;
|
|
1341 |
}
|
|
1342 |
}
|
|
1343 |
rdata.Reset();
|
|
1344 |
}
|
|
1345 |
|
|
1346 |
data.Reset();
|
|
1347 |
}
|
|
1348 |
}
|
|
1349 |
data1.Reset();
|
|
1350 |
}
|
|
1351 |
}
|
|
1352 |
|
|
1353 |
inparam->Reset();
|
|
1354 |
outparam->Reset();
|
|
1355 |
delete uidset1;
|
|
1356 |
RemoveProvCalendar(inparam, outparam, interface, KCalFileName1);
|
|
1357 |
return retvalue;
|
|
1358 |
|
|
1359 |
}
|
|
1360 |
|
|
1361 |
TInt CTestAddSync::AddNewApptWithAttendees()
|
|
1362 |
{
|
|
1363 |
|
|
1364 |
iServiceHandler = CLiwServiceHandler::NewL();
|
|
1365 |
|
|
1366 |
CLiwGenericParamList* inparam = &(iServiceHandler->InParamListL());
|
|
1367 |
CLiwGenericParamList* outparam = &(iServiceHandler->OutParamListL());
|
|
1368 |
|
|
1369 |
|
|
1370 |
TInt err;
|
|
1371 |
RCriteriaArray interest;
|
|
1372 |
CleanupClosePushL(interest);
|
|
1373 |
|
|
1374 |
CLiwCriteriaItem* crit = CLiwCriteriaItem::NewL(1, KTestInterface,KTestContent);
|
|
1375 |
crit->SetServiceClass(TUid::Uid(KLiwClassBase));
|
|
1376 |
CleanupStack::PushL(crit);
|
|
1377 |
interest.AppendL(crit);
|
|
1378 |
|
|
1379 |
iServiceHandler->AttachL(interest);
|
|
1380 |
iServiceHandler->ExecuteServiceCmdL(*crit, *inparam, *outparam);
|
|
1381 |
|
|
1382 |
TInt pos = 0;
|
|
1383 |
|
|
1384 |
outparam->FindFirst( pos, KTestInterface );
|
|
1385 |
if(pos != KErrNotFound)
|
|
1386 |
{
|
|
1387 |
interface = (*outparam)[pos].Value().AsInterface();
|
|
1388 |
}
|
|
1389 |
CleanupStack::PopAndDestroy(crit);
|
|
1390 |
CleanupStack::PopAndDestroy(&interest);
|
|
1391 |
|
|
1392 |
outparam->Reset();
|
|
1393 |
inparam->Reset();
|
|
1394 |
|
|
1395 |
AddProvCalendar(inparam, outparam, interface, KCalFileName1);
|
|
1396 |
TUIDSet* uidset1;
|
|
1397 |
TBuf<50> globaluid;
|
|
1398 |
AddProvAppointmentDailyRepeatAndAttendees(inparam, outparam, interface, KCalFileName1 ,uidset1 );
|
|
1399 |
//localuid.Num(TInt64(uidset1->iLocalUID));
|
|
1400 |
globaluid.Copy(uidset1->iGlobalUID->Des());
|
|
1401 |
TLiwGenericParam dsNameParam(KContentType, TLiwVariant(_L("CalendarEntry")));
|
|
1402 |
inparam->AppendL(dsNameParam);
|
|
1403 |
|
|
1404 |
CLiwDefaultMap *filterMap = CLiwDefaultMap::NewL();
|
|
1405 |
TLiwGenericParam filterParam(KFilter, TLiwVariant(filterMap));
|
|
1406 |
inparam->AppendL(filterParam);
|
|
1407 |
filterMap->DecRef();
|
|
1408 |
|
|
1409 |
filterMap->InsertL(KCalendarName,TLiwVariant(_L("C:CalendarFileA")));
|
|
1410 |
filterMap->InsertL(_L8("id"),TLiwVariant(globaluid));
|
|
1411 |
|
|
1412 |
TRAP(err,interface->ExecuteCmdL( _L8("GetList") ,*inparam ,*outparam));
|
|
1413 |
|
|
1414 |
pos = 0 ;
|
|
1415 |
|
|
1416 |
const TLiwGenericParam* finaloutput = outparam->FindFirst( pos,_L8("ReturnValue"));
|
|
1417 |
TInt count = 0;
|
|
1418 |
CLiwMap* map;
|
|
1419 |
TInt retvalue = KErrNone;
|
|
1420 |
if ( finaloutput )
|
|
1421 |
{
|
|
1422 |
CLiwIterable* iterlist = finaloutput->Value().AsIterable();
|
|
1423 |
if(iterlist)
|
|
1424 |
{
|
|
1425 |
TLiwVariant data1;
|
|
1426 |
while(iterlist->NextL(data1) )
|
|
1427 |
{
|
|
1428 |
const CLiwMap* res = data1.AsMap();
|
|
1429 |
if ( res )
|
|
1430 |
{
|
|
1431 |
TLiwVariant data;
|
|
1432 |
if(res->FindL(_L8("Description"), data))
|
|
1433 |
{
|
|
1434 |
TPtrC rep = data.AsDes();
|
|
1435 |
if(rep.CompareF(_L("Meeting")) != 0 )
|
|
1436 |
{
|
|
1437 |
retvalue = KErrGeneral;
|
|
1438 |
break;
|
|
1439 |
}
|
|
1440 |
}
|
|
1441 |
|
|
1442 |
if(res->FindL(_L8("Organizer"), data))
|
|
1443 |
{
|
|
1444 |
const CLiwMap* map = data.AsMap();
|
|
1445 |
TLiwVariant rdata;
|
|
1446 |
if(map->FindL(_L8("CommonName"), rdata))
|
|
1447 |
{
|
|
1448 |
TPtrC cn = rdata.AsDes();
|
|
1449 |
if( cn.CompareF(_L("sapi")) != 0 )
|
|
1450 |
{
|
|
1451 |
retvalue = KErrGeneral;
|
|
1452 |
rdata.Reset();
|
|
1453 |
break;
|
|
1454 |
}
|
|
1455 |
}
|
|
1456 |
if(map->FindL(_L8("Address"), rdata))
|
|
1457 |
{
|
|
1458 |
TPtrC add = rdata.AsDes();
|
|
1459 |
if( add.CompareF(_L("mdc@nokia.com")) != 0 )
|
|
1460 |
{
|
|
1461 |
retvalue = KErrGeneral;
|
|
1462 |
rdata.Reset();
|
|
1463 |
break;
|
|
1464 |
}
|
|
1465 |
}
|
|
1466 |
rdata.Reset();
|
|
1467 |
}
|
|
1468 |
|
|
1469 |
if(res->FindL(_L8("PhoneOwner"), data))
|
|
1470 |
{
|
|
1471 |
TPtrC rep = data.AsDes();
|
|
1472 |
if(rep.CompareF(_L("h2s@nokia.com")) != 0 )
|
|
1473 |
{
|
|
1474 |
retvalue = KErrGeneral;
|
|
1475 |
break;
|
|
1476 |
}
|
|
1477 |
}
|
|
1478 |
|
|
1479 |
if(res->FindL(_L8("Attendees"), data))
|
|
1480 |
{
|
|
1481 |
const CLiwList* list = data.AsList();
|
|
1482 |
if ( list )
|
|
1483 |
{
|
|
1484 |
TInt count = list->Count();
|
|
1485 |
for ( int index = 0; index < count; index++ )
|
|
1486 |
{
|
|
1487 |
TLiwVariant element;
|
|
1488 |
list->AtL(index, element);
|
|
1489 |
const CLiwMap* map = element.AsMap();
|
|
1490 |
TLiwVariant attParam;
|
|
1491 |
if ( map && map->FindL(_L8("Address"), attParam) )
|
|
1492 |
{
|
|
1493 |
TPtrC address = attParam.AsDes();
|
|
1494 |
if( address.CompareF(_L("h2s@nokia.com")) != 0 )
|
|
1495 |
{
|
|
1496 |
retvalue = KErrGeneral;
|
|
1497 |
attParam.Reset();
|
|
1498 |
element.Reset();
|
|
1499 |
break;
|
|
1500 |
}
|
|
1501 |
}
|
|
1502 |
if ( map->FindL( _L8("CommonName"), attParam ) )
|
|
1503 |
{
|
|
1504 |
TPtrC cn = attParam.AsDes();
|
|
1505 |
if( cn.CompareF(_L("sapi")) != 0 )
|
|
1506 |
{
|
|
1507 |
retvalue = KErrGeneral;
|
|
1508 |
attParam.Reset();
|
|
1509 |
element.Reset();
|
|
1510 |
break;
|
|
1511 |
}
|
|
1512 |
}
|
|
1513 |
attParam.Reset();
|
|
1514 |
element.Reset();
|
|
1515 |
}
|
|
1516 |
}
|
|
1517 |
}
|
|
1518 |
|
|
1519 |
data.Reset();
|
|
1520 |
}
|
|
1521 |
}
|
|
1522 |
data1.Reset();
|
|
1523 |
}
|
|
1524 |
}
|
|
1525 |
|
|
1526 |
inparam->Reset();
|
|
1527 |
outparam->Reset();
|
|
1528 |
delete uidset1;
|
|
1529 |
RemoveProvCalendar(inparam, outparam, interface, KCalFileName1);
|
|
1530 |
return retvalue;
|
|
1531 |
}
|