// FXUT.H
//
// Copyright (c) 1998 Symbian Ltd.  All rights reserved.
//

#if !defined (__FXUT_H__)
#define __FXUT_H__

#if !defined (__BADESCA_H__)
#include <BADESCA.H>
#endif

#if !defined(__FAXSTD_H__)
#include <faxstd.h>
#endif

#if !defined(__FAXDEF_H__)
#include <faxdefn.h>
#endif

#if !defined(__FAXSET_H__)
#include<faxset.h>		// TFaxSettings
#endif

#if !defined(__MSVRCPT_H__)
#include <msvrcpt.h>
#endif

////////////////////////////////
// global definitions
const TUid KMsgFileFaxHeaderUid	= {0x100001D7};
const TUint KFaxsResolutionMask=0x00000001;
const TUint KFaxsSendLockMask=0x00000010;

////////////////////////////////
// forward declarations
class TMsvEntry;
class RMsvDictionaryStore;
class CMsvStore;
class RMsvReadStream;
class RMsvWriteStream;
class CMsvEntry;

class TMTMFaxSettings : public TFaxSettings
	{
public:
	IMPORT_C void ExternalizeL (RWriteStream &) const;
    IMPORT_C void InternalizeL (RReadStream &);
    IMPORT_C TMTMFaxSettings& operator=(const TMTMFaxSettings& aFaxSettings);

	IMPORT_C void StoreL(CMsvStore& aMsvStore) const;
	IMPORT_C void RestoreL(const CMsvStore& aMessageStore );
public:
	TBuf<20> iUserName;
	};


//
//
//
class CFaxRecipient : public CMsvRecipient
	{
public:
	IMPORT_C CFaxRecipient();
	IMPORT_C ~CFaxRecipient();

	// streaming operations
	IMPORT_C void InternalizeL( RMsvReadStream& aReadStream);
	IMPORT_C void ExternalizeL( RMsvWriteStream& aWriteStream) const;

	IMPORT_C TPtrC Name() const;
	IMPORT_C void SetNameL( const TDesC& );

	IMPORT_C TPtrC8 Number() const;
	IMPORT_C void SetNumberL(const TDesC8&);

private: //data
	TInt  iNoPages;
	TFaxResolution iAttachmentResolution;
	HBufC8* iNumber;
	HBufC*  iName;
	};

class CFaxRecipient;
class CFaxHeader : public CArrayPtrFlat<CFaxRecipient>
	{
public:
	IMPORT_C CFaxHeader();
	IMPORT_C ~CFaxHeader();

	IMPORT_C void RestoreL( CMsvStore& aStore );
	IMPORT_C void StoreL( CMsvStore& aStore );// const;
	};

/////////////////////
//TFaxSessionProgress
/////////////////////

enum TFaxSessionState {	EFaxSessionNotStarted, 
						EFaxSessionTransfering, 
						EFaxSessionStopped, 
						EFaxSessionCompleted,
						EFaxSessionCancelled,
						EFaxSessionOOM
						};

enum TFaxSessionType{ EFaxSessionIdle,
					  EFaxSendSession,
					  EFaxRecvSession
					};
						

class TFaxSessionProgress
	{
	public:
		inline TFaxSessionProgress();
	// member data
	public:
		TFaxSessionType		iType;
		TInt				iMessage;
		TInt				iMessagesSuccessful;
		TFaxSessionState	iState;
		TFaxPhase			iPhase;
		TFaxMode			iMode;
		TInt				iPageNumber;
		TBuf8<64>			iFaxNumber; // what is maximum dial string
		TInt				iError;
	};


typedef TPckgBuf<TFaxSessionProgress> TFaxSessionProgressBuf;


class FaxUtils
	{
public:
	IMPORT_C static TInt SizeL(CMsvEntry& aEntry, RFs& aFs);
	};

#include "fxut.inl"

#endif 

