// Borland C++ Builder
// Copyright (c) 1995, 2002 by Borland Software Corporation
// All rights reserved

// (DO NOT EDIT: machine generated header) 'ahmtmapimail.pas' rev: 6.00

#ifndef ahmtmapimailHPP
#define ahmtmapimailHPP

#pragma delphiheader begin
#pragma option push -w-
#pragma option push -Vx
#include <ahmmailconst.hpp>	// Pascal unit
#include <SysUtils.hpp>	// Pascal unit
#include <ahmmailclass.hpp>	// Pascal unit
#include <Mapi.hpp>	// Pascal unit
#include <Classes.hpp>	// Pascal unit
#include <Windows.hpp>	// Pascal unit
#include <SysInit.hpp>	// Pascal unit
#include <System.hpp>	// Pascal unit

//-- user supplied -----------------------------------------------------------

namespace Ahmtmapimail
{
//-- type declarations -------------------------------------------------------
class DELPHICLASS TAHMExceptdllerror;
class PASCALIMPLEMENTATION TAHMExceptdllerror : public Sysutils::Exception 
{
	typedef Sysutils::Exception inherited;
	
public:
	#pragma option push -w-inl
	/* Exception.Create */ inline __fastcall TAHMExceptdllerror(const AnsiString Msg) : Sysutils::Exception(Msg) { }
	#pragma option pop
	#pragma option push -w-inl
	/* Exception.CreateFmt */ inline __fastcall TAHMExceptdllerror(const AnsiString Msg, const System::TVarRec * Args, const int Args_Size) : Sysutils::Exception(Msg, Args, Args_Size) { }
	#pragma option pop
	#pragma option push -w-inl
	/* Exception.CreateRes */ inline __fastcall TAHMExceptdllerror(int Ident)/* overload */ : Sysutils::Exception(Ident) { }
	#pragma option pop
	#pragma option push -w-inl
	/* Exception.CreateResFmt */ inline __fastcall TAHMExceptdllerror(int Ident, const System::TVarRec * Args, const int Args_Size)/* overload */ : Sysutils::Exception(Ident, Args, Args_Size) { }
	#pragma option pop
	#pragma option push -w-inl
	/* Exception.CreateHelp */ inline __fastcall TAHMExceptdllerror(const AnsiString Msg, int AHelpContext) : Sysutils::Exception(Msg, AHelpContext) { }
	#pragma option pop
	#pragma option push -w-inl
	/* Exception.CreateFmtHelp */ inline __fastcall TAHMExceptdllerror(const AnsiString Msg, const System::TVarRec * Args, const int Args_Size, int AHelpContext) : Sysutils::Exception(Msg, Args, Args_Size, AHelpContext) { }
	#pragma option pop
	#pragma option push -w-inl
	/* Exception.CreateResHelp */ inline __fastcall TAHMExceptdllerror(int Ident, int AHelpContext)/* overload */ : Sysutils::Exception(Ident, AHelpContext) { }
	#pragma option pop
	#pragma option push -w-inl
	/* Exception.CreateResFmtHelp */ inline __fastcall TAHMExceptdllerror(System::PResStringRec ResStringRec, const System::TVarRec * Args, const int Args_Size, int AHelpContext)/* overload */ : Sysutils::Exception(ResStringRec, Args, Args_Size, AHelpContext) { }
	#pragma option pop
	
public:
	#pragma option push -w-inl
	/* TObject.Destroy */ inline __fastcall virtual ~TAHMExceptdllerror(void) { }
	#pragma option pop
	
};


class DELPHICLASS TAHMExceptAttachmentError;
class PASCALIMPLEMENTATION TAHMExceptAttachmentError : public Sysutils::Exception 
{
	typedef Sysutils::Exception inherited;
	
public:
	#pragma option push -w-inl
	/* Exception.Create */ inline __fastcall TAHMExceptAttachmentError(const AnsiString Msg) : Sysutils::Exception(Msg) { }
	#pragma option pop
	#pragma option push -w-inl
	/* Exception.CreateFmt */ inline __fastcall TAHMExceptAttachmentError(const AnsiString Msg, const System::TVarRec * Args, const int Args_Size) : Sysutils::Exception(Msg, Args, Args_Size) { }
	#pragma option pop
	#pragma option push -w-inl
	/* Exception.CreateRes */ inline __fastcall TAHMExceptAttachmentError(int Ident)/* overload */ : Sysutils::Exception(Ident) { }
	#pragma option pop
	#pragma option push -w-inl
	/* Exception.CreateResFmt */ inline __fastcall TAHMExceptAttachmentError(int Ident, const System::TVarRec * Args, const int Args_Size)/* overload */ : Sysutils::Exception(Ident, Args, Args_Size) { }
	#pragma option pop
	#pragma option push -w-inl
	/* Exception.CreateHelp */ inline __fastcall TAHMExceptAttachmentError(const AnsiString Msg, int AHelpContext) : Sysutils::Exception(Msg, AHelpContext) { }
	#pragma option pop
	#pragma option push -w-inl
	/* Exception.CreateFmtHelp */ inline __fastcall TAHMExceptAttachmentError(const AnsiString Msg, const System::TVarRec * Args, const int Args_Size, int AHelpContext) : Sysutils::Exception(Msg, Args, Args_Size, AHelpContext) { }
	#pragma option pop
	#pragma option push -w-inl
	/* Exception.CreateResHelp */ inline __fastcall TAHMExceptAttachmentError(int Ident, int AHelpContext)/* overload */ : Sysutils::Exception(Ident, AHelpContext) { }
	#pragma option pop
	#pragma option push -w-inl
	/* Exception.CreateResFmtHelp */ inline __fastcall TAHMExceptAttachmentError(System::PResStringRec ResStringRec, const System::TVarRec * Args, const int Args_Size, int AHelpContext)/* overload */ : Sysutils::Exception(ResStringRec, Args, Args_Size, AHelpContext) { }
	#pragma option pop
	
public:
	#pragma option push -w-inl
	/* TObject.Destroy */ inline __fastcall virtual ~TAHMExceptAttachmentError(void) { }
	#pragma option pop
	
};


class DELPHICLASS TAHMExceptunavailable;
class PASCALIMPLEMENTATION TAHMExceptunavailable : public Sysutils::Exception 
{
	typedef Sysutils::Exception inherited;
	
public:
	#pragma option push -w-inl
	/* Exception.Create */ inline __fastcall TAHMExceptunavailable(const AnsiString Msg) : Sysutils::Exception(Msg) { }
	#pragma option pop
	#pragma option push -w-inl
	/* Exception.CreateFmt */ inline __fastcall TAHMExceptunavailable(const AnsiString Msg, const System::TVarRec * Args, const int Args_Size) : Sysutils::Exception(Msg, Args, Args_Size) { }
	#pragma option pop
	#pragma option push -w-inl
	/* Exception.CreateRes */ inline __fastcall TAHMExceptunavailable(int Ident)/* overload */ : Sysutils::Exception(Ident) { }
	#pragma option pop
	#pragma option push -w-inl
	/* Exception.CreateResFmt */ inline __fastcall TAHMExceptunavailable(int Ident, const System::TVarRec * Args, const int Args_Size)/* overload */ : Sysutils::Exception(Ident, Args, Args_Size) { }
	#pragma option pop
	#pragma option push -w-inl
	/* Exception.CreateHelp */ inline __fastcall TAHMExceptunavailable(const AnsiString Msg, int AHelpContext) : Sysutils::Exception(Msg, AHelpContext) { }
	#pragma option pop
	#pragma option push -w-inl
	/* Exception.CreateFmtHelp */ inline __fastcall TAHMExceptunavailable(const AnsiString Msg, const System::TVarRec * Args, const int Args_Size, int AHelpContext) : Sysutils::Exception(Msg, Args, Args_Size, AHelpContext) { }
	#pragma option pop
	#pragma option push -w-inl
	/* Exception.CreateResHelp */ inline __fastcall TAHMExceptunavailable(int Ident, int AHelpContext)/* overload */ : Sysutils::Exception(Ident, AHelpContext) { }
	#pragma option pop
	#pragma option push -w-inl
	/* Exception.CreateResFmtHelp */ inline __fastcall TAHMExceptunavailable(System::PResStringRec ResStringRec, const System::TVarRec * Args, const int Args_Size, int AHelpContext)/* overload */ : Sysutils::Exception(ResStringRec, Args, Args_Size, AHelpContext) { }
	#pragma option pop
	
public:
	#pragma option push -w-inl
	/* TObject.Destroy */ inline __fastcall virtual ~TAHMExceptunavailable(void) { }
	#pragma option pop
	
};


typedef int UINT;

typedef int ULong;

typedef ULong *lpULONG;

typedef int LHANDLE;

typedef LHANDLE *lpLHANDLE;

typedef int Dword;

typedef void *LPVOID;

struct TMapiFileDesc;
typedef TMapiFileDesc *lpMapiFileDesc;

#pragma pack(push, 4)
struct TMapiFileDesc
{
	ULong ulReserved;
	ULong flFlags;
	ULong nPosition;
	char *lpszPathName;
	char *lpszFileName;
	void *lpFileType;
} ;
#pragma pack(pop)

struct TMapiRecipDesc;
typedef TMapiRecipDesc *lpMapiRecipDesc;

typedef lpMapiRecipDesc *lppMapiRecipDesc;

#pragma pack(push, 4)
struct TMapiRecipDesc
{
	ULong ulReserved;
	ULong ulRecipClass;
	char *lpszName;
	char *lpszAddress;
	ULong ulEIDSize;
	void *lpEntryID;
} ;
#pragma pack(pop)

struct TMapiMessage;
typedef TMapiMessage *lpMapiMessage;

typedef lpMapiMessage *TlppMapiMessage;

#pragma pack(push, 4)
struct TMapiMessage
{
	ULong ulReserved;
	char *lpszSubject;
	char *lpszNoteText;
	char *lpszMessageType;
	char *lpszDateReceived;
	char *lpszConversationID;
	ULong flFlags;
	TMapiRecipDesc *lpOriginator;
	ULong nRecipCount;
	TMapiRecipDesc *lpRecips;
	ULong nFileCount;
	TMapiFileDesc *lpFiles;
} ;
#pragma pack(pop)

class DELPHICLASS TAHMMapiMessage;
typedef void __fastcall (__closure *TAHMOnSendError)(System::TObject* Sender, int ErrorNo, TAHMMapiMessage* Mail);

typedef void __fastcall (__closure *TAHMMapiSend)(System::TObject* Sender, TAHMMapiMessage* Mail);

typedef void __fastcall (__closure *TAHMMapiConnect)(System::TObject* Sender, int ErrorNo);

typedef TMapiRecipDesc TAHMMapiRecipArray[999];

class DELPHICLASS TAHMMapiAttachment;
class PASCALIMPLEMENTATION TAHMMapiAttachment : public Classes::TCollectionItem 
{
	typedef Classes::TCollectionItem inherited;
	
private:
	AnsiString FFilename;
	TAHMMapiMessage* FAHMMapiMessage;
	
protected:
	virtual AnsiString __fastcall GetDisplayName();
	
public:
	__fastcall virtual TAHMMapiAttachment(Classes::TCollection* Collection);
	__property TAHMMapiMessage* Owner = {read=FAHMMapiMessage};
	
__published:
	__property AnsiString Filename = {read=FFilename, write=FFilename};
public:
	#pragma option push -w-inl
	/* TCollectionItem.Destroy */ inline __fastcall virtual ~TAHMMapiAttachment(void) { }
	#pragma option pop
	
};


#pragma option push -b-
enum TAHMFaxorMail { ccMail, ccFax };
#pragma option pop

class DELPHICLASS TAHMMapiAttachments;
class PASCALIMPLEMENTATION TAHMMapiAttachments : public Ahmmailclass::TAHMMailCollection 
{
	typedef Ahmmailclass::TAHMMailCollection inherited;
	
public:
	TAHMMapiAttachment* operator[](int Index) { return Items[Index]; }
	
private:
	TAHMMapiMessage* FAHMMapiMessage;
	TAHMMapiAttachment* __fastcall GeTAHMMapiAttachment(int Index);
	void __fastcall SeTAHMMapiAttachment(int Index, TAHMMapiAttachment* Value);
	
protected:
	DYNAMIC Classes::TPersistent* __fastcall GetOwner(void);
	
public:
	__fastcall TAHMMapiAttachments(TAHMMapiMessage* AOwner);
	HIDESBASE TAHMMapiAttachment* __fastcall Add(AnsiString Filename);
	__property TAHMMapiAttachment* Items[int Index] = {read=GeTAHMMapiAttachment, write=SeTAHMMapiAttachment/*, default*/};
public:
	#pragma option push -w-inl
	/* TCollection.Destroy */ inline __fastcall virtual ~TAHMMapiAttachments(void) { }
	#pragma option pop
	
};


class DELPHICLASS TAHMMapiMail;
class DELPHICLASS TAHMMapiMessages;
class PASCALIMPLEMENTATION TAHMMapiMessages : public Ahmmailclass::TAHMMailCollection 
{
	typedef Ahmmailclass::TAHMMailCollection inherited;
	
public:
	TAHMMapiMessage* operator[](int Index) { return Items[Index]; }
	
private:
	TAHMMapiMail* FAHMMapiMail;
	TAHMMapiMessage* __fastcall GetAHMMapiMessage(int Index);
	void __fastcall SetAHMMapiMessage(int Index, TAHMMapiMessage* Value);
	
protected:
	DYNAMIC Classes::TPersistent* __fastcall GetOwner(void);
	
public:
	__fastcall TAHMMapiMessages(TAHMMapiMail* AOwner);
	HIDESBASE TAHMMapiMessage* __fastcall Add(void);
	HIDESBASE bool __fastcall Delete(int Index);
	__property TAHMMapiMessage* Items[int Index] = {read=GetAHMMapiMessage, write=SetAHMMapiMessage/*, default*/};
public:
	#pragma option push -w-inl
	/* TCollection.Destroy */ inline __fastcall virtual ~TAHMMapiMessages(void) { }
	#pragma option pop
	
};


class PASCALIMPLEMENTATION TAHMMapiMail : public Ahmmailclass::TAHMMailsComponent 
{
	typedef Ahmmailclass::TAHMMailsComponent inherited;
	
private:
	TAHMMapiMessages* FAHMMapiMessages;
	ULong FLogonFlags;
	bool FNewSession;
	AnsiString FProfile;
	AnsiString FPassword;
	bool FDefaultProfile;
	Classes::TStrings* FSignature;
	Classes::TNotifyEvent FBeforeLogOff;
	Classes::TNotifyEvent FAfterSendAll;
	Classes::TNotifyEvent FBeforeSendAll;
	Classes::TNotifyEvent FBeforeLogon;
	Classes::TNotifyEvent FAfterExecute;
	Classes::TNotifyEvent FOnLogonSuccess;
	Classes::TNotifyEvent FOnLogoffSuccess;
	TAHMOnSendError FOnSendError;
	TAHMMapiSend FOnDeleteMail;
	TAHMMapiSend FBeforeSendMail;
	TAHMMapiSend FAfterSendMail;
	TAHMMapiConnect FOnLogonFailure;
	TAHMMapiConnect FOnLogoffFailure;
	bool FDeleteAfterSend;
	Classes::TNotifyEvent FOnMapiNotAvailable;
	unsigned FParentWindow;
	bool __fastcall GetMAPIAvail(void);
	void __fastcall SetMapiAvail(const bool Value);
	void __fastcall SeTAHMMapiMessages(TAHMMapiMessages* Value);
	void * __fastcall TheRecipients(TAHMMapiMessage* AHMMessage);
	void __fastcall SetSignature(Classes::TStrings* Value);
	
protected:
	ULong hSession;
	virtual void __fastcall CheckMAPI(void);
	int __fastcall SendMapi(void);
	int __fastcall Logoff(void);
	int __fastcall Logon(void);
	
public:
	__fastcall virtual TAHMMapiMail(Classes::TComponent* AOwner);
	__fastcall virtual ~TAHMMapiMail(void);
	__property unsigned ParentWindow = {read=FParentWindow, write=FParentWindow, nodefault};
	virtual bool __fastcall Execute(void);
	
__published:
	__property bool MapiInstalled = {read=GetMAPIAvail, write=SetMapiAvail, stored=false, nodefault};
	__property bool NewSession = {read=FNewSession, write=FNewSession, default=0};
	__property TAHMMapiMessages* Messages = {read=FAHMMapiMessages, write=SeTAHMMapiMessages};
	__property AnsiString Password = {read=FPassword, write=FPassword};
	__property AnsiString Profile = {read=FProfile, write=FProfile};
	__property bool DefaultProfile = {read=FDefaultProfile, write=FDefaultProfile, stored=true, default=1};
	__property Classes::TStrings* Signature = {read=FSignature, write=SetSignature};
	__property bool DeleteAfterSend = {read=FDeleteAfterSend, write=FDeleteAfterSend, default=1};
	__property Classes::TNotifyEvent BeforeLogon = {read=FBeforeLogon, write=FBeforeLogon};
	__property Classes::TNotifyEvent BeforeSendAll = {read=FBeforeSendAll, write=FBeforeSendAll};
	__property Classes::TNotifyEvent AfterSendAll = {read=FAfterSendAll, write=FAfterSendAll};
	__property Classes::TNotifyEvent BeforeLogoff = {read=FBeforeLogOff, write=FBeforeLogOff};
	__property Classes::TNotifyEvent AfterExecute = {read=FAfterExecute, write=FAfterExecute};
	__property TAHMOnSendError OnSendError = {read=FOnSendError, write=FOnSendError};
	__property Classes::TNotifyEvent OnLogonSuccess = {read=FOnLogonSuccess, write=FOnLogonSuccess};
	__property TAHMMapiConnect OnLogonFailure = {read=FOnLogonFailure, write=FOnLogonFailure};
	__property Classes::TNotifyEvent OnLogoffSuccess = {read=FOnLogoffSuccess, write=FOnLogoffSuccess};
	__property Classes::TNotifyEvent OnMapiNotAvailable = {read=FOnMapiNotAvailable, write=FOnMapiNotAvailable};
	__property TAHMMapiConnect OnLogoffFailure = {read=FOnLogoffFailure, write=FOnLogoffFailure};
	__property TAHMMapiSend BeforeSendMail = {read=FBeforeSendMail, write=FBeforeSendMail};
	__property TAHMMapiSend AfterSendMail = {read=FAfterSendMail, write=FAfterSendMail};
	__property TAHMMapiSend OnDeleteMail = {read=FOnDeleteMail, write=FOnDeleteMail};
};


class PASCALIMPLEMENTATION TAHMMapiMessage : public Classes::TCollectionItem 
{
	typedef Classes::TCollectionItem inherited;
	
private:
	TAHMMapiMail* FAHMMapiMail;
	bool FSendSuccess;
	AnsiString FSubject;
	Classes::TStrings* FMessage;
	bool FReceipt;
	bool FDialog;
	Classes::TStrings* FRecipientsTo;
	Classes::TStrings* FRecipientsCC;
	Classes::TStrings* FRecipientsBC;
	TAHMMapiAttachments* FAHMMapiAttachments;
	AnsiString FFaxNumber;
	TAHMFaxorMail FSendMethod;
	AnsiString FFaxTo;
	void __fastcall SeTAHMMapiAttachments(TAHMMapiAttachments* Value);
	void __fastcall SetRecipientsTo(Classes::TStrings* Value);
	void __fastcall SetRecipientsCC(Classes::TStrings* Value);
	void __fastcall SetRecipientsBC(Classes::TStrings* Value);
	void __fastcall SetMessage(Classes::TStrings* Value);
	
protected:
	virtual AnsiString __fastcall GetDisplayName();
	
public:
	__fastcall virtual TAHMMapiMessage(Classes::TCollection* Collection);
	__fastcall virtual ~TAHMMapiMessage(void);
	__property TAHMMapiMail* Owner = {read=FAHMMapiMail};
	
__published:
	__property Classes::TStrings* Message = {read=FMessage, write=SetMessage};
	__property TAHMFaxorMail SendMethod = {read=FSendMethod, write=FSendMethod, nodefault};
	__property AnsiString FaxNumber = {read=FFaxNumber, write=FFaxNumber};
	__property AnsiString FaxTo = {read=FFaxTo, write=FFaxTo};
	__property TAHMMapiAttachments* Attachments = {read=FAHMMapiAttachments, write=SeTAHMMapiAttachments};
	__property AnsiString Subject = {read=FSubject, write=FSubject};
	__property Classes::TStrings* RecipientsTo = {read=FRecipientsTo, write=SetRecipientsTo};
	__property Classes::TStrings* RecipientsCC = {read=FRecipientsCC, write=SetRecipientsCC};
	__property Classes::TStrings* RecipientsBC = {read=FRecipientsBC, write=SetRecipientsBC};
	__property bool Receipt = {read=FReceipt, write=FReceipt, default=0};
	__property bool Dialog = {read=FDialog, write=FDialog, default=0};
};


class DELPHICLASS TAHMQuickMail;
class PASCALIMPLEMENTATION TAHMQuickMail : public Ahmmailclass::TAHMMailsComponent 
{
	typedef Ahmmailclass::TAHMMailsComponent inherited;
	
private:
	AnsiString fname;
	AnsiString femail;
	Classes::TNotifyEvent foe;
	Classes::TNotifyEvent fbs;
	TAHMFaxorMail fmf;
	AnsiString fsubject;
	AnsiString ferr;
	Classes::TStrings* ftext;
	void __fastcall SetText(Classes::TStrings* value);
	
public:
	virtual bool __fastcall Execute(void);
	__fastcall virtual TAHMQuickMail(Classes::TComponent* AOwner);
	__fastcall virtual ~TAHMQuickMail(void);
	
__published:
	__property AnsiString ToEmailorFaxAddress = {read=femail, write=femail};
	__property AnsiString ToName = {read=fname, write=fname};
	__property Classes::TStrings* TextToSend = {read=ftext, write=SetText};
	__property AnsiString Subject = {read=fsubject, write=fsubject};
	__property TAHMFaxorMail MailorFax = {read=fmf, write=fmf, default=0};
	__property AnsiString ErrorNo = {read=ferr, write=ferr};
	__property Classes::TNotifyEvent BeforeSend = {read=fbs, write=fbs};
	__property Classes::TNotifyEvent OnError = {read=foe, write=foe};
};


//-- var, const, procedure ---------------------------------------------------

}	/* namespace Ahmtmapimail */
using namespace Ahmtmapimail;
#pragma option pop	// -w-
#pragma option pop	// -Vx

#pragma delphiheader end.
//-- end unit ----------------------------------------------------------------
#endif	// ahmtmapimail
