1.1 --- a/epoc32/include/popcmtm.h Tue Mar 16 16:12:26 2010 +0000
1.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
1.3 @@ -1,233 +0,0 @@
1.4 -// Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
1.5 -// All rights reserved.
1.6 -// This component and the accompanying materials are made available
1.7 -// under the terms of the License "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members
1.8 -// which accompanies this distribution, and is available
1.9 -// at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
1.10 -//
1.11 -// Initial Contributors:
1.12 -// Nokia Corporation - initial contribution.
1.13 -//
1.14 -// Contributors:
1.15 -//
1.16 -// Description:
1.17 -// Client MTM for the POP3 protocol
1.18 -//
1.19 -//
1.20 -
1.21 -
1.22 -#if !defined (__POPCMTM_H__)
1.23 -#define __POPCMTM_H__
1.24 -
1.25 -#if !defined (__MIUTMSG_H__)
1.26 -#include <miutmsg.h>
1.27 -#endif
1.28 -#if !defined (__MIUTPARS_H__)
1.29 -#include <miutpars.h> //TImMessageField
1.30 -#endif
1.31 -#if !defined (__POP3CMDS_H__)
1.32 -#include <pop3cmds.h> // KPOP3MTMConnect etc
1.33 -#endif
1.34 -#if !defined (__POP3SET_H__)
1.35 -#include <pop3set.h> // KPOP3MTMConnect etc
1.36 -#endif
1.37 -
1.38 -class CImPOP3GetMail;
1.39 -class CImEmailAutoSend;
1.40 -
1.41 -/////// Pop3 Client MTM /////////////////////////////////////////////////////////////////////////////
1.42 -class CPop3ClientMtm : public CBaseMtm
1.43 -/** POP3 client MTM interface.
1.44 -
1.45 -Most of the functions in this class are implementations of the virtual functions
1.46 -defined by the base class CBaseMtm.
1.47 -@publishedAll
1.48 -@released
1.49 -*/
1.50 - {
1.51 -/**
1.52 -@deprecated
1.53 -*/
1.54 -
1.55 -public:
1.56 - enum TImPopcNewEmailHeaderType
1.57 - {
1.58 - EForwardedEmail,
1.59 - EReplyToEmail,
1.60 - EReceiptToEmail
1.61 - };
1.62 -
1.63 -public:
1.64 - IMPORT_C static CPop3ClientMtm* NewL(CRegisteredMtmDll& aRegisteredMtmDll, CMsvSession& aMsvSession);
1.65 - ~CPop3ClientMtm();
1.66 -
1.67 - void SaveMessageL();
1.68 - void LoadMessageL();
1.69 -
1.70 - IMPORT_C void StoreSettingsL();
1.71 - IMPORT_C void RestoreSettingsL();
1.72 -
1.73 - CMsvOperation* ReplyL (TMsvId aId, TMsvPartList aPartlist, TRequestStatus& aCompletionStatus);
1.74 - CMsvOperation* ForwardL(TMsvId aId, TMsvPartList aPartList, TRequestStatus& aCompletionStatus);
1.75 -
1.76 - TUint ValidateMessage(TMsvPartList aPartList);
1.77 - TMsvPartList Find(const TDesC& aTextToFind, TMsvPartList aPartList);
1.78 -
1.79 - void AddAddresseeL(const TDesC& aRealAddress);
1.80 - void AddAddresseeL(const TDesC& aRealAddress, const TDesC& aAlias);
1.81 - void RemoveAddressee(TInt aIndex);
1.82 -
1.83 - IMPORT_C void SetSettingsL(const CImPop3Settings& aSettings);
1.84 - IMPORT_C const CImPop3Settings& Settings() const;
1.85 -
1.86 - // --- RTTI functions ---
1.87 - TInt QueryCapability(TUid aCapability, TInt& aResponse);
1.88 - void InvokeSyncFunctionL(TInt aFunctionId, const CMsvEntrySelection& aSelection, TDes8& aParameter);
1.89 - CMsvOperation* InvokeAsyncFunctionL(TInt aFunctionId, const CMsvEntrySelection& aSelection, TDes8& aParameter, TRequestStatus& aCompletionStatus);
1.90 -
1.91 - // Attachment functions to support the SendAs API
1.92 - IMPORT_C virtual void AddAttachmentL(const TDesC& aFilePath, const TDesC8& aMimeType, TUint aCharset, TRequestStatus& aStatus);
1.93 - IMPORT_C virtual void AddAttachmentL(RFile& aFile, const TDesC8& aMimeType, TUint aCharset, TRequestStatus& aStatus);
1.94 - IMPORT_C virtual void AddLinkedAttachmentL(const TDesC& aFilePath, const TDesC8& aMimeType, TUint aCharset, TRequestStatus& aStatus);
1.95 - IMPORT_C virtual void AddEntryAsAttachmentL(TMsvId aAttachmentId, TRequestStatus& aStatus);
1.96 - EXPORT_C virtual void CreateAttachmentL(const TDesC& aFileName, RFile& aAttachmentFile, const TDesC8& aMimeType, TUint aCharset, TRequestStatus& aStatus);
1.97 - IMPORT_C virtual void CreateMessageL(TMsvId aServiceId);
1.98 -
1.99 - IMPORT_C virtual TMsvId DefaultServiceL() const;
1.100 - IMPORT_C virtual void RemoveDefaultServiceL();
1.101 - IMPORT_C virtual void ChangeDefaultServiceL(const TMsvId& aService);
1.102 -
1.103 -protected:
1.104 - CPop3ClientMtm(CRegisteredMtmDll& aRegisteredMtmDll, CMsvSession& aMsvSession);
1.105 - void ConstructL();
1.106 - void ContextEntrySwitched();
1.107 -
1.108 -private:
1.109 - TBool ValidateAddress(const TPtrC& anAddress);
1.110 - void SendOnNextConnectionL();
1.111 - TMsvPartList DoFindL(const TDesC& aTextToFind, TMsvPartList aPartList);
1.112 - CMsvEntrySelection* FilteredChildrenLC(TBool aNewOnly, TInt aMaxEmailSize);
1.113 - CMsvEntrySelection* FilteredSelectionLC(TInt aMaxEmailSize, const CMsvEntrySelection& aSelection);
1.114 -
1.115 -
1.116 -
1.117 -private:
1.118 - CImPop3Settings* iImPop3Settings;
1.119 - TImMessageField iTImMessageField;
1.120 - CImHeader* iHeader;
1.121 -
1.122 - HBufC* iEmailAddressFormatString; // defines format of email address used by "Send as" API eg _LIT("/"%S/" <%S>")
1.123 - CImEmailOperation* iImEmailOperation;
1.124 - CImPOP3GetMail* iImPOP3GetMail;
1.125 - };
1.126 -
1.127 -
1.128 -class CImPOP3GetMail : public CMsvOperation
1.129 -/** Encapsulates an operation to copy/move POP3 emails from the remote inbox to
1.130 -any local folder.
1.131 -
1.132 -Functionality is provided to:
1.133 -
1.134 -1. copy/move any new emails
1.135 -
1.136 -2. copy/move a selection of emails
1.137 -
1.138 -3. copy/move all emails
1.139 -
1.140 -4. in the Remote Inbox to a local folder.
1.141 -
1.142 -There are three cases for copying/moving the emails from the Remote Inbox:
1.143 -
1.144 -1. the user is connected to the account so just copy/move the emails
1.145 -
1.146 -2. the user is not connected to the account so connect, copy/move the emails,
1.147 -and then disconnect
1.148 -
1.149 -3. the user is not connected to the account so connect, copy/move the emails,
1.150 -and then stay online
1.151 -
1.152 -Objects of this type are returned from CPop3ClientMtm::InvokeAsyncFunctionL()
1.153 -when a suitable get command is requested.
1.154 -@publishedAll
1.155 -@released
1.156 -*/
1.157 - {
1.158 -public:
1.159 - /** Defines types of get mail operation. */
1.160 - enum TImPOP3GetMailType
1.161 - {
1.162 - /** Connect and copy new mail and stay online. */
1.163 - EConnectAndCopyNewMailAndStayOnline,
1.164 - /** Connect and copy new mail and disconnect. */
1.165 - EConnectAndCopyNewMailAndDisconnect,
1.166 - /** Connect and move new mail and stay online. */
1.167 - EConnectAndMoveNewMailAndStayOnline,
1.168 - /** Connect and move new mail and disconnect. */
1.169 - EConnectAndMoveNewMailAndDisconnect,
1.170 - /** Connect and copy mail selection and stay online. */
1.171 - EConnectAndCopyMailSelectionAndStayOnline,
1.172 - /** Connect and copy mail selection and disconnect. */
1.173 - EConnectAndCopyMailSelectionAndDisconnect,
1.174 - /** Connect and move mail selection and stay online. */
1.175 - EConnectAndMoveMailSelectionAndStayOnline,
1.176 - /** Connect and move mail selection and disconnect. */
1.177 - EConnectAndMoveMailSelectionAndDisconnect,
1.178 - /** Connect and copy all mail and stay online. */
1.179 - EConnectAndCopyAllMailAndStayOnline,
1.180 - /** Connect and copy all mail and disconnect. */
1.181 - EConnectAndCopyAllMailAndDisconnect,
1.182 - /** Connect and move all mail and stay online. */
1.183 - EConnectAndMoveAllMailAndStayOnline,
1.184 - /** Connect and move all mail and disconnect. */
1.185 - EConnectAndMoveAllMailAndDisconnect
1.186 - };
1.187 -
1.188 -public:
1.189 - IMPORT_C CMsvOperation* GetMailL(CPop3ClientMtm& aPop3ClientMtm, TRequestStatus& aObserverRequestStatus, const CMsvEntrySelection& aMsvEntrySelection, TDes8& aPop3GetMailInfo, TImPOP3GetMailType aPOP3GetMailType);
1.190 - IMPORT_C const TDesC8& FinalProgress();
1.191 - IMPORT_C ~CImPOP3GetMail();
1.192 - void DoCancel();
1.193 - void RunL();
1.194 - const TDesC8& ProgressL();
1.195 -private:
1.196 - CImPOP3GetMail(CMsvSession& aMsvSession, TRequestStatus& aObserverRequestStatus, CPop3ClientMtm& aPop3ClientMtm, TImPOP3GetMailType aPOP3GetMailType);
1.197 - void ConstructL(const CMsvEntrySelection& aMsvEntrySelection, TDes8& aPop3GetMailInfo);
1.198 - void SelectNextStateL(); // selects next state to go to
1.199 - void ChangeStateL(); // initiates the next state operation
1.200 - void SelectAndChangeToNextStateL();
1.201 - void RequestComplete(TInt aError);
1.202 - void Complete();
1.203 - void ConnectToMailboxL();
1.204 - void CopyMoveNewMessagesL(TBool aCopy);
1.205 - void CopyMoveMessageSelectionL(TBool aCopy);
1.206 - void CopyMoveAllMessagesL(TBool aCopy);
1.207 - void DisconnectFromMailboxL();
1.208 - void ResetProgress();
1.209 - void StoreProgressL();
1.210 -private:
1.211 - enum TImPOP3GetMailState
1.212 - {
1.213 - EConnectToMailbox,
1.214 - ECopyNewMessages,
1.215 - EMoveNewMessages,
1.216 - ECopyMessageSelection,
1.217 - EMoveMessageSelection,
1.218 - ECopyAllMessages,
1.219 - EMoveAllMessages,
1.220 - EDisconnectFromMailbox,
1.221 - EFinished
1.222 - };
1.223 -
1.224 - CPop3ClientMtm& iPop3ClientMtm;
1.225 - CMsvEntrySelection* iMsvEntrySelection;
1.226 - CMsvOperation* iMsvOperation;
1.227 -
1.228 - TPop3Progress iProgress;
1.229 - TPop3Progress iErrorProgress;
1.230 - TImPOP3GetMailState iState;
1.231 - TImPOP3GetMailType iPOP3GetMailType;
1.232 - TPckgBuf<TPop3Progress> iProgressBuf;
1.233 - TPckgBuf<TImPop3GetMailInfo> iPop3GetMailInfo;
1.234 - };
1.235 -
1.236 -#endif // __POPCMTM_H__