00001 /* 00002 * ============================================================================ 00003 * Name : CalenInterimUtils.h 00004 * Part of : Calendar / CalInterimUtils 00005 * 00006 * Description: 00007 * This class contains utility methods related to usage of 00008 * Calendar Interim API. 00009 * 00010 * Version: 00011 * 00012 * Copyright (C) 2005 Nokia Corporation. 00013 * This material, including documentation and any related 00014 * computer programs, is protected by copyright controlled by 00015 * Nokia Corporation. All rights are reserved. Copying, 00016 * including reproducing, storing, adapting or translating, any 00017 * or all of this material requires the prior written consent of 00018 * Nokia Corporation. This material also contains confidential 00019 * information which may not be disclosed to others without the 00020 * prior written consent of Nokia Corporation. 00021 * ============================================================================ 00022 */ 00023 00024 #ifndef __CALENINTERIMUTILS_H__ 00025 #define __CALENINTERIMUTILS_H__ 00026 00027 // INCLUDES 00028 #include <e32base.h> 00029 00030 // FORWARD DECLARATIONS 00031 class CCalEntry; 00032 class CCalAttendee; 00033 class CCalUser; 00034 00035 // CLASS DECLARATION 00036 00042 class CalenInterimUtils 00043 { 00044 public: // New functions 00045 00053 IMPORT_C static void PopulateChildFromParentL( CCalEntry& aChild, 00054 const CCalEntry& aParent ); 00055 00061 IMPORT_C static HBufC8* GlobalUidL(); 00062 00063 private: // New functions 00067 static void PopulateAttendeeListL( CCalEntry& aChild, 00068 const CCalEntry& aParent ); 00069 00070 /* 00071 * Helper which creates a new copy of the given attendee. Item is 00072 * left in the cleanup stack. 00073 * 00074 * @param aSource attendee to copy 00075 * @return attendee, ownership is transferred to caller. 00076 */ 00077 static CCalAttendee* CopyAttendeeLC( const CCalAttendee& aSource ); 00078 00079 /* 00080 * Helper which creates a new copy of the given cal user. Item is 00081 * left in the cleanup stack. 00082 * 00083 * @param aSource user to copy 00084 * @return user, ownership is transferred to caller. 00085 */ 00086 static CCalUser* CopyUserLC( const CCalUser& aSource ); 00087 00093 static void GetImeiL( TDes& aImei ); 00094 00095 private: // Helper functions for GUID generation. 00096 static TInt64 GetTicksFromGregorianCalendarStartL(); 00097 static TInt64 GetImeiAsNodeValueL(); 00098 static HBufC8* DoCreateUidLC(const TUint32& aClockSeq, const TUint64& aTimeStamp, const TUint64& aNodeValue); 00099 static TUint8 GenerateRandomAsciiReadableCharacter(); 00100 static void ReplaceIllegalCharacters( TDes8& aString ); 00101 static TBool IsIllegalCharacter( TUint8& aChar ); 00102 }; 00103 00104 // __CALENINTERIMUTILS_H__ 00105 #endif 00106 00107 // End of File