1.1 --- a/epoc32/include/rsendasmessage.h Tue Nov 24 13:55:44 2009 +0000
1.2 +++ b/epoc32/include/rsendasmessage.h Tue Mar 16 16:12:26 2010 +0000
1.3 @@ -1,1 +1,150 @@
1.4 -rsendasmessage.h
1.5 +// Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
1.6 +// All rights reserved.
1.7 +// This component and the accompanying materials are made available
1.8 +// 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
1.9 +// which accompanies this distribution, and is available
1.10 +// at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
1.11 +//
1.12 +// Initial Contributors:
1.13 +// Nokia Corporation - initial contribution.
1.14 +//
1.15 +// Contributors:
1.16 +//
1.17 +// Description:
1.18 +//
1.19 +
1.20 +#ifndef __RSENDASMESSAGE_H__
1.21 +#define __RSENDASMESSAGE_H__
1.22 +
1.23 +#include <msvapi.h>
1.24 +#include <csendasaccounts.h>
1.25 +#include <cmsvrecipientlist.h>
1.26 +
1.27 +class RSendAs;
1.28 +class CRichText;
1.29 +class RFile;
1.30 +
1.31 +/**
1.32 +Send as progress
1.33 +
1.34 +@publishedAll
1.35 +@released
1.36 +*/
1.37 +typedef CMsvSendOperation::TSendOperationProgress TSendAsProgress;
1.38 +
1.39 +/**
1.40 +Encapsulates creating and sending a message. This class requires
1.41 +a connected RSendAs session.
1.42 +
1.43 +A client application can have several RSendAsMessage objects created simultaneously.
1.44 +Each RSendAsMessage object corresponds to a single message.
1.45 +
1.46 +With the RSendAsMessage class, a client application can perform the following
1.47 +operations:
1.48 +
1.49 +-Creating and managing a message
1.50 +
1.51 +-Modifying a message created using SendAs
1.52 +
1.53 +-Sending a message
1.54 +
1.55 +-Launching a message editor
1.56 +
1.57 +Client applications do not require any capabilities in order to use the RSendAs
1.58 +and RSendAsMessage APIs. However, if an application does not have the necessary security
1.59 +capabilities to send a message, the SendAs server ensures that a message is only sent
1.60 +after the user's authorization.
1.61 +
1.62 +A message created using RSendAsMessage can be saved, sent, or passed to the appropriate
1.63 +message editor. There are two types of send operation:
1.64 +
1.65 +-A confirmed send is forwarded to the UI MTM for the message type. Typically this
1.66 +results in the user being asked to confirm that the message should be sent.
1.67 +
1.68 +-An unconfirmed send fails if the client application does not have the
1.69 +required capabilities to use the server MTM for the message type.
1.70 +
1.71 +There are asynchronous and synchronous forms of these sending methods. Progress information for
1.72 +sending is available when the asynchronous forms are used. The synchronous forms, and the
1.73 +methods for saving the message and for launching it in a message editor, all close the handle to the
1.74 +RSendAsMessage, so the message cannot be further accessed through the API.
1.75 +
1.76 +@publishedAll
1.77 +@released
1.78 +*/
1.79 +class RSendAsMessage : public RSubSessionBase
1.80 + {
1.81 +public:
1.82 +/**
1.83 +Defines the recipient types available when adding a recipient to a message
1.84 +*/
1.85 + enum TSendAsRecipientType
1.86 + {
1.87 + /**
1.88 + Designates a 'To' recipient.
1.89 + */
1.90 + ESendAsRecipientTo = EMsvRecipientTo,
1.91 +
1.92 + /**
1.93 + Designates a 'Cc' recipient.
1.94 + */
1.95 + ESendAsRecipientCc,
1.96 +
1.97 + /**
1.98 + Designates a 'Bcc' recipient.
1.99 + */
1.100 + ESendAsRecipientBcc
1.101 + };
1.102 +public:
1.103 + IMPORT_C void CreateL(RSendAs& aSendAs, TSendAsAccount aAccount);
1.104 + IMPORT_C void CreateL(RSendAs& aSendAs, TUid aMessageType);
1.105 + //
1.106 + IMPORT_C void SendMessage(TRequestStatus& aStatus);
1.107 + IMPORT_C void SendMessageAndCloseL(); // Sends in background
1.108 + IMPORT_C void SendMessageConfirmed(TRequestStatus& aStatus);
1.109 + IMPORT_C void SendMessageConfirmedAndCloseL(); // Sends in background
1.110 + IMPORT_C void LaunchEditorAndCloseL();
1.111 + IMPORT_C void SaveMessageAndCloseL();
1.112 + //
1.113 + IMPORT_C void ProgressL(TSendAsProgress& aProgress);
1.114 +
1.115 + IMPORT_C void SetBodyTextL(const CRichText& aBody);
1.116 + IMPORT_C void SetBodyTextL(const TDesC& aBody);
1.117 + IMPORT_C void SetSubjectL(const TDesC& aSubject);
1.118 + IMPORT_C void SetBioTypeL(TUid aBioType);
1.119 + //
1.120 + IMPORT_C void AddRecipientL(const TDesC& aAddress, TSendAsRecipientType aRecipientType);
1.121 + IMPORT_C void AddRecipientL(const TDesC& aAddress, const TDesC& aAlias, TSendAsRecipientType aRecipientType);
1.122 + //
1.123 + IMPORT_C void AddAttachment(const TDesC& aFilePath, const TDesC8& aMimeType, TUint aCharset, TRequestStatus& aStatus);
1.124 + IMPORT_C void AddAttachment(const TDesC& aFilePath, const TDesC8& aMimeType, TRequestStatus& aStatus);
1.125 + IMPORT_C void AddAttachment(const TDesC& aFilePath, TRequestStatus& aStatus);
1.126 +
1.127 + IMPORT_C void AddAttachment(RFile& aFile, const TDesC8& aMimeType, TUint aCharset, TRequestStatus& aStatus);
1.128 + IMPORT_C void AddAttachment(RFile& aFile, const TDesC8& aMimeType, TRequestStatus& aStatus);
1.129 + IMPORT_C void AddAttachment(RFile& aFile, TRequestStatus& aStatus);
1.130 +
1.131 + IMPORT_C void AddLinkedAttachment(const TDesC& aFilePath, const TDesC8& aMimeType, TUint aCharset, TRequestStatus& aStatus);
1.132 + IMPORT_C void AddLinkedAttachment(const TDesC& aFilePath, const TDesC8& aMimeType, TRequestStatus& aStatus);
1.133 + IMPORT_C void AddLinkedAttachment(const TDesC& aFilePath, TRequestStatus& aStatus);
1.134 +
1.135 + IMPORT_C void CreateAttachmentL(const TDesC& aFileName, RFile& aAttachmentFile);
1.136 + IMPORT_C void CreateAttachmentL(const TDesC& aFileName, RFile& aAttachmentFile, const TDesC8& aMimeType);
1.137 + IMPORT_C void CreateAttachmentL(const TDesC& aFileName, RFile& aAttachmentFile, const TDesC8& aMimeType, TUint aCharset);
1.138 +
1.139 + //
1.140 + IMPORT_C void Cancel();
1.141 + IMPORT_C void Close();
1.142 +
1.143 + /**
1.144 + Sets the character encoding value. The character encoding value options are 7-bit,
1.145 + 8-bit and 16-Bit Unicode. By default the character set encoding is 7 bit encoding.
1.146 + */
1.147 + IMPORT_C void SetCharacterSetL(const TUint aCharset);
1.148 +
1.149 +
1.150 +private:
1.151 + TAny* iAny; // Future proofing.
1.152 + };
1.153 +
1.154 +#endif // __RSENDASMESSAGE_H__