// CodeGear C++Builder
// Copyright (c) 1995, 2024 by Embarcadero Technologies, Inc.
// All rights reserved

// (DO NOT EDIT: machine generated header) 'MSWPD.pas' rev: 36.00 (Windows)

#ifndef MSWPDHPP
#define MSWPDHPP

#pragma delphiheader begin
#pragma option push
#if defined(__BORLANDC__) && !defined(__clang__)
#pragma option -w-      // All warnings off
#pragma option -Vx      // Zero-length empty class member 
#endif
#pragma pack(push,8)
#include <System.hpp>
#include <SysInit.hpp>
#include <System.Classes.hpp>
#include <System.SysUtils.hpp>
#include <MSWBase.hpp>
#include <Winapi.Windows.hpp>
#include <Winapi.ActiveX.hpp>
#include <System.Win.ComObj.hpp>
#include <System.Types.hpp>

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

namespace Mswpd
{
//-- forward type declarations -----------------------------------------------
struct TWPDFileHeader;
struct TWPDIndexItem;
class DELPHICLASS TWPDHeaderPacket;
class DELPHICLASS THeaderPacketList;
class DELPHICLASS TWPDFontDescriptor;
class DELPHICLASS TWPDFontDescriptorList;
class DELPHICLASS TWordPerfectFile;
//-- type declarations -------------------------------------------------------
#pragma pack(push,1)
struct DECLSPEC_DRECORD TWPDFileHeader
{
public:
	System::StaticArray<System::Byte, 4> Ident;
	unsigned DocumentPointerPosition;
	System::Byte ProductID;
	System::Byte FileType;
	System::Byte MajorVersion;
	System::Byte MinorVersion;
	System::Word EncryptionPosition;
	System::Word IndexHeaderPosition;
	unsigned Reserved;
	System::LongInt DocumentEnd;
};
#pragma pack(pop)


#pragma pack(push,1)
struct DECLSPEC_DRECORD TWPDIndexItem
{
public:
	System::Byte Flags;
	System::Byte PacketType;
	System::Word UseCount;
	System::Word HiddenCount;
	unsigned DataPacketSize;
	unsigned DataPointer;
};
#pragma pack(pop)


#pragma pack(push,4)
class PASCALIMPLEMENTATION TWPDHeaderPacket : public System::TObject
{
	typedef System::TObject inherited;
	
public:
	System::Word PID;
	System::Byte PacketType;
	unsigned PacketPosition;
	bool HasChildren;
public:
	/* TObject.Create */ inline __fastcall TWPDHeaderPacket() : System::TObject() { }
	/* TObject.Destroy */ inline __fastcall virtual ~TWPDHeaderPacket() { }
	
};

#pragma pack(pop)

#pragma pack(push,4)
class PASCALIMPLEMENTATION THeaderPacketList : public System::Classes::TList
{
	typedef System::Classes::TList inherited;
	
public:
	/* TList.Destroy */ inline __fastcall virtual ~THeaderPacketList() { }
	
public:
	/* TObject.Create */ inline __fastcall THeaderPacketList() : System::Classes::TList() { }
	
};

#pragma pack(pop)

#pragma pack(push,4)
class PASCALIMPLEMENTATION TWPDFontDescriptor : public System::TObject
{
	typedef System::TObject inherited;
	
public:
	System::Word PacketID;
	System::Word CharacterWidth;
	System::Word AscenderHeight;
	System::Word xHeight;
	System::Word DescenderHeight;
	System::Word ItalicsAdjust;
	System::Byte PrimaryFamilyId;
	System::Byte PrimaryFamilyMemberId;
	System::Byte ScriptingSystem;
	System::Byte PrimaryCharacterSet;
	System::Byte Width;
	System::Byte Weight;
	System::Byte Attributes;
	System::Byte GeneralCharacteristics;
	System::Byte Classification;
	System::Byte FillByte;
	System::Byte FontType;
	System::Byte FontSourceFileType;
	System::UnicodeString FontName;
public:
	/* TObject.Create */ inline __fastcall TWPDFontDescriptor() : System::TObject() { }
	/* TObject.Destroy */ inline __fastcall virtual ~TWPDFontDescriptor() { }
	
};

#pragma pack(pop)

#pragma pack(push,4)
class PASCALIMPLEMENTATION TWPDFontDescriptorList : public System::Classes::TList
{
	typedef System::Classes::TList inherited;
	
public:
	/* TList.Destroy */ inline __fastcall virtual ~TWPDFontDescriptorList() { }
	
public:
	/* TObject.Create */ inline __fastcall TWPDFontDescriptorList() : System::Classes::TList() { }
	
};

#pragma pack(pop)

class PASCALIMPLEMENTATION TWordPerfectFile : public Mswbase::TMSWBaseDocument
{
	typedef Mswbase::TMSWBaseDocument inherited;
	
private:
	TWPDFileHeader Header;
	THeaderPacketList* HeaderPacketList;
	TWPDFontDescriptorList* FontDescriptorList;
	bool ParagraphChanged;
	bool UndoOn;
	bool FontChanged;
	System::UnicodeString LastJustify;
	System::UnicodeString __fastcall ProcessSysCharacter(System::Classes::TStream* Stream, System::Byte ch);
	void __fastcall ParseFontDescriptor(System::Classes::TStream* Stream, int PID, unsigned PacketSize, unsigned DataPointer);
	
protected:
	virtual void __fastcall ClearInternalLists();
	void __fastcall LoadIStorage(_di_IStorage Storage);
	void __fastcall ReadDocFromStream(System::Classes::TStream* Stream);
	
public:
	__fastcall virtual TWordPerfectFile(System::Classes::TComponent* AOwner);
	__fastcall virtual ~TWordPerfectFile();
	virtual void __fastcall LoadFromStream(System::Classes::TStream* Stream);
	virtual void __fastcall LoadFromFile(const System::WideString AFileName);
	virtual bool __fastcall IsPasswordProtected();
};


//-- var, const, procedure ---------------------------------------------------
}	/* namespace Mswpd */
#if !defined(DELPHIHEADER_NO_IMPLICIT_NAMESPACE_USE) && !defined(NO_USING_NAMESPACE_MSWPD)
using namespace Mswpd;
#endif
#pragma pack(pop)
#pragma option pop

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