|
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 CESMRICalTimeZone. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 // Class include. |
|
20 #include "emailtrace.h" |
|
21 #include "cesmricaltimezone.h" // CESMRICalTimeZone |
|
22 |
|
23 //debug |
|
24 |
|
25 // User includes. |
|
26 #include "esmricalkeywords.h" // Literals |
|
27 |
|
28 /** |
|
29 Static factory construction |
|
30 @return A new CESMRICalTimeZone |
|
31 @internalTechnology |
|
32 */ |
|
33 CESMRICalTimeZone* CESMRICalTimeZone::NewLC(TICalMethod aMethod) |
|
34 { |
|
35 FUNC_LOG; |
|
36 |
|
37 CESMRICalTimeZone* self = new (ELeave) CESMRICalTimeZone; |
|
38 CleanupStack::PushL(self); |
|
39 self->ConstructL(aMethod); |
|
40 |
|
41 return self; |
|
42 } |
|
43 |
|
44 /** |
|
45 Destructor |
|
46 @internalTechnology |
|
47 */ |
|
48 CESMRICalTimeZone::~CESMRICalTimeZone() |
|
49 { |
|
50 FUNC_LOG; |
|
51 } |
|
52 |
|
53 /** |
|
54 Constructor |
|
55 @internalTechnology |
|
56 */ |
|
57 CESMRICalTimeZone::CESMRICalTimeZone() |
|
58 { |
|
59 FUNC_LOG; |
|
60 |
|
61 iComponentType = EICalTimeZone; |
|
62 iComponentMethodBitMask = EMaskTimezoneAny; |
|
63 |
|
64 } |
|
65 |
|
66 /** |
|
67 Internal construction |
|
68 @internalTechnology |
|
69 */ |
|
70 void CESMRICalTimeZone::ConstructL(TICalMethod aMethod) |
|
71 { |
|
72 FUNC_LOG; |
|
73 |
|
74 iMethod = aMethod; |
|
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 CESMRICalTimeZone::ValidatePropertyImpl(const TDesC& aName) const |
|
86 { |
|
87 FUNC_LOG; |
|
88 |
|
89 if ((aName.CompareF(KICalTzid) == 0) || (aName.CompareF(KICalLastmodified) == 0) || (aName.CompareF(KICalTzurl) == 0)) |
|
90 { |
|
91 // 1 TZID |
|
92 // 0..1 LAST-MOD |
|
93 // 0..1 TZURL |
|
94 return (FindProperty(aName) == NULL); |
|
95 } |
|
96 |
|
97 if ((aName.Length() >= 2) && (aName.Left(2).CompareF(KICalXProperty) == 0)) |
|
98 { |
|
99 // 0..* X-[anything] |
|
100 return ETrue; |
|
101 } |
|
102 |
|
103 // If we got this far we didn't match any of the possible property names |
|
104 return EFalse; |
|
105 } |
|
106 |
|
107 /** |
|
108 Checks that the iCalendar specification allows this calendar component to |
|
109 contain a nested component of type aType. |
|
110 @param aType the type of component to validate. |
|
111 @return ETrue if the component is a valid child for this component, otherwise |
|
112 EFalse. |
|
113 @internalTechnology |
|
114 */ |
|
115 TBool CESMRICalTimeZone::ValidateComponent(TICalComponentType aType) const |
|
116 { |
|
117 FUNC_LOG; |
|
118 // VTIMEZONE can only contain STANDARD or DAYLIGHT components. |
|
119 return ((aType == EICalDaylight) || (aType == EICalStandard)); |
|
120 } |
|
121 |
|
122 // End of File |
|
123 |