Location:
rsendasmessage.h
Link against: sendas2.lib
class RSendAsMessage : public RSubSessionBase;
Encapsulates creating and sending a message. This class requires a connected RSendAs
session.
A client application can have several RSendAsMessage objects created simultaneously. Each RSendAsMessage object corresponds to a single message.
With the RSendAsMessage class, a client application can perform the following operations:
-Creating and managing a message
-Modifying a message created using SendAs
-Sending a message
-Launching a message editor
Client applications do not require any capabilities in order to use the RSendAs
and RSendAsMessage APIs. However, if an application does not have the necessary security capabilities to send a message,
the SendAs server ensures that a message is only sent after the user's authorization.
A message created using RSendAsMessage can be saved, sent, or passed to the appropriate message editor. There are two types of send operation:
-A confirmed send is forwarded to the UI MTM for the message type. Typically this results in the user being asked to confirm that the message should be sent.
-An unconfirmed send fails if the client application does not have the required capabilities to use the server MTM for the message type.
There are asynchronous and synchronous forms of these sending methods. Progress information for sending is available when the asynchronous forms are used. The synchronous forms, and the methods for saving the message and for launching it in a message editor, all close the handle to the RSendAsMessage, so the message cannot be further accessed through the API.
RSubSessionBase
- Client-side handle to a sub-session
RSendAsMessage
- Encapsulates creating and sending a message
Defined in RSendAsMessage
:
AddAttachment()
, AddAttachment()
, AddAttachment()
, AddAttachment()
, AddAttachment()
, AddAttachment()
, AddLinkedAttachment()
, AddLinkedAttachment()
, AddLinkedAttachment()
, AddRecipientL()
, AddRecipientL()
, Cancel()
, Close()
, CreateAttachmentL()
, CreateAttachmentL()
, CreateAttachmentL()
, CreateL()
, CreateL()
, ESendAsRecipientBcc
, ESendAsRecipientCc
, ESendAsRecipientTo
, LaunchEditorAndCloseL()
, ProgressL()
, SaveMessageAndCloseL()
, SendMessage()
, SendMessageAndCloseL()
, SendMessageConfirmed()
, SendMessageConfirmedAndCloseL()
, SetBioTypeL()
, SetBodyTextL()
, SetBodyTextL()
, SetSubjectL()
, TSendAsRecipientType
Inherited from RSubSessionBase
:
CloseSubSession()
,
CreateAutoCloseSubSession()
,
CreateSubSession()
,
Send()
,
SendReceive()
,
Session()
,
SubSessionHandle()
IMPORT_C void CreateL(RSendAs &aSendAs, TSendAsAccount aAccount);
Create a new message in the Drafts folder.
The message type is implied by the type of the account used. The message can be modified or deleted by this object at any time up until the message is sent, deleted or opened in an editor.
|
IMPORT_C void CreateL(RSendAs &aSendAs, TUid aMessageType);
Create a new message in the Drafts folder.
The message type is specified. The message can be modified or deleted by this object at any time up until the message is sent, deleted or opened in an editor.
|
IMPORT_C void SendMessage(TRequestStatus &aStatus);
Asynchronously send this message. This method requests that the SendAs server send the message without prompting the user. This will only be allowed to happen if the caller holds sufficient capabilities to perform this action. If the caller does not hold these capabilities, then the message send will be automatically demoted to a confirmed send. The RSendAsMessage API cannot modify the message if this method fails.
|
IMPORT_C void SendMessageAndCloseL();
Sends this message in the background without confirmation and close the handle. This is a synchronous operation. This will only be allowed to happen if the caller holds sufficient capabilities to perform this action. If the caller does not hold these capabilities, then the message send will be automatically demoted to a confirmed send. The RSendAsMessage API cannot modify or resend the message if this method fails. No progress information is available after calling this API.
IMPORT_C void SendMessageConfirmed(TRequestStatus &aStatus);
Asynchronously send this message. This method requests that the SendAs server send the message, prompting the user for confirmation. This functionality must be supported by the UI MTM for the selected message type. The RSendAsMessage API cannot modify the message if this method fails.
|
IMPORT_C void SendMessageConfirmedAndCloseL();
Sends this message in the background and close the handle to it. This is a synchronous operation. This method requests that the SendAs server send the message, prompting the user for confirmation. This functionality must be supported by the UI MTM for the selected message type. The RSendAsMessage API cannot modify or resend the message if this method fails.
IMPORT_C void LaunchEditorAndCloseL();
Opens the message in the associated message editor for the message type. The RSendAsMessage handle is closed, so that the message cannot be futher accessed through the object.
IMPORT_C void SaveMessageAndCloseL();
Close an open message and save it in the Drafts folder.
IMPORT_C void ProgressL(TSendAsProgress &aProgress);
Retrieve the progress information for this message. This method can be called at any time after message creation.
|
IMPORT_C void SetBodyTextL(const CRichText &aBody);
Set the body text of this message using a CRichText
object. The object must have an open message to use this method.
|
IMPORT_C void SetBodyTextL(const TDesC &aBody);
Set the body text of this message using a plain descriptor. The object must have an open message to use this method.
|
IMPORT_C void SetSubjectL(const TDesC &aSubject);
Set the subject of this message using a plain descriptor. The object must have an open message to use this method.
|
IMPORT_C void SetBioTypeL(TUid aBioType);
Set the BIO type of this message. The object must have an open message to use this method.
|
IMPORT_C void AddRecipientL(const TDesC &aAddress, TSendAsRecipientType aRecipientType);
Add a recipient to this message. The recipient's address is held in a descriptor, and is in the correct format for the message type.
The recipient type is one of the TSendAsRecipientType constants, currently one of: ESendAsRecipientTo - The recipient goes in the 'To' field. ESendAsRecipientCc - The recipient goes in the 'Cc' field. ESendAsRecipientBcc - The recipient goes in the 'Bcc' field.
If the 'Cc' field is not supported, the recipient will instead be added to the 'To' field since these are functionally equivalent. If the 'Bcc' field is not supported, this method will return KErrNotSupported.
|
IMPORT_C void AddRecipientL(const TDesC &aAddress, const TDesC &aAlias, TSendAsRecipientType aRecipientType);
Add a recipient with an alias to this message. The recipient's address is held in a descriptor, and is in the correct format for the message type. The alias is the displayed recipient name.
The recipient type is one of the TSendAsRecipientType constants, currently one of: ESendAsRecipientTo - The recipient goes in the 'To' field. ESendAsRecipientCc - The recipient goes in the 'Cc' field. ESendAsRecipientBcc - The recipient goes in the 'Bcc' field.
If the 'Cc' field is not supported, the recipient will instead be added to the 'To' field since these are functionally equivalent. If the 'Bcc' field is not supported, this method will return KErrNotSupported.
|
IMPORT_C void AddAttachment(const TDesC &aFilePath, const TDesC8 &aMimeType, TUint aCharset, TRequestStatus &aStatus);
Add an attachment to this message asynchronously.
A copy of the specified file is attached to message.
|
IMPORT_C void AddAttachment(const TDesC &aFilePath, const TDesC8 &aMimeType, TRequestStatus &aStatus);
Add an attachment to this message asynchronously.
A copy of the specified file is attached to message.
|
IMPORT_C void AddAttachment(const TDesC &aFilePath, TRequestStatus &aStatus);
Add an attachment to this message. The attachment is copied into the message store from the supplied filename.
|
IMPORT_C void AddAttachment(RFile &aFile, const TDesC8 &aMimeType, TUint aCharset, TRequestStatus &aStatus);
Add an attachment to this message asynchronously.
A copy of the specified file is attached to message.
|
IMPORT_C void AddAttachment(RFile &aFile, const TDesC8 &aMimeType, TRequestStatus &aStatus);
Add an attachment to this message asynchronously.
A copy of the specified file is attached to message.
|
IMPORT_C void AddAttachment(RFile &aFile, TRequestStatus &aStatus);
Add an attachment to this message. The attachment is copied into the message store from the supplied file.
|
IMPORT_C void AddLinkedAttachment(const TDesC &aFilePath, const TDesC8 &aMimeType, TUint aCharset, TRequestStatus &aStatus);
Add an attachment to this message. The attachment is linked to the message from the supplied filename. This file must be present when the message is sent.
|
IMPORT_C void AddLinkedAttachment(const TDesC &aFilePath, const TDesC8 &aMimeType, TRequestStatus &aStatus);
Add an attachment to this message asynchronously.
The attachment is linked to the message from the supplied filename. This file must be present when the message is sent.
|
IMPORT_C void AddLinkedAttachment(const TDesC &aFilePath, TRequestStatus &aStatus);
Add an attachment to this message asynchronously.
The attachment is linked to the message from the supplied filename. This file must be present when the message is sent.
|
IMPORT_C void CreateAttachmentL(const TDesC &aFileName, RFile &aAttachmentFile);
Create an attachment to this message. The RFile
object should not be open when this method is called. On return, the supplied RFile
is able to write into the file.
|
IMPORT_C void CreateAttachmentL(const TDesC &aFileName, RFile &aAttachmentFile, const TDesC8 &aMimeType);
Create an attachment to this message. The RFile
object should not be open when this method is called. On return, the supplied RFile
is able to write into the file.
|
IMPORT_C void CreateAttachmentL(const TDesC &aFileName, RFile &aAttachmentFile, const TDesC8 &aMimeType, TUint aCharset);
Create an attachment to this message. The RFile
object should not be open when this method is called. On return, the supplied RFile
is able to write into the file.
|
IMPORT_C void Cancel();
Cancels any asynchronous request.
Only a single asynchronous request is supported at any one time. This method cancels the current requests if any.
TSendAsRecipientType
Defines the recipient types available when adding a recipient to a message
|