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

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

#ifndef ahmtfontholderHPP
#define ahmtfontholderHPP

#pragma delphiheader begin
#pragma option push -w-
#pragma option push -Vx
#include <ahmsystemconst.hpp>	// Pascal unit
#include <ahmsystemclass.hpp>	// Pascal unit
#include <Dialogs.hpp>	// Pascal unit
#include <Forms.hpp>	// Pascal unit
#include <Controls.hpp>	// Pascal unit
#include <Graphics.hpp>	// Pascal unit
#include <Classes.hpp>	// Pascal unit
#include <SysUtils.hpp>	// Pascal unit
#include <Messages.hpp>	// Pascal unit
#include <Windows.hpp>	// Pascal unit
#include <SysInit.hpp>	// Pascal unit
#include <System.hpp>	// Pascal unit

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

namespace Ahmtfontholder
{
//-- type declarations -------------------------------------------------------
typedef AnsiString TAHMTTFFont;

typedef void __fastcall (__closure *TAHMFontInstallEvent)(System::TObject* Sender, const AnsiString FontName);

class DELPHICLASS TAHMStoredFont;
class DELPHICLASS TAHMFontHolder;
class DELPHICLASS TAHMStoredFonts;
class PASCALIMPLEMENTATION TAHMStoredFonts : public Ahmsystemclass::TAHMCollection 
{
	typedef Ahmsystemclass::TAHMCollection inherited;
	
public:
	TAHMStoredFont* operator[](int Index) { return Items[Index]; }
	
private:
	TAHMFontHolder* FAHMFontStorage;
	TAHMStoredFont* __fastcall GetAHMStoredFont(int Index);
	void __fastcall SetAHMStoredFont(int Index, TAHMStoredFont* Value);
	
protected:
	DYNAMIC Classes::TPersistent* __fastcall GetOwner(void);
	
public:
	__fastcall TAHMStoredFonts(TAHMFontHolder* AOwner);
	HIDESBASE TAHMStoredFont* __fastcall Add(void);
	HIDESBASE bool __fastcall Delete(int Index);
	__property TAHMStoredFont* Items[int Index] = {read=GetAHMStoredFont, write=SetAHMStoredFont/*, default*/};
public:
	#pragma option push -w-inl
	/* TCollection.Destroy */ inline __fastcall virtual ~TAHMStoredFonts(void) { }
	#pragma option pop
	
};


class PASCALIMPLEMENTATION TAHMFontHolder : public Ahmsystemclass::TAHMSystemComponent 
{
	typedef Ahmsystemclass::TAHMSystemComponent inherited;
	
private:
	Classes::TStrings* FTTFFonts;
	TAHMStoredFonts* FAHMStoredFonts;
	TAHMFontInstallEvent FOnInstalled;
	TAHMFontInstallEvent FOnFontExists;
	void __fastcall SetAHMStoredFonts(TAHMStoredFonts* Value);
	Classes::TStrings* __fastcall GetTTFFonts(void);
	
public:
	__fastcall virtual TAHMFontHolder(Classes::TComponent* AOwner);
	virtual void __fastcall Loaded(void);
	__fastcall virtual ~TAHMFontHolder(void);
	__property Classes::TStrings* TTFFonts = {read=GetTTFFonts};
	
__published:
	__property TAHMStoredFonts* Fonts = {read=FAHMStoredFonts, write=SetAHMStoredFonts};
	__property TAHMFontInstallEvent OnFontInstalled = {read=FOnInstalled, write=FOnInstalled};
	__property TAHMFontInstallEvent OnFontExists = {read=FOnFontExists, write=FOnFontExists};
};


class PASCALIMPLEMENTATION TAHMStoredFont : public Classes::TCollectionItem 
{
	typedef Classes::TCollectionItem inherited;
	
private:
	TAHMFontHolder* FAHMFontStorage;
	Classes::TMemoryStream* FFontData;
	AnsiString FFont;
	AnsiString FFontFileID;
	bool FFontLoaded;
	AnsiString FInstalledFontResFileID;
	AnsiString FInstalledFontFileID;
	bool FInstall;
	Classes::TNotifyEvent FOnInstalled;
	Classes::TNotifyEvent FOnFontExists;
	void __fastcall SetInstall(const bool Value);
	void __fastcall ReadBinaryData(Classes::TStream* Stream);
	void __fastcall WriteBinaryData(Classes::TStream* Stream);
	void __fastcall RemoveFont(void);
	void __fastcall SetFont(const AnsiString Value);
	AnsiString __fastcall GetFileName();
	void __fastcall SetFileName(const AnsiString Value);
	bool __fastcall Empty(void);
	bool __fastcall RNotEmpty(void);
	
protected:
	virtual AnsiString __fastcall GetDisplayName();
	virtual void __fastcall DefineProperties(Classes::TFiler* Filer);
	void __fastcall WriteToFile(const AnsiString Filename);
	void __fastcall LoadFromFile(const AnsiString Filename);
	
public:
	__fastcall virtual TAHMStoredFont(Classes::TCollection* Collection);
	virtual void __fastcall Assign(Classes::TPersistent* Source);
	__fastcall virtual ~TAHMStoredFont(void);
	void __fastcall InstallFont(void);
	__property TAHMFontHolder* Owner = {read=FAHMFontStorage};
	__property AnsiString DisplayName = {read=GetDisplayName};
	
__published:
	__property AnsiString Font = {read=FFont, write=SetFont, stored=RNotEmpty};
	__property AnsiString FntFilename = {read=GetFileName, write=SetFileName, stored=RNotEmpty};
	__property bool AutoInstall = {read=FInstall, write=SetInstall, stored=RNotEmpty, default=0};
	__property Classes::TNotifyEvent OnFontInstalled = {read=FOnInstalled, write=FOnInstalled};
	__property Classes::TNotifyEvent OnFontExists = {read=FOnFontExists, write=FOnFontExists};
};


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

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

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