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