email/pop3andsmtpmtm/popservermtm/inc/POPS.H
changeset 0 72b543305e3a
child 76 60a8a215b0ec
equal deleted inserted replaced
-1:000000000000 0:72b543305e3a
       
     1 // Copyright (c) 2006-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 // popservermtm module header
       
    15 // 
       
    16 //
       
    17 
       
    18 /**
       
    19  @file
       
    20  @internalComponent
       
    21  @released
       
    22 */
       
    23 
       
    24 #ifndef __POPS_H__
       
    25 #define __POPS_H__
       
    26 
       
    27 #include <e32base.h>
       
    28 #include <imsk.h>
       
    29 #include <msvstd.h>
       
    30 #include <cimcaf.h>
       
    31 
       
    32 class CImPop3Settings;
       
    33 class CPop3IdleTimer;
       
    34 class CImIAPPreferences;
       
    35 class CImPop3Capa;
       
    36 #if (defined SYMBIAN_EMAIL_CAPABILITY_SUPPORT)
       
    37 class CPopAuthMechanismHelper;
       
    38 #endif
       
    39 
       
    40 
       
    41 const TInt KImPopSessionPriority = 1;
       
    42 
       
    43 //
       
    44 // CImPop3Session
       
    45 //
       
    46 // A Pop3 Session
       
    47 //
       
    48 //
       
    49 class CImPop3Session : public CMsgActive
       
    50     {
       
    51 public:
       
    52 	static CImPop3Session* NewL(RSocketServ& aServ, CImConnect& aConnect);
       
    53 	~CImPop3Session();		// destructor kills socket server
       
    54 
       
    55 	void ConnectL(CImPop3Settings* aPopSettings, const CImIAPPreferences& aPrefs,TRequestStatus& aStatus);
       
    56 	void Quit(TRequestStatus&);
       
    57 	void Waiting(TRequestStatus&);
       
    58 
       
    59 	void SetMessageArray(TInt32* aIdArray, TUint aNoMessages);
       
    60 	TInt32* MessageArray();
       
    61 	TInt GetNumMessages();
       
    62 	TInt MessageNo(TMsvId);
       
    63 	CImTextServerSession* TextServerSession();
       
    64 
       
    65 	void SetPending();
       
    66 	TBool IsPending();
       
    67 	void SetOpNotPending();
       
    68 	TBool IsConnectedToInternet();
       
    69 	CImCaf* GetCafL(RFs& aFs);
       
    70 	TBool PipeliningSupport();
       
    71 
       
    72 private:
       
    73 	CImPop3Session();	// constructor
       
    74 	void ConstructL(RSocketServ& aServ, CImConnect& aConnect);
       
    75 
       
    76 	void DoRunL();
       
    77 	void DoCancel();
       
    78 	void DoComplete(TInt&);
       
    79 
       
    80     void ChangeStateL();				// the state machine engine
       
    81 	void ConstructApopL();
       
    82 	void SetOpPending();
       
    83 	TInt GetPopError();
       
    84 	void GetCapabilitiesL();
       
    85 #if (defined SYMBIAN_EMAIL_CAPABILITY_SUPPORT)
       
    86 	void SelectAuthExtensionProfileL();
       
    87 #endif	
       
    88 
       
    89 private:
       
    90 	enum				// States of "session" state machine
       
    91 		{
       
    92 		EConnectingToPop,
       
    93 		EPopCapabilities,
       
    94 #if (defined SYMBIAN_EMAIL_CAPABILITY_SUPPORT)
       
    95 		ESaslAuthInProgress,
       
    96 		ESaslAuthIsDone,
       
    97 #endif		
       
    98 		EWaitingForReply,
       
    99 		EAuthorisingUser,
       
   100 		EAuthorisingPass,
       
   101 		EAuthorisingApop,
       
   102 		EPopConnected,
       
   103 		EStopPop,
       
   104 		ERequestingTLS,
       
   105 		ESettingTLS,
       
   106 		ELoggingEvent
       
   107 		};
       
   108 private:
       
   109 	TInt				iState;
       
   110 	TInt				iNextState;
       
   111 	TInt				iCompleted;
       
   112 	TBool				iOpPending;
       
   113 
       
   114 	TBool				iSocketConnected;
       
   115 
       
   116 	HBufC8*				iPopApop;
       
   117 	HBufC8*				iConnectReply;
       
   118 
       
   119 	CImPop3Settings*	iPopSettings;
       
   120 	
       
   121 	TInt				iNoMessages;
       
   122 	TInt32*				iIdTab;
       
   123 
       
   124     CImTextServerSession*			iSocket;
       
   125 	CImCaf*				iCaf;
       
   126 
       
   127 	CImPop3Capa*		iPopCapabilities;
       
   128 	TBuf8<KImMailMaxBufferSize>	iResponseBuffer;
       
   129 #if (defined SYMBIAN_EMAIL_CAPABILITY_SUPPORT)
       
   130 	TBool iSaslAuthLogin;
       
   131 	CPopAuthMechanismHelper* iPopAuthHelper;
       
   132 #endif
       
   133 
       
   134 public:
       
   135 	TInt MaxHeaders();
       
   136     };
       
   137 
       
   138 #endif