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