williamr@2: // Copyright (c) 1998-2009 Nokia Corporation and/or its subsidiary(-ies). williamr@2: // All rights reserved. williamr@2: // This component and the accompanying materials are made available williamr@4: // under the terms of "Eclipse Public License v1.0" williamr@2: // which accompanies this distribution, and is available williamr@4: // at the URL "http://www.eclipse.org/legal/epl-v10.html". williamr@2: // williamr@2: // Initial Contributors: williamr@2: // Nokia Corporation - initial contribution. williamr@2: // williamr@2: // Contributors: williamr@2: // williamr@2: // Description: williamr@2: // williamr@2: williamr@2: #ifndef __IMAPSET_H__ williamr@2: #define __IMAPSET_H__ williamr@2: williamr@2: williamr@2: williamr@2: williamr@2: #include williamr@2: #include williamr@2: williamr@2: class TBearerTypes; williamr@2: class TImImap4GetPartialMailInfo; williamr@2: williamr@2: /** Default IMAP4 server port number. */ williamr@2: const TUint32 KIMAPDefaultPortNumber = 143; williamr@2: williamr@2: /** Default inbox refresh rate in seconds. */ williamr@2: const TInt KImapDefaultInboxSyncRate = 300; williamr@2: williamr@2: /** Default idle timeout in seconds. */ williamr@2: const TInt KImapDefaultIdleTimeout = 1740; williamr@2: williamr@2: /** Default fetch size in bytes. */ williamr@2: const TUint KImapDefaultFetchSizeBytes = 20480; williamr@2: williamr@2: williamr@2: williamr@2: /** @deprecated */ williamr@2: const TInt32 KImImapSynchroniseAll = -1; williamr@2: williamr@2: /** @deprecated */ williamr@2: const TInt32 KImImapSynchroniseNone = 0; williamr@2: williamr@2: williamr@2: /** williamr@2: Describes the folder subscription synchronisation strategy. williamr@2: williamr@2: This specifies whether the local or remote folder subscription flags, or a williamr@2: combination of both, are used to determine which mailboxes are synchronised. williamr@2: For an overview of the synchronisation process, see CImap4ClientMtm. williamr@2: williamr@2: @see CImImap4Settings::SetSynchronise() williamr@2: @see CImImap4Settings::Synchronise() williamr@2: williamr@2: @publishedAll williamr@2: @released williamr@2: */ williamr@2: enum TFolderSyncType williamr@2: { williamr@2: /** Folders that are marked for subscription either locally or remotely are synchronised. */ williamr@2: EUseCombination=0, williamr@2: /** Only folders marked for subscription locally are synchronised. */ williamr@2: EUseLocal, williamr@2: /** Only folders marked for subscription remotely are synchronised. */ williamr@2: EUseRemote williamr@2: }; williamr@2: williamr@2: williamr@2: /** williamr@2: Specifies methods of synchronising IMAP4 subscription information with a server. williamr@2: williamr@2: Subscription settings that have been set on folders on the local device, and williamr@2: subscription settings that have been set on the corresponding mailboxes on the williamr@2: remote server can be synchronised, as part of the synchronisation process williamr@2: (see the overview for CImap4ClientMtm). williamr@2: williamr@2: @see CImImap4Settings::SetSubscribe() williamr@2: @see CImImap4Settings::Subscribe() williamr@2: williamr@2: @publishedAll williamr@2: @released williamr@2: */ williamr@2: enum TFolderSubscribeType williamr@2: { williamr@2: /** Do not alter local or remote subscription information. */ williamr@2: EUpdateNeither=0, williamr@2: /** Update local copy of subscription information when it is received from the williamr@2: remote IMAP4 server at the beginning of the mail session. */ williamr@2: EUpdateLocal, williamr@2: /** Update remote copy of subscription information so that it matches the local williamr@2: subscription information. */ williamr@2: EUpdateRemote, williamr@2: /** Merge local and remote subscription information, store updated information williamr@2: on the remote server and store merged data on the local message store. */ williamr@2: EUpdateBoth williamr@2: }; williamr@2: williamr@2: williamr@2: /** williamr@2: Defines which components of a message to fetch when copying or moving from williamr@2: a server. williamr@2: williamr@2: @see CImImap4Settings::SetGetMailOptions() williamr@2: @see CImImap4Settings::GetMailOptions() williamr@2: williamr@2: @publishedAll williamr@2: @released williamr@2: */ williamr@2: enum TImap4GetMailOptions williamr@2: { williamr@2: /** Get message headers. */ williamr@2: EGetImap4EmailHeaders, williamr@2: /** Get message body. */ williamr@2: EGetImap4EmailBodyText, williamr@2: /** Get message body and attachments. */ williamr@2: EGetImap4EmailBodyTextAndAttachments, williamr@2: /** Get message attachments. */ williamr@2: EGetImap4EmailAttachments, williamr@2: /** Get message body, including non-plain or non-HTML alternative text parts (or attachments). */ williamr@2: EGetImap4EmailBodyAlternativeText williamr@2: }; williamr@2: williamr@2: /** williamr@2: Defines which components of a message should be fetched partially when williamr@2: fetching the message from a server. williamr@2: williamr@2: @see williamr@2: CImImap4Settings williamr@2: williamr@2: @publishedAll williamr@2: @released williamr@2: */ williamr@2: enum TImImap4PartialMailOptions williamr@2: { williamr@2: /** No size limits, full message to be fetched.*/ williamr@2: ENoSizeLimits, williamr@2: /** Get body text only. williamr@2: Gets text/plain part only if text/plain part size + text/html part size williamr@2: is greater than body text size limit. williamr@2: Gets text/plain part and text/html part if text/plain part size + text/html part size williamr@2: is less than body text size limit of the message.*/ williamr@2: EBodyTextOnly, williamr@2: /** Gets all the attachments less than attachment size limit.*/ williamr@2: EAttachmentsOnly, williamr@2: /** Gets the body text less than or equal to body text size limit and attachments williamr@2: less than or equal to attachment size limit.*/ williamr@2: EBodyTextAndAttachments, williamr@2: /** Gets the body text less than total size limit and also attachments whose size williamr@2: is within total size limit minus fetched body parts.*/ williamr@2: ECumulative, williamr@2: /** Gets the body text less than total size limit and all non-HTML text attachments whose size williamr@2: is within total size limit minus fetched body parts.*/ williamr@2: EBodyAlternativeText williamr@2: }; williamr@2: williamr@2: /** williamr@2: Flags to indicate what type of IMAP4 progress information is being returned. williamr@2: williamr@2: @publishedAll williamr@2: @released williamr@2: */ williamr@2: enum TImap4ProgressType williamr@2: { williamr@2: /** Progress information is an TImap4GenericProgress object. */ williamr@2: EImap4GenericProgressType, williamr@2: /** Progress information is an TImap4SyncProgress object. */ williamr@2: EImap4SyncProgressType williamr@2: }; williamr@2: williamr@2: williamr@2: class TImap4GenericProgress williamr@2: /** williamr@2: Progress information for an IMAP4 get operation. williamr@2: williamr@2: For the 'get mail when already connected' operations, the progress state can williamr@2: be obtained from TImap4GenericProgress::iState. In the case of the 'connect williamr@2: and get mail and disconnect' and 'connect and get mail and stay online', the williamr@2: actual progress defined in TImap4GenericProgress::iState will be of the form williamr@2: of 'Copy New Mail', 'Populating Message Selection' etc. The sub-operation williamr@2: state can then be obtained in the form of 'Connecting', 'Fetching', 'Disconnecting' williamr@2: etc. from TImap4GenericProgress::iImap4SubStateProgress. williamr@2: williamr@2: @see williamr@2: CImImap4GetMail williamr@2: williamr@2: @publishedAll williamr@2: @released williamr@2: */ williamr@2: { williamr@2: public: williamr@2: IMPORT_C TInt ConnectionState() const; williamr@2: IMPORT_C TInt ConnectionIAP() const; williamr@2: williamr@2: public: williamr@2: /** Operation type. */ williamr@2: enum TImap4GenericProgressOp williamr@2: { williamr@2: /** Connect operation. */ williamr@2: EConnect, williamr@2: /** Disconnect operation. */ williamr@2: EDisconnect, williamr@2: /** Sync operation. */ williamr@2: ESync, williamr@2: /** Select operation. */ williamr@2: ESelect, williamr@2: /** Copy messages to local operation. */ williamr@2: ECopyToLocal, williamr@2: /** Copy messages within remote server operation. */ williamr@2: ECopyWithinService, williamr@2: /** Copy messages from local operation. */ williamr@2: ECopyFromLocal, williamr@2: /** Move messages to local operation. */ williamr@2: EMoveToLocal, williamr@2: /** Move messages within remote server operation. */ williamr@2: EMoveWithinService, williamr@2: /** Move messages from local operation. */ williamr@2: EMoveFromLocal, williamr@2: /** Message population operation. */ williamr@2: EPopulate, williamr@2: /** Delete operation. */ williamr@2: EDelete, williamr@2: /** Offline delete operation. */ williamr@2: EOffLineDelete, williamr@2: /** Offline undelete operation. */ williamr@2: EOffLineUndelete, williamr@2: /** Offline delete operation. */ williamr@2: EOffLineCopyToLocal, williamr@2: /** Offline move messages to local operation. */ williamr@2: EOffLineMoveToLocal, williamr@2: /** Offline copy messages from local operation. */ williamr@2: EOffLineCopyFromLocal, williamr@2: /** Offline move messages from local operation. */ williamr@2: EOffLineMoveFromLocal, williamr@2: /** Offline copy messages within remote server operation. */ williamr@2: EOffLineCopyWithinService, williamr@2: /** Offline move messages within remote server operation. */ williamr@2: EOffLineMoveWithinService, williamr@2: /** Offline message population operation. */ williamr@2: EOffLinePopulate williamr@2: }; williamr@2: williamr@2: /** Operation state information. */ williamr@2: enum TImap4GenericProgressState williamr@2: { williamr@2: /** Disconnected. */ williamr@2: EDisconnected, williamr@2: /** Connecting. */ williamr@2: EConnecting, williamr@2: /** Idle. */ williamr@2: EIdle, williamr@2: /** Selecting the folder to use. */ williamr@2: ESelecting, williamr@2: /** Fetching messages to mirror server. */ williamr@2: EFetching, williamr@2: /** Appending local messages to remote server. */ williamr@2: EAppending, williamr@2: /** Copying local messages to local or within service. */ williamr@2: ECopying, williamr@2: /** Deleting an item, including expunging a folder. */ williamr@2: EDeleting, williamr@2: /** Synchronising folder after an operation. */ williamr@2: ESyncing, williamr@2: /** Disconnecting. */ williamr@2: EDisconnecting, williamr@2: /** Sync already in progress. */ williamr@2: EBusy, williamr@2: /** CImImap4GetMail move operation in progress. */ williamr@2: EMoving, williamr@2: /** CImImap4GetMail copy new mail operation in progress. */ williamr@2: ECopyNewMail, williamr@2: /** CImImap4GetMail move new mail operation in progress. */ williamr@2: EMoveNewMail, williamr@2: /** CImImap4GetMail copy selected messages operation in progress. */ williamr@2: ECopyMailSelection, williamr@2: /** CImImap4GetMail move selected messages operation in progress. */ williamr@2: EMoveMailSelection, williamr@2: /** CImImap4GetMail copy all messages operation in progress. */ williamr@2: ECopyAllMail, williamr@2: /** CImImap4GetMail move all messages operation in progress. */ williamr@2: EMoveAllMail, williamr@2: /** CImImap4GetMail populate new messages operation in progress. */ williamr@2: EPopulateNewMail, williamr@2: /** CImImap4GetMail populate all messages operation in progress. */ williamr@2: EPopulateAllMail, williamr@2: /** CImImap4GetMail populate selected messages operation in progress. */ williamr@2: EPopulateMailSelection williamr@2: }; williamr@2: williamr@2: /** Progress information type: always EImap4GenericProgressType. */ williamr@2: TImap4ProgressType iType; williamr@2: /** Operation type. */ williamr@2: TImap4GenericProgressOp iOperation; williamr@2: /** williamr@2: The progress state. williamr@2: williamr@2: For 'connect and get mail and disconnect' and 'connect and get mail and stay williamr@2: online' type operations, additional sub-operation state can be obtained from williamr@2: iImap4SubStateProgress. williamr@2: */ williamr@2: TImap4GenericProgressState iState; williamr@2: /** williamr@2: The progress sub-state. williamr@2: williamr@2: This only applies to 'connect and get mail and disconnect' and 'connect and williamr@2: get mail and stay online' type operations. williamr@2: */ williamr@2: TImap4GenericProgressState iImap4SubStateProgress; williamr@2: /** In the EConnecting state, this field holds the connection iap value, williamr@2: otherwise it holds the number of messages still to be processed. */ williamr@2: TInt iMsgsToDo; williamr@2: /** In the EConnecting state, this field holds the connection stage value, williamr@2: otherwise it holds the number of messages processed. */ williamr@2: TInt iMsgsDone; williamr@2: /** Number of message parts still to be processed. */ williamr@2: TInt iPartsToDo; williamr@2: /** Number of message parts processed. */ williamr@2: TInt iPartsDone; williamr@2: /** Number of bytes (for a multipart fetch) still to be processed. */ williamr@2: TInt iBytesToDo; williamr@2: /** Number of bytes (for a multipart fetch) processed. */ williamr@2: TInt iBytesDone; williamr@2: /** Error code. */ williamr@2: TInt iErrorCode; williamr@2: /** Message ID returned from the operation. */ williamr@2: TMsvId iReturnedMsvId; williamr@2: /** The total size of messages to be downloaded (bytes). */ williamr@2: TInt iTotalSize; williamr@2: }; williamr@2: williamr@2: williamr@2: class TImap4SyncProgress williamr@2: /** williamr@2: IMAP4 synchronisation progress information. williamr@2: williamr@2: The client may then use an object of this type created by the server MTM to williamr@2: track synchronisation progress. williamr@2: williamr@2: @publishedAll williamr@2: @released williamr@2: */ williamr@2: { williamr@2: public: williamr@2: /** Synchronisation state. */ williamr@2: enum TImap4SyncProgressState williamr@2: { williamr@2: /** Idle. */ williamr@2: EIdle, williamr@2: /** Busy. */ williamr@2: EBusy, williamr@2: /** Connecting. */ williamr@2: EConnecting, williamr@2: /** Disconnecting. */ williamr@2: EDisconnecting, williamr@2: /** Synchronising inbox. */ williamr@2: ESyncInbox, williamr@2: /** Synchronising folder tree. */ williamr@2: ESyncFolderTree, williamr@2: /** Checking remote subscription. */ williamr@2: ECheckRemoteSubscription, williamr@2: /** Updating remote subscription. */ williamr@2: EUpdateRemoteSubscription, williamr@2: /** Synchronising other information. */ williamr@2: ESyncOther, williamr@2: /** Deleting. */ williamr@2: EDeleting, williamr@2: /** Processing pending operations. */ williamr@2: EProcessingPendingOps williamr@2: }; williamr@2: williamr@2: /** Progress information type: always EImapSyncProgressType. */ williamr@2: TImap4ProgressType iType; williamr@2: /** Synchronisation state. */ williamr@2: TImap4SyncProgressState iState; // Where is the sync up to? williamr@2: /** williamr@2: "Folders to do" count for synchronisation. williamr@2: This is meaningful during the #ESyncOther and #EDeleting williamr@2: synchronisation stages. williamr@2: */ williamr@2: TInt iFoldersToDo; williamr@2: /** williamr@2: "Folders done" count for synchronisation. williamr@2: This is meaningful during the #ESyncOther and #EDeleting williamr@2: synchronisation stages. williamr@2: */ williamr@2: TInt iFoldersDone; williamr@2: /** williamr@2: "Message to do" count for synchronisation. williamr@2: This is meaningful during the #ESyncInbox, #ESyncOther and #EProcessingPendingOps williamr@2: synchronisation stages. williamr@2: */ williamr@2: TInt iMsgsToDo; williamr@2: /** williamr@2: "Message done" count for synchronisation. williamr@2: This is meaningful during the #ESyncInbox, #ESyncOther and #EProcessingPendingOps williamr@2: synchronisation stages. williamr@2: */ williamr@2: TInt iMsgsDone; williamr@2: /** williamr@2: Number of headers fetched during synchronisation. williamr@2: */ williamr@2: TInt iHeadersFetched; williamr@2: /** williamr@2: Number of folders orphaned during synchronisation. williamr@2: williamr@2: An orphaned folder is a local folder which existed williamr@2: under the service, but which did not exist williamr@2: on the remote server when synchronisation was done. williamr@2: */ williamr@2: TInt iOrphanedFolders; williamr@2: /** williamr@2: Number of new folders during synchronisation. williamr@2: */ williamr@2: TInt iNewFolders; williamr@2: /** williamr@2: Number of orphaned messages during synchronisation. williamr@2: williamr@2: An orphaned message is one which existed locally williamr@2: under the service, but which did not exist williamr@2: on the remote server when synchronisation was done. williamr@2: */ williamr@2: TInt iOrphanedMessages; williamr@2: /** williamr@2: Number of remote messages tagged for deletion. williamr@2: williamr@2: In IMAP, messages can be flagged as deleted, before williamr@2: they are later permanently removed. williamr@2: */ williamr@2: TInt iRemoteMessagesDeleteTagged; williamr@2: /** Number of messages fetched during synchronisation. williamr@2: williamr@2: In the current implementation, this is always 0. Use williamr@2: iHeadersFetched to get the number of headers fetched. williamr@2: */ williamr@2: TInt iMessagesFetchedOK; williamr@2: /** Number of message parts fetched during synchronisation. williamr@2: williamr@2: In the current implementation, this is always 0. williamr@2: */ williamr@2: TInt iMessagePartsFetchedOK; williamr@2: /** Number of message parts not found during synchronisation. williamr@2: williamr@2: In the current implementation, this is always 0. williamr@2: */ williamr@2: TInt iMessagePartsNotFound; williamr@2: /** Number of folders not found during synchronisation. williamr@2: williamr@2: This can occur if the remote server returns an error when williamr@2: a client attempts to select a folder during synchronisation. williamr@2: */ williamr@2: TInt iFoldersNotFound; williamr@2: /** Any error-code that the client needs to be informed of. */ williamr@2: TInt iErrorCode; williamr@2: }; williamr@2: williamr@2: class TImap4CompoundProgress williamr@2: /** williamr@2: IMAP operation progress information. williamr@2: williamr@2: The class supplies both the two IMAP progress types, generic and synchronisation. williamr@2: williamr@2: The IMAP4 server MTM owns two IMAP4 sessions that are used independently of williamr@2: each other to perform 'background' and 'foreground' operations. In a typical williamr@2: situation, the user may be downloading the body parts of a message (populating) williamr@2: in the foreground whilst in the background a full synchronisation may be underway. williamr@2: In this scenario, the generic progress will give an indication of the 'foreground' williamr@2: activity and the synchronisation progress will give an indication of the 'background' williamr@2: progress. The synchronisation progress component of the compound progress williamr@2: will always show the synchronisation progress irrespective of whether the williamr@2: synchronisation is running in the foreground or the background. williamr@2: williamr@2: @publishedAll williamr@2: @released williamr@2: */ williamr@2: { williamr@2: public: williamr@2: /** Generic progress. */ williamr@2: TImap4GenericProgress iGenericProgress; williamr@2: /** Synchronisation progress. */ williamr@2: TImap4SyncProgress iSyncProgress; williamr@2: }; williamr@2: williamr@2: williamr@2: class CImImap4Settings : public CImBaseEmailSettings williamr@2: /** williamr@2: Settings for connection to and use of an IMAP4 mail server and its mailboxes. williamr@2: williamr@2: Messaging clients should use an instance of this class to specify and retrieve williamr@2: configuration settings that are used by an IMAP4 service when executing email williamr@2: operations. williamr@2: williamr@2: Service settings include: williamr@2: williamr@2: - server log on settings (user name and password) williamr@2: - message header synchronisation strategy and synchronisation limits williamr@2: - message getting options, such as maximum size. Note that these options williamr@2: are not used by the IMAP MTM. They can be used by client applications to williamr@2: store user preferences, and be used by the client when issuing get commands. williamr@2: - miscelleanous settings, including whether IMAP IDLE should be used williamr@2: williamr@2: CImImap4Settings objects are created and accessed through williamr@2: CEmailAccounts. CEmailAccounts can also be used to get the williamr@2: connection settings, such as the ISP to use, used to access an IMAP server. williamr@2: williamr@2: Settings for a service are associated with a service-type entry in the Message williamr@2: Server'smessage store. However the settings are not actually stored in the williamr@2: message store, but in the device's Central Repository data store. williamr@2: williamr@2: @see CEmailAccounts williamr@2: williamr@2: @publishedAll williamr@2: @released williamr@2: */ williamr@2: { williamr@2: public: williamr@2: IMPORT_C CImImap4Settings(); williamr@2: IMPORT_C virtual ~CImImap4Settings(); williamr@2: IMPORT_C void Reset(); williamr@2: IMPORT_C const TPtrC8 LoginName() const; williamr@2: IMPORT_C void SetLoginNameL(const TDesC8& aLoginName); williamr@2: IMPORT_C const TPtrC8 Password() const; williamr@2: IMPORT_C void SetPasswordL(const TDesC8& aPassword); williamr@2: IMPORT_C const TPtrC8 FolderPath() const; williamr@2: IMPORT_C void SetFolderPathL(const TDesC8& aFolderPath); williamr@2: IMPORT_C const TPtrC8 SearchString() const; williamr@2: IMPORT_C void SetSearchStringL(const TDesC8& aSearchString); williamr@2: IMPORT_C TText8 PathSeparator() const; williamr@2: IMPORT_C void SetPathSeparator(const TText8 aPathSeparator); williamr@2: IMPORT_C TBool DisconnectedUserMode() const; williamr@2: IMPORT_C void SetDisconnectedUserMode(TBool aFlag); williamr@2: IMPORT_C void SetSynchronise(const TFolderSyncType aType); williamr@2: IMPORT_C TFolderSyncType Synchronise() const; williamr@2: IMPORT_C void SetSubscribe(const TFolderSubscribeType aType); williamr@2: IMPORT_C TFolderSubscribeType Subscribe() const; williamr@2: IMPORT_C TBool AutoSendOnConnect() const; williamr@2: IMPORT_C void SetAutoSendOnConnect(TBool aFlag); williamr@2: IMPORT_C TUint MaxEmailSize() const; williamr@2: IMPORT_C void SetMaxEmailSize(const TUint aMaxEmailSize); williamr@2: IMPORT_C TBool DeleteEmailsWhenDisconnecting() const; williamr@2: IMPORT_C void SetDeleteEmailsWhenDisconnecting(TBool aFlag); williamr@2: IMPORT_C TBool AcknowledgeReceipts() const; williamr@2: IMPORT_C void SetAcknowledgeReceipts(TBool aFlag); williamr@2: IMPORT_C TImap4GetMailOptions GetMailOptions() const; williamr@2: IMPORT_C void SetGetMailOptions(TImap4GetMailOptions aGetMailOptions); williamr@2: IMPORT_C CImImap4Settings& CopyL(const CImImap4Settings& aCImImap4Settings); williamr@2: IMPORT_C TBool operator==(const CImImap4Settings& aCImImap4Settings) const; williamr@2: IMPORT_C TInt32 InboxSynchronisationLimit() const; williamr@2: IMPORT_C void SetInboxSynchronisationLimit(const TInt32 aInboxSyncLimit); williamr@2: IMPORT_C TInt32 MailboxSynchronisationLimit() const; williamr@2: IMPORT_C void SetMailboxSynchronisationLimit(const TInt32 aMailboxSyncLimit); williamr@2: IMPORT_C TBool UpdatingSeenFlags() const; williamr@2: IMPORT_C void SetUpdatingSeenFlags(TBool aFlag); williamr@2: IMPORT_C TInt SyncRate() const; williamr@2: IMPORT_C void SetSyncRateL(TInt aSyncRate); williamr@2: IMPORT_C TUint FetchSize() const; williamr@2: IMPORT_C void SetFetchSizeL(TUint aFetchSizeBytes); williamr@2: IMPORT_C TBool ImapIdle() const; williamr@2: IMPORT_C void SetImapIdle(TBool aFlag); williamr@2: IMPORT_C TInt ImapIdleTimeout() const; williamr@2: IMPORT_C void SetImapIdleTimeoutL(TInt aIdleTimeout); williamr@2: IMPORT_C TImImap4PartialMailOptions PartialMailOptions() const; williamr@2: IMPORT_C void SetPartialMailOptionsL(TImImap4PartialMailOptions aPartialMailOptions); williamr@2: IMPORT_C TInt32 BodyTextSizeLimit() const; williamr@2: IMPORT_C void SetBodyTextSizeLimitL(TInt32 aBodyTextSizeLimit); williamr@2: IMPORT_C TInt32 AttachmentSizeLimit() const; williamr@2: IMPORT_C void SetAttachmentSizeLimitL(TInt32 aAttachmentSizeLimit); williamr@2: IMPORT_C TBool UseExpunge() const; williamr@2: IMPORT_C void SetUseExpunge(TBool aFlag); williamr@2: IMPORT_C void SetTlsSslDomainL(const TDesC8& aDomainName); williamr@2: IMPORT_C TPtrC8 TlsSslDomain() const; williamr@2: IMPORT_C void SetUseSyncDownloadRules(TBool aFlag); williamr@2: IMPORT_C TBool UseSyncDownloadRules(); williamr@2: IMPORT_C void SetFolderSyncDisabled(TBool aFlag); williamr@2: IMPORT_C TBool FolderSyncDisabled(); williamr@4: williamr@4: #if (defined SYMBIAN_EMAIL_CAPABILITY_SUPPORT) williamr@4: IMPORT_C TBool IMAP4Auth() const; williamr@4: IMPORT_C void SetIMAP4Auth(TBool aFlag); williamr@4: IMPORT_C TBool FallBack() const; williamr@4: IMPORT_C void SetFallBack(TBool aFlag); williamr@4: #endif williamr@2: williamr@2: private: williamr@2: class TImImap4SettingsExtension williamr@2: { williamr@2: public: williamr@2: inline TImImap4SettingsExtension(); williamr@2: public: williamr@2: HBufC8* iLoginName; williamr@2: HBufC8* iPassword; williamr@2: HBufC8* iFolderPath; williamr@2: HBufC8* iSearchString; williamr@2: HBufC8* iTlsSslDomain; williamr@2: TInt iSyncRate; williamr@2: TInt iImapIdleTimeout; williamr@2: TUint iFetchSizeBytes; williamr@2: TImImap4PartialMailOptions iPartialMailOptions; williamr@2: TInt32 iBodyTextSizeLimit; williamr@2: TInt32 iAttachmentSizeLimit; williamr@2: }; williamr@2: williamr@2: inline TImImap4SettingsExtension* Extension() const; williamr@2: inline void CheckExtensionExistsL(); williamr@2: williamr@2: enum TImImap4EmailSettings williamr@2: { williamr@2: KImap4EmailSettingsClearFlag = 0x00000000, williamr@2: KImap4BaseEmailSettingsLastUsedFlag = CImBaseEmailSettings::EBaseEmailSettingsLastUsedFlag, //0x00000002 williamr@4: KImap4EmailDisconnectedModeFlag = KImap4BaseEmailSettingsLastUsedFlag << 1, //0x00000004 williamr@4: KImap4EmailAutoSendFlag = KImap4EmailDisconnectedModeFlag << 1, //0x00000008 williamr@4: KImap4EmailDeleteEmailsWhenDisconnecting = KImap4EmailAutoSendFlag << 1, //0x00000010 williamr@4: KImap4EmailAcknowledgeReceipts = KImap4EmailDeleteEmailsWhenDisconnecting << 1,//0x00000020 williamr@4: KImap4EmailUpdatingSeenFlags = KImap4EmailAcknowledgeReceipts << 1, //0x00000040 williamr@4: KImap4EmailIdleFlag = KImap4EmailUpdatingSeenFlags << 1, //0x00000080 williamr@2: KImap4EmailExpungeFlag = KImap4EmailIdleFlag << 1, williamr@4: KImap4EmailUseSyncDownloadRules = KImap4EmailExpungeFlag << 1, //0x00000200 williamr@4: KImap4EmailSettingsFolderSyncDisabled = KImap4EmailUseSyncDownloadRules << 1, //0x00000400 williamr@4: #if (defined SYMBIAN_EMAIL_CAPABILITY_SUPPORT) williamr@4: KImap4EmailSettingsAuthenticationFlag = KImap4EmailSettingsFolderSyncDisabled << 1, //0x00000800 williamr@4: KImap4EmailSettingsFallBackFlag = KImap4EmailSettingsAuthenticationFlag << 1, //0x00001000 williamr@4: KImap4EmailSettingsLastUsedFlag = KImap4EmailSettingsFallBackFlag //0x00001000 williamr@4: #else williamr@4: KImap4EmailSettingsLastUsedFlag = KImap4EmailSettingsFolderSyncDisabled //0x00000400 williamr@4: #endif williamr@2: }; williamr@2: williamr@2: TImImap4SettingsExtension* iExtension; // renamed iReceiptAddress williamr@2: williamr@2: TInt32 iInboxSyncLimit; williamr@2: TInt32 iMailboxSyncLimit; williamr@2: williamr@2: TText8 iPathSeparator; williamr@2: TFolderSyncType iSynchroniseStrategy; williamr@2: TFolderSubscribeType iSubscriptionStrategy; williamr@2: TUint32 iMaxEmailSize; williamr@2: TImap4GetMailOptions iGetMailOptions; williamr@2: }; williamr@2: williamr@2: williamr@2: class TImImap4GetMailInfo williamr@2: /** williamr@2: Specifies options used when retrieving messages with IMAP. williamr@2: williamr@2: An TImImap4GetMailInfo is passed as a packaged parameter williamr@2: to CImap4ClientMtm::InvokeAsyncFunctionL() when a message williamr@2: getting command is issued. williamr@2: williamr@2: Options include the maximum message size, and what williamr@2: message parts are required. williamr@2: williamr@2: @see CImImap4GetMail williamr@2: @see TImap4Cmds williamr@2: williamr@2: @publishedAll williamr@2: @released williamr@2: */ williamr@2: { williamr@2: public: williamr@2: /** The maximum message size (bytes). williamr@2: Messages of greater size are not fetched. */ williamr@2: TInt32 iMaxEmailSize; williamr@2: /** The required message parts. */ williamr@2: TImap4GetMailOptions iGetMailBodyParts; williamr@2: /** The destination folder ID, specifying the williamr@2: target folder when messages are copied or moved. */ williamr@2: TMsvId iDestinationFolder; williamr@2: }; williamr@2: williamr@2: /** williamr@2: Specifies message criteria that are used as a filter when retrieving messages partially. williamr@2: williamr@2: Options include the maximum size for the whole message, williamr@2: the maximum size for the body of the message, williamr@2: the maximum size for the attachments with the message, and williamr@2: the message parts required. williamr@2: williamr@2: An TImImap4GetPartialMailInfo is passed as a packaged parameter williamr@2: to CImap4ClientMtm::InvokeAsyncFunctionL() when a message williamr@2: populate command is issued. williamr@2: williamr@2: @see williamr@2: CImImap4GetMail williamr@2: williamr@2: @publishedAll williamr@2: @released williamr@2: */ williamr@2: williamr@2: class TImImap4GetPartialMailInfo : public TImImap4GetMailInfo williamr@2: { williamr@2: public: williamr@2: /** The maximum size limit for the total message (bytes). */ williamr@2: TInt32 iTotalSizeLimit; williamr@2: /** The maximum size limit for body of the message (bytes). */ williamr@2: TInt32 iBodyTextSizeLimit; williamr@2: /** The maximum size limit for the attachments (bytes). */ williamr@2: TInt32 iAttachmentSizeLimit; williamr@2: /** The required message parts. */ williamr@2: TImImap4PartialMailOptions iPartialMailOptions; williamr@2: }; williamr@2: williamr@2: inline CImImap4Settings::TImImap4SettingsExtension* CImImap4Settings::Extension() const williamr@2: { williamr@2: return iExtension; williamr@2: } williamr@2: williamr@2: inline void CImImap4Settings::CheckExtensionExistsL() williamr@2: { williamr@2: if (!iExtension) williamr@2: iExtension=new (ELeave) CImImap4Settings::TImImap4SettingsExtension; williamr@2: } williamr@2: inline CImImap4Settings::TImImap4SettingsExtension::TImImap4SettingsExtension() williamr@2: : iLoginName(NULL) ,iPassword(NULL) ,iFolderPath(NULL),iSearchString(NULL),iTlsSslDomain(NULL), iSyncRate(KImapDefaultInboxSyncRate), iImapIdleTimeout(KImapDefaultIdleTimeout), iFetchSizeBytes(KImapDefaultFetchSizeBytes), williamr@2: iPartialMailOptions(ENoSizeLimits),iBodyTextSizeLimit(KMaxTInt),iAttachmentSizeLimit(KMaxTInt) williamr@2: { williamr@2: } williamr@2: williamr@2: williamr@2: #endif // __IMAPSET_H__