williamr@2
|
1 |
// Copyright (c) 1998-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 __IMAPSET_H__
|
williamr@2
|
17 |
#define __IMAPSET_H__
|
williamr@2
|
18 |
|
williamr@2
|
19 |
|
williamr@2
|
20 |
|
williamr@2
|
21 |
|
williamr@2
|
22 |
#include <msvuids.h>
|
williamr@2
|
23 |
#include <miutset.h>
|
williamr@2
|
24 |
|
williamr@2
|
25 |
class TBearerTypes;
|
williamr@2
|
26 |
class TImImap4GetPartialMailInfo;
|
williamr@2
|
27 |
|
williamr@2
|
28 |
/** Default IMAP4 server port number. */
|
williamr@2
|
29 |
const TUint32 KIMAPDefaultPortNumber = 143;
|
williamr@2
|
30 |
|
williamr@2
|
31 |
/** Default inbox refresh rate in seconds. */
|
williamr@2
|
32 |
const TInt KImapDefaultInboxSyncRate = 300;
|
williamr@2
|
33 |
|
williamr@2
|
34 |
/** Default idle timeout in seconds. */
|
williamr@2
|
35 |
const TInt KImapDefaultIdleTimeout = 1740;
|
williamr@2
|
36 |
|
williamr@2
|
37 |
/** Default fetch size in bytes. */
|
williamr@2
|
38 |
const TUint KImapDefaultFetchSizeBytes = 20480;
|
williamr@2
|
39 |
|
williamr@2
|
40 |
|
williamr@2
|
41 |
|
williamr@2
|
42 |
/** @deprecated */
|
williamr@2
|
43 |
const TInt32 KImImapSynchroniseAll = -1;
|
williamr@2
|
44 |
|
williamr@2
|
45 |
/** @deprecated */
|
williamr@2
|
46 |
const TInt32 KImImapSynchroniseNone = 0;
|
williamr@2
|
47 |
|
williamr@2
|
48 |
|
williamr@2
|
49 |
/**
|
williamr@2
|
50 |
Describes the folder subscription synchronisation strategy.
|
williamr@2
|
51 |
|
williamr@2
|
52 |
This specifies whether the local or remote folder subscription flags, or a
|
williamr@2
|
53 |
combination of both, are used to determine which mailboxes are synchronised.
|
williamr@2
|
54 |
For an overview of the synchronisation process, see CImap4ClientMtm.
|
williamr@2
|
55 |
|
williamr@2
|
56 |
@see CImImap4Settings::SetSynchronise()
|
williamr@2
|
57 |
@see CImImap4Settings::Synchronise()
|
williamr@2
|
58 |
|
williamr@2
|
59 |
@publishedAll
|
williamr@2
|
60 |
@released
|
williamr@2
|
61 |
*/
|
williamr@2
|
62 |
enum TFolderSyncType
|
williamr@2
|
63 |
{
|
williamr@2
|
64 |
/** Folders that are marked for subscription either locally or remotely are synchronised. */
|
williamr@2
|
65 |
EUseCombination=0,
|
williamr@2
|
66 |
/** Only folders marked for subscription locally are synchronised. */
|
williamr@2
|
67 |
EUseLocal,
|
williamr@2
|
68 |
/** Only folders marked for subscription remotely are synchronised. */
|
williamr@2
|
69 |
EUseRemote
|
williamr@2
|
70 |
};
|
williamr@2
|
71 |
|
williamr@2
|
72 |
|
williamr@2
|
73 |
/**
|
williamr@2
|
74 |
Specifies methods of synchronising IMAP4 subscription information with a server.
|
williamr@2
|
75 |
|
williamr@2
|
76 |
Subscription settings that have been set on folders on the local device, and
|
williamr@2
|
77 |
subscription settings that have been set on the corresponding mailboxes on the
|
williamr@2
|
78 |
remote server can be synchronised, as part of the synchronisation process
|
williamr@2
|
79 |
(see the overview for CImap4ClientMtm).
|
williamr@2
|
80 |
|
williamr@2
|
81 |
@see CImImap4Settings::SetSubscribe()
|
williamr@2
|
82 |
@see CImImap4Settings::Subscribe()
|
williamr@2
|
83 |
|
williamr@2
|
84 |
@publishedAll
|
williamr@2
|
85 |
@released
|
williamr@2
|
86 |
*/
|
williamr@2
|
87 |
enum TFolderSubscribeType
|
williamr@2
|
88 |
{
|
williamr@2
|
89 |
/** Do not alter local or remote subscription information. */
|
williamr@2
|
90 |
EUpdateNeither=0,
|
williamr@2
|
91 |
/** Update local copy of subscription information when it is received from the
|
williamr@2
|
92 |
remote IMAP4 server at the beginning of the mail session. */
|
williamr@2
|
93 |
EUpdateLocal,
|
williamr@2
|
94 |
/** Update remote copy of subscription information so that it matches the local
|
williamr@2
|
95 |
subscription information. */
|
williamr@2
|
96 |
EUpdateRemote,
|
williamr@2
|
97 |
/** Merge local and remote subscription information, store updated information
|
williamr@2
|
98 |
on the remote server and store merged data on the local message store. */
|
williamr@2
|
99 |
EUpdateBoth
|
williamr@2
|
100 |
};
|
williamr@2
|
101 |
|
williamr@2
|
102 |
|
williamr@2
|
103 |
/**
|
williamr@2
|
104 |
Defines which components of a message to fetch when copying or moving from
|
williamr@2
|
105 |
a server.
|
williamr@2
|
106 |
|
williamr@2
|
107 |
@see CImImap4Settings::SetGetMailOptions()
|
williamr@2
|
108 |
@see CImImap4Settings::GetMailOptions()
|
williamr@2
|
109 |
|
williamr@2
|
110 |
@publishedAll
|
williamr@2
|
111 |
@released
|
williamr@2
|
112 |
*/
|
williamr@2
|
113 |
enum TImap4GetMailOptions
|
williamr@2
|
114 |
{
|
williamr@2
|
115 |
/** Get message headers. */
|
williamr@2
|
116 |
EGetImap4EmailHeaders,
|
williamr@2
|
117 |
/** Get message body. */
|
williamr@2
|
118 |
EGetImap4EmailBodyText,
|
williamr@2
|
119 |
/** Get message body and attachments. */
|
williamr@2
|
120 |
EGetImap4EmailBodyTextAndAttachments,
|
williamr@2
|
121 |
/** Get message attachments. */
|
williamr@2
|
122 |
EGetImap4EmailAttachments,
|
williamr@2
|
123 |
/** Get message body, including non-plain or non-HTML alternative text parts (or attachments). */
|
williamr@2
|
124 |
EGetImap4EmailBodyAlternativeText
|
williamr@2
|
125 |
};
|
williamr@2
|
126 |
|
williamr@2
|
127 |
/**
|
williamr@2
|
128 |
Defines which components of a message should be fetched partially when
|
williamr@2
|
129 |
fetching the message from a server.
|
williamr@2
|
130 |
|
williamr@2
|
131 |
@see
|
williamr@2
|
132 |
CImImap4Settings
|
williamr@2
|
133 |
|
williamr@2
|
134 |
@publishedAll
|
williamr@2
|
135 |
@released
|
williamr@2
|
136 |
*/
|
williamr@2
|
137 |
enum TImImap4PartialMailOptions
|
williamr@2
|
138 |
{
|
williamr@2
|
139 |
/** No size limits, full message to be fetched.*/
|
williamr@2
|
140 |
ENoSizeLimits,
|
williamr@2
|
141 |
/** Get body text only.
|
williamr@2
|
142 |
Gets text/plain part only if text/plain part size + text/html part size
|
williamr@2
|
143 |
is greater than body text size limit.
|
williamr@2
|
144 |
Gets text/plain part and text/html part if text/plain part size + text/html part size
|
williamr@2
|
145 |
is less than body text size limit of the message.*/
|
williamr@2
|
146 |
EBodyTextOnly,
|
williamr@2
|
147 |
/** Gets all the attachments less than attachment size limit.*/
|
williamr@2
|
148 |
EAttachmentsOnly,
|
williamr@2
|
149 |
/** Gets the body text less than or equal to body text size limit and attachments
|
williamr@2
|
150 |
less than or equal to attachment size limit.*/
|
williamr@2
|
151 |
EBodyTextAndAttachments,
|
williamr@2
|
152 |
/** Gets the body text less than total size limit and also attachments whose size
|
williamr@2
|
153 |
is within total size limit minus fetched body parts.*/
|
williamr@2
|
154 |
ECumulative,
|
williamr@2
|
155 |
/** Gets the body text less than total size limit and all non-HTML text attachments whose size
|
williamr@2
|
156 |
is within total size limit minus fetched body parts.*/
|
williamr@2
|
157 |
EBodyAlternativeText
|
williamr@2
|
158 |
};
|
williamr@2
|
159 |
|
williamr@2
|
160 |
/**
|
williamr@2
|
161 |
Flags to indicate what type of IMAP4 progress information is being returned.
|
williamr@2
|
162 |
|
williamr@2
|
163 |
@publishedAll
|
williamr@2
|
164 |
@released
|
williamr@2
|
165 |
*/
|
williamr@2
|
166 |
enum TImap4ProgressType
|
williamr@2
|
167 |
{
|
williamr@2
|
168 |
/** Progress information is an TImap4GenericProgress object. */
|
williamr@2
|
169 |
EImap4GenericProgressType,
|
williamr@2
|
170 |
/** Progress information is an TImap4SyncProgress object. */
|
williamr@2
|
171 |
EImap4SyncProgressType
|
williamr@2
|
172 |
};
|
williamr@2
|
173 |
|
williamr@2
|
174 |
|
williamr@2
|
175 |
class TImap4GenericProgress
|
williamr@2
|
176 |
/**
|
williamr@2
|
177 |
Progress information for an IMAP4 get operation.
|
williamr@2
|
178 |
|
williamr@2
|
179 |
For the 'get mail when already connected' operations, the progress state can
|
williamr@2
|
180 |
be obtained from TImap4GenericProgress::iState. In the case of the 'connect
|
williamr@2
|
181 |
and get mail and disconnect' and 'connect and get mail and stay online', the
|
williamr@2
|
182 |
actual progress defined in TImap4GenericProgress::iState will be of the form
|
williamr@2
|
183 |
of 'Copy New Mail', 'Populating Message Selection' etc. The sub-operation
|
williamr@2
|
184 |
state can then be obtained in the form of 'Connecting', 'Fetching', 'Disconnecting'
|
williamr@2
|
185 |
etc. from TImap4GenericProgress::iImap4SubStateProgress.
|
williamr@2
|
186 |
|
williamr@2
|
187 |
@see
|
williamr@2
|
188 |
CImImap4GetMail
|
williamr@2
|
189 |
|
williamr@2
|
190 |
@publishedAll
|
williamr@2
|
191 |
@released
|
williamr@2
|
192 |
*/
|
williamr@2
|
193 |
{
|
williamr@2
|
194 |
public:
|
williamr@2
|
195 |
IMPORT_C TInt ConnectionState() const;
|
williamr@2
|
196 |
IMPORT_C TInt ConnectionIAP() const;
|
williamr@2
|
197 |
|
williamr@2
|
198 |
public:
|
williamr@2
|
199 |
/** Operation type. */
|
williamr@2
|
200 |
enum TImap4GenericProgressOp
|
williamr@2
|
201 |
{
|
williamr@2
|
202 |
/** Connect operation. */
|
williamr@2
|
203 |
EConnect,
|
williamr@2
|
204 |
/** Disconnect operation. */
|
williamr@2
|
205 |
EDisconnect,
|
williamr@2
|
206 |
/** Sync operation. */
|
williamr@2
|
207 |
ESync,
|
williamr@2
|
208 |
/** Select operation. */
|
williamr@2
|
209 |
ESelect,
|
williamr@2
|
210 |
/** Copy messages to local operation. */
|
williamr@2
|
211 |
ECopyToLocal,
|
williamr@2
|
212 |
/** Copy messages within remote server operation. */
|
williamr@2
|
213 |
ECopyWithinService,
|
williamr@2
|
214 |
/** Copy messages from local operation. */
|
williamr@2
|
215 |
ECopyFromLocal,
|
williamr@2
|
216 |
/** Move messages to local operation. */
|
williamr@2
|
217 |
EMoveToLocal,
|
williamr@2
|
218 |
/** Move messages within remote server operation. */
|
williamr@2
|
219 |
EMoveWithinService,
|
williamr@2
|
220 |
/** Move messages from local operation. */
|
williamr@2
|
221 |
EMoveFromLocal,
|
williamr@2
|
222 |
/** Message population operation. */
|
williamr@2
|
223 |
EPopulate,
|
williamr@2
|
224 |
/** Delete operation. */
|
williamr@2
|
225 |
EDelete,
|
williamr@2
|
226 |
/** Offline delete operation. */
|
williamr@2
|
227 |
EOffLineDelete,
|
williamr@2
|
228 |
/** Offline undelete operation. */
|
williamr@2
|
229 |
EOffLineUndelete,
|
williamr@2
|
230 |
/** Offline delete operation. */
|
williamr@2
|
231 |
EOffLineCopyToLocal,
|
williamr@2
|
232 |
/** Offline move messages to local operation. */
|
williamr@2
|
233 |
EOffLineMoveToLocal,
|
williamr@2
|
234 |
/** Offline copy messages from local operation. */
|
williamr@2
|
235 |
EOffLineCopyFromLocal,
|
williamr@2
|
236 |
/** Offline move messages from local operation. */
|
williamr@2
|
237 |
EOffLineMoveFromLocal,
|
williamr@2
|
238 |
/** Offline copy messages within remote server operation. */
|
williamr@2
|
239 |
EOffLineCopyWithinService,
|
williamr@2
|
240 |
/** Offline move messages within remote server operation. */
|
williamr@2
|
241 |
EOffLineMoveWithinService,
|
williamr@2
|
242 |
/** Offline message population operation. */
|
williamr@2
|
243 |
EOffLinePopulate
|
williamr@2
|
244 |
};
|
williamr@2
|
245 |
|
williamr@2
|
246 |
/** Operation state information. */
|
williamr@2
|
247 |
enum TImap4GenericProgressState
|
williamr@2
|
248 |
{
|
williamr@2
|
249 |
/** Disconnected. */
|
williamr@2
|
250 |
EDisconnected,
|
williamr@2
|
251 |
/** Connecting. */
|
williamr@2
|
252 |
EConnecting,
|
williamr@2
|
253 |
/** Idle. */
|
williamr@2
|
254 |
EIdle,
|
williamr@2
|
255 |
/** Selecting the folder to use. */
|
williamr@2
|
256 |
ESelecting,
|
williamr@2
|
257 |
/** Fetching messages to mirror server. */
|
williamr@2
|
258 |
EFetching,
|
williamr@2
|
259 |
/** Appending local messages to remote server. */
|
williamr@2
|
260 |
EAppending,
|
williamr@2
|
261 |
/** Copying local messages to local or within service. */
|
williamr@2
|
262 |
ECopying,
|
williamr@2
|
263 |
/** Deleting an item, including expunging a folder. */
|
williamr@2
|
264 |
EDeleting,
|
williamr@2
|
265 |
/** Synchronising folder after an operation. */
|
williamr@2
|
266 |
ESyncing,
|
williamr@2
|
267 |
/** Disconnecting. */
|
williamr@2
|
268 |
EDisconnecting,
|
williamr@2
|
269 |
/** Sync already in progress. */
|
williamr@2
|
270 |
EBusy,
|
williamr@2
|
271 |
/** CImImap4GetMail move operation in progress. */
|
williamr@2
|
272 |
EMoving,
|
williamr@2
|
273 |
/** CImImap4GetMail copy new mail operation in progress. */
|
williamr@2
|
274 |
ECopyNewMail,
|
williamr@2
|
275 |
/** CImImap4GetMail move new mail operation in progress. */
|
williamr@2
|
276 |
EMoveNewMail,
|
williamr@2
|
277 |
/** CImImap4GetMail copy selected messages operation in progress. */
|
williamr@2
|
278 |
ECopyMailSelection,
|
williamr@2
|
279 |
/** CImImap4GetMail move selected messages operation in progress. */
|
williamr@2
|
280 |
EMoveMailSelection,
|
williamr@2
|
281 |
/** CImImap4GetMail copy all messages operation in progress. */
|
williamr@2
|
282 |
ECopyAllMail,
|
williamr@2
|
283 |
/** CImImap4GetMail move all messages operation in progress. */
|
williamr@2
|
284 |
EMoveAllMail,
|
williamr@2
|
285 |
/** CImImap4GetMail populate new messages operation in progress. */
|
williamr@2
|
286 |
EPopulateNewMail,
|
williamr@2
|
287 |
/** CImImap4GetMail populate all messages operation in progress. */
|
williamr@2
|
288 |
EPopulateAllMail,
|
williamr@2
|
289 |
/** CImImap4GetMail populate selected messages operation in progress. */
|
williamr@2
|
290 |
EPopulateMailSelection
|
williamr@2
|
291 |
};
|
williamr@2
|
292 |
|
williamr@2
|
293 |
/** Progress information type: always EImap4GenericProgressType. */
|
williamr@2
|
294 |
TImap4ProgressType iType;
|
williamr@2
|
295 |
/** Operation type. */
|
williamr@2
|
296 |
TImap4GenericProgressOp iOperation;
|
williamr@2
|
297 |
/**
|
williamr@2
|
298 |
The progress state.
|
williamr@2
|
299 |
|
williamr@2
|
300 |
For 'connect and get mail and disconnect' and 'connect and get mail and stay
|
williamr@2
|
301 |
online' type operations, additional sub-operation state can be obtained from
|
williamr@2
|
302 |
iImap4SubStateProgress.
|
williamr@2
|
303 |
*/
|
williamr@2
|
304 |
TImap4GenericProgressState iState;
|
williamr@2
|
305 |
/**
|
williamr@2
|
306 |
The progress sub-state.
|
williamr@2
|
307 |
|
williamr@2
|
308 |
This only applies to 'connect and get mail and disconnect' and 'connect and
|
williamr@2
|
309 |
get mail and stay online' type operations.
|
williamr@2
|
310 |
*/
|
williamr@2
|
311 |
TImap4GenericProgressState iImap4SubStateProgress;
|
williamr@2
|
312 |
/** In the EConnecting state, this field holds the connection iap value,
|
williamr@2
|
313 |
otherwise it holds the number of messages still to be processed. */
|
williamr@2
|
314 |
TInt iMsgsToDo;
|
williamr@2
|
315 |
/** In the EConnecting state, this field holds the connection stage value,
|
williamr@2
|
316 |
otherwise it holds the number of messages processed. */
|
williamr@2
|
317 |
TInt iMsgsDone;
|
williamr@2
|
318 |
/** Number of message parts still to be processed. */
|
williamr@2
|
319 |
TInt iPartsToDo;
|
williamr@2
|
320 |
/** Number of message parts processed. */
|
williamr@2
|
321 |
TInt iPartsDone;
|
williamr@2
|
322 |
/** Number of bytes (for a multipart fetch) still to be processed. */
|
williamr@2
|
323 |
TInt iBytesToDo;
|
williamr@2
|
324 |
/** Number of bytes (for a multipart fetch) processed. */
|
williamr@2
|
325 |
TInt iBytesDone;
|
williamr@2
|
326 |
/** Error code. */
|
williamr@2
|
327 |
TInt iErrorCode;
|
williamr@2
|
328 |
/** Message ID returned from the operation. */
|
williamr@2
|
329 |
TMsvId iReturnedMsvId;
|
williamr@2
|
330 |
/** The total size of messages to be downloaded (bytes). */
|
williamr@2
|
331 |
TInt iTotalSize;
|
williamr@2
|
332 |
};
|
williamr@2
|
333 |
|
williamr@2
|
334 |
|
williamr@2
|
335 |
class TImap4SyncProgress
|
williamr@2
|
336 |
/**
|
williamr@2
|
337 |
IMAP4 synchronisation progress information.
|
williamr@2
|
338 |
|
williamr@2
|
339 |
The client may then use an object of this type created by the server MTM to
|
williamr@2
|
340 |
track synchronisation progress.
|
williamr@2
|
341 |
|
williamr@2
|
342 |
@publishedAll
|
williamr@2
|
343 |
@released
|
williamr@2
|
344 |
*/
|
williamr@2
|
345 |
{
|
williamr@2
|
346 |
public:
|
williamr@2
|
347 |
/** Synchronisation state. */
|
williamr@2
|
348 |
enum TImap4SyncProgressState
|
williamr@2
|
349 |
{
|
williamr@2
|
350 |
/** Idle. */
|
williamr@2
|
351 |
EIdle,
|
williamr@2
|
352 |
/** Busy. */
|
williamr@2
|
353 |
EBusy,
|
williamr@2
|
354 |
/** Connecting. */
|
williamr@2
|
355 |
EConnecting,
|
williamr@2
|
356 |
/** Disconnecting. */
|
williamr@2
|
357 |
EDisconnecting,
|
williamr@2
|
358 |
/** Synchronising inbox. */
|
williamr@2
|
359 |
ESyncInbox,
|
williamr@2
|
360 |
/** Synchronising folder tree. */
|
williamr@2
|
361 |
ESyncFolderTree,
|
williamr@2
|
362 |
/** Checking remote subscription. */
|
williamr@2
|
363 |
ECheckRemoteSubscription,
|
williamr@2
|
364 |
/** Updating remote subscription. */
|
williamr@2
|
365 |
EUpdateRemoteSubscription,
|
williamr@2
|
366 |
/** Synchronising other information. */
|
williamr@2
|
367 |
ESyncOther,
|
williamr@2
|
368 |
/** Deleting. */
|
williamr@2
|
369 |
EDeleting,
|
williamr@2
|
370 |
/** Processing pending operations. */
|
williamr@2
|
371 |
EProcessingPendingOps
|
williamr@2
|
372 |
};
|
williamr@2
|
373 |
|
williamr@2
|
374 |
/** Progress information type: always EImapSyncProgressType. */
|
williamr@2
|
375 |
TImap4ProgressType iType;
|
williamr@2
|
376 |
/** Synchronisation state. */
|
williamr@2
|
377 |
TImap4SyncProgressState iState; // Where is the sync up to?
|
williamr@2
|
378 |
/**
|
williamr@2
|
379 |
"Folders to do" count for synchronisation.
|
williamr@2
|
380 |
This is meaningful during the #ESyncOther and #EDeleting
|
williamr@2
|
381 |
synchronisation stages.
|
williamr@2
|
382 |
*/
|
williamr@2
|
383 |
TInt iFoldersToDo;
|
williamr@2
|
384 |
/**
|
williamr@2
|
385 |
"Folders done" count for synchronisation.
|
williamr@2
|
386 |
This is meaningful during the #ESyncOther and #EDeleting
|
williamr@2
|
387 |
synchronisation stages.
|
williamr@2
|
388 |
*/
|
williamr@2
|
389 |
TInt iFoldersDone;
|
williamr@2
|
390 |
/**
|
williamr@2
|
391 |
"Message to do" count for synchronisation.
|
williamr@2
|
392 |
This is meaningful during the #ESyncInbox, #ESyncOther and #EProcessingPendingOps
|
williamr@2
|
393 |
synchronisation stages.
|
williamr@2
|
394 |
*/
|
williamr@2
|
395 |
TInt iMsgsToDo;
|
williamr@2
|
396 |
/**
|
williamr@2
|
397 |
"Message done" count for synchronisation.
|
williamr@2
|
398 |
This is meaningful during the #ESyncInbox, #ESyncOther and #EProcessingPendingOps
|
williamr@2
|
399 |
synchronisation stages.
|
williamr@2
|
400 |
*/
|
williamr@2
|
401 |
TInt iMsgsDone;
|
williamr@2
|
402 |
/**
|
williamr@2
|
403 |
Number of headers fetched during synchronisation.
|
williamr@2
|
404 |
*/
|
williamr@2
|
405 |
TInt iHeadersFetched;
|
williamr@2
|
406 |
/**
|
williamr@2
|
407 |
Number of folders orphaned during synchronisation.
|
williamr@2
|
408 |
|
williamr@2
|
409 |
An orphaned folder is a local folder which existed
|
williamr@2
|
410 |
under the service, but which did not exist
|
williamr@2
|
411 |
on the remote server when synchronisation was done.
|
williamr@2
|
412 |
*/
|
williamr@2
|
413 |
TInt iOrphanedFolders;
|
williamr@2
|
414 |
/**
|
williamr@2
|
415 |
Number of new folders during synchronisation.
|
williamr@2
|
416 |
*/
|
williamr@2
|
417 |
TInt iNewFolders;
|
williamr@2
|
418 |
/**
|
williamr@2
|
419 |
Number of orphaned messages during synchronisation.
|
williamr@2
|
420 |
|
williamr@2
|
421 |
An orphaned message is one which existed locally
|
williamr@2
|
422 |
under the service, but which did not exist
|
williamr@2
|
423 |
on the remote server when synchronisation was done.
|
williamr@2
|
424 |
*/
|
williamr@2
|
425 |
TInt iOrphanedMessages;
|
williamr@2
|
426 |
/**
|
williamr@2
|
427 |
Number of remote messages tagged for deletion.
|
williamr@2
|
428 |
|
williamr@2
|
429 |
In IMAP, messages can be flagged as deleted, before
|
williamr@2
|
430 |
they are later permanently removed.
|
williamr@2
|
431 |
*/
|
williamr@2
|
432 |
TInt iRemoteMessagesDeleteTagged;
|
williamr@2
|
433 |
/** Number of messages fetched during synchronisation.
|
williamr@2
|
434 |
|
williamr@2
|
435 |
In the current implementation, this is always 0. Use
|
williamr@2
|
436 |
iHeadersFetched to get the number of headers fetched.
|
williamr@2
|
437 |
*/
|
williamr@2
|
438 |
TInt iMessagesFetchedOK;
|
williamr@2
|
439 |
/** Number of message parts fetched during synchronisation.
|
williamr@2
|
440 |
|
williamr@2
|
441 |
In the current implementation, this is always 0.
|
williamr@2
|
442 |
*/
|
williamr@2
|
443 |
TInt iMessagePartsFetchedOK;
|
williamr@2
|
444 |
/** Number of message parts not found during synchronisation.
|
williamr@2
|
445 |
|
williamr@2
|
446 |
In the current implementation, this is always 0.
|
williamr@2
|
447 |
*/
|
williamr@2
|
448 |
TInt iMessagePartsNotFound;
|
williamr@2
|
449 |
/** Number of folders not found during synchronisation.
|
williamr@2
|
450 |
|
williamr@2
|
451 |
This can occur if the remote server returns an error when
|
williamr@2
|
452 |
a client attempts to select a folder during synchronisation.
|
williamr@2
|
453 |
*/
|
williamr@2
|
454 |
TInt iFoldersNotFound;
|
williamr@2
|
455 |
/** Any error-code that the client needs to be informed of. */
|
williamr@2
|
456 |
TInt iErrorCode;
|
williamr@2
|
457 |
};
|
williamr@2
|
458 |
|
williamr@2
|
459 |
class TImap4CompoundProgress
|
williamr@2
|
460 |
/**
|
williamr@2
|
461 |
IMAP operation progress information.
|
williamr@2
|
462 |
|
williamr@2
|
463 |
The class supplies both the two IMAP progress types, generic and synchronisation.
|
williamr@2
|
464 |
|
williamr@2
|
465 |
The IMAP4 server MTM owns two IMAP4 sessions that are used independently of
|
williamr@2
|
466 |
each other to perform 'background' and 'foreground' operations. In a typical
|
williamr@2
|
467 |
situation, the user may be downloading the body parts of a message (populating)
|
williamr@2
|
468 |
in the foreground whilst in the background a full synchronisation may be underway.
|
williamr@2
|
469 |
In this scenario, the generic progress will give an indication of the 'foreground'
|
williamr@2
|
470 |
activity and the synchronisation progress will give an indication of the 'background'
|
williamr@2
|
471 |
progress. The synchronisation progress component of the compound progress
|
williamr@2
|
472 |
will always show the synchronisation progress irrespective of whether the
|
williamr@2
|
473 |
synchronisation is running in the foreground or the background.
|
williamr@2
|
474 |
|
williamr@2
|
475 |
@publishedAll
|
williamr@2
|
476 |
@released
|
williamr@2
|
477 |
*/
|
williamr@2
|
478 |
{
|
williamr@2
|
479 |
public:
|
williamr@2
|
480 |
/** Generic progress. */
|
williamr@2
|
481 |
TImap4GenericProgress iGenericProgress;
|
williamr@2
|
482 |
/** Synchronisation progress. */
|
williamr@2
|
483 |
TImap4SyncProgress iSyncProgress;
|
williamr@2
|
484 |
};
|
williamr@2
|
485 |
|
williamr@2
|
486 |
|
williamr@2
|
487 |
class CImImap4Settings : public CImBaseEmailSettings
|
williamr@2
|
488 |
/**
|
williamr@2
|
489 |
Settings for connection to and use of an IMAP4 mail server and its mailboxes.
|
williamr@2
|
490 |
|
williamr@2
|
491 |
Messaging clients should use an instance of this class to specify and retrieve
|
williamr@2
|
492 |
configuration settings that are used by an IMAP4 service when executing email
|
williamr@2
|
493 |
operations.
|
williamr@2
|
494 |
|
williamr@2
|
495 |
Service settings include:
|
williamr@2
|
496 |
|
williamr@2
|
497 |
- server log on settings (user name and password)
|
williamr@2
|
498 |
- message header synchronisation strategy and synchronisation limits
|
williamr@2
|
499 |
- message getting options, such as maximum size. Note that these options
|
williamr@2
|
500 |
are not used by the IMAP MTM. They can be used by client applications to
|
williamr@2
|
501 |
store user preferences, and be used by the client when issuing get commands.
|
williamr@2
|
502 |
- miscelleanous settings, including whether IMAP IDLE should be used
|
williamr@2
|
503 |
|
williamr@2
|
504 |
CImImap4Settings objects are created and accessed through
|
williamr@2
|
505 |
CEmailAccounts. CEmailAccounts can also be used to get the
|
williamr@2
|
506 |
connection settings, such as the ISP to use, used to access an IMAP server.
|
williamr@2
|
507 |
|
williamr@2
|
508 |
Settings for a service are associated with a service-type entry in the Message
|
williamr@2
|
509 |
Server'smessage store. However the settings are not actually stored in the
|
williamr@2
|
510 |
message store, but in the device's Central Repository data store.
|
williamr@2
|
511 |
|
williamr@2
|
512 |
@see CEmailAccounts
|
williamr@2
|
513 |
|
williamr@2
|
514 |
@publishedAll
|
williamr@2
|
515 |
@released
|
williamr@2
|
516 |
*/
|
williamr@2
|
517 |
{
|
williamr@2
|
518 |
public:
|
williamr@2
|
519 |
IMPORT_C CImImap4Settings();
|
williamr@2
|
520 |
IMPORT_C virtual ~CImImap4Settings();
|
williamr@2
|
521 |
IMPORT_C void Reset();
|
williamr@2
|
522 |
IMPORT_C const TPtrC8 LoginName() const;
|
williamr@2
|
523 |
IMPORT_C void SetLoginNameL(const TDesC8& aLoginName);
|
williamr@2
|
524 |
IMPORT_C const TPtrC8 Password() const;
|
williamr@2
|
525 |
IMPORT_C void SetPasswordL(const TDesC8& aPassword);
|
williamr@2
|
526 |
IMPORT_C const TPtrC8 FolderPath() const;
|
williamr@2
|
527 |
IMPORT_C void SetFolderPathL(const TDesC8& aFolderPath);
|
williamr@2
|
528 |
IMPORT_C const TPtrC8 SearchString() const;
|
williamr@2
|
529 |
IMPORT_C void SetSearchStringL(const TDesC8& aSearchString);
|
williamr@2
|
530 |
IMPORT_C TText8 PathSeparator() const;
|
williamr@2
|
531 |
IMPORT_C void SetPathSeparator(const TText8 aPathSeparator);
|
williamr@2
|
532 |
IMPORT_C TBool DisconnectedUserMode() const;
|
williamr@2
|
533 |
IMPORT_C void SetDisconnectedUserMode(TBool aFlag);
|
williamr@2
|
534 |
IMPORT_C void SetSynchronise(const TFolderSyncType aType);
|
williamr@2
|
535 |
IMPORT_C TFolderSyncType Synchronise() const;
|
williamr@2
|
536 |
IMPORT_C void SetSubscribe(const TFolderSubscribeType aType);
|
williamr@2
|
537 |
IMPORT_C TFolderSubscribeType Subscribe() const;
|
williamr@2
|
538 |
IMPORT_C TBool AutoSendOnConnect() const;
|
williamr@2
|
539 |
IMPORT_C void SetAutoSendOnConnect(TBool aFlag);
|
williamr@2
|
540 |
IMPORT_C TUint MaxEmailSize() const;
|
williamr@2
|
541 |
IMPORT_C void SetMaxEmailSize(const TUint aMaxEmailSize);
|
williamr@2
|
542 |
IMPORT_C TBool DeleteEmailsWhenDisconnecting() const;
|
williamr@2
|
543 |
IMPORT_C void SetDeleteEmailsWhenDisconnecting(TBool aFlag);
|
williamr@2
|
544 |
IMPORT_C TBool AcknowledgeReceipts() const;
|
williamr@2
|
545 |
IMPORT_C void SetAcknowledgeReceipts(TBool aFlag);
|
williamr@2
|
546 |
IMPORT_C TImap4GetMailOptions GetMailOptions() const;
|
williamr@2
|
547 |
IMPORT_C void SetGetMailOptions(TImap4GetMailOptions aGetMailOptions);
|
williamr@2
|
548 |
IMPORT_C CImImap4Settings& CopyL(const CImImap4Settings& aCImImap4Settings);
|
williamr@2
|
549 |
IMPORT_C TBool operator==(const CImImap4Settings& aCImImap4Settings) const;
|
williamr@2
|
550 |
IMPORT_C TInt32 InboxSynchronisationLimit() const;
|
williamr@2
|
551 |
IMPORT_C void SetInboxSynchronisationLimit(const TInt32 aInboxSyncLimit);
|
williamr@2
|
552 |
IMPORT_C TInt32 MailboxSynchronisationLimit() const;
|
williamr@2
|
553 |
IMPORT_C void SetMailboxSynchronisationLimit(const TInt32 aMailboxSyncLimit);
|
williamr@2
|
554 |
IMPORT_C TBool UpdatingSeenFlags() const;
|
williamr@2
|
555 |
IMPORT_C void SetUpdatingSeenFlags(TBool aFlag);
|
williamr@2
|
556 |
IMPORT_C TInt SyncRate() const;
|
williamr@2
|
557 |
IMPORT_C void SetSyncRateL(TInt aSyncRate);
|
williamr@2
|
558 |
IMPORT_C TUint FetchSize() const;
|
williamr@2
|
559 |
IMPORT_C void SetFetchSizeL(TUint aFetchSizeBytes);
|
williamr@2
|
560 |
IMPORT_C TBool ImapIdle() const;
|
williamr@2
|
561 |
IMPORT_C void SetImapIdle(TBool aFlag);
|
williamr@2
|
562 |
IMPORT_C TInt ImapIdleTimeout() const;
|
williamr@2
|
563 |
IMPORT_C void SetImapIdleTimeoutL(TInt aIdleTimeout);
|
williamr@2
|
564 |
IMPORT_C TImImap4PartialMailOptions PartialMailOptions() const;
|
williamr@2
|
565 |
IMPORT_C void SetPartialMailOptionsL(TImImap4PartialMailOptions aPartialMailOptions);
|
williamr@2
|
566 |
IMPORT_C TInt32 BodyTextSizeLimit() const;
|
williamr@2
|
567 |
IMPORT_C void SetBodyTextSizeLimitL(TInt32 aBodyTextSizeLimit);
|
williamr@2
|
568 |
IMPORT_C TInt32 AttachmentSizeLimit() const;
|
williamr@2
|
569 |
IMPORT_C void SetAttachmentSizeLimitL(TInt32 aAttachmentSizeLimit);
|
williamr@2
|
570 |
IMPORT_C TBool UseExpunge() const;
|
williamr@2
|
571 |
IMPORT_C void SetUseExpunge(TBool aFlag);
|
williamr@2
|
572 |
IMPORT_C void SetTlsSslDomainL(const TDesC8& aDomainName);
|
williamr@2
|
573 |
IMPORT_C TPtrC8 TlsSslDomain() const;
|
williamr@2
|
574 |
IMPORT_C void SetUseSyncDownloadRules(TBool aFlag);
|
williamr@2
|
575 |
IMPORT_C TBool UseSyncDownloadRules();
|
williamr@2
|
576 |
IMPORT_C void SetFolderSyncDisabled(TBool aFlag);
|
williamr@2
|
577 |
IMPORT_C TBool FolderSyncDisabled();
|
williamr@4
|
578 |
|
williamr@4
|
579 |
#if (defined SYMBIAN_EMAIL_CAPABILITY_SUPPORT)
|
williamr@4
|
580 |
IMPORT_C TBool IMAP4Auth() const;
|
williamr@4
|
581 |
IMPORT_C void SetIMAP4Auth(TBool aFlag);
|
williamr@4
|
582 |
IMPORT_C TBool FallBack() const;
|
williamr@4
|
583 |
IMPORT_C void SetFallBack(TBool aFlag);
|
williamr@4
|
584 |
#endif
|
williamr@2
|
585 |
|
williamr@2
|
586 |
private:
|
williamr@2
|
587 |
class TImImap4SettingsExtension
|
williamr@2
|
588 |
{
|
williamr@2
|
589 |
public:
|
williamr@2
|
590 |
inline TImImap4SettingsExtension();
|
williamr@2
|
591 |
public:
|
williamr@2
|
592 |
HBufC8* iLoginName;
|
williamr@2
|
593 |
HBufC8* iPassword;
|
williamr@2
|
594 |
HBufC8* iFolderPath;
|
williamr@2
|
595 |
HBufC8* iSearchString;
|
williamr@2
|
596 |
HBufC8* iTlsSslDomain;
|
williamr@2
|
597 |
TInt iSyncRate;
|
williamr@2
|
598 |
TInt iImapIdleTimeout;
|
williamr@2
|
599 |
TUint iFetchSizeBytes;
|
williamr@2
|
600 |
TImImap4PartialMailOptions iPartialMailOptions;
|
williamr@2
|
601 |
TInt32 iBodyTextSizeLimit;
|
williamr@2
|
602 |
TInt32 iAttachmentSizeLimit;
|
williamr@2
|
603 |
};
|
williamr@2
|
604 |
|
williamr@2
|
605 |
inline TImImap4SettingsExtension* Extension() const;
|
williamr@2
|
606 |
inline void CheckExtensionExistsL();
|
williamr@2
|
607 |
|
williamr@2
|
608 |
enum TImImap4EmailSettings
|
williamr@2
|
609 |
{
|
williamr@2
|
610 |
KImap4EmailSettingsClearFlag = 0x00000000,
|
williamr@2
|
611 |
KImap4BaseEmailSettingsLastUsedFlag = CImBaseEmailSettings::EBaseEmailSettingsLastUsedFlag, //0x00000002
|
williamr@4
|
612 |
KImap4EmailDisconnectedModeFlag = KImap4BaseEmailSettingsLastUsedFlag << 1, //0x00000004
|
williamr@4
|
613 |
KImap4EmailAutoSendFlag = KImap4EmailDisconnectedModeFlag << 1, //0x00000008
|
williamr@4
|
614 |
KImap4EmailDeleteEmailsWhenDisconnecting = KImap4EmailAutoSendFlag << 1, //0x00000010
|
williamr@4
|
615 |
KImap4EmailAcknowledgeReceipts = KImap4EmailDeleteEmailsWhenDisconnecting << 1,//0x00000020
|
williamr@4
|
616 |
KImap4EmailUpdatingSeenFlags = KImap4EmailAcknowledgeReceipts << 1, //0x00000040
|
williamr@4
|
617 |
KImap4EmailIdleFlag = KImap4EmailUpdatingSeenFlags << 1, //0x00000080
|
williamr@2
|
618 |
KImap4EmailExpungeFlag = KImap4EmailIdleFlag << 1,
|
williamr@4
|
619 |
KImap4EmailUseSyncDownloadRules = KImap4EmailExpungeFlag << 1, //0x00000200
|
williamr@4
|
620 |
KImap4EmailSettingsFolderSyncDisabled = KImap4EmailUseSyncDownloadRules << 1, //0x00000400
|
williamr@4
|
621 |
#if (defined SYMBIAN_EMAIL_CAPABILITY_SUPPORT)
|
williamr@4
|
622 |
KImap4EmailSettingsAuthenticationFlag = KImap4EmailSettingsFolderSyncDisabled << 1, //0x00000800
|
williamr@4
|
623 |
KImap4EmailSettingsFallBackFlag = KImap4EmailSettingsAuthenticationFlag << 1, //0x00001000
|
williamr@4
|
624 |
KImap4EmailSettingsLastUsedFlag = KImap4EmailSettingsFallBackFlag //0x00001000
|
williamr@4
|
625 |
#else
|
williamr@4
|
626 |
KImap4EmailSettingsLastUsedFlag = KImap4EmailSettingsFolderSyncDisabled //0x00000400
|
williamr@4
|
627 |
#endif
|
williamr@2
|
628 |
};
|
williamr@2
|
629 |
|
williamr@2
|
630 |
TImImap4SettingsExtension* iExtension; // renamed iReceiptAddress
|
williamr@2
|
631 |
|
williamr@2
|
632 |
TInt32 iInboxSyncLimit;
|
williamr@2
|
633 |
TInt32 iMailboxSyncLimit;
|
williamr@2
|
634 |
|
williamr@2
|
635 |
TText8 iPathSeparator;
|
williamr@2
|
636 |
TFolderSyncType iSynchroniseStrategy;
|
williamr@2
|
637 |
TFolderSubscribeType iSubscriptionStrategy;
|
williamr@2
|
638 |
TUint32 iMaxEmailSize;
|
williamr@2
|
639 |
TImap4GetMailOptions iGetMailOptions;
|
williamr@2
|
640 |
};
|
williamr@2
|
641 |
|
williamr@2
|
642 |
|
williamr@2
|
643 |
class TImImap4GetMailInfo
|
williamr@2
|
644 |
/**
|
williamr@2
|
645 |
Specifies options used when retrieving messages with IMAP.
|
williamr@2
|
646 |
|
williamr@2
|
647 |
An TImImap4GetMailInfo is passed as a packaged parameter
|
williamr@2
|
648 |
to CImap4ClientMtm::InvokeAsyncFunctionL() when a message
|
williamr@2
|
649 |
getting command is issued.
|
williamr@2
|
650 |
|
williamr@2
|
651 |
Options include the maximum message size, and what
|
williamr@2
|
652 |
message parts are required.
|
williamr@2
|
653 |
|
williamr@2
|
654 |
@see CImImap4GetMail
|
williamr@2
|
655 |
@see TImap4Cmds
|
williamr@2
|
656 |
|
williamr@2
|
657 |
@publishedAll
|
williamr@2
|
658 |
@released
|
williamr@2
|
659 |
*/
|
williamr@2
|
660 |
{
|
williamr@2
|
661 |
public:
|
williamr@2
|
662 |
/** The maximum message size (bytes).
|
williamr@2
|
663 |
Messages of greater size are not fetched. */
|
williamr@2
|
664 |
TInt32 iMaxEmailSize;
|
williamr@2
|
665 |
/** The required message parts. */
|
williamr@2
|
666 |
TImap4GetMailOptions iGetMailBodyParts;
|
williamr@2
|
667 |
/** The destination folder ID, specifying the
|
williamr@2
|
668 |
target folder when messages are copied or moved. */
|
williamr@2
|
669 |
TMsvId iDestinationFolder;
|
williamr@2
|
670 |
};
|
williamr@2
|
671 |
|
williamr@2
|
672 |
/**
|
williamr@2
|
673 |
Specifies message criteria that are used as a filter when retrieving messages partially.
|
williamr@2
|
674 |
|
williamr@2
|
675 |
Options include the maximum size for the whole message,
|
williamr@2
|
676 |
the maximum size for the body of the message,
|
williamr@2
|
677 |
the maximum size for the attachments with the message, and
|
williamr@2
|
678 |
the message parts required.
|
williamr@2
|
679 |
|
williamr@2
|
680 |
An TImImap4GetPartialMailInfo is passed as a packaged parameter
|
williamr@2
|
681 |
to CImap4ClientMtm::InvokeAsyncFunctionL() when a message
|
williamr@2
|
682 |
populate command is issued.
|
williamr@2
|
683 |
|
williamr@2
|
684 |
@see
|
williamr@2
|
685 |
CImImap4GetMail
|
williamr@2
|
686 |
|
williamr@2
|
687 |
@publishedAll
|
williamr@2
|
688 |
@released
|
williamr@2
|
689 |
*/
|
williamr@2
|
690 |
|
williamr@2
|
691 |
class TImImap4GetPartialMailInfo : public TImImap4GetMailInfo
|
williamr@2
|
692 |
{
|
williamr@2
|
693 |
public:
|
williamr@2
|
694 |
/** The maximum size limit for the total message (bytes). */
|
williamr@2
|
695 |
TInt32 iTotalSizeLimit;
|
williamr@2
|
696 |
/** The maximum size limit for body of the message (bytes). */
|
williamr@2
|
697 |
TInt32 iBodyTextSizeLimit;
|
williamr@2
|
698 |
/** The maximum size limit for the attachments (bytes). */
|
williamr@2
|
699 |
TInt32 iAttachmentSizeLimit;
|
williamr@2
|
700 |
/** The required message parts. */
|
williamr@2
|
701 |
TImImap4PartialMailOptions iPartialMailOptions;
|
williamr@2
|
702 |
};
|
williamr@2
|
703 |
|
williamr@2
|
704 |
inline CImImap4Settings::TImImap4SettingsExtension* CImImap4Settings::Extension() const
|
williamr@2
|
705 |
{
|
williamr@2
|
706 |
return iExtension;
|
williamr@2
|
707 |
}
|
williamr@2
|
708 |
|
williamr@2
|
709 |
inline void CImImap4Settings::CheckExtensionExistsL()
|
williamr@2
|
710 |
{
|
williamr@2
|
711 |
if (!iExtension)
|
williamr@2
|
712 |
iExtension=new (ELeave) CImImap4Settings::TImImap4SettingsExtension;
|
williamr@2
|
713 |
}
|
williamr@2
|
714 |
inline CImImap4Settings::TImImap4SettingsExtension::TImImap4SettingsExtension()
|
williamr@2
|
715 |
: iLoginName(NULL) ,iPassword(NULL) ,iFolderPath(NULL),iSearchString(NULL),iTlsSslDomain(NULL), iSyncRate(KImapDefaultInboxSyncRate), iImapIdleTimeout(KImapDefaultIdleTimeout), iFetchSizeBytes(KImapDefaultFetchSizeBytes),
|
williamr@2
|
716 |
iPartialMailOptions(ENoSizeLimits),iBodyTextSizeLimit(KMaxTInt),iAttachmentSizeLimit(KMaxTInt)
|
williamr@2
|
717 |
{
|
williamr@2
|
718 |
}
|
williamr@2
|
719 |
|
williamr@2
|
720 |
|
williamr@2
|
721 |
#endif // __IMAPSET_H__
|