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