2 * Copyright (c) 2002-2006 Nokia Corporation and/or its subsidiary(-ies).
4 * This component and the accompanying materials are made available
5 * under the terms of the License "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members
6 * which accompanies this distribution, and is available
7 * at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
9 * Initial Contributors:
10 * Nokia Corporation - initial contribution.
14 * Description: Encapsulates the message data for sending services.
19 #ifndef C_MESSAGEDATA_H
20 #define C_MESSAGEDATA_H
26 #include "CMessageAddress.h"
30 class CMessageDataImpl;
33 * Encapsulates the message data for sending services.
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.
42 class CMessageData : public CBase
44 public: // Constructors and destructor
47 * Two-phased constructor.
49 * @return Pointer to object of CMessageData.
51 IMPORT_C static CMessageData* NewL();
54 * Two-phased constructor.
56 * @return Pointer to object of CMessageData.
58 IMPORT_C static CMessageData* NewLC();
63 IMPORT_C virtual ~CMessageData();
65 public: // New functions
68 * Set message subject.
70 * @since Series 60 3.0
71 * @param aSubject Sets message subject. Does not take ownership.
74 IMPORT_C void SetSubjectL( const TDesC* aSubject );
77 * Returns message subject.
79 * @since Series 60 3.0
80 * @return Message subject.
82 IMPORT_C const TPtrC Subject() const;
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.
89 * NOTE: Do not add any temporary files as an attachment. Always use
90 * AppendAttachmentHandleL for temporary files.
92 * @since Series 60 3.0
93 * @param aFilePath File path of the attachment.
97 IMPORT_C void AppendAttachmentL( const TDesC& aFilePath );
100 * Returns the array of attachment file paths.
102 * @since Series 60 3.0
103 * @return Array of attachment file paths.
105 IMPORT_C const CDesCArray& AttachmentArray() const;
108 * Clears the array of attachment file paths.
110 * @since Series 60 3.0
111 * @return Array of attachment file paths.
113 IMPORT_C void ClearAttachmentArray();
116 * Encapsulates address and alias to CMessageAddress and adds to array.
118 * @since Series 60 3.0
119 * @param aAddress Real address.
120 * @param aAlias Alias for the real address.
123 IMPORT_C void AppendToAddressL(
124 const TDesC& aAddress,
125 const TDesC& aAlias = KNullDesC);
128 * Returns array of addresses and aliases.
130 * @since Series 60 3.0
131 * @return Array of addresses and aliases.
133 IMPORT_C const CMessageAddressArray& ToAddressArray() const;
136 * Encapsulates CC address and alias to CMessageAddress and adds to
139 * @since Series 60 3.0
140 * @param aCcAddress Real CC-address.
141 * @param aCcAlias Alias for the real CC-address.
144 IMPORT_C void AppendCcAddressL(
145 const TDesC& aCcAddress,
146 const TDesC& aCcAlias = KNullDesC);
149 * Returns array of CC addresses and aliases.
151 * @since Series 60 3.0
152 * @return Array of cc addresses and aliases.
154 IMPORT_C const CMessageAddressArray& CcAddressArray() const;
157 * Encapsulates Bcc address and alias to CMessageAddress and adds to
160 * @since Series 60 3.0
161 * @param aBccAddress Real Bcc-address.
162 * @param aBccAlias Alias for the real Bcc-address.
165 IMPORT_C void AppendBccAddressL(
166 const TDesC& aBccAddress,
167 const TDesC& aBccAlias = KNullDesC);
170 * Returns array of Bcc addresses and aliases.
172 * @since Series 60 3.0
173 * @return Array of Bcc addresses and aliases.
175 IMPORT_C const CMessageAddressArray& BccAddressArray() const;
178 * Set message body text.
180 * @since Series 60 3.0
181 * @param aBodyText Message body text.
184 IMPORT_C void SetBodyTextL( const CRichText* aBodyText );
187 * Returns message body text.
189 * @since Series 60 3.0
190 * @return Message body text.
192 IMPORT_C const CRichText* BodyText() const;
195 * Appends attachment handle to the array of attachment handles.
197 * NOTE: Attachment handles should be opened using ShareProtected()
198 * file session, otherwise handles can not be transfered through
199 * client-server interface.
201 * NOTE: When adding a temporary file as an attachment, always use this method,
203 * @since Series 60 3.0
204 * @param aFileHandle File handle of the attachment.
207 IMPORT_C void AppendAttachmentHandleL( const RFile& aFileHandle );
210 * Returns the array of attachment handles.
212 * @since Series 60 3.0
213 * @return Array of attachment handles.
215 IMPORT_C const RArray<RFile>& AttachmentHandleArray() const;
218 * Returns data type id.
220 * This can be used for interpreting the opaque data.
221 * @since Series 60 3.0
222 * @return Data type id.
224 IMPORT_C TUid DataType() const;
227 * Clears all addressee arrays.
229 * @since Series 60 3.0
232 IMPORT_C void ClearAddresses();
235 * Externalizes message data to a stream
237 * @since Series 60 3.2
241 IMPORT_C void ExternalizeL( RWriteStream& aStream ) const;
244 * Internalizes message data to from a stream
246 * @since Series 60 3.2
249 IMPORT_C void InternalizeL( RReadStream& aStream );
254 * @since Series 60 3.2
255 * @param aData Opaque data.
256 * @param aDataType, Identifier for the opaque data.
259 IMPORT_C void SetOpaqueDataL( const TDesC8* aData, TUid aDataType );
264 * @since Series 60 3.2
265 * @return aData Opaque data.
267 IMPORT_C const TPtrC8 OpaqueData() const;
272 * C++ default constructor.
274 IMPORT_C CMessageData();
277 * By default Symbian 2nd phase constructor is private.
279 IMPORT_C void ConstructL();
284 * Data type of this message. Normally this is KSenduiMsgDataBase
285 * This can be used for interpreting the opaque data.
292 * Message data implementation.
295 CMessageDataImpl* iMessageDataImpl;
305 RArray<TAny*> iReserved6;
309 #endif // C_MESSAGEDATA_H