|
1 /* |
|
2 * Copyright (c) 2007 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: Data container for a single MIME multipart part. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 |
|
21 #ifndef C_SIMPLECONTENT2_H |
|
22 #define C_SIMPLECONTENT2_H |
|
23 |
|
24 |
|
25 // Includes |
|
26 #include <e32std.h> |
|
27 #include <e32base.h> |
|
28 |
|
29 #include "msimplecontent.h" |
|
30 #include "simplecommon.h" |
|
31 |
|
32 /** |
|
33 * CSimpleContent |
|
34 * |
|
35 * Data container for a single MIME multipart part. |
|
36 * |
|
37 * @lib simplexmlutils |
|
38 * @since S60 v3.2 |
|
39 */ |
|
40 class CSimpleContent : public CBase, public MSimpleContent |
|
41 { |
|
42 public: |
|
43 |
|
44 static CSimpleContent* NewL( |
|
45 const TDesC8& aContentID, const TDesC8& aContentType ); |
|
46 |
|
47 static CSimpleContent* NewLC( |
|
48 const TDesC8& aContentID, const TDesC8& aContentType ); |
|
49 |
|
50 virtual ~CSimpleContent(); |
|
51 |
|
52 // from base class MSimpleContent |
|
53 |
|
54 /** |
|
55 * Destructor |
|
56 */ |
|
57 void Close(); |
|
58 |
|
59 /** |
|
60 * Data accessor |
|
61 * |
|
62 * @since S60 ?S60_version |
|
63 * @return data |
|
64 */ |
|
65 TPtrC8 Body(); |
|
66 |
|
67 /** |
|
68 * Data accessor |
|
69 * |
|
70 * @since S60 ?S60_version |
|
71 * @return data, ownership is transferred |
|
72 */ |
|
73 HBufC8* GiveBodyOwnerShip(); |
|
74 |
|
75 /** |
|
76 * Data setter |
|
77 * |
|
78 * @since S60 ?S60_version |
|
79 * @param aData data to be copied |
|
80 */ |
|
81 void CopyBodyL( const TDesC8& aData ); |
|
82 |
|
83 /** |
|
84 * Data setter |
|
85 * |
|
86 * @since S60 ?S60_version |
|
87 * @param aData data, ownetship is taken. |
|
88 */ |
|
89 void SetBody( HBufC8* aData ); |
|
90 |
|
91 /** |
|
92 * content-id accessor |
|
93 * @return content-id |
|
94 */ |
|
95 TPtrC8 ContentID(); |
|
96 |
|
97 /** |
|
98 * content-type accessor |
|
99 * @return content-type |
|
100 */ |
|
101 TPtrC8 ContentType(); |
|
102 |
|
103 |
|
104 private: |
|
105 |
|
106 CSimpleContent(); |
|
107 |
|
108 void ConstructL( |
|
109 const TDesC8& aContentID, const TDesC8& aContentType ); |
|
110 |
|
111 |
|
112 private: // data |
|
113 |
|
114 /** |
|
115 * ContentID |
|
116 * Own. |
|
117 */ |
|
118 HBufC8* iContentID; |
|
119 |
|
120 /** |
|
121 * ContentType |
|
122 * Own. |
|
123 */ |
|
124 HBufC8* iContentType; |
|
125 |
|
126 /** |
|
127 * Body |
|
128 * Own. |
|
129 */ |
|
130 HBufC8* iBody; |
|
131 }; |
|
132 |
|
133 |
|
134 |
|
135 #endif // ? C_CLASSNAME_H |