// POP3SET.H
//
// Copyright (c) 1998 Symbian Ltd.  All rights reserved. 
//

#if !defined (__POP3SET_H__)
#define __POP3SET_H__

#if !defined (__MSVUIDS_H__)
#include <MSVUIDS.H>
#endif
#if !defined(__MIUTSET_H__)
#include "miutset.h"
#endif
#if !defined(__MIUT_ERR_H__)
#include "miut_err.h"
#endif


const TUint16 KImPop3SettingsVersion = 1;	// identify which version of this class has been stored
const TUint32 KPOP3DefaultPortNumber = 110;

class CMsvStore;
class RMsvWriteStream;
class RMsvReadStream;


class TPop3Progress
	{
public:
	enum TPop3ProgressType 
		{
		EPopRefreshing,
		EPopCopying,
		EPopDeleting,
		EPopConnecting,
		EPopTidying,
		EPopConnectedAndIdle,
		EPopDisconnecting,
		EPopDisconnected,
		EPopMoving,
		EPopMaxProgressValue=EPopMoving
		};

	TPop3ProgressType	iPop3Progress;
	TInt				iTotalMsgs;
	TInt				iMsgsToProcess;
	TInt				iBytesDone;
	TInt				iTotalBytes;
	TInt				iErrorCode; // client side needs to be informed of an error
	};


class CImPop3Settings : public CImBaseEmailSettings
	{
public:
	IMPORT_C CImPop3Settings();
	IMPORT_C ~CImPop3Settings();
	IMPORT_C void Reset();

	// streaming operations
	IMPORT_C void InternalizeL( RMsvReadStream&  );
	IMPORT_C void ExternalizeL( RMsvWriteStream& ) const;
	IMPORT_C void RestoreL( CMsvStore& aMessageStore );
	IMPORT_C void StoreL  ( CMsvStore& aMessageStore ) const;

	// User name
	IMPORT_C const TPtrC8 LoginName() const;
	IMPORT_C void SetLoginNameL( const TDesC8& );

	// Password
	IMPORT_C const TPtrC8 Password() const;
	IMPORT_C void SetPasswordL( const TDesC8& );

	// APOP connection or not
	IMPORT_C const TBool AutoSendOnConnect() const;
	IMPORT_C void SetAutoSendOnConnect( TBool );

	// APOP connection or not
	IMPORT_C const TBool Apop() const;
	IMPORT_C void SetApop( TBool );
	IMPORT_C CImPop3Settings& CopyL(const CImPop3Settings& aCImPop3Settings);
	IMPORT_C TBool operator==(const CImPop3Settings& aCImPop3Settings) const;

public:
	enum TImBaseEmailSettings
		{
		KPop3SettingsClearFlag				= 0x00000000,
		KPop3EmailSettingsFirstUnusedFlag	= CImBaseEmailSettings::EBaseEmailSettingsFirstUnusedFlag,
		KPop3ApopFlag						= 0x00000001,
		KPop3AutoSendFlag					= 0x00000002,
		KPop3EmailSettingsLastUsedFlag		= KPop3AutoSendFlag
		};
private:

	HBufC8* iLoginName;
	HBufC8* iPassword;
	};




#endif // #define __POP3SET_H__