pimappsupport/vcardandvcal/tsrc/thelpers.h
changeset 0 f979ecb2b13e
equal deleted inserted replaced
-1:000000000000 0:f979ecb2b13e
       
     1 // Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     2 // All rights reserved.
       
     3 // This component and the accompanying materials are made available
       
     4 // under the terms of "Eclipse Public License v1.0"
       
     5 // which accompanies this distribution, and is available
       
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 //
       
    15 
       
    16 #if !defined(__THELPERS_H__)
       
    17 	#define __THELPERS_H__
       
    18 
       
    19 // System includes
       
    20 #include <e32std.h>
       
    21 #include <badesca.h>
       
    22 #include <vprop.h>
       
    23 
       
    24 // Classes referenced
       
    25 class CParserPropertyValueHBufC;
       
    26 class CParserPropertyValueDateTime;
       
    27 class CParserPropertyValueDate;
       
    28 class CParserPropertyValueCDesCArray;
       
    29 class CParserParam;
       
    30 
       
    31 // Constants
       
    32 const TUint KVersitTest2InternalUidForUTF8 = 0x100001;
       
    33 const TUint KVersitTest2InternalUidForUTF7 = 0x100002;
       
    34 
       
    35 
       
    36 //
       
    37 // VTestHelpers (header)
       
    38 //
       
    39 class VTestHelpers
       
    40 	{
       
    41 //
       
    42 public:											// STATIC HELPER FUNCTIONS
       
    43 //
       
    44 	static TInt									MakeRandomNumber(const TInt aLow, const TInt aHigh, TInt64& aSeed);
       
    45 	static void									ConvertUnicodeToNarrowL(const TDesC16& aSource, TDes8& aDest, TUint aCharConvCharSet);
       
    46 	static TBool								DoesParameterAlreadyExist(CArrayPtr<CParserParam>* aArrayOfParams, const TDesC8& aName);
       
    47 	static CParserPropertyValueHBufC*			CreateTextPropertyValueL(const TDesC& aValue);
       
    48 	static CParserPropertyValueDateTime*		CreateDateTimePropertyValueL(const TDateTime& aDateTime);
       
    49 	static CParserPropertyValueDate*			CreateDatePropertyValueL(const TDateTime& aDateTime);
       
    50 	
       
    51 	// Use together...
       
    52 	static void									CreateDescriptorArrayL(const TDesC& aItem, CDesCArray*& aArray, TBool aAddSpace);
       
    53 	static CParserPropertyValueCDesCArray*		CreateArrayPropertyValueL(CDesCArray* aArray);
       
    54 	};
       
    55 
       
    56 
       
    57 
       
    58 //
       
    59 // CComparitorParserProperty (header)
       
    60 //
       
    61 class CComparitorParserProperty : public CParserProperty
       
    62 	{
       
    63 //
       
    64 public:								// ACCESS
       
    65 //
       
    66 	inline CComparitorParserProperty(CParserPropertyValue& aPropertyValue) :CParserProperty(aPropertyValue,NULL) {}
       
    67 	inline CParserPropertyValue*	PropertyValue() const		{ return iPropertyValue;	}
       
    68 	inline HBufC8*					PropertyName() const		{ return iPropertyName;		}
       
    69 	inline CArrayPtr<CParserParam>*	ArrayOfParameters() const	{ return iArrayOfParams;	}
       
    70 	inline TInt						ParameterCount() const		{ return (iArrayOfParams)? iArrayOfParams->Count() : 0;	}
       
    71 
       
    72 //
       
    73 public:								// EQUALITY CHECKS
       
    74 //
       
    75 	TBool							IsEqualL(const CComparitorParserProperty* aProp) const;
       
    76 
       
    77 //
       
    78 private:							// INTERNAL COMPARISON METHODS
       
    79 //
       
    80 	static TBool					PropCDesCArrayIsEqualL(CDesCArray* a1, CDesCArray* a2);
       
    81 	static TBool					PropTimeZoneIsEqualL(TTimeIntervalSeconds a1, TTimeIntervalSeconds a2);
       
    82 	static TBool					PropDaylightIsEqualL(CVersitDaylight* a1, CVersitDaylight* a2);
       
    83 	static TBool					PropDateTimeIsEqualL(TVersitDateTime* a1, TVersitDateTime* a2);
       
    84 	static TBool					PropDateIsEqualL(TVersitDateTime* a1, TVersitDateTime* a2);
       
    85 	static TBool					PropMultiDateTimeIsEqualL(CArrayPtr<TVersitDateTime>* a1, CArrayPtr<TVersitDateTime>* a2);
       
    86 	static TBool					PropIntIsEqualL(TInt a1, TInt a2);
       
    87 	static TBool					PropHBufCIsEqualL(const TDesC& a1, const TDesC& a2);
       
    88 	static TBool					DateEqual(const TDateTime& a1, const TDateTime& a2);
       
    89 	static TBool					DateTimeIsEqual(const TDateTime& a1, const TDateTime& a2);
       
    90 	};
       
    91 
       
    92 
       
    93 
       
    94 //
       
    95 // CParserPropertyWithoutCharsetTags (header)
       
    96 //
       
    97 class CParserPropertyWithoutCharsetTags : public CParserProperty
       
    98 	{
       
    99 	inline CParserPropertyWithoutCharsetTags(CParserPropertyValue& aPropertyValue) :CParserProperty(aPropertyValue,NULL) {}
       
   100 //
       
   101 public:								// ACCESS
       
   102 //
       
   103 	void							RemoveAllCharsetTagsFromParametersL();
       
   104 	};
       
   105 
       
   106 #endif