calendarengines/versit2/src/ICalBase.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:   Class implementing the definition of CICalBase. This class is base class from which ICal class has been derived.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 // Class include.
       
    21 #include "ICalBase.h"	// CICalBase
       
    22 
       
    23 //debug
       
    24 #include "calendarengines_debug.h"
       
    25 
       
    26 // User includes.
       
    27 #include "ICalComponent.h"			// CICalComponent
       
    28 #include "ICalContentLineReader.h"	// CICalContentLineReader
       
    29 #include "ICalContentLineWriter.h"	// CICalContentLineWriter
       
    30 #include "ICalErrors.h"				// Error codes
       
    31 #include "ICalKeyWords.h"			// Literals
       
    32 #include "ICalProperty.h"			// CICalProperty
       
    33 #include "ICalUtil.h"				// NICalUtil
       
    34 #include "ICalValue.h"				// CICalValue
       
    35 
       
    36 using namespace NICalUtil;
       
    37 
       
    38 /**
       
    39 Destructor.
       
    40 @internalTechnology
       
    41 */
       
    42 CICalBase::~CICalBase()
       
    43 	{
       
    44 	TRACE_ENTRY_POINT;
       
    45 	
       
    46 	iComponents.ResetAndDestroy();
       
    47 	iProperties.ResetAndDestroy();
       
    48 	
       
    49 	TRACE_EXIT_POINT;
       
    50 	}
       
    51 	
       
    52 /**
       
    53 Creates a new property with a value from the given parameters, adds it to 
       
    54 this object and returns a modifiable reference to it.
       
    55 @param aName Name of the property to add.
       
    56 @param aValue Value of the property to add.
       
    57 @return A reference to a new property owned by this object.
       
    58 @leave Leaves with KErrUnsupportedProperty if the given property is not valid.
       
    59 for this component.
       
    60 @publishedPartner
       
    61 */
       
    62 EXPORT_C CICalProperty& CICalBase::AddPropertyL(const TDesC& aName, const TDesC& aValue)
       
    63 	{
       
    64 	TRACE_ENTRY_POINT;
       
    65 	
       
    66 	CICalProperty* property = CreatePropertyL(aName);	// Not taking ownership.
       
    67 	
       
    68 	if (!property)
       
    69 		{
       
    70 		User::Leave(KErrUnsupportedProperty);	
       
    71 		}
       
    72 	
       
    73 	property->AddValueL(aValue);
       
    74 	
       
    75 	TRACE_EXIT_POINT;
       
    76 	return *property;
       
    77 	}
       
    78 
       
    79 /**
       
    80 Creates a new property with a value and adds it to this object, returning a
       
    81 reference to it. Ownership of aValue is transferred and it will be deleted if
       
    82 this function leaves.
       
    83 @leave Leaves with KErrPropertyHasNoValue if aValue is Null.
       
    84 @leave Leaves with KErrUnsupportedProperty if the given property is not valid.
       
    85 @return A new property
       
    86 @publishedPartner
       
    87 */
       
    88 EXPORT_C CICalProperty& CICalBase::AddPropertyL(const TDesC& aName, CICalValue* aValue)
       
    89 	{
       
    90 	TRACE_ENTRY_POINT;
       
    91 	
       
    92 	if (!aValue)
       
    93 		{
       
    94 		User::Leave(KErrPropertyHasNoValue);
       
    95 		}
       
    96 		
       
    97 	CleanupStack::PushL(aValue);
       
    98 	CICalProperty* property = CreatePropertyL(aName);	// Not taking ownership.
       
    99 	
       
   100 	if (!property)
       
   101 		{
       
   102 		User::Leave(KErrUnsupportedProperty);	
       
   103 		}
       
   104 	
       
   105 	CleanupStack::Pop(aValue);
       
   106 	property->AddValueL(aValue);
       
   107 	
       
   108 	TRACE_EXIT_POINT;
       
   109 	return *property;
       
   110 	}
       
   111 
       
   112 /**
       
   113 Creates a new component, adds it to this object, and returns a modifiable
       
   114 reference to it.
       
   115 @param aType The type of component to be created.
       
   116 @return A new component
       
   117 @leave Leaves with KErrUnsupportedComponent if the given component is not a
       
   118 valid subcomponent for this object.
       
   119 @publishedPartner
       
   120 */
       
   121 EXPORT_C CICalComponent& CICalBase::AddComponentL(TICalComponentType aType)
       
   122 	{
       
   123 	TRACE_ENTRY_POINT;
       
   124 	
       
   125 	CICalComponent* component = CreateComponentL(aType);	// Not taking ownership.
       
   126 	
       
   127 	if (!component)
       
   128 		{
       
   129 		User::Leave(KErrUnsupportedComponent);
       
   130 		}
       
   131 	TRACE_EXIT_POINT;	
       
   132 	return *component;
       
   133 	}
       
   134 	
       
   135 /**
       
   136 Access function for the component array.
       
   137 @return The array of components as a constant reference.
       
   138 @publishedPartner
       
   139 */
       
   140 EXPORT_C const RPointerArray<CICalComponent>& CICalBase::Components() const
       
   141 	{
       
   142 	TRACE_ENTRY_POINT;
       
   143 	TRACE_EXIT_POINT;
       
   144 	return iComponents; 
       
   145 	}
       
   146 
       
   147 /**
       
   148 Access function for the property array.
       
   149 @return The array of properties as a constant reference.
       
   150 @publishedPartner
       
   151 */
       
   152 EXPORT_C const RPointerArray<CICalProperty>& CICalBase::Properties() const
       
   153 	{
       
   154 	TRACE_ENTRY_POINT;
       
   155 	TRACE_EXIT_POINT;
       
   156 	return iProperties;
       
   157 	}
       
   158 
       
   159 /**
       
   160 Returns the descriptor form of this component type.
       
   161 @return The descriptor form of this component type.
       
   162 @publishedPartner
       
   163 */
       
   164 EXPORT_C const TDesC& CICalBase::TypeStringL() const
       
   165 	{
       
   166 	TRACE_ENTRY_POINT;
       
   167 	TRACE_EXIT_POINT;
       
   168 	return TypeStringL(iComponentType);
       
   169 	}
       
   170 	
       
   171 /**
       
   172 Access method returning the concrete type as an enumeration.
       
   173 @return The type of the concrete derived class.
       
   174 @publishedPartner
       
   175 */
       
   176 EXPORT_C CICalBase::TICalComponentType CICalBase::Type() const
       
   177 	{
       
   178 	TRACE_ENTRY_POINT;
       
   179 	TRACE_EXIT_POINT;
       
   180 	return iComponentType;
       
   181 	}
       
   182 	
       
   183 /**
       
   184 Checks for a component already existing in current object's sub-components
       
   185 @param aType The type of the component to check.
       
   186 @return ETrue if the property does exist, EFalse otherwise
       
   187 @publishedPartner
       
   188 */
       
   189 EXPORT_C TBool CICalBase::ComponentExists(TICalComponentType aType) const
       
   190 	{
       
   191 	const TInt count = iComponents.Count();
       
   192 	
       
   193 	for (TInt i = 0; i < count; i++)
       
   194 		{
       
   195 		if (iComponents[i]->Type() == aType)
       
   196 			{
       
   197 			TRACE_EXIT_POINT;
       
   198 			return ETrue;
       
   199 			}
       
   200 		}
       
   201 	
       
   202 	TRACE_EXIT_POINT;	
       
   203 	return EFalse;
       
   204 	}
       
   205 
       
   206 /**
       
   207 Finds the first property with a particular name and returns a pointer to it.
       
   208 Ownership is not passed out.
       
   209 @param aName The name of the property to search for.
       
   210 @return A pointer to the property, or NULL.
       
   211 @publishedPartner
       
   212 */
       
   213 EXPORT_C const CICalProperty* CICalBase::FindProperty(const TDesC& aName) const
       
   214 	{
       
   215 	TRACE_ENTRY_POINT;
       
   216 	
       
   217 	const TInt count = iProperties.Count();
       
   218 	
       
   219 	for (TInt p = 0; p < count; ++p)
       
   220 		{
       
   221 		if (iProperties[p]->Type().CompareF(aName) == 0)
       
   222 			{
       
   223 			TRACE_EXIT_POINT;
       
   224 			return iProperties[p];
       
   225 			}
       
   226 		}
       
   227 	
       
   228 	TRACE_EXIT_POINT;
       
   229 	return NULL;
       
   230 	}
       
   231 
       
   232 /**
       
   233 Takes a line reader and reads lines from it until the end of the component is
       
   234 located. Any other END:, or an end of file, are treated as errors.
       
   235 @param aReader The line reader to read from.
       
   236 @leave Leaves with KErrCorrupt if the component is corrupt.
       
   237 @internalTechnology
       
   238 */
       
   239 void CICalBase::InternalizeL(CICalContentLineReader& aReader)
       
   240 	{
       
   241 	TRACE_ENTRY_POINT;
       
   242 	
       
   243 	TPtrC line;
       
   244 	TPtrC name;
       
   245 	TPtrC parameters;
       
   246 	TPtrC values;
       
   247 	
       
   248 	TInt error(aReader.GetNextContentLine(line));
       
   249 
       
   250 	while (error == KErrNone)
       
   251 		{
       
   252 		if (ExtractSectionsL(line, name, parameters, values) == KErrNone)
       
   253 			{	
       
   254 			if (name.CompareF(KICalBegin) == 0)
       
   255 				{
       
   256 				// This is the start of a component:
       
   257 				
       
   258 				TICalComponentType type(TypeFromNameL(values));
       
   259 				
       
   260 				if (type == EICalInvalid)
       
   261 					{
       
   262 					aReader.SkipComponentL(values);
       
   263 					}
       
   264 				else
       
   265 					{
       
   266 					CICalComponent* component = CreateComponentL(type);	// Not taking ownership.
       
   267 					
       
   268 					if (component)
       
   269 						{
       
   270 						component->InternalizeL(aReader);	
       
   271 						}
       
   272 					else
       
   273 						{
       
   274 						// This component cannot be nested - ignore it
       
   275 						aReader.SkipComponentL(values);
       
   276 						}
       
   277 					}
       
   278 				}
       
   279 			else if (name.CompareF(KICalEnd) == 0)
       
   280 				{
       
   281 				// This is the end of a component.
       
   282 				if (values.CompareF(TypeStringL(iComponentType)) != 0)
       
   283 					{
       
   284 					User::Leave(KErrCorrupt);	// This is the end of a different component!
       
   285 					}
       
   286 				break;
       
   287 				}
       
   288 			else
       
   289 				{
       
   290 				// This is a property
       
   291 				
       
   292 				// Only allow properties with at least one value - if there is no value then
       
   293 				// ignore the property and continue.
       
   294 				if (values.Length() > 0)
       
   295 					{	
       
   296 					CICalProperty* property = CreatePropertyL(name); // Not taking ownership
       
   297 					if (property)
       
   298 						{
       
   299 						if (name.CompareF(KICalRRule) == 0)
       
   300 							{
       
   301 							// This is a special case - commas have a different meaning.
       
   302 							ExtractParametersL(parameters, *property);
       
   303 							property->AddValueL(values);
       
   304 							}
       
   305 						else if (name.CompareF(KICalCategories) == 0)
       
   306 							{
       
   307 							// Outlook escapes the comma separators between categories.
       
   308 							// This is not part of the iCal specification.
       
   309 							ExtractParametersL(parameters, *property);
       
   310 							ExtractPropertyValuesL(values, *property, EEscapeValueSeparators);
       
   311 							}
       
   312 						else if (name.CompareF(KICalTzid) == 0)
       
   313 							{
       
   314 							// Outlook doesn't escape commas in TZID fields.
       
   315 							// This is not part of the iCal specification.
       
   316 							ExtractParametersL(parameters, *property);
       
   317 							property->AddValueL(values);
       
   318 							}
       
   319 						else
       
   320 							{
       
   321 							ExtractPropertyL(parameters, values, *property);
       
   322 							}
       
   323 						
       
   324 						// Remove property if it doesn't have a value.
       
   325 						if (property->Values().Count() == 0)
       
   326 							{
       
   327 							TInt index(iProperties.Find(property));
       
   328 							
       
   329 							if (index >= 0)
       
   330 								{
       
   331 								iProperties.Remove(index);
       
   332 								}
       
   333 								
       
   334 							delete property;
       
   335 							}
       
   336 						else
       
   337 							{
       
   338 							// If the property is a method, remember it.
       
   339 							if (name.CompareF(KICalMethod) == 0)
       
   340 								{
       
   341 								TPtrC val;
       
   342 								val.Set(property->Values()[0]->TextL());
       
   343 								if (val.CompareF(KICalPublish) == 0)
       
   344 									{
       
   345 									iMethod = CICalBase::EMethodPublish;
       
   346 									}
       
   347 								else if (val.CompareF(KICalRequest) == 0)
       
   348 									{
       
   349 									iMethod = CICalBase::EMethodRequest;
       
   350 									}
       
   351 								else if (val.CompareF(KICalReply) == 0)
       
   352 									{
       
   353 									iMethod = CICalBase::EMethodReply;
       
   354 									}
       
   355 								else if (val.CompareF(KICalAdd) == 0)
       
   356 									{
       
   357 									iMethod = CICalBase::EMethodAdd;
       
   358 									}
       
   359 								else if (val.CompareF(KICalCancel) == 0)
       
   360 									{
       
   361 									iMethod = CICalBase::EMethodCancel;
       
   362 									}
       
   363 								else if (val.CompareF(KICalRefresh) == 0)
       
   364 									{
       
   365 									iMethod = CICalBase::EMethodRefresh;
       
   366 									}
       
   367 								else if (val.CompareF(KICalCounter) == 0)
       
   368 									{
       
   369 									iMethod = CICalBase::EMethodCounter;
       
   370 									}
       
   371 								else if (val.CompareF(KICalDeclineCounter) == 0)
       
   372 									{
       
   373 									iMethod = CICalBase::EMethodDeclineCounter;
       
   374 									}
       
   375 								else
       
   376 									{
       
   377 									User::Leave(KErrCorrupt);
       
   378 									}
       
   379 								}
       
   380 							}
       
   381 						}
       
   382 					}
       
   383 				}
       
   384 			}
       
   385 			
       
   386 		error = aReader.GetNextContentLine(line);
       
   387 		}
       
   388 		
       
   389 	if ((error != KErrNone) && (error != KErrEof))
       
   390 		{
       
   391 		User::Leave(error);
       
   392 		}
       
   393 		
       
   394     TRACE_EXIT_POINT;
       
   395 	}
       
   396 
       
   397 /**
       
   398 Takes a line writer and exports this component, including all owned properties
       
   399 and sub components, to it.
       
   400 @param aWriter the writer to export to.
       
   401 @internalTechnology
       
   402 */
       
   403 void CICalBase::ExternalizeL(CICalContentLineWriter& aWriter) const
       
   404 	{
       
   405 	TRACE_ENTRY_POINT;
       
   406 	
       
   407 	aWriter.AppendL(KICalBegin());
       
   408 	aWriter.AppendL(KICalColon());
       
   409 	aWriter.AppendL(TypeStringL(iComponentType));
       
   410 	
       
   411 	aWriter.WriteContentLineL();
       
   412 	
       
   413 	// Externalize any component properties:
       
   414 	TInt count(iProperties.Count());
       
   415 	
       
   416 	for (TInt prop = 0; prop < count; ++prop)
       
   417 		{
       
   418 		// Only externalise properties with a value.
       
   419 		if (iProperties[prop]->Values().Count() > 0)
       
   420 			{
       
   421 			iProperties[prop]->ExternalizeL(aWriter);
       
   422 			}
       
   423 		}
       
   424 
       
   425 	// Externalize any child components:	
       
   426 	count = iComponents.Count();
       
   427 	for (TInt comp = 0; comp < count; ++comp)
       
   428 		{
       
   429 		iComponents[comp]->ExternalizeL(aWriter);
       
   430 		}
       
   431 
       
   432 	aWriter.AppendL(KICalEnd());
       
   433 	aWriter.AppendL(KICalColon());
       
   434 	aWriter.AppendL(TypeStringL(iComponentType));
       
   435 	aWriter.WriteContentLineL();
       
   436 	
       
   437 	TRACE_EXIT_POINT;
       
   438 	}
       
   439 
       
   440 /**
       
   441 Converts between a TICalComponentType and the type as a descriptor. 
       
   442 @param aName The type as a descriptor.
       
   443 @return The type as an enumeration.
       
   444 @leave KErrCorrupt if this is not a valid type.
       
   445 @internalTechnology
       
   446 */
       
   447 CICalBase::TICalComponentType CICalBase::TypeFromNameL(const TDesC& aName)
       
   448 	{
       
   449 	TRACE_ENTRY_POINT;
       
   450 	
       
   451 	TICalComponentType type(EICalInvalid);
       
   452 
       
   453 	if (aName.CompareF(KICalVCalendar) == 0)
       
   454 		{
       
   455 		type = EICalCalendar;
       
   456 		}
       
   457 	else if (aName.CompareF(KICalEvent) == 0)
       
   458 		{
       
   459 		type = EICalEvent;
       
   460 		}
       
   461 	else if (aName.CompareF(KICalTodo) == 0)
       
   462 		{
       
   463 		type = EICalTodo;
       
   464 		}
       
   465 	else if (aName.CompareF(KICalJournal) == 0)
       
   466 		{
       
   467 		type = EICalJournal;
       
   468 		}
       
   469 	else if (aName.CompareF(KICalAlarm) == 0)
       
   470 		{
       
   471 		type = EICalAlarm;
       
   472 		}
       
   473 	else if (aName.CompareF(KICalTimeZone) == 0)
       
   474 		{
       
   475 		type = EICalTimeZone;
       
   476 		}
       
   477 	else if (aName.CompareF(KICalFreeBusy) == 0)
       
   478 		{
       
   479 		type = EICalFreeBusy;
       
   480 		}
       
   481 	else if (aName.CompareF(KICalStandard) == 0)
       
   482 		{
       
   483 		type = EICalStandard;
       
   484 		}
       
   485 	else if (aName.CompareF(KICalDaylight) == 0)
       
   486 		{
       
   487 		type = EICalDaylight;
       
   488 		}
       
   489 	else
       
   490 		{
       
   491 		type = EICalInvalid;
       
   492 		}
       
   493 	
       
   494 	TRACE_EXIT_POINT;
       
   495 	return type;
       
   496 	}
       
   497 	
       
   498 /**
       
   499 Constructor
       
   500 @internalTechnology
       
   501 */
       
   502 CICalBase::CICalBase()
       
   503 	{
       
   504 	TRACE_ENTRY_POINT;
       
   505 	TRACE_EXIT_POINT;
       
   506 	}
       
   507 	
       
   508 /**
       
   509 Converts between a TICalComponentType and the type as a descriptor.
       
   510 @param aType The type as an enumeration.
       
   511 @return The type as a descriptor.
       
   512 @leave KErrCorrupt if this is not a valid type.
       
   513 @internalTechnology
       
   514 */
       
   515 const TDesC& CICalBase::TypeStringL(TICalComponentType aType) const
       
   516 	{
       
   517 	TRACE_ENTRY_POINT;
       
   518 	
       
   519 	switch (aType)
       
   520 		{
       
   521 		case EICalCalendar:
       
   522 		    TRACE_EXIT_POINT;
       
   523 			return KICalVCalendar();
       
   524 		case EICalEvent:
       
   525 		    TRACE_EXIT_POINT;
       
   526 			return KICalEvent();
       
   527 		case EICalJournal:
       
   528 		    TRACE_EXIT_POINT;
       
   529 			return KICalJournal();
       
   530 		case EICalAlarm:
       
   531 		    TRACE_EXIT_POINT;
       
   532 			return KICalAlarm();
       
   533 		case EICalFreeBusy:
       
   534 		    TRACE_EXIT_POINT;
       
   535 			return KICalFreeBusy();
       
   536 		case EICalTodo:
       
   537 		    TRACE_EXIT_POINT;
       
   538 			return KICalTodo();
       
   539 		case EICalTimeZone:
       
   540 		    TRACE_EXIT_POINT;
       
   541 			return KICalTimeZone();
       
   542 		case EICalStandard:
       
   543 		    TRACE_EXIT_POINT;
       
   544 			return KICalStandard();
       
   545 		case EICalDaylight:
       
   546 		    TRACE_EXIT_POINT;
       
   547 			return KICalDaylight();
       
   548 		case EICalInvalid:
       
   549 			// Fall through...
       
   550 		default:
       
   551 			User::Leave(KErrCorrupt);
       
   552 			break;	
       
   553 		};
       
   554 
       
   555     TRACE_EXIT_POINT;		
       
   556 	return KNullDesC;	// Never reached.
       
   557 	}
       
   558 
       
   559 /**
       
   560 Private implementation of AddComponentL(), used directly during InternalizeL().
       
   561 Checks that the given component can be nested within this component. The returned
       
   562 pointer will be NULL if it is not supported - the calling function does NOT take
       
   563 ownership of the returned pointer.
       
   564 @param aType The type of component to be created.
       
   565 @return pointer to newly added component. This will be NULL if the property is
       
   566 not supported.
       
   567 @leave Leaves if there is an error adding a new component.
       
   568 @internalTechnology
       
   569 */
       
   570 CICalComponent* CICalBase::CreateComponentL(TICalComponentType aType)
       
   571 	{
       
   572 	TRACE_ENTRY_POINT;
       
   573 	
       
   574 	CICalComponent* component = NULL;
       
   575 	
       
   576 	if (ValidateComponent(aType))
       
   577 		{
       
   578 		component = CICalComponent::CreateICalComponentLC(aType, iMethod);
       
   579 		User::LeaveIfError(iComponents.Append(component));
       
   580 		CleanupStack::Pop(component);
       
   581 		}
       
   582 	
       
   583 	TRACE_EXIT_POINT;	
       
   584 	return component;	
       
   585 	}
       
   586 	
       
   587 /**
       
   588 Private implementation of AddPropertyL(), used directly during InternalizeL().
       
   589 Checks that the given property is supported by this component. The returned
       
   590 pointer will be NULL if it is not supported - the calling function does NOT
       
   591 take ownership of the returned pointer.
       
   592 @param aName Name of the property to add.
       
   593 @return pointer to newly added property. This will be NULL if the property is
       
   594 not supported.
       
   595 @leave Leaves if there is an error adding a new property.
       
   596 @internalTechnology
       
   597 */
       
   598 CICalProperty* CICalBase::CreatePropertyL(const TDesC& aName)
       
   599 	{
       
   600 	TRACE_ENTRY_POINT;
       
   601 	
       
   602 	CICalProperty* property = NULL;
       
   603 	
       
   604 	if (ValidateProperty(aName))
       
   605 		{
       
   606 		property = CICalProperty::NewLC(aName);
       
   607 		User::LeaveIfError(iProperties.Append(property));
       
   608 		CleanupStack::Pop(property);
       
   609 		}
       
   610 	
       
   611 	TRACE_EXIT_POINT;	
       
   612 	return property;
       
   613 	}
       
   614 
       
   615 TBool CICalBase::ValidateProperty(const TDesC& aName) const
       
   616 	{
       
   617 	TRACE_ENTRY_POINT;
       
   618 	
       
   619 	if (
       
   620 	//Not checking properties in these components here...
       
   621 	(iComponentType == EICalCalendar) || (iComponentType == EICalAlarm) || 
       
   622 	(iComponentType == EICalTimeZone) || (iComponentType == EICalDaylight) || 
       
   623 	(iComponentType == EICalStandard) || (iComponentType == EICalJournal) ||
       
   624 	(iComponentType == EICalEvent) || (iComponentType == EICalTodo) ||
       
   625 	
       
   626 	//If no METHOD property exists, then RFC2446 does not apply...
       
   627 	(iComponentMethodBitMask & EMaskEventNone)    ||
       
   628 	(iComponentMethodBitMask & EMaskTodoNone)     ||
       
   629 	(iComponentMethodBitMask & EMaskJournalNone)  ||
       
   630 	(iComponentMethodBitMask & EMaskFreeBusyNone) ||
       
   631 	
       
   632 	//Validate the property against RFC2446	
       
   633 	((iComponentMethodBitMask & EICalAttendeeFlags) && (aName.CompareF(KICalAttendee) == 0)) ||
       
   634 	((iComponentMethodBitMask & EICalDtStampFlags) && (aName.CompareF(KICalDtstamp) == 0)) ||
       
   635 	((iComponentMethodBitMask & EICalDtStartFlags) && (aName.CompareF(KICalDtstart) == 0)) ||
       
   636 	((iComponentMethodBitMask & EICalOrganizerFlags) && (aName.CompareF(KICalOrganizer) == 0)) ||
       
   637 	((iComponentMethodBitMask & EICalSummaryFlags) && (aName.CompareF(KICalSummary) == 0)) ||
       
   638 	((iComponentMethodBitMask & EICalUIDFlags) && (aName.CompareF(KICalUid) == 0)) ||
       
   639 	((iComponentMethodBitMask & EICalRecurrenceIdFlags) && (aName.CompareF(KICalRecurrenceId) == 0)) ||
       
   640 	((iComponentMethodBitMask & EICalSequenceFlags) && (aName.CompareF(KICalSequence) == 0)) ||
       
   641 	((iComponentMethodBitMask & EICalAttachFlags) && (aName.CompareF(KICalAttach) == 0)) ||
       
   642 	((iComponentMethodBitMask & EICalCategoriesFlags) && (aName.CompareF(KICalCategories) == 0)) ||
       
   643 	((iComponentMethodBitMask & EICalClassFlags) && (aName.CompareF(KICalClass) == 0)) ||
       
   644 	((iComponentMethodBitMask & EICalCommentFlags) && (aName.CompareF(KICalComment) == 0)) ||
       
   645 	((iComponentMethodBitMask & EICalContactFlags) && (aName.CompareF(KICalContact) == 0)) ||
       
   646 	((iComponentMethodBitMask & EICalCreatedFlags) && (aName.CompareF(KICalCreated) == 0)) ||
       
   647 	((iComponentMethodBitMask & EICalDescriptionFlags) && (aName.CompareF(KICalDescription) == 0)) ||
       
   648 	((iComponentMethodBitMask & EICalDtEndFlags) && (aName.CompareF(KICalDtend) == 0)) ||
       
   649 	((iComponentMethodBitMask & EICalDurationFlags) && (aName.CompareF(KICalDuration) == 0)) ||
       
   650 	((iComponentMethodBitMask & EICalExDateFlags) && (aName.CompareF(KICalExdate) == 0)) ||
       
   651 	((iComponentMethodBitMask & EICalExRuleFlags) && (aName.CompareF(KICalExrule) == 0)) ||
       
   652 	((iComponentMethodBitMask & EICalGeoFlags) && (aName.CompareF(KICalGeo) == 0)) ||
       
   653 	((iComponentMethodBitMask & EICalLastModifiedFlags) && (aName.CompareF(KICalLastmodified) == 0)) ||
       
   654 	((iComponentMethodBitMask & EICalLocationFlags) && (aName.CompareF(KICalLocation) == 0)) ||
       
   655 	((iComponentMethodBitMask & EICalPriorityFlags) && (aName.CompareF(KICalPriority) == 0)) ||
       
   656 	((iComponentMethodBitMask & EICalRDateFlags) && (aName.CompareF(KICalRdate) == 0)) ||
       
   657 	((iComponentMethodBitMask & EICalRelatedToFlags) && (aName.CompareF(KICalRelatedto) == 0)) ||
       
   658 	((iComponentMethodBitMask & EICalRequestStatusFlags) && (aName.CompareF(KICalRequeststatus) == 0)) ||
       
   659 	((iComponentMethodBitMask & EICalResourcesFlags) && (aName.CompareF(KICalResources) == 0)) ||
       
   660 	((iComponentMethodBitMask & EICalRRuleFlags) && (aName.CompareF(KICalRRule) == 0)) ||
       
   661 	((iComponentMethodBitMask & EICalStatusFlags) && (aName.CompareF(KICalStatus) == 0)) ||
       
   662 	((iComponentMethodBitMask & EICalTranspFlags) && (aName.CompareF(KICalTransp) == 0)) ||
       
   663 	((iComponentMethodBitMask & EICalUrlFlags) && (aName.CompareF(KICalUrl) == 0)) ||
       
   664 	((iComponentMethodBitMask & EICalDueFlags) && (aName.CompareF(KICalDue) == 0)) ||
       
   665 	((iComponentMethodBitMask & EICalPercentCompleteFlags) && (aName.CompareF(KICalPercentcomplete) == 0)) ||
       
   666 	((iComponentMethodBitMask & EICalFreeBusyFlags) && (aName.CompareF(KICalFreebusy) == 0))
       
   667 	)
       
   668 		{
       
   669 		TRACE_EXIT_POINT;
       
   670 		return ValidatePropertyImpl(aName);
       
   671 		}
       
   672 	
       
   673 	//Allow all X-Properties
       
   674 	else if ((aName.Length() >= 2) && (aName.Left(2).CompareF(KICalXProperty) == 0))
       
   675 		{
       
   676 		TRACE_EXIT_POINT;
       
   677 		return ETrue;
       
   678 		}
       
   679 		
       
   680 	TRACE_EXIT_POINT;
       
   681 	return EFalse;
       
   682 	}
       
   683 
       
   684 // End of File
       
   685