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

// (DO NOT EDIT: machine generated header) 'Idnntpserver.pas' rev: 10.00

#ifndef IdnntpserverHPP
#define IdnntpserverHPP

#pragma delphiheader begin
#pragma option push
#pragma option -w-      // All warnings off
#pragma option -Vx      // Zero-length empty class member functions
#pragma pack(push,8)
#include <System.hpp>	// Pascal unit
#include <Sysinit.hpp>	// Pascal unit
#include <Idassignednumbers.hpp>	// Pascal unit
#include <Idcontext.hpp>	// Pascal unit
#include <Idcustomtcpserver.hpp>	// Pascal unit
#include <Idyarn.hpp>	// Pascal unit
#include <Idcommandhandlers.hpp>	// Pascal unit
#include <Idexception.hpp>	// Pascal unit
#include <Idglobal.hpp>	// Pascal unit
#include <Idserveriohandler.hpp>	// Pascal unit
#include <Idcmdtcpserver.hpp>	// Pascal unit
#include <Idexplicittlsclientserverbase.hpp>	// Pascal unit
#include <Idsys.hpp>	// Pascal unit
#include <Idtcpconnection.hpp>	// Pascal unit
#include <Idtcpserver.hpp>	// Pascal unit
#include <Idobjs.hpp>	// Pascal unit
#include <Idtask.hpp>	// Pascal unit
#include <Idcomponent.hpp>	// Pascal unit
#include <Idbasecomponent.hpp>	// Pascal unit
#include <Classes.hpp>	// Pascal unit

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

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


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


class DELPHICLASS TIdNNTPContext;
class PASCALIMPLEMENTATION TIdNNTPContext : public Idcontext::TIdContext 
{
	typedef Idcontext::TIdContext inherited;
	
protected:
	int FCurrentArticle;
	AnsiString FCurrentGroup;
	AnsiString FUserName;
	AnsiString FPassword;
	bool FAuthenticated;
	bool FModeReader;
	bool __fastcall GetUsingTLS(void);
	
public:
	__fastcall virtual TIdNNTPContext(Idtcpconnection::TIdTCPConnection* AConnection, Idyarn::TIdYarn* AYarn, Classes::TThreadList* AList);
	__property int CurrentArticle = {read=FCurrentArticle, nodefault};
	__property AnsiString CurrentGroup = {read=FCurrentGroup};
	__property bool ModeReader = {read=FModeReader, nodefault};
	__property AnsiString UserName = {read=FUserName};
	__property AnsiString Password = {read=FPassword};
	__property bool Authenticated = {read=FAuthenticated, nodefault};
	__property bool UsingTLS = {read=GetUsingTLS, nodefault};
public:
	#pragma option push -w-inl
	/* TIdContext.Destroy */ inline __fastcall virtual ~TIdNNTPContext(void) { }
	#pragma option pop
	
};


typedef void __fastcall (__closure *TIdNNTPOnAuth)(TIdNNTPContext* AThread, bool &VAccept);

typedef void __fastcall (__closure *TIdNNTPOnNewGroupsList)(TIdNNTPContext* AThread, const System::TDateTime ADateStamp, const AnsiString ADistributions);

typedef void __fastcall (__closure *TIdNNTPOnNewNews)(TIdNNTPContext* AThread, const AnsiString Newsgroups, const System::TDateTime ADateStamp, const AnsiString ADistributions);

typedef void __fastcall (__closure *TIdNNTPOnIHaveCheck)(TIdNNTPContext* AThread, const AnsiString AMsgID, bool VAccept);

typedef void __fastcall (__closure *TIdNNTPOnArticleByNo)(TIdNNTPContext* AThread, const int AMsgNo);

typedef void __fastcall (__closure *TIdNNTPOnArticleByID)(TIdNNTPContext* AThread, const AnsiString AMsgID);

typedef void __fastcall (__closure *TIdNNTPOnCheckMsgNo)(TIdNNTPContext* AThread, const int AMsgNo, AnsiString &VMsgID);

typedef void __fastcall (__closure *TIdNNTPOnMovePointer)(TIdNNTPContext* AThread, int &AMsgNo, AnsiString &VMsgID);

typedef void __fastcall (__closure *TIdNNTPOnPost)(TIdNNTPContext* AThread, bool &VPostOk, AnsiString &VErrorText);

typedef void __fastcall (__closure *TIdNNTPOnSelectGroup)(TIdNNTPContext* AThread, const AnsiString AGroup, int &VMsgCount, int &VMsgFirst, int &VMsgLast, bool &VGroupExists);

typedef void __fastcall (__closure *TIdNNTPOnCheckListGroup)(TIdNNTPContext* AThread, const AnsiString AGroup, bool &VCanJoin, int &VFirstArticle);

typedef void __fastcall (__closure *TIdNNTPOnXOver)(TIdNNTPContext* AThread, const int AMsgFirst, const int AMsgLast);

typedef void __fastcall (__closure *TIdNNTPOnXHdr)(TIdNNTPContext* AThread, const AnsiString AHeaderName, const int AMsgFirst, const int AMsgLast, const AnsiString AMsgID);

class DELPHICLASS TIdNNTPServer;
class PASCALIMPLEMENTATION TIdNNTPServer : public Idexplicittlsclientserverbase::TIdExplicitTLSServer 
{
	typedef Idexplicittlsclientserverbase::TIdExplicitTLSServer inherited;
	
protected:
	bool FImplicitTLS;
	Classes::TStrings* FHelp;
	Classes::TStrings* FOverviewFormat;
	TIdNNTPOnArticleByNo FOnArticleByNo;
	TIdNNTPOnArticleByNo FOnBodyByNo;
	TIdNNTPOnArticleByNo FOnHeadByNo;
	TIdNNTPOnCheckMsgNo FOnCheckMsgNo;
	TIdNNTPOnMovePointer FOnStatMsgNo;
	TIdNNTPOnMovePointer FOnNextArticle;
	TIdNNTPOnMovePointer FOnPrevArticle;
	TIdNNTPOnCheckListGroup FOnCheckListGroup;
	Idcustomtcpserver::TIdServerThreadEvent FOnListGroup;
	Idcustomtcpserver::TIdServerThreadEvent FOnListGroups;
	TIdNNTPOnNewGroupsList FOnListNewGroups;
	TIdNNTPOnPost FOnPost;
	TIdNNTPOnSelectGroup FOnSelectGroup;
	TIdNNTPOnXOver FOnXOver;
	TIdNNTPOnXHdr FOnXHdr;
	TIdNNTPOnNewNews FOnNewNews;
	TIdNNTPOnIHaveCheck FOnIHaveCheck;
	TIdNNTPOnPost FOnIHavePost;
	TIdNNTPOnAuth FOnAuth;
	bool __fastcall SecLayerOk(Idcommandhandlers::TIdCommand* ASender);
	bool __fastcall AuthOk(Idcommandhandlers::TIdCommand* ASender);
	AnsiString __fastcall RawNavigate(TIdNNTPContext* AThread, TIdNNTPOnMovePointer AEvent);
	void __fastcall CommandArticle(Idcommandhandlers::TIdCommand* ASender);
	void __fastcall CommandAuthInfoUser(Idcommandhandlers::TIdCommand* ASender);
	void __fastcall CommandAuthInfoPassword(Idcommandhandlers::TIdCommand* ASender);
	void __fastcall CommandBody(Idcommandhandlers::TIdCommand* ASender);
	void __fastcall CommandDate(Idcommandhandlers::TIdCommand* ASender);
	void __fastcall CommandHead(Idcommandhandlers::TIdCommand* ASender);
	void __fastcall CommandGroup(Idcommandhandlers::TIdCommand* ASender);
	void __fastcall CommandIHave(Idcommandhandlers::TIdCommand* ASender);
	void __fastcall CommandLast(Idcommandhandlers::TIdCommand* ASender);
	void __fastcall CommandList(Idcommandhandlers::TIdCommand* ASender);
	void __fastcall CommandListGroup(Idcommandhandlers::TIdCommand* ASender);
	void __fastcall CommandListExtensions(Idcommandhandlers::TIdCommand* ASender);
	void __fastcall CommandModeReader(Idcommandhandlers::TIdCommand* ASender);
	void __fastcall CommandNewGroups(Idcommandhandlers::TIdCommand* ASender);
	void __fastcall CommandNewNews(Idcommandhandlers::TIdCommand* ASender);
	void __fastcall CommandNext(Idcommandhandlers::TIdCommand* ASender);
	void __fastcall CommandPost(Idcommandhandlers::TIdCommand* ASender);
	void __fastcall CommandSlave(Idcommandhandlers::TIdCommand* ASender);
	void __fastcall CommandStat(Idcommandhandlers::TIdCommand* ASender);
	void __fastcall CommandXHdr(Idcommandhandlers::TIdCommand* ASender);
	void __fastcall CommandXOver(Idcommandhandlers::TIdCommand* ASender);
	void __fastcall CommandSTARTTLS(Idcommandhandlers::TIdCommand* ASender);
	void __fastcall DoListGroups(TIdNNTPContext* AThread);
	void __fastcall DoSelectGroup(TIdNNTPContext* AThread, const AnsiString AGroup, int &VMsgCount, int &VMsgFirst, int &VMsgLast, bool &VGroupExists);
	virtual void __fastcall InitializeCommandHandlers(void);
	void __fastcall SetHelp(Classes::TStrings* AValue);
	void __fastcall SetOverviewFormat(Classes::TStrings* AValue);
	virtual void __fastcall SetIOHandler(const Idserveriohandler::TIdServerIOHandler* AValue);
	void __fastcall SetImplicitTLS(const bool AValue);
	virtual void __fastcall InitComponent(void);
	
public:
	__fastcall virtual ~TIdNNTPServer(void);
	/*         class method */ static System::TDateTime __fastcall NNTPTimeToTime(TMetaClass* vmt, const AnsiString ATimeStamp);
	/*         class method */ static System::TDateTime __fastcall NNTPDateTimeToDateTime(TMetaClass* vmt, const AnsiString ATimeStamp);
	
__published:
	__property DefaultPort  = {default=119};
	__property Classes::TStrings* Help = {read=FHelp, write=SetHelp};
	__property TIdNNTPOnArticleByNo OnArticleByNo = {read=FOnArticleByNo, write=FOnArticleByNo};
	__property TIdNNTPOnAuth OnAuth = {read=FOnAuth, write=FOnAuth};
	__property TIdNNTPOnArticleByNo OnBodyByNo = {read=FOnBodyByNo, write=FOnBodyByNo};
	__property TIdNNTPOnArticleByNo OnHeadByNo = {read=FOnHeadByNo, write=FOnHeadByNo};
	__property TIdNNTPOnCheckMsgNo OnCheckMsgNo = {read=FOnCheckMsgNo, write=FOnCheckMsgNo};
	__property TIdNNTPOnMovePointer OnStatMsgNo = {read=FOnStatMsgNo, write=FOnStatMsgNo};
	__property TIdNNTPOnMovePointer OnNextArticle = {read=FOnNextArticle, write=FOnNextArticle};
	__property TIdNNTPOnMovePointer OnPrevArticle = {read=FOnPrevArticle, write=FOnPrevArticle};
	__property TIdNNTPOnCheckListGroup OnCheckListGroup = {read=FOnCheckListGroup, write=FOnCheckListGroup};
	__property Idcustomtcpserver::TIdServerThreadEvent OnListGroups = {read=FOnListGroups, write=FOnListGroups};
	__property Idcustomtcpserver::TIdServerThreadEvent OnListGroup = {read=FOnListGroup, write=FOnListGroup};
	__property TIdNNTPOnNewGroupsList OnListNewGroups = {read=FOnListNewGroups, write=FOnListNewGroups};
	__property TIdNNTPOnSelectGroup OnSelectGroup = {read=FOnSelectGroup, write=FOnSelectGroup};
	__property TIdNNTPOnPost OnPost = {read=FOnPost, write=FOnPost};
	__property TIdNNTPOnXOver OnXOver = {read=FOnXOver, write=FOnXOver};
	__property Classes::TStrings* OverviewFormat = {read=FOverviewFormat, write=SetOverviewFormat};
	__property TIdNNTPOnXHdr OnXHdr = {read=FOnXHdr, write=FOnXHdr};
	__property TIdNNTPOnNewNews OnNewNews = {read=FOnNewNews, write=FOnNewNews};
	__property TIdNNTPOnIHaveCheck OnIHaveCheck = {read=FOnIHaveCheck, write=FOnIHaveCheck};
	__property TIdNNTPOnPost OnIHavePost = {read=FOnIHavePost, write=FOnIHavePost};
	__property bool ImplicitTLS = {read=FImplicitTLS, write=SetImplicitTLS, default=0};
public:
	#pragma option push -w-inl
	/* TIdBaseComponent.Create */ inline __fastcall TIdNNTPServer(Classes::TComponent* AOwner)/* overload */ : Idexplicittlsclientserverbase::TIdExplicitTLSServer(AOwner) { }
	#pragma option pop
	
};


//-- var, const, procedure ---------------------------------------------------
static const bool DEF_NNTP_IMPLICIT_TLS = false;

}	/* namespace Idnntpserver */
using namespace Idnntpserver;
#pragma pack(pop)
#pragma option pop

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