emailservices/emailclientapi/inc/emailmultipart.h
changeset 47 f83bd4ae1fe3
child 62 a8c646b56683
equal deleted inserted replaced
45:780f926bc26c 47:f83bd4ae1fe3
       
     1 /*
       
     2 * Copyright (c) 2010 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: Definition of Email text content.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef EMAILMULTIPART_H_
       
    20 #define EMAILMULTIPART_H_
       
    21 // INCLUDES
       
    22 #include "cfsmailclient.h"
       
    23 #include <memailcontent.h>
       
    24 #include "emailapiutils.h"
       
    25 
       
    26 using namespace EmailInterface;
       
    27 
       
    28 class CEmailMessageContent;
       
    29 
       
    30 
       
    31 // CLASS DECLARATION
       
    32 
       
    33 NONSHARABLE_CLASS( CEmailMultipart ) : public CBase,
       
    34                                        public MEmailMultipart
       
    35 {
       
    36 public:
       
    37     static CEmailMultipart* NewL( CPluginData& aPluginData, 
       
    38             const TMessageContentId& aMsgContentId, 
       
    39             CFSMailMessagePart* aPart,
       
    40             const TDataOwner aOwner );
       
    41     
       
    42     ~CEmailMultipart();
       
    43     
       
    44 public: // from MEmailInterface
       
    45     TEmailTypeId InterfaceId() const;
       
    46     
       
    47     void Release();
       
    48 
       
    49 public: // from MEmailMessageContent
       
    50     
       
    51     TMessageContentId Id() const;
       
    52 
       
    53     TPtrC ContentType() const;
       
    54 
       
    55     void SetContentType( const TDesC& aContentType );
       
    56 
       
    57     TPtrC ContentId() const;
       
    58 
       
    59     void SetContentId( const TDesC& aContentId );
       
    60 
       
    61     TPtrC ContentDescription() const;
       
    62 
       
    63     void SetContentDescription( const TDesC& aContentDescription );
       
    64 
       
    65     TPtrC ContentDisposition() const;
       
    66 
       
    67     void SetContentDisposition( const TDesC& aContentDisposition );
       
    68 
       
    69     TPtrC ContentClass() const;
       
    70 
       
    71     void SetContentClass( const TDesC& aContentClass );
       
    72 
       
    73     TInt AvailableSize() const;
       
    74 
       
    75     TInt TotalSize() const;
       
    76 
       
    77     TPtrC ContentL() const;
       
    78 
       
    79     void SetContentL( const TDesC& aContent );
       
    80 
       
    81     void FetchL( MEmailFetchObserver& aObserver );
       
    82 
       
    83     void CancelFetch();
       
    84 
       
    85     void SaveToFileL( const TDesC& aPath );
       
    86 
       
    87     MEmailMultipart* AsMultipartOrNull() const;
       
    88     
       
    89     MEmailTextContent* AsTextContentOrNull() const;
       
    90 
       
    91     MEmailAttachment* AsAttachmentOrNull() const;
       
    92     
       
    93 public: // from MEmailMultipart
       
    94     TInt PartCountL();
       
    95 
       
    96     MEmailMessageContent* PartByIndexL( const TUint aIndex ) const;
       
    97 
       
    98     void DeletePartL( const TUint aIndex );
       
    99 
       
   100     void AddPartL(
       
   101         const MEmailMessageContent& aPart,
       
   102         const TUint aPos );
       
   103     
       
   104 public: // for internal usage
       
   105     void SetOwner( const TDataOwner aOwner );
       
   106     
       
   107     
       
   108 private:
       
   109     CEmailMultipart( const TDataOwner aOwner );
       
   110     
       
   111     void ConstructL( CPluginData& aPluginData, const TMessageContentId& aMsgContentId, CFSMailMessagePart* aPart );
       
   112     
       
   113 private: // Private data        
       
   114     CEmailMessageContent* iEmailMsgContent;
       
   115     RArray<TFSMailMsgId> iChildParts;
       
   116     TUint iChildPartCount;
       
   117     TDataOwner iOwner;
       
   118 };
       
   119 
       
   120 #endif // EMAILMULTIPART_H_
       
   121 
       
   122 // End of file
       
   123