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