|
1 /* |
|
2 * Copyright (c) 2002-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: Encapsulates the message data for sending services. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef C_MESSAGEDATA_H |
|
20 #define C_MESSAGEDATA_H |
|
21 |
|
22 #include <e32base.h> |
|
23 #include <badesca.h> |
|
24 #include <f32file.h> |
|
25 #include <msvstd.h> |
|
26 #include "CMessageAddress.h" |
|
27 |
|
28 class MDesC16Array; |
|
29 class CRichText; |
|
30 class CMessageDataImpl; |
|
31 |
|
32 /** |
|
33 * Encapsulates the message data for sending services. |
|
34 * |
|
35 * Encapsulates the message data for sending services. Class supports |
|
36 * externalazation and internalization, which are used to relay message |
|
37 * to SendUI server application. |
|
38 * |
|
39 * @lib sendui |
|
40 * @since S60 v3.0 |
|
41 */ |
|
42 class CMessageData : public CBase |
|
43 { |
|
44 public: // Constructors and destructor |
|
45 |
|
46 /** |
|
47 * Two-phased constructor. |
|
48 * |
|
49 * @return Pointer to object of CMessageData. |
|
50 */ |
|
51 IMPORT_C static CMessageData* NewL(); |
|
52 |
|
53 /** |
|
54 * Two-phased constructor. |
|
55 * |
|
56 * @return Pointer to object of CMessageData. |
|
57 */ |
|
58 IMPORT_C static CMessageData* NewLC(); |
|
59 |
|
60 /** |
|
61 * Destructor. |
|
62 */ |
|
63 IMPORT_C virtual ~CMessageData(); |
|
64 |
|
65 public: // New functions |
|
66 |
|
67 /** |
|
68 * Set message subject. |
|
69 * |
|
70 * @since Series 60 3.0 |
|
71 * @param aSubject Sets message subject. Does not take ownership. |
|
72 * @return None. |
|
73 */ |
|
74 IMPORT_C void SetSubjectL( const TDesC* aSubject ); |
|
75 |
|
76 /** |
|
77 * Returns message subject. |
|
78 * |
|
79 * @since Series 60 3.0 |
|
80 * @return Message subject. |
|
81 */ |
|
82 IMPORT_C const TPtrC Subject() const; |
|
83 |
|
84 /** |
|
85 * Appends attachment file path to the array of attachment file paths. Only a link |
|
86 * to the attachment is stored and compared to AppendAttachmentHandleL less resources |
|
87 * is used during the send operation. |
|
88 * |
|
89 * NOTE: Do not add any temporary files as an attachment. Always use |
|
90 * AppendAttachmentHandleL for temporary files. |
|
91 * |
|
92 * @since Series 60 3.0 |
|
93 * @param aFilePath File path of the attachment. |
|
94 * |
|
95 * @return None. |
|
96 */ |
|
97 IMPORT_C void AppendAttachmentL( const TDesC& aFilePath ); |
|
98 |
|
99 /** |
|
100 * Returns the array of attachment file paths. |
|
101 * |
|
102 * @since Series 60 3.0 |
|
103 * @return Array of attachment file paths. |
|
104 */ |
|
105 IMPORT_C const CDesCArray& AttachmentArray() const; |
|
106 |
|
107 /** |
|
108 * Clears the array of attachment file paths. |
|
109 * |
|
110 * @since Series 60 3.0 |
|
111 * @return Array of attachment file paths. |
|
112 */ |
|
113 IMPORT_C void ClearAttachmentArray(); |
|
114 |
|
115 /** |
|
116 * Encapsulates address and alias to CMessageAddress and adds to array. |
|
117 * |
|
118 * @since Series 60 3.0 |
|
119 * @param aAddress Real address. |
|
120 * @param aAlias Alias for the real address. |
|
121 * @return None. |
|
122 */ |
|
123 IMPORT_C void AppendToAddressL( |
|
124 const TDesC& aAddress, |
|
125 const TDesC& aAlias = KNullDesC); |
|
126 |
|
127 /** |
|
128 * Returns array of addresses and aliases. |
|
129 * |
|
130 * @since Series 60 3.0 |
|
131 * @return Array of addresses and aliases. |
|
132 */ |
|
133 IMPORT_C const CMessageAddressArray& ToAddressArray() const; |
|
134 |
|
135 /** |
|
136 * Encapsulates CC address and alias to CMessageAddress and adds to |
|
137 * array. |
|
138 * |
|
139 * @since Series 60 3.0 |
|
140 * @param aCcAddress Real CC-address. |
|
141 * @param aCcAlias Alias for the real CC-address. |
|
142 * @return None. |
|
143 */ |
|
144 IMPORT_C void AppendCcAddressL( |
|
145 const TDesC& aCcAddress, |
|
146 const TDesC& aCcAlias = KNullDesC); |
|
147 |
|
148 /** |
|
149 * Returns array of CC addresses and aliases. |
|
150 * |
|
151 * @since Series 60 3.0 |
|
152 * @return Array of cc addresses and aliases. |
|
153 */ |
|
154 IMPORT_C const CMessageAddressArray& CcAddressArray() const; |
|
155 |
|
156 /** |
|
157 * Encapsulates Bcc address and alias to CMessageAddress and adds to |
|
158 * array. |
|
159 * |
|
160 * @since Series 60 3.0 |
|
161 * @param aBccAddress Real Bcc-address. |
|
162 * @param aBccAlias Alias for the real Bcc-address. |
|
163 * @return None. |
|
164 */ |
|
165 IMPORT_C void AppendBccAddressL( |
|
166 const TDesC& aBccAddress, |
|
167 const TDesC& aBccAlias = KNullDesC); |
|
168 |
|
169 /** |
|
170 * Returns array of Bcc addresses and aliases. |
|
171 * |
|
172 * @since Series 60 3.0 |
|
173 * @return Array of Bcc addresses and aliases. |
|
174 */ |
|
175 IMPORT_C const CMessageAddressArray& BccAddressArray() const; |
|
176 |
|
177 /** |
|
178 * Set message body text. |
|
179 * |
|
180 * @since Series 60 3.0 |
|
181 * @param aBodyText Message body text. |
|
182 * @return None. |
|
183 */ |
|
184 IMPORT_C void SetBodyTextL( const CRichText* aBodyText ); |
|
185 |
|
186 /** |
|
187 * Returns message body text. |
|
188 * |
|
189 * @since Series 60 3.0 |
|
190 * @return Message body text. |
|
191 */ |
|
192 IMPORT_C const CRichText* BodyText() const; |
|
193 |
|
194 /** |
|
195 * Appends attachment handle to the array of attachment handles. |
|
196 * |
|
197 * NOTE: Attachment handles should be opened using ShareProtected() |
|
198 * file session, otherwise handles can not be transfered through |
|
199 * client-server interface. |
|
200 * |
|
201 * NOTE: When adding a temporary file as an attachment, always use this method, |
|
202 * |
|
203 * @since Series 60 3.0 |
|
204 * @param aFileHandle File handle of the attachment. |
|
205 * @return None. |
|
206 */ |
|
207 IMPORT_C void AppendAttachmentHandleL( const RFile& aFileHandle ); |
|
208 |
|
209 /** |
|
210 * Returns the array of attachment handles. |
|
211 * |
|
212 * @since Series 60 3.0 |
|
213 * @return Array of attachment handles. |
|
214 */ |
|
215 IMPORT_C const RArray<RFile>& AttachmentHandleArray() const; |
|
216 |
|
217 /** |
|
218 * Returns data type id. |
|
219 * |
|
220 * This can be used for interpreting the opaque data. |
|
221 * @since Series 60 3.0 |
|
222 * @return Data type id. |
|
223 */ |
|
224 IMPORT_C TUid DataType() const; |
|
225 |
|
226 /** |
|
227 * Clears all addressee arrays. |
|
228 * |
|
229 * @since Series 60 3.0 |
|
230 * @return None. |
|
231 */ |
|
232 IMPORT_C void ClearAddresses(); |
|
233 |
|
234 /** |
|
235 * Externalizes message data to a stream |
|
236 * |
|
237 * @since Series 60 3.2 |
|
238 * @return None. |
|
239 */ |
|
240 |
|
241 IMPORT_C void ExternalizeL( RWriteStream& aStream ) const; |
|
242 |
|
243 /** |
|
244 * Internalizes message data to from a stream |
|
245 * |
|
246 * @since Series 60 3.2 |
|
247 * @return None. |
|
248 */ |
|
249 IMPORT_C void InternalizeL( RReadStream& aStream ); |
|
250 |
|
251 /** |
|
252 * Set opaque data |
|
253 * |
|
254 * @since Series 60 3.2 |
|
255 * @param aData Opaque data. |
|
256 * @param aDataType, Identifier for the opaque data. |
|
257 * @return None. |
|
258 */ |
|
259 IMPORT_C void SetOpaqueDataL( const TDesC8* aData, TUid aDataType ); |
|
260 |
|
261 /** |
|
262 * Get opaque data |
|
263 * |
|
264 * @since Series 60 3.2 |
|
265 * @return aData Opaque data. |
|
266 */ |
|
267 IMPORT_C const TPtrC8 OpaqueData() const; |
|
268 |
|
269 protected: |
|
270 |
|
271 /** |
|
272 * C++ default constructor. |
|
273 */ |
|
274 IMPORT_C CMessageData(); |
|
275 |
|
276 /** |
|
277 * By default Symbian 2nd phase constructor is private. |
|
278 */ |
|
279 IMPORT_C void ConstructL(); |
|
280 |
|
281 protected: // Data |
|
282 |
|
283 /** |
|
284 * Data type of this message. Normally this is KSenduiMsgDataBase |
|
285 * This can be used for interpreting the opaque data. |
|
286 */ |
|
287 TUid iDataType; |
|
288 |
|
289 private: // Data |
|
290 |
|
291 /** |
|
292 * Message data implementation. |
|
293 * Owned. |
|
294 */ |
|
295 CMessageDataImpl* iMessageDataImpl; |
|
296 |
|
297 /** |
|
298 * Reserved. |
|
299 */ |
|
300 TAny* iReserved1; |
|
301 TAny* iReserved2; |
|
302 TAny* iReserved3; |
|
303 TAny* iReserved4; |
|
304 TAny* iReserved5; |
|
305 RArray<TAny*> iReserved6; |
|
306 |
|
307 }; |
|
308 |
|
309 #endif // C_MESSAGEDATA_H |
|
310 |
|
311 // End of File |
|
312 |