emailservices/emailstore/message_store/client/src/MsgStorePropertyContainerWithContent.cpp
changeset 0 8466d47a6819
child 8 e1b6206813b4
equal deleted inserted replaced
-1:000000000000 0:8466d47a6819
       
     1 /*
       
     2 * Copyright (c) 2006 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:  Message store property container with content client implementation.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #include "MsgStorePropertyContainerWithContent.h"
       
    20 #include "MsgStoreSessionContext.h"
       
    21 
       
    22 // -------------------------------------
       
    23 // CMsgStorePropertyContainerWithContent
       
    24 // -------------------------------------
       
    25 
       
    26 // ==========================================================================
       
    27 // FUNCTION: Constructor
       
    28 // ==========================================================================
       
    29 CMsgStorePropertyContainerWithContent::CMsgStorePropertyContainerWithContent( 
       
    30         CMsgStoreSessionContext& aSessionContext, 
       
    31         TMsgStoreId aId, 
       
    32         TMsgStoreId aParentId, 
       
    33         TMsgStoreId aMailBoxId ) :
       
    34 	CMsgStoreWritablePropertyContainer( aSessionContext, aId, aParentId, aMailBoxId ), 
       
    35 	iHasContent(EFalse)
       
    36 	{
       
    37 	} // end constructor
       
    38 
       
    39 // ==========================================================================
       
    40 // FUNCTION: ContentLengthL
       
    41 // ==========================================================================
       
    42 EXPORT_C TUint CMsgStorePropertyContainerWithContent::ContentLengthL()
       
    43 	{
       
    44 	return iContext.iSession.ContentLengthL( iId, iParentId );
       
    45 	} // end ContentLengthL
       
    46 
       
    47 // ==========================================================================
       
    48 // FUNCTION: FetchContentToBufferL
       
    49 // ==========================================================================
       
    50 EXPORT_C void CMsgStorePropertyContainerWithContent::FetchContentToBufferL( TDes8& aBuffer, TUint aStartOffset )
       
    51 	{
       
    52 	iContext.iSession.FetchContentL( iId, iParentId, aBuffer, aStartOffset );
       
    53 	} // end FetchContentToBufferL
       
    54 
       
    55 // ==========================================================================
       
    56 // FUNCTION: FetchContentToFileL
       
    57 // ==========================================================================
       
    58 EXPORT_C void CMsgStorePropertyContainerWithContent::FetchContentToFileL( const TDesC& aFilename )
       
    59 	{
       
    60 	iContext.iSession.FetchContentL( iId, iParentId, aFilename );
       
    61 	} // end FetchContentToFileL
       
    62 
       
    63 // ==========================================================================
       
    64 // FUNCTION: RemoveContentL
       
    65 // ==========================================================================
       
    66 EXPORT_C void CMsgStorePropertyContainerWithContent::RemoveContentL()
       
    67 	{
       
    68 	iContext.iSession.RemoveContentL( iId, iParentId );
       
    69 	iHasContent = EFalse;
       
    70 	} // end RemoveContentL
       
    71 
       
    72 // ==========================================================================
       
    73 // FUNCTION: AppendToContentL
       
    74 // ==========================================================================
       
    75 EXPORT_C void CMsgStorePropertyContainerWithContent::AppendToContentL( const TDesC8& aBuffer )
       
    76 	{
       
    77 	iContext.iSession.AppendToContentL( iId, iParentId, aBuffer );
       
    78 	iHasContent = ETrue;
       
    79 	} // end AppendToContentL
       
    80 
       
    81 // ==========================================================================
       
    82 // FUNCTION: PrependToContentL
       
    83 // ==========================================================================
       
    84 EXPORT_C void CMsgStorePropertyContainerWithContent::PrependToContentL(
       
    85     const TDesC8& aBuffer )
       
    86     {
       
    87     iContext.iSession.PrependToContentL( iId, iParentId, aBuffer );
       
    88     iHasContent = ETrue;
       
    89     }
       
    90 
       
    91 // ==========================================================================
       
    92 // FUNCTION: ReplaceContentL
       
    93 // ==========================================================================
       
    94 EXPORT_C void CMsgStorePropertyContainerWithContent::ReplaceContentL( const TDesC8& aBuffer )
       
    95 	{
       
    96 	iContext.iSession.ReplaceContentL( iId, iParentId, aBuffer );
       
    97 	iHasContent = ETrue;
       
    98 	} // end ReplaceContentL
       
    99 
       
   100 // ==========================================================================
       
   101 // FUNCTION: ReplaceContentWithFileL
       
   102 // ==========================================================================
       
   103 EXPORT_C void CMsgStorePropertyContainerWithContent::ReplaceContentWithFileL( const TDesC& aFilename )
       
   104 	{
       
   105 	iContext.iSession.ReplaceContentWithFileL( iId, iParentId, aFilename );
       
   106 	iHasContent = ETrue;
       
   107 	} // end ReplaceContentWithFileL
       
   108 	
       
   109 // ==========================================================================
       
   110 // FUNCTION: OpenOriginalContentFileL
       
   111 // ==========================================================================
       
   112 EXPORT_C void CMsgStorePropertyContainerWithContent::OpenOriginalContentFileL( RFile& aFile )
       
   113     {
       
   114     iContext.iSession.OpenOriginalContentFileL( iId, iParentId, aFile );
       
   115     }
       
   116