williamr@2
|
1 |
// Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
|
williamr@2
|
2 |
// All rights reserved.
|
williamr@2
|
3 |
// This component and the accompanying materials are made available
|
williamr@4
|
4 |
// under the terms of "Eclipse Public License v1.0"
|
williamr@2
|
5 |
// which accompanies this distribution, and is available
|
williamr@4
|
6 |
// at the URL "http://www.eclipse.org/legal/epl-v10.html".
|
williamr@2
|
7 |
//
|
williamr@2
|
8 |
// Initial Contributors:
|
williamr@2
|
9 |
// Nokia Corporation - initial contribution.
|
williamr@2
|
10 |
//
|
williamr@2
|
11 |
// Contributors:
|
williamr@2
|
12 |
//
|
williamr@2
|
13 |
// Description:
|
williamr@2
|
14 |
//
|
williamr@2
|
15 |
|
williamr@2
|
16 |
#ifndef __RSENDASMESSAGE_H__
|
williamr@2
|
17 |
#define __RSENDASMESSAGE_H__
|
williamr@2
|
18 |
|
williamr@2
|
19 |
#include <msvapi.h>
|
williamr@2
|
20 |
#include <csendasaccounts.h>
|
williamr@2
|
21 |
#include <cmsvrecipientlist.h>
|
williamr@2
|
22 |
|
williamr@2
|
23 |
class RSendAs;
|
williamr@2
|
24 |
class CRichText;
|
williamr@2
|
25 |
class RFile;
|
williamr@2
|
26 |
|
williamr@2
|
27 |
/**
|
williamr@2
|
28 |
Send as progress
|
williamr@2
|
29 |
|
williamr@2
|
30 |
@publishedAll
|
williamr@2
|
31 |
@released
|
williamr@2
|
32 |
*/
|
williamr@2
|
33 |
typedef CMsvSendOperation::TSendOperationProgress TSendAsProgress;
|
williamr@2
|
34 |
|
williamr@2
|
35 |
/**
|
williamr@2
|
36 |
Encapsulates creating and sending a message. This class requires
|
williamr@2
|
37 |
a connected RSendAs session.
|
williamr@2
|
38 |
|
williamr@2
|
39 |
A client application can have several RSendAsMessage objects created simultaneously.
|
williamr@2
|
40 |
Each RSendAsMessage object corresponds to a single message.
|
williamr@2
|
41 |
|
williamr@2
|
42 |
With the RSendAsMessage class, a client application can perform the following
|
williamr@2
|
43 |
operations:
|
williamr@2
|
44 |
|
williamr@2
|
45 |
-Creating and managing a message
|
williamr@2
|
46 |
|
williamr@2
|
47 |
-Modifying a message created using SendAs
|
williamr@2
|
48 |
|
williamr@2
|
49 |
-Sending a message
|
williamr@2
|
50 |
|
williamr@2
|
51 |
-Launching a message editor
|
williamr@2
|
52 |
|
williamr@2
|
53 |
Client applications do not require any capabilities in order to use the RSendAs
|
williamr@2
|
54 |
and RSendAsMessage APIs. However, if an application does not have the necessary security
|
williamr@2
|
55 |
capabilities to send a message, the SendAs server ensures that a message is only sent
|
williamr@2
|
56 |
after the user's authorization.
|
williamr@2
|
57 |
|
williamr@2
|
58 |
A message created using RSendAsMessage can be saved, sent, or passed to the appropriate
|
williamr@2
|
59 |
message editor. There are two types of send operation:
|
williamr@2
|
60 |
|
williamr@2
|
61 |
-A confirmed send is forwarded to the UI MTM for the message type. Typically this
|
williamr@2
|
62 |
results in the user being asked to confirm that the message should be sent.
|
williamr@2
|
63 |
|
williamr@2
|
64 |
-An unconfirmed send fails if the client application does not have the
|
williamr@2
|
65 |
required capabilities to use the server MTM for the message type.
|
williamr@2
|
66 |
|
williamr@2
|
67 |
There are asynchronous and synchronous forms of these sending methods. Progress information for
|
williamr@2
|
68 |
sending is available when the asynchronous forms are used. The synchronous forms, and the
|
williamr@2
|
69 |
methods for saving the message and for launching it in a message editor, all close the handle to the
|
williamr@2
|
70 |
RSendAsMessage, so the message cannot be further accessed through the API.
|
williamr@2
|
71 |
|
williamr@2
|
72 |
@publishedAll
|
williamr@2
|
73 |
@released
|
williamr@2
|
74 |
*/
|
williamr@2
|
75 |
class RSendAsMessage : public RSubSessionBase
|
williamr@2
|
76 |
{
|
williamr@2
|
77 |
public:
|
williamr@2
|
78 |
/**
|
williamr@2
|
79 |
Defines the recipient types available when adding a recipient to a message
|
williamr@2
|
80 |
*/
|
williamr@2
|
81 |
enum TSendAsRecipientType
|
williamr@2
|
82 |
{
|
williamr@2
|
83 |
/**
|
williamr@2
|
84 |
Designates a 'To' recipient.
|
williamr@2
|
85 |
*/
|
williamr@2
|
86 |
ESendAsRecipientTo = EMsvRecipientTo,
|
williamr@2
|
87 |
|
williamr@2
|
88 |
/**
|
williamr@2
|
89 |
Designates a 'Cc' recipient.
|
williamr@2
|
90 |
*/
|
williamr@2
|
91 |
ESendAsRecipientCc,
|
williamr@2
|
92 |
|
williamr@2
|
93 |
/**
|
williamr@2
|
94 |
Designates a 'Bcc' recipient.
|
williamr@2
|
95 |
*/
|
williamr@2
|
96 |
ESendAsRecipientBcc
|
williamr@2
|
97 |
};
|
williamr@2
|
98 |
public:
|
williamr@2
|
99 |
IMPORT_C void CreateL(RSendAs& aSendAs, TSendAsAccount aAccount);
|
williamr@2
|
100 |
IMPORT_C void CreateL(RSendAs& aSendAs, TUid aMessageType);
|
williamr@2
|
101 |
//
|
williamr@2
|
102 |
IMPORT_C void SendMessage(TRequestStatus& aStatus);
|
williamr@2
|
103 |
IMPORT_C void SendMessageAndCloseL(); // Sends in background
|
williamr@2
|
104 |
IMPORT_C void SendMessageConfirmed(TRequestStatus& aStatus);
|
williamr@2
|
105 |
IMPORT_C void SendMessageConfirmedAndCloseL(); // Sends in background
|
williamr@2
|
106 |
IMPORT_C void LaunchEditorAndCloseL();
|
williamr@2
|
107 |
IMPORT_C void SaveMessageAndCloseL();
|
williamr@2
|
108 |
//
|
williamr@2
|
109 |
IMPORT_C void ProgressL(TSendAsProgress& aProgress);
|
williamr@2
|
110 |
|
williamr@2
|
111 |
IMPORT_C void SetBodyTextL(const CRichText& aBody);
|
williamr@2
|
112 |
IMPORT_C void SetBodyTextL(const TDesC& aBody);
|
williamr@2
|
113 |
IMPORT_C void SetSubjectL(const TDesC& aSubject);
|
williamr@2
|
114 |
IMPORT_C void SetBioTypeL(TUid aBioType);
|
williamr@2
|
115 |
//
|
williamr@2
|
116 |
IMPORT_C void AddRecipientL(const TDesC& aAddress, TSendAsRecipientType aRecipientType);
|
williamr@2
|
117 |
IMPORT_C void AddRecipientL(const TDesC& aAddress, const TDesC& aAlias, TSendAsRecipientType aRecipientType);
|
williamr@2
|
118 |
//
|
williamr@2
|
119 |
IMPORT_C void AddAttachment(const TDesC& aFilePath, const TDesC8& aMimeType, TUint aCharset, TRequestStatus& aStatus);
|
williamr@2
|
120 |
IMPORT_C void AddAttachment(const TDesC& aFilePath, const TDesC8& aMimeType, TRequestStatus& aStatus);
|
williamr@2
|
121 |
IMPORT_C void AddAttachment(const TDesC& aFilePath, TRequestStatus& aStatus);
|
williamr@2
|
122 |
|
williamr@2
|
123 |
IMPORT_C void AddAttachment(RFile& aFile, const TDesC8& aMimeType, TUint aCharset, TRequestStatus& aStatus);
|
williamr@2
|
124 |
IMPORT_C void AddAttachment(RFile& aFile, const TDesC8& aMimeType, TRequestStatus& aStatus);
|
williamr@2
|
125 |
IMPORT_C void AddAttachment(RFile& aFile, TRequestStatus& aStatus);
|
williamr@2
|
126 |
|
williamr@2
|
127 |
IMPORT_C void AddLinkedAttachment(const TDesC& aFilePath, const TDesC8& aMimeType, TUint aCharset, TRequestStatus& aStatus);
|
williamr@2
|
128 |
IMPORT_C void AddLinkedAttachment(const TDesC& aFilePath, const TDesC8& aMimeType, TRequestStatus& aStatus);
|
williamr@2
|
129 |
IMPORT_C void AddLinkedAttachment(const TDesC& aFilePath, TRequestStatus& aStatus);
|
williamr@2
|
130 |
|
williamr@2
|
131 |
IMPORT_C void CreateAttachmentL(const TDesC& aFileName, RFile& aAttachmentFile);
|
williamr@2
|
132 |
IMPORT_C void CreateAttachmentL(const TDesC& aFileName, RFile& aAttachmentFile, const TDesC8& aMimeType);
|
williamr@2
|
133 |
IMPORT_C void CreateAttachmentL(const TDesC& aFileName, RFile& aAttachmentFile, const TDesC8& aMimeType, TUint aCharset);
|
williamr@2
|
134 |
|
williamr@2
|
135 |
//
|
williamr@2
|
136 |
IMPORT_C void Cancel();
|
williamr@2
|
137 |
IMPORT_C void Close();
|
williamr@2
|
138 |
|
williamr@2
|
139 |
/**
|
williamr@2
|
140 |
Sets the character encoding value. The character encoding value options are 7-bit,
|
williamr@2
|
141 |
8-bit and 16-Bit Unicode. By default the character set encoding is 7 bit encoding.
|
williamr@2
|
142 |
*/
|
williamr@2
|
143 |
IMPORT_C void SetCharacterSetL(const TUint aCharset);
|
williamr@2
|
144 |
|
williamr@2
|
145 |
|
williamr@2
|
146 |
private:
|
williamr@2
|
147 |
TAny* iAny; // Future proofing.
|
williamr@2
|
148 |
};
|
williamr@2
|
149 |
|
williamr@2
|
150 |
#endif // __RSENDASMESSAGE_H__
|