|
1 // Copyright (c) 2005-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 // Contains declaration of CTestCreateCalEntriesStep class, which is used for |
|
15 // creating armed calendar entries |
|
16 // |
|
17 // |
|
18 |
|
19 #ifndef __TEST_CREATE_CAL_ENTRIES_STEP_H__ |
|
20 #define __TEST_CREATE_CAL_ENTRIES_STEP_H__ |
|
21 |
|
22 // User Includes |
|
23 #include "TestBaseStep.h" |
|
24 |
|
25 // System includes |
|
26 #include <calentryview.h> |
|
27 |
|
28 /*@{*/ |
|
29 // Literal constant defined for identifying step name |
|
30 _LIT(KTestCreateCalEntriesStep, "TestCreateCalEntriesStep"); |
|
31 /*@}*/ |
|
32 |
|
33 /*@{*/ |
|
34 // Literal constants defined for error messages |
|
35 _LIT(KCalSessionError, "Error occured while creating cal session: %D"); |
|
36 _LIT(KEntryViewError, "Error occured while creating entry view: %D"); |
|
37 _LIT(KCreateEntriesError, "Error occured while creating entries: %D"); |
|
38 /*@}*/ |
|
39 |
|
40 /*@{*/ |
|
41 // Literal constants defined for constructing sub-section names |
|
42 _LIT(KDot, "."); |
|
43 _LIT(KEntry, "entry"); |
|
44 /*@}*/ |
|
45 |
|
46 /*@{*/ |
|
47 // Literal constants that identify the type of entry in the in file |
|
48 _LIT(KTodo, "todo"); |
|
49 _LIT(KEvent, "event"); |
|
50 _LIT(KReminder, "reminder"); |
|
51 _LIT(KAnniversary, "anniv"); |
|
52 /*@}*/ |
|
53 |
|
54 /** |
|
55 Test step to create a set of armed calendar entries |
|
56 @internalTechnology |
|
57 @test |
|
58 */ |
|
59 class CTestCreateCalEntriesStep : public CTestBaseStep |
|
60 { |
|
61 public: |
|
62 // Construction |
|
63 CTestCreateCalEntriesStep(CTestMultipleAlarmsServer& aTestServer); |
|
64 |
|
65 // TEF pure virtual |
|
66 TVerdict doTestStepL(); |
|
67 |
|
68 protected: |
|
69 void CreateCalEntriesL(); |
|
70 |
|
71 private: |
|
72 void FillCalEntriesFromSubSectionsL(RPointerArray<CCalEntry>& aEntryArray, const TInt& aNumOfEntries); |
|
73 void FillCalEntriesAtWillL(RPointerArray<CCalEntry>& aEntryArray, const TInt& aNumOfEntries); |
|
74 void GetSubSectionName(HBufC*& aSubSectionName, const TInt& aSubSectionNo); |
|
75 TBool GetCalEntryDetails(const TDesC& aSectionName, TPtrC& aTypeOfEntry, TPtrC& aGUId, TPtrC& aAlarmMessage, TInt& aAlarmMinsFromNow); |
|
76 CCalEntry* CreateCalEntryL(const CCalEntry::TType& aTypeOfEntry, const TDesC& aGUId, const TDesC& aAlarmMessage); |
|
77 void SetCalTimesL(CCalEntry*& aEntry, const TTime aNow, const TInt& aAlarmMinsFromNow); |
|
78 CCalAlarm* CreateCalAlarmL(const TDesC& aSectionName, const TInt& aAlarmMinsFromNow); |
|
79 void SetAlarmContentL(const TDesC& aSectionName, CCalAlarm*& aCalAlarm); |
|
80 void DoSetAlarmContentL(const TPtrC& aTypeOfAD, const TDesC& aSectionName, CCalAlarm*& aCalAlarm); |
|
81 void CompareAndPrintResult(const TInt& aTriedNum, const TInt& aActualNum); |
|
82 CCalEntry::TType GetEntryTypeL(const TDesC& aTypeString); |
|
83 |
|
84 private: |
|
85 TCalTime iCalStartTime; |
|
86 TCalTime iCalEndTime; |
|
87 }; |
|
88 |
|
89 #endif // __TEST_CREATE_CAL_ENTRIES_STEP_H__ |