epoc32/include/rsendasmessage.h
branchSymbian2
changeset 2 2fe1408b6811
parent 0 061f57f2323e
equal deleted inserted replaced
1:666f914201fb 2:2fe1408b6811
     1 rsendasmessage.h
     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 the License "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members
       
     5 // which accompanies this distribution, and is available
       
     6 // at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 //
       
    15 
       
    16 #ifndef __RSENDASMESSAGE_H__
       
    17 #define __RSENDASMESSAGE_H__
       
    18 
       
    19 #include <msvapi.h>
       
    20 #include <csendasaccounts.h>
       
    21 #include <cmsvrecipientlist.h>
       
    22 
       
    23 class RSendAs;
       
    24 class CRichText;
       
    25 class RFile;
       
    26 
       
    27 /**
       
    28 Send as progress
       
    29 
       
    30 @publishedAll
       
    31 @released
       
    32 */
       
    33 typedef CMsvSendOperation::TSendOperationProgress TSendAsProgress;
       
    34 
       
    35 /**
       
    36 Encapsulates creating and sending a message.  This class requires
       
    37 a connected RSendAs session.
       
    38 
       
    39 A client application can have several RSendAsMessage objects created simultaneously.
       
    40 Each RSendAsMessage object corresponds to a single message.
       
    41 
       
    42 With the RSendAsMessage class, a client application can perform the following
       
    43 operations:
       
    44 
       
    45 -Creating and managing a message
       
    46 
       
    47 -Modifying a message created using SendAs
       
    48 
       
    49 -Sending a message
       
    50 
       
    51 -Launching a message editor
       
    52 
       
    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.
       
    57 
       
    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:  
       
    60 
       
    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.
       
    63 
       
    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.
       
    66 
       
    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.
       
    71 
       
    72 @publishedAll
       
    73 @released
       
    74 */
       
    75 class RSendAsMessage : public RSubSessionBase
       
    76 	{
       
    77 public:
       
    78 /**
       
    79 Defines the recipient types available when adding a recipient to a message
       
    80 */
       
    81 	enum TSendAsRecipientType
       
    82 		{
       
    83 		/**
       
    84 		Designates a 'To' recipient.
       
    85 		*/
       
    86 		ESendAsRecipientTo = EMsvRecipientTo,
       
    87 			
       
    88 		/**
       
    89 		Designates a 'Cc' recipient.
       
    90 		*/
       
    91 		ESendAsRecipientCc,
       
    92 		
       
    93 		/**
       
    94 		Designates a 'Bcc' recipient.
       
    95 		*/
       
    96 		ESendAsRecipientBcc
       
    97 		};
       
    98 public:
       
    99 	IMPORT_C void CreateL(RSendAs& aSendAs, TSendAsAccount aAccount);
       
   100 	IMPORT_C void CreateL(RSendAs& aSendAs, TUid aMessageType);
       
   101 	//
       
   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();
       
   108 	//
       
   109 	IMPORT_C void ProgressL(TSendAsProgress& aProgress);
       
   110 
       
   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);
       
   115 	//
       
   116 	IMPORT_C void AddRecipientL(const TDesC& aAddress, TSendAsRecipientType aRecipientType);
       
   117 	IMPORT_C void AddRecipientL(const TDesC& aAddress, const TDesC& aAlias, TSendAsRecipientType aRecipientType);
       
   118 	//
       
   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);
       
   122 
       
   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);
       
   126 
       
   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);
       
   130 	
       
   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);
       
   134 	
       
   135 	//
       
   136 	IMPORT_C void Cancel();
       
   137 	IMPORT_C void Close();
       
   138 	
       
   139 	/** 
       
   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.
       
   142 	*/
       
   143 	IMPORT_C void SetCharacterSetL(const TUint aCharset);
       
   144 
       
   145 
       
   146 private:
       
   147 	TAny* iAny; // Future proofing.
       
   148 	};
       
   149 
       
   150 #endif	//  __RSENDASMESSAGE_H__