pimappservices/calendar/shared/src/agmentry.cpp
branchRCL_3
changeset 31 97232defd20e
parent 30 bd7edf625bdd
equal deleted inserted replaced
30:bd7edf625bdd 31:97232defd20e
    27 #include <calentry.h>
    27 #include <calentry.h>
    28 //#include "calentryimpl.h"
    28 //#include "calentryimpl.h"
    29 #include <e32math.h>
    29 #include <e32math.h>
    30 
    30 
    31 #include <asshddefs.h>
    31 #include <asshddefs.h>
    32 
    32 #define KUserDataInt 4 
    33 
    33 
    34 //---------------------------------- CAgnEntry ------------------------------------------
    34 //---------------------------------- CAgnEntry ------------------------------------------
    35 
    35 
    36 EXPORT_C CAgnEntry* CAgnEntry::NewL(CCalEntry::TType aType)
    36 EXPORT_C CAgnEntry* CAgnEntry::NewL(CCalEntry::TType aType)
    37 	{
    37 	{
   409 	if ( Location() != aEntry.Location() )
   409 	if ( Location() != aEntry.Location() )
   410 		{
   410 		{
   411 		return EFalse;
   411 		return EFalse;
   412 		}
   412 		}
   413 	
   413 	
       
   414     if ( UserDataInt() != aEntry.UserDataInt() )     
       
   415         {       
       
   416         return EFalse;       
       
   417         }   
       
   418     
   414 	return ETrue;
   419 	return ETrue;
   415 	}
   420 	}
   416 
   421 
   417 
   422 
   418 EXPORT_C const TDesC& CAgnEntry::AlarmSoundName() const
   423 EXPORT_C const TDesC& CAgnEntry::AlarmSoundName() const
   685 			}
   690 			}
   686 		}
   691 		}
   687 
   692 
   688     // Set the user integer of the stream.
   693     // Set the user integer of the stream.
   689 	aStream.WriteInt32L( UserInt() );
   694 	aStream.WriteInt32L( UserInt() );
   690 	
   695 
   691 	// future DC proofing
   696     TInt skipCount( 0 );
   692 	aStream.WriteUint32L(0); // number of bytes until end of entry
   697     //skip count(4) for UserDataInt is added
       
   698     //to read those many bytes after fixed length of agmentry.
       
   699     skipCount += KUserDataInt; 
       
   700     
       
   701     // Number of bytes until end of entry 
       
   702     aStream.WriteUint32L( skipCount );
       
   703     aStream.WriteInt32L( UserDataInt() );      
   693 	}
   704 	}
   694 
   705 
   695 
   706 
   696 EXPORT_C void CAgnEntry::InternalizeL(RReadStream& aStream)
   707 EXPORT_C void CAgnEntry::InternalizeL(RReadStream& aStream)
   697 	{
   708 	{
   826 		}
   837 		}
   827 	
   838 	
   828 	// Set the user integer of this entry from the stream.
   839 	// Set the user integer of this entry from the stream.
   829 	SetUserInt(aStream.ReadInt32L());
   840 	SetUserInt(aStream.ReadInt32L());
   830 	
   841 	
   831 	// future DC proofing
       
   832 	size = aStream.ReadUint32L(); // number of bytes until end of entry
   842 	size = aStream.ReadUint32L(); // number of bytes until end of entry
       
   843 	
       
   844 	if ( size >= KUserDataInt )       
       
   845         {       
       
   846         SetUserDataInt( aStream.ReadInt32L() );
       
   847 		size -= KUserDataInt;
       
   848         }  
   833 	while (size > 0)
   849 	while (size > 0)
   834 		{
   850 		{
   835 		aStream.ReadUint8L(); // ignore data
   851 			aStream.ReadUint8L(); // ignore data
   836 		size--;
   852 			size--;
   837 		}
   853 		}     
   838 	}
   854 	}
   839 
   855 
   840 EXPORT_C CAgnEntry* CAgnEntry::CloneL() const
   856 EXPORT_C CAgnEntry* CAgnEntry::CloneL() const
   841 	{
   857 	{
   842 	CAgnEntry* entry = NULL;
   858 	CAgnEntry* entry = NULL;
  1005 	if(aCopyType == CCalEntry::ECopyAll)
  1021 	if(aCopyType == CCalEntry::ECopyAll)
  1006 		{
  1022 		{
  1007 		HBufC8* guid = aSource.Guid().AllocL();
  1023 		HBufC8* guid = aSource.Guid().AllocL();
  1008 		SetGuid(guid);
  1024 		SetGuid(guid);
  1009 		}		
  1025 		}		
       
  1026 	// copy int       
       
  1027 	iUserDataInt = aSource.UserDataInt();   
  1010 	}
  1028 	}
  1011 	
  1029 	
  1012 EXPORT_C CCalEntry::TReplicationStatus CAgnEntry::ReplicationStatus() const
  1030 EXPORT_C CCalEntry::TReplicationStatus CAgnEntry::ReplicationStatus() const
  1013 /** Get ReplicationStatus
  1031 /** Get ReplicationStatus
  1014 
  1032 
  1232 		}
  1250 		}
  1233 		
  1251 		
  1234 	iPhoneOwner = aAttendee;
  1252 	iPhoneOwner = aAttendee;
  1235 	}
  1253 	}
  1236 
  1254 
       
  1255 EXPORT_C void CAgnEntry::ClearMRSpecificData()
       
  1256     {
       
  1257     // clears the iMeetingOrganizer and iAttendeeList.
       
  1258     if( iMeetingOrganizer )
       
  1259         {
       
  1260         delete iMeetingOrganizer;
       
  1261         iMeetingOrganizer = NULL;
       
  1262 
       
  1263         }
       
  1264     if( iPhoneOwner )
       
  1265         {
       
  1266         iPhoneOwner = NULL;
       
  1267         }
       
  1268 
       
  1269     if( iAttendeeList )
       
  1270         {
       
  1271         iAttendeeList->ResetAndDestroy();
       
  1272         delete iAttendeeList;
       
  1273         iAttendeeList = NULL;
       
  1274         }
       
  1275     }
  1237 
  1276 
  1238 EXPORT_C void CAgnEntry::SetDTStampUtcL(const TTime& aDTStampUtc)
  1277 EXPORT_C void CAgnEntry::SetDTStampUtcL(const TTime& aDTStampUtc)
  1239 /**
  1278 /**
  1240 @internalComponent
  1279 @internalComponent
  1241 */
  1280 */
  2084 
  2123 
  2085 TBool CAgnEntry::IsFlagSet(TFlags aFlag) const
  2124 TBool CAgnEntry::IsFlagSet(TFlags aFlag) const
  2086 	{
  2125 	{
  2087 	return (iFlags & aFlag);
  2126 	return (iFlags & aFlag);
  2088 	}
  2127 	}
       
  2128 
       
  2129 EXPORT_C void CAgnEntry::SetUserDataInt( TUint32 aUserInt )       
       
  2130     {       
       
  2131     iUserDataInt = aUserInt;       
       
  2132     }       
       
  2133 
       
  2134 EXPORT_C TUint32 CAgnEntry::UserDataInt() const       
       
  2135     {       
       
  2136     return iUserDataInt;       
       
  2137     }