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