1 // Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
2 // All rights reserved.
3 // This component and the accompanying materials are made available
4 // under the terms of "Eclipse Public License v1.0"
5 // which accompanies this distribution, and is available
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
16 #ifndef __RSENDASMESSAGE_H__
17 #define __RSENDASMESSAGE_H__
20 #include <csendasaccounts.h>
21 #include <cmsvrecipientlist.h>
33 typedef CMsvSendOperation::TSendOperationProgress TSendAsProgress;
36 Encapsulates creating and sending a message. This class requires
37 a connected RSendAs session.
39 A client application can have several RSendAsMessage objects created simultaneously.
40 Each RSendAsMessage object corresponds to a single message.
42 With the RSendAsMessage class, a client application can perform the following
45 -Creating and managing a message
47 -Modifying a message created using SendAs
51 -Launching a message editor
53 Client applications do not require any capabilities in order to use the RSendAs
54 and RSendAsMessage APIs. However, if an application does not have the necessary security
55 capabilities to send a message, the SendAs server ensures that a message is only sent
56 after the user's authorization.
58 A message created using RSendAsMessage can be saved, sent, or passed to the appropriate
59 message editor. There are two types of send operation:
61 -A confirmed send is forwarded to the UI MTM for the message type. Typically this
62 results in the user being asked to confirm that the message should be sent.
64 -An unconfirmed send fails if the client application does not have the
65 required capabilities to use the server MTM for the message type.
67 There are asynchronous and synchronous forms of these sending methods. Progress information for
68 sending is available when the asynchronous forms are used. The synchronous forms, and the
69 methods for saving the message and for launching it in a message editor, all close the handle to the
70 RSendAsMessage, so the message cannot be further accessed through the API.
75 class RSendAsMessage : public RSubSessionBase
79 Defines the recipient types available when adding a recipient to a message
81 enum TSendAsRecipientType
84 Designates a 'To' recipient.
86 ESendAsRecipientTo = EMsvRecipientTo,
89 Designates a 'Cc' recipient.
94 Designates a 'Bcc' recipient.
99 IMPORT_C void CreateL(RSendAs& aSendAs, TSendAsAccount aAccount);
100 IMPORT_C void CreateL(RSendAs& aSendAs, TUid aMessageType);
102 IMPORT_C void SendMessage(TRequestStatus& aStatus);
103 IMPORT_C void SendMessageAndCloseL(); // Sends in background
104 IMPORT_C void SendMessageConfirmed(TRequestStatus& aStatus);
105 IMPORT_C void SendMessageConfirmedAndCloseL(); // Sends in background
106 IMPORT_C void LaunchEditorAndCloseL();
107 IMPORT_C void SaveMessageAndCloseL();
109 IMPORT_C void ProgressL(TSendAsProgress& aProgress);
111 IMPORT_C void SetBodyTextL(const CRichText& aBody);
112 IMPORT_C void SetBodyTextL(const TDesC& aBody);
113 IMPORT_C void SetSubjectL(const TDesC& aSubject);
114 IMPORT_C void SetBioTypeL(TUid aBioType);
116 IMPORT_C void AddRecipientL(const TDesC& aAddress, TSendAsRecipientType aRecipientType);
117 IMPORT_C void AddRecipientL(const TDesC& aAddress, const TDesC& aAlias, TSendAsRecipientType aRecipientType);
119 IMPORT_C void AddAttachment(const TDesC& aFilePath, const TDesC8& aMimeType, TUint aCharset, TRequestStatus& aStatus);
120 IMPORT_C void AddAttachment(const TDesC& aFilePath, const TDesC8& aMimeType, TRequestStatus& aStatus);
121 IMPORT_C void AddAttachment(const TDesC& aFilePath, TRequestStatus& aStatus);
123 IMPORT_C void AddAttachment(RFile& aFile, const TDesC8& aMimeType, TUint aCharset, TRequestStatus& aStatus);
124 IMPORT_C void AddAttachment(RFile& aFile, const TDesC8& aMimeType, TRequestStatus& aStatus);
125 IMPORT_C void AddAttachment(RFile& aFile, TRequestStatus& aStatus);
127 IMPORT_C void AddLinkedAttachment(const TDesC& aFilePath, const TDesC8& aMimeType, TUint aCharset, TRequestStatus& aStatus);
128 IMPORT_C void AddLinkedAttachment(const TDesC& aFilePath, const TDesC8& aMimeType, TRequestStatus& aStatus);
129 IMPORT_C void AddLinkedAttachment(const TDesC& aFilePath, TRequestStatus& aStatus);
131 IMPORT_C void CreateAttachmentL(const TDesC& aFileName, RFile& aAttachmentFile);
132 IMPORT_C void CreateAttachmentL(const TDesC& aFileName, RFile& aAttachmentFile, const TDesC8& aMimeType);
133 IMPORT_C void CreateAttachmentL(const TDesC& aFileName, RFile& aAttachmentFile, const TDesC8& aMimeType, TUint aCharset);
136 IMPORT_C void Cancel();
137 IMPORT_C void Close();
140 Sets the character encoding value. The character encoding value options are 7-bit,
141 8-bit and 16-Bit Unicode. By default the character set encoding is 7 bit encoding.
143 IMPORT_C void SetCharacterSetL(const TUint aCharset);
147 TAny* iAny; // Future proofing.
150 #endif // __RSENDASMESSAGE_H__