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

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

#ifndef InnntpserverHPP
#define InnntpserverHPP

#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 <Classes.hpp>	// Pascal unit
#include <Inassignednumbers.hpp>	// Pascal unit
#include <Incontext.hpp>	// Pascal unit
#include <Inyarn.hpp>	// Pascal unit
#include <Incommandhandlers.hpp>	// Pascal unit
#include <Inexception.hpp>	// Pascal unit
#include <Inglobal.hpp>	// Pascal unit
#include <Inserveriohandler.hpp>	// Pascal unit
#include <Incmdtcpserver.hpp>	// Pascal unit
#include <Inexplicittlsclientserverbase.hpp>	// Pascal unit
#include <Intcpconnection.hpp>	// Pascal unit
#include <Intcpserver.hpp>	// Pascal unit
#include <Intask.hpp>	// Pascal unit
#include <Incomponent.hpp>	// Pascal unit
#include <Inbasecomponent.hpp>	// Pascal unit

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

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


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


class DELPHICLASS TInNNTPContext;
class PASCALIMPLEMENTATION TInNNTPContext : public Incontext::TInContext 
{
	typedef Incontext::TInContext inherited;
	
protected:
	int FCurrentArticle;
	AnsiString FCurrentGroup;
	AnsiString FUserName;
	AnsiString FPassword;
	bool FAuthenticated;
	bool FModeReader;
	bool __fastcall GetUsingTLS(void);
	
public:
	__fastcall virtual TInNNTPContext(Intcpconnection::TInTCPConnection* AConnection, Inyarn::TInYarn* 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
	/* TInContext.Destroy */ inline __fastcall virtual ~TInNNTPContext(void) { }
	#pragma option pop
	
};


typedef void __fastcall (__closure *TInNNTPOnAuth)(TInNNTPContext* AThread, bool &VAccept);

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

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

typedef void __fastcall (__closure *TInNNTPOnIHaveCheck)(TInNNTPContext* AThread, const AnsiString AMsgID, bool VAccept);

typedef void __fastcall (__closure *TInNNTPOnArticleByNo)(TInNNTPContext* AThread, const int AMsgNo);

typedef void __fastcall (__closure *TInNNTPOnArticleByID)(TInNNTPContext* AThread, const AnsiString AMsgID);

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

typedef void __fastcall (__closure *TInNNTPOnMovePointer)(TInNNTPContext* AThread, int &AMsgNo, AnsiString &VMsgID);

typedef void __fastcall (__closure *TInNNTPOnPost)(TInNNTPContext* AThread, bool &VPostOk, AnsiString &VErrorText);

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

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

typedef void __fastcall (__closure *TInNNTPOnXOver)(TInNNTPContext* AThread, const int AMsgFirst, const int AMsgLast);

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

class DELPHICLASS TInNNTPServer;
class PASCALIMPLEMENTATION TInNNTPServer : public Inexplicittlsclientserverbase::TIdExplicitTLSServer 
{
	typedef Inexplicittlsclientserverbase::TIdExplicitTLSServer inherited;
	
protected:
	bool FImplicitTLS;
	Classes::TStrings* FHelp;
	Classes::TStrings* FOverviewFormat;
	TInNNTPOnArticleByNo FOnArticleByNo;
	TInNNTPOnArticleByNo FOnBodyByNo;
	TInNNTPOnArticleByNo FOnHeadByNo;
	TInNNTPOnCheckMsgNo FOnCheckMsgNo;
	TInNNTPOnMovePointer FOnStatMsgNo;
	TInNNTPOnMovePointer FOnNextArticle;
	TInNNTPOnMovePointer FOnPrevArticle;
	TInNNTPOnCheckListGroup FOnCheckListGroup;
	Intcpserver::TIdServerThreadEvent FOnListGroup;
	Intcpserver::TIdServerThreadEvent FOnListGroups;
	TInNNTPOnNewGroupsList FOnListNewGroups;
	TInNNTPOnPost FOnPost;
	TInNNTPOnSelectGroup FOnSelectGroup;
	TInNNTPOnXOver FOnXOver;
	TInNNTPOnXHdr FOnXHdr;
	TInNNTPOnNewNews FOnNewNews;
	TInNNTPOnIHaveCheck FOnIHaveCheck;
	TInNNTPOnPost FOnIHavePost;
	TInNNTPOnAuth FOnAuth;
	bool __fastcall SecLayerOk(Incommandhandlers::TIdCommand* ASender);
	bool __fastcall AuthOk(Incommandhandlers::TIdCommand* ASender);
	AnsiString __fastcall RawNavigate(TInNNTPContext* AThread, TInNNTPOnMovePointer AEvent);
	void __fastcall CommandArticle(Incommandhandlers::TIdCommand* ASender);
	void __fastcall CommandAuthInfoUser(Incommandhandlers::TIdCommand* ASender);
	void __fastcall CommandAuthInfoPassword(Incommandhandlers::TIdCommand* ASender);
	void __fastcall CommandBody(Incommandhandlers::TIdCommand* ASender);
	void __fastcall CommandDate(Incommandhandlers::TIdCommand* ASender);
	void __fastcall CommandHead(Incommandhandlers::TIdCommand* ASender);
	void __fastcall CommandGroup(Incommandhandlers::TIdCommand* ASender);
	void __fastcall CommandIHave(Incommandhandlers::TIdCommand* ASender);
	void __fastcall CommandLast(Incommandhandlers::TIdCommand* ASender);
	void __fastcall CommandList(Incommandhandlers::TIdCommand* ASender);
	void __fastcall CommandListGroup(Incommandhandlers::TIdCommand* ASender);
	void __fastcall CommandListExtensions(Incommandhandlers::TIdCommand* ASender);
	void __fastcall CommandModeReader(Incommandhandlers::TIdCommand* ASender);
	void __fastcall CommandNewGroups(Incommandhandlers::TIdCommand* ASender);
	void __fastcall CommandNewNews(Incommandhandlers::TIdCommand* ASender);
	void __fastcall CommandNext(Incommandhandlers::TIdCommand* ASender);
	void __fastcall CommandPost(Incommandhandlers::TIdCommand* ASender);
	void __fastcall CommandSlave(Incommandhandlers::TIdCommand* ASender);
	void __fastcall CommandStat(Incommandhandlers::TIdCommand* ASender);
	void __fastcall CommandXHdr(Incommandhandlers::TIdCommand* ASender);
	void __fastcall CommandXOver(Incommandhandlers::TIdCommand* ASender);
	void __fastcall CommandSTARTTLS(Incommandhandlers::TIdCommand* ASender);
	void __fastcall DoListGroups(TInNNTPContext* AThread);
	void __fastcall DoSelectGroup(TInNNTPContext* 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 Inserveriohandler::TInServerIOHandler* AValue);
	void __fastcall SetImplicitTLS(const bool AValue);
	virtual void __fastcall InitComponent(void);
	
public:
	__fastcall virtual ~TInNNTPServer(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 TInNNTPOnArticleByNo OnArticleByNo = {read=FOnArticleByNo, write=FOnArticleByNo};
	__property TInNNTPOnAuth OnAuth = {read=FOnAuth, write=FOnAuth};
	__property TInNNTPOnArticleByNo OnBodyByNo = {read=FOnBodyByNo, write=FOnBodyByNo};
	__property TInNNTPOnArticleByNo OnHeadByNo = {read=FOnHeadByNo, write=FOnHeadByNo};
	__property TInNNTPOnCheckMsgNo OnCheckMsgNo = {read=FOnCheckMsgNo, write=FOnCheckMsgNo};
	__property TInNNTPOnMovePointer OnStatMsgNo = {read=FOnStatMsgNo, write=FOnStatMsgNo};
	__property TInNNTPOnMovePointer OnNextArticle = {read=FOnNextArticle, write=FOnNextArticle};
	__property TInNNTPOnMovePointer OnPrevArticle = {read=FOnPrevArticle, write=FOnPrevArticle};
	__property TInNNTPOnCheckListGroup OnCheckListGroup = {read=FOnCheckListGroup, write=FOnCheckListGroup};
	__property Intcpserver::TIdServerThreadEvent OnListGroups = {read=FOnListGroups, write=FOnListGroups};
	__property Intcpserver::TIdServerThreadEvent OnListGroup = {read=FOnListGroup, write=FOnListGroup};
	__property TInNNTPOnNewGroupsList OnListNewGroups = {read=FOnListNewGroups, write=FOnListNewGroups};
	__property TInNNTPOnSelectGroup OnSelectGroup = {read=FOnSelectGroup, write=FOnSelectGroup};
	__property TInNNTPOnPost OnPost = {read=FOnPost, write=FOnPost};
	__property TInNNTPOnXOver OnXOver = {read=FOnXOver, write=FOnXOver};
	__property Classes::TStrings* OverviewFormat = {read=FOverviewFormat, write=SetOverviewFormat};
	__property TInNNTPOnXHdr OnXHdr = {read=FOnXHdr, write=FOnXHdr};
	__property TInNNTPOnNewNews OnNewNews = {read=FOnNewNews, write=FOnNewNews};
	__property TInNNTPOnIHaveCheck OnIHaveCheck = {read=FOnIHaveCheck, write=FOnIHaveCheck};
	__property TInNNTPOnPost OnIHavePost = {read=FOnIHavePost, write=FOnIHavePost};
	__property bool ImplicitTLS = {read=FImplicitTLS, write=SetImplicitTLS, default=0};
public:
	#pragma option push -w-inl
	/* TInBaseComponent.Create */ inline __fastcall TInNNTPServer(Classes::TComponent* AOwner)/* overload */ : Inexplicittlsclientserverbase::TIdExplicitTLSServer(AOwner) { }
	#pragma option pop
	
};


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

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

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