|
1 /* |
|
2 * Copyright (c) 2002-2004 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 "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: This file implements class CESMRICalAlarm. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 // Class include. |
|
20 #include "emailtrace.h" |
|
21 #include "cesmricalalarm.h" // CESMRICalAlarm |
|
22 |
|
23 //debug |
|
24 |
|
25 // User includes. |
|
26 #include "esmricalkeywords.h" // Literals |
|
27 |
|
28 /** |
|
29 Static factory construction |
|
30 @return A new CESMRICalAlarm |
|
31 @internalTechnology |
|
32 */ |
|
33 CESMRICalAlarm* CESMRICalAlarm::NewLC(TICalMethod aMethod) |
|
34 { |
|
35 FUNC_LOG; |
|
36 |
|
37 CESMRICalAlarm* self = new (ELeave) CESMRICalAlarm; |
|
38 CleanupStack::PushL(self); |
|
39 self->ConstructL(aMethod); |
|
40 |
|
41 return self; |
|
42 } |
|
43 |
|
44 /** |
|
45 Destructor |
|
46 @internalTechnology |
|
47 */ |
|
48 CESMRICalAlarm::~CESMRICalAlarm() |
|
49 { |
|
50 FUNC_LOG; |
|
51 } |
|
52 |
|
53 /** |
|
54 Constructor |
|
55 @internalTechnology |
|
56 */ |
|
57 CESMRICalAlarm::CESMRICalAlarm() |
|
58 { |
|
59 FUNC_LOG; |
|
60 |
|
61 iComponentType = EICalAlarm; |
|
62 |
|
63 } |
|
64 |
|
65 /** |
|
66 Internal construction |
|
67 @internalTechnology |
|
68 */ |
|
69 void CESMRICalAlarm::ConstructL(TICalMethod aMethod) |
|
70 { |
|
71 FUNC_LOG; |
|
72 |
|
73 iMethod = aMethod; |
|
74 iComponentMethodBitMask = EMaskAlarmAny; |
|
75 |
|
76 } |
|
77 |
|
78 /** |
|
79 Checks that the iCalendar specification allows this calendar component to |
|
80 contain the property aName |
|
81 @param aName the name of the property to validate |
|
82 @return ETrue if the property is valid for this component, otherwise EFalse |
|
83 @internalTechnology |
|
84 */ |
|
85 TBool CESMRICalAlarm::ValidatePropertyImpl(const TDesC& aName) const |
|
86 { |
|
87 FUNC_LOG; |
|
88 |
|
89 if ((aName.CompareF(KICalAction) == 0) || (aName.CompareF(KICalTrigger) == 0) || |
|
90 (aName.CompareF(KICalDuration) == 0) || (aName.CompareF(KICalRepeat) == 0) || |
|
91 (aName.CompareF(KICalDescription) == 0) || (aName.CompareF(KICalSummary) == 0)) |
|
92 { |
|
93 // 1 ACTION |
|
94 // 1 TRIGGER |
|
95 // 0..1 DURATION |
|
96 // 0..1 REPEAT |
|
97 // 0..1 DESCRIPTION |
|
98 // 0..1 SUMMARY |
|
99 return (FindProperty(aName) == NULL); |
|
100 } |
|
101 else if(aName.CompareF(KICalAttendee) == 0 || aName.CompareF(KICalAttach) == 0) |
|
102 { |
|
103 // 0..* ATTENDEE |
|
104 // 0..* ATTACH |
|
105 return ETrue; |
|
106 } |
|
107 |
|
108 if ((aName.Length() >= 2) && (aName.Left(2).CompareF(KICalXProperty) == 0)) |
|
109 { |
|
110 // 0..* X-[anything] |
|
111 return ETrue; |
|
112 } |
|
113 |
|
114 // If we got this far we didn't match any of the possible property names |
|
115 return EFalse; |
|
116 } |
|
117 |
|
118 /** |
|
119 Checks that the iCalendar specification allows this calendar component to |
|
120 contain a nested component of type aType. |
|
121 @param aType the type of component to validate. |
|
122 @return ETrue if the component is a valid child for this component, otherwise |
|
123 EFalse. |
|
124 @internalTechnology |
|
125 */ |
|
126 TBool CESMRICalAlarm::ValidateComponent(TICalComponentType /*aType*/) const |
|
127 { |
|
128 FUNC_LOG; |
|
129 // VALARM cannot contain other components. |
|
130 return EFalse; |
|
131 } |
|
132 |
|
133 // End of File |
|
134 |