47
|
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: mail content implementation definition
|
|
15 |
*
|
|
16 |
*/
|
|
17 |
|
|
18 |
#ifndef EMAILCONTENT_H
|
|
19 |
#define EMAILCONTENT_H
|
|
20 |
|
|
21 |
#include <memailcontent.h>
|
|
22 |
|
62
|
23 |
#include "CFSMailClient.h"
|
47
|
24 |
#include "emailapiutils.h"
|
|
25 |
|
|
26 |
using namespace EmailInterface;
|
|
27 |
|
|
28 |
class CFSMailPlugin;
|
|
29 |
class CFSMailRequestObserver;
|
|
30 |
|
|
31 |
NONSHARABLE_CLASS( CEmailMessageContent ) : public CBase,
|
|
32 |
public MEmailMessageContent
|
|
33 |
{
|
|
34 |
public:
|
|
35 |
static CEmailMessageContent* NewL(
|
|
36 |
CPluginData& aPluginData,
|
|
37 |
const TMessageContentId& aMsgContentId,
|
|
38 |
CFSMailMessagePart* aPart);
|
|
39 |
|
|
40 |
~CEmailMessageContent();
|
|
41 |
|
|
42 |
public: // from MEmailInterface
|
|
43 |
TEmailTypeId InterfaceId() const;
|
|
44 |
|
|
45 |
void Release();
|
|
46 |
|
|
47 |
public: // from MEmailMessageContent
|
|
48 |
TMessageContentId Id() const;
|
|
49 |
|
|
50 |
TPtrC ContentType() const;
|
|
51 |
|
|
52 |
void SetContentType( const TDesC& aContentType );
|
|
53 |
|
|
54 |
TPtrC ContentId() const;
|
|
55 |
|
|
56 |
void SetContentId( const TDesC& aContentId );
|
|
57 |
|
|
58 |
TPtrC ContentDescription() const;
|
|
59 |
|
|
60 |
void SetContentDescription( const TDesC& aContentDescription );
|
|
61 |
|
|
62 |
TPtrC ContentDisposition() const;
|
|
63 |
|
|
64 |
void SetContentDisposition( const TDesC& aContentDisposition );
|
|
65 |
|
|
66 |
TPtrC ContentClass() const;
|
|
67 |
|
|
68 |
void SetContentClass( const TDesC& aContentClass );
|
|
69 |
|
|
70 |
TInt AvailableSize() const;
|
|
71 |
|
|
72 |
TInt TotalSize() const;
|
|
73 |
|
|
74 |
TPtrC ContentL() const;
|
|
75 |
|
|
76 |
void SetContentL( const TDesC& aContent );
|
|
77 |
|
|
78 |
void FetchL( MEmailFetchObserver& aObserver );
|
|
79 |
|
|
80 |
void CancelFetch();
|
|
81 |
|
|
82 |
void SaveToFileL( const TDesC& aPath );
|
|
83 |
|
|
84 |
MEmailMultipart* AsMultipartOrNull() const;
|
|
85 |
|
|
86 |
MEmailTextContent* AsTextContentOrNull() const;
|
|
87 |
|
|
88 |
MEmailAttachment* AsAttachmentOrNull() const;
|
|
89 |
|
|
90 |
public:
|
|
91 |
CFSMailMessagePart& Part();
|
|
92 |
void SetPart( CFSMailMessagePart *aPart );
|
|
93 |
|
|
94 |
CPluginData& PluginData();
|
|
95 |
|
|
96 |
protected:
|
|
97 |
CEmailMessageContent( CPluginData& aPluginData, const TMessageContentId& aMsgContentId, CFSMailMessagePart* aPart );
|
|
98 |
|
|
99 |
private:
|
|
100 |
class CContentRequestObserver: public CBase,
|
|
101 |
public MFSMailRequestObserver
|
|
102 |
{
|
|
103 |
public:
|
|
104 |
CContentRequestObserver( CEmailMessageContent &aParent);
|
|
105 |
|
|
106 |
virtual void RequestResponseL( TFSProgress aEvent, TInt aRequestId );
|
|
107 |
void SetObserverL( MEmailFetchObserver* aObserver );
|
|
108 |
private:
|
|
109 |
MEmailFetchObserver* iObserver;
|
|
110 |
CEmailMessageContent& iParent;
|
|
111 |
};
|
|
112 |
|
|
113 |
private:
|
|
114 |
void ConstructL();
|
|
115 |
|
|
116 |
private:
|
|
117 |
CPluginData& iPluginData;
|
|
118 |
CFSMailPlugin* iPlugin;
|
|
119 |
CFSMailMessagePart* iPart;
|
|
120 |
TMessageContentId iMsgContentId;
|
|
121 |
mutable HBufC* iBuf;
|
|
122 |
mutable TUint iUsed;
|
|
123 |
CContentRequestObserver *iFetchObserver;
|
|
124 |
TInt iRequestId;
|
|
125 |
};
|
|
126 |
|
|
127 |
#endif // EMAILCONTENT_H
|
|
128 |
|
|
129 |
// End of file
|