|
1 /* |
|
2 * Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: Provides meeting request sending service. |
|
15 * Service expects to received messages of type CMimeMessageData. |
|
16 * Implements CSendingService. |
|
17 * |
|
18 */ |
|
19 |
|
20 |
|
21 |
|
22 #ifndef CMEETINGREQUESTSENDER_H |
|
23 #define CMEETINGREQUESTSENDER_H |
|
24 |
|
25 // INCLUDES |
|
26 #include <e32base.h> |
|
27 #include <e32std.h> // RPointerArray |
|
28 #include <msvapi.h> // MMsvSessionObserver |
|
29 #include <f32file.h> // RFs |
|
30 #include <coemain.h> |
|
31 #include <CSendingService.h> |
|
32 #include <CMessageAddress.h> |
|
33 #include <SenduiMtmUids.h> |
|
34 #include <CMsvRecipientList.h> |
|
35 #include "MeetingRequestSenderUids.hrh" |
|
36 |
|
37 // FORWARD DECLARATIONS |
|
38 class CMsvSession; |
|
39 class CClientMtmRegistry; |
|
40 class CBaseMtm; |
|
41 class TDataType; |
|
42 class CMeetingRequestData; |
|
43 class CSendUiAttachment; |
|
44 class CSendUiSingleton; |
|
45 |
|
46 // CLASS DEFINITION |
|
47 /** |
|
48 * |
|
49 * CMeetingRequestSender in an ECOM plug-in to Sendui. |
|
50 * Plug-in is used to send meeting requests. |
|
51 * Sendui is responsible of instantiating and calling the |
|
52 * service when needed. |
|
53 * @lib MeetingRequestSender.dll |
|
54 * @since Series 60 3.0 |
|
55 */ |
|
56 class CMeetingRequestSender : public CSendingService |
|
57 { |
|
58 public: // Constructors and destructor |
|
59 |
|
60 /** |
|
61 * Two-phased constructor. |
|
62 */ |
|
63 static CMeetingRequestSender* NewL( TSendingServiceParams* aParams ); |
|
64 |
|
65 /** |
|
66 * Two-phased constructor. |
|
67 */ |
|
68 static CMeetingRequestSender* NewLC( TSendingServiceParams* aParams ); |
|
69 |
|
70 /** |
|
71 * Destructor. |
|
72 */ |
|
73 virtual ~CMeetingRequestSender(); |
|
74 |
|
75 private: // Constructors |
|
76 |
|
77 /** |
|
78 * C++ default constructor. |
|
79 */ |
|
80 CMeetingRequestSender( CCoeEnv& aCoeEnv, CSendUiSingleton& aSingleton ); |
|
81 |
|
82 /** |
|
83 * By default Symbian 2nd phase constructor is private. |
|
84 */ |
|
85 void ConstructL( ); |
|
86 |
|
87 public: // Methods from CSendingService |
|
88 |
|
89 void PopulateServicesListL( |
|
90 RPointerArray<CSendingServiceInfo>& aList ); |
|
91 |
|
92 void CreateAndSendMessageL( |
|
93 TUid aServiceUid, |
|
94 const CMessageData* aMessageData, |
|
95 TBool aLaunchEditorEmbedded = ETrue); |
|
96 |
|
97 TUid ServiceProviderId() const; |
|
98 |
|
99 /** |
|
100 * Return technology type of a given service |
|
101 * |
|
102 * @since Series 60 v3.1 |
|
103 * @return TUid Technology type id |
|
104 */ |
|
105 TUid TechnologyTypeId( ) const; |
|
106 |
|
107 private: // New methods |
|
108 |
|
109 /** |
|
110 * Creates and sends message by using client MTM. |
|
111 * |
|
112 * @since Series 60 3.0 |
|
113 * @param aMessageData Data for the meeting request message. |
|
114 * @return None. |
|
115 */ |
|
116 void DoCreateAndSendMessageL( const CMessageData& aMessageData, |
|
117 CMeetingRequestData* aMeetingRequestData ); |
|
118 |
|
119 /** |
|
120 * Transfer iCal IDs to client MTM. |
|
121 * |
|
122 * @since Series 60 3.0 |
|
123 * @param aMessageData Data for the meeting request message. |
|
124 * @return None. |
|
125 */ |
|
126 void TransferIdsToClientL( const CMessageData& aMessageData ); |
|
127 |
|
128 /** |
|
129 * Creates new message. Index entry is initialized and |
|
130 * new message is created in drafs folder. |
|
131 * @since Series 60 3.0 |
|
132 * @param aMessageData Message containing subject. |
|
133 * @return None. |
|
134 */ |
|
135 void CreateMessageL( const CMessageData& aMessageData ); |
|
136 |
|
137 /** |
|
138 * Add addressees. |
|
139 * @since Series 60 3.0 |
|
140 * @param aRecipientType Recipient type. |
|
141 * @param aAddressees Array of addressees. |
|
142 * @return None. |
|
143 */ |
|
144 void AddAddresseesL( |
|
145 TMsvRecipientType aRecipientType, |
|
146 const CMessageAddressArray& aAddressees ); |
|
147 |
|
148 /** |
|
149 * Add attachment to email. |
|
150 * @since Series 60 3.0 |
|
151 * @param Attachment. |
|
152 * @return None |
|
153 */ |
|
154 void AddAttachmentL( |
|
155 CSendUiAttachment* aAttachment, |
|
156 TInt aLinksSupported ); |
|
157 |
|
158 /** |
|
159 * Remove illegal characters from string. Illegal chars |
|
160 * are replaced with spaces. String is trimmed before it is |
|
161 * returned. |
|
162 * @since Series 60 3.0 |
|
163 * @param aCheckedString String where chars are removed |
|
164 * @return None |
|
165 */ |
|
166 void RemoveIllegalChars( HBufC* aCheckedString ); |
|
167 |
|
168 /** |
|
169 * Initialize plug-in service info. |
|
170 * @since Series 60 3.0 |
|
171 * @return None |
|
172 */ |
|
173 void InitializeServiceL(); |
|
174 |
|
175 /** |
|
176 * Set message body. |
|
177 * @since Series 60 3.0 |
|
178 * @param aMessageData Message data which contains the body. |
|
179 * @return None. |
|
180 */ |
|
181 void SetBodyL( const CMessageData& aMessageData ); |
|
182 |
|
183 /** |
|
184 * Create email headers ("standard" and MIME) |
|
185 * @since Series 60 3.0 |
|
186 * @param aMessageData Message which contains attendees and MIME type. |
|
187 * @return None. |
|
188 */ |
|
189 void CreateHeaderL( const CMessageData& aMessageData, CMeetingRequestData* aMeetingRequestData ); |
|
190 |
|
191 /** |
|
192 * Add attachments to the email. |
|
193 * @since Series 60 3.0 |
|
194 * @param aMessageData Message which contains attachments. |
|
195 * @return None. |
|
196 */ |
|
197 void AddAttachmentsL( const CMessageData& aMessageData ); |
|
198 |
|
199 /** |
|
200 * Check if there are enough disk space. |
|
201 * @since Series 60 3.0 |
|
202 * @param aMsgSize Total message size including attachments. |
|
203 * @return None. |
|
204 */ |
|
205 void CheckDiskSpaceL( TInt aMsgSize ); |
|
206 |
|
207 /** |
|
208 * Initialize standard email header. |
|
209 * @since Series 60 3.0 |
|
210 * @param aMessageData Message containing addressees. |
|
211 * @return None. |
|
212 */ |
|
213 void InitStdHeaderL( const CMessageData& aMessageData ); |
|
214 |
|
215 /** |
|
216 * Initialize MIME email header. |
|
217 * @since Series 60 3.0 |
|
218 * @param aMessageData Message containing MIME type. |
|
219 * @return None. |
|
220 */ |
|
221 void InitMimeHeaderL( CMeetingRequestData* aMeetingRequestData ); |
|
222 |
|
223 /** |
|
224 * Validate email. |
|
225 * @since Series 60 3.0 |
|
226 * @return ETrue, if email is valid. |
|
227 */ |
|
228 TBool ValidateEmail( ); |
|
229 |
|
230 /** |
|
231 * Send email. |
|
232 * @since Series 60 3.0 |
|
233 * @return None. |
|
234 */ |
|
235 void SendEmailL( ); |
|
236 |
|
237 /** |
|
238 * Initialize and create MTM client resources. |
|
239 * @since Series 60 3.0 |
|
240 * @param aMessageData |
|
241 * @return None. |
|
242 */ |
|
243 void InitResourcesL( CMeetingRequestData* aMeetingRequestData ); |
|
244 |
|
245 /** |
|
246 * Move message to specified folder (usually outbox). |
|
247 * @since Series 60 3.0 |
|
248 * @param aTarget Id of target folder. |
|
249 * @return None. |
|
250 */ |
|
251 void MoveMessageEntryL( TMsvId aTarget ); |
|
252 |
|
253 /** |
|
254 * Resolves the client MTM type by using service id. |
|
255 * @since Series 60 3.0 |
|
256 * @param aServiceId Mailbox id |
|
257 * @return None. |
|
258 */ |
|
259 void ResolveClientMTMTypeL( TMsvId aServiceId ); |
|
260 |
|
261 /** |
|
262 * Returns a new descriptor where "MAILTO:" prefix |
|
263 * is removed if it existed. |
|
264 * @since Series 60 3.0 |
|
265 * @param aAddress Text string to be parsed. |
|
266 * @return TPtrC A new string which has no "MAILTO:" prefix. |
|
267 */ |
|
268 TPtrC AttendeeAdressWithoutPrefix( const TDesC& aAddress ); |
|
269 |
|
270 private: // Data |
|
271 |
|
272 // Contains pointers to the data of the services provided by this plugin. |
|
273 // Pointed service data objects are owned. |
|
274 RPointerArray<CSendingServiceInfo> iServiceArray; |
|
275 |
|
276 CStreamStore* iStore; //Owns |
|
277 CBaseMtm* iClientMtm; //Owns |
|
278 TMsvId iMailServiceId; |
|
279 TUid iClientMtmType; |
|
280 }; |
|
281 |
|
282 |
|
283 #endif // CMEETINGREQUESTSENDER_H |
|
284 |
|
285 // End of File |