// Borland C++ Builder
// Copyright (c) 1995, 1998 by Borland International
// All rights reserved

// (DO NOT EDIT: machine generated header) 'AHMTFontHolder.pas' rev: 3.00

#ifndef AHMTFontHolderHPP
#define AHMTFontHolderHPP
#include <AHMSystemConst.hpp>
#include <AHMSystemClass.hpp>
#include <Dialogs.hpp>
#include <Forms.hpp>
#include <Controls.hpp>
#include <Graphics.hpp>
#include <Classes.hpp>
#include <SysUtils.hpp>
#include <Messages.hpp>
#include <Windows.hpp>
#include <SysInit.hpp>
#include <System.hpp>

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

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

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

class DELPHICLASS TAHMStoredFont;
class DELPHICLASS TAHMFontHolder;
class DELPHICLASS TAHMStoredFonts;
class PASCALIMPLEMENTATION TAHMStoredFonts : public Classes::TCollection 
{
	typedef Classes::TCollection inherited;
	
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);
	bool __fastcall Delete(int Index);
	__property TAHMFontHolder* Owner = {read=FAHMFontStorage};
	__property TAHMStoredFont* Items[int Index] = {read=GetAHMStoredFont, write=SetAHMStoredFont/*, default
		*/};
public:
	/* TCollection.Destroy */ __fastcall virtual ~TAHMStoredFonts(void) { }
	
};

class PASCALIMPLEMENTATION TAHMFontHolder : public Ahmsystemclass::TAHMSystemsComponent 
{
	typedef Ahmsystemclass::TAHMSystemsComponent 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;
	System::AnsiString FFont;
	System::AnsiString FFontFileID;
	bool FFontLoaded;
	System::AnsiString FInstalledFontResFileID;
	System::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 System::AnsiString Value);
	System::AnsiString __fastcall GetFileName(void);
	void __fastcall SetFileName(const System::AnsiString Value);
	bool __fastcall Empty(void);
	bool __fastcall RNotEmpty(void);
	
protected:
	virtual System::AnsiString __fastcall GetDisplayName(void);
	virtual void __fastcall DefineProperties(Classes::TFiler* Filer);
	void __fastcall WriteToFile(const System::AnsiString Filename);
	void __fastcall LoadFromFile(const System::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 System::AnsiString DisplayName = {read=GetDisplayName};
	
__published:
	__property System::AnsiString Font = {read=FFont, write=SetFont, stored=RNotEmpty};
	__property System::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 */
#if !defined(NO_IMPLICIT_NAMESPACE_USE)
using namespace Ahmtfontholder;
#endif
//-- end unit ----------------------------------------------------------------
#endif	// AHMTFontHolder
