pimappservices/calendar/client/src/calattachment.cpp
changeset 45 b6db4fd4947b
parent 0 f979ecb2b13e
equal deleted inserted replaced
23:fd30d51f876b 45:b6db4fd4947b
   552 @released
   552 @released
   553 @capability ReadUserData
   553 @capability ReadUserData
   554 */
   554 */
   555 EXPORT_C void CCalAttachmentFile::FetchFileHandleL(RFile& aFileHandle) const
   555 EXPORT_C void CCalAttachmentFile::FetchFileHandleL(RFile& aFileHandle) const
   556 	{
   556 	{
   557 	if (iAttachmentImpl->IsFileHandleSet() || ! iCalSessionImpl)
   557     if ( iAttachmentImpl->IsFileHandleSet() )
   558 		{
   558         {
   559 		User::Leave(KErrArgument);
   559         aFileHandle.Close();
   560 		}
   560         User::LeaveIfError(
   561 
   561                 aFileHandle.Duplicate( iAttachmentImpl->FileHandle() ) );
   562 	iCalSessionImpl->Server().FetchFileHandleL(aFileHandle, iAttachmentImpl->Uid(), iCalSessionImpl->FileId());
   562         }
       
   563     else if ( iCalSessionImpl )
       
   564         {
       
   565         iCalSessionImpl->Server().FetchFileHandleL(
       
   566                 aFileHandle, 
       
   567                 iAttachmentImpl->Uid(), 
       
   568                 iCalSessionImpl->FileId() );            
       
   569         }
       
   570     else
       
   571         {
       
   572         User::Leave( KErrArgument );
       
   573         }
   563 	}
   574 	}
   564 
   575 
   565 /** Load the binary data into the attachment object to be accessed through the CCalAttachment::Value function.
   576 /** Load the binary data into the attachment object to be accessed through the CCalAttachment::Value function.
   566 Note that binary data can be very large so this may use up a lot of RAM.
   577 Note that binary data can be very large so this may use up a lot of RAM.
   567 If binary data has already been loaded, this function will do nothing. In that case, CCalAttachment::Value will 
   578 If binary data has already been loaded, this function will do nothing. In that case, CCalAttachment::Value will