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

// (DO NOT EDIT: machine generated header) 'RVOfficeCnv.pas' rev: 4.00

#ifndef RVOfficeCnvHPP
#define RVOfficeCnvHPP

#pragma delphiheader begin
#pragma option push -w-
#include <RVTypes.hpp>	// Pascal unit
#include <RichView.hpp>	// Pascal unit
#include <Forms.hpp>	// Pascal unit
#include <RVClasses.hpp>	// Pascal unit
#include <SysUtils.hpp>	// Pascal unit
#include <Classes.hpp>	// Pascal unit
#include <Windows.hpp>	// Pascal unit
#include <SysInit.hpp>	// Pascal unit
#include <System.hpp>	// Pascal unit

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

namespace Rvofficecnv
{
//-- type declarations -------------------------------------------------------
class DELPHICLASS TRVOfficeConverterInfo;
#pragma pack(push, 1)
class PASCALIMPLEMENTATION TRVOfficeConverterInfo : public System::TObject 
{
	typedef System::TObject inherited;
	
public:
	AnsiString Name;
	AnsiString Path;
	AnsiString Filter;
public:
	#pragma option push -w-inl
	/* TObject.Create */ inline __fastcall TRVOfficeConverterInfo(void) : System::TObject() { }
	#pragma option pop
	#pragma option push -w-inl
	/* TObject.Destroy */ inline __fastcall virtual ~TRVOfficeConverterInfo(void) { }
	#pragma option pop
	
};

#pragma pack(pop)

typedef int __stdcall (*TInitConverter32)(HWND hwndWord, char * szModule);

typedef void __stdcall (*TUninitConverter)(void);

typedef int __stdcall (*TForeignToRtf32Callback)(int cchBuff, int nPercent);

typedef int __stdcall (*TRtfToForeign32Callback)(int rgfOptions, int nReserved);

typedef short __stdcall (*TForeignToRtf32)(unsigned ghszFile, void * pstgForeign, unsigned ghBuff, unsigned 
	ghszClass, unsigned ghszSubset, TForeignToRtf32Callback lpfnOut);

typedef short __stdcall (*TRtfToForeign32)(unsigned ghszFile, void * pstgForeign, unsigned ghBuff, unsigned 
	ghszClass, TRtfToForeign32Callback lpfnIn);

typedef unsigned __stdcall (*TRegisterApp)(int lFlags, void * lpRegApp);

typedef void __fastcall (__closure *TConvertingEvent)(System::TObject* Sender, int Percent);

class DELPHICLASS TRVOfficeCnvList;
class DELPHICLASS TRVOfficeConverter;
#pragma pack(push, 1)
class PASCALIMPLEMENTATION TRVOfficeConverter : public Classes::TComponent 
{
	typedef Classes::TComponent inherited;
	
private:
	TRVOfficeCnvList* FImportConverters;
	TRVOfficeCnvList* FExportConverters;
	TConvertingEvent FOnConverting;
	Rvclasses::TRVMemoryStream* FStream;
	bool FExcludeHTMLImportConverter;
	bool FExcludeHTMLExportConverter;
	bool FPreviewMode;
	int FErrorCode;
	bool FExtensionsInFilter;
	TRVOfficeCnvList* __fastcall GetExportConverters(void);
	TRVOfficeCnvList* __fastcall GetImportConverters(void);
	
public:
	__fastcall virtual TRVOfficeConverter(Classes::TComponent* AOwner);
	__fastcall virtual ~TRVOfficeConverter(void);
	bool __fastcall ImportRTF(const AnsiString FileName, int ConverterIndex);
	bool __fastcall ExportRTF(const AnsiString FileName, int ConverterIndex);
	bool __fastcall ImportRV(const AnsiString FileName, Richview::TCustomRichView* rv, int ConverterIndex
		);
	bool __fastcall ExportRV(const AnsiString FileName, Richview::TCustomRichView* rv, int ConverterIndex
		);
	AnsiString __fastcall GetImportFilter(void);
	AnsiString __fastcall GetExportFilter(void);
	__property TRVOfficeCnvList* ImportConverters = {read=GetImportConverters};
	__property TRVOfficeCnvList* ExportConverters = {read=GetExportConverters};
	__property Rvclasses::TRVMemoryStream* Stream = {read=FStream};
	__property int ErrorCode = {read=FErrorCode, nodefault};
	
__published:
	__property bool ExcludeHTMLImportConverter = {read=FExcludeHTMLImportConverter, write=FExcludeHTMLImportConverter
		, default=0};
	__property bool ExcludeHTMLExportConverter = {read=FExcludeHTMLExportConverter, write=FExcludeHTMLExportConverter
		, default=0};
	__property bool PreviewMode = {read=FPreviewMode, write=FPreviewMode, default=0};
	__property bool ExtensionsInFilter = {read=FExtensionsInFilter, write=FExtensionsInFilter, default=0
		};
	__property TConvertingEvent OnConverting = {read=FOnConverting, write=FOnConverting};
};

#pragma pack(pop)

#pragma pack(push, 1)
class PASCALIMPLEMENTATION TRVOfficeCnvList : public Rvclasses::TRVList 
{
	typedef Rvclasses::TRVList inherited;
	
private:
	TRVOfficeConverter* FOwner;
	unsigned hBuffer;
	TConvertingEvent FOnConverting;
	Rvclasses::TRVMemoryStream* FStream;
	int FStep;
	int FStart;
	int FSize;
	HIDESBASE void __fastcall Put(int Index, TRVOfficeConverterInfo* Value);
	HIDESBASE TRVOfficeConverterInfo* __fastcall Get(int Index);
	void __fastcall LoadList(const AnsiString RegPath, bool ExcludeHTML);
	
public:
	__fastcall TRVOfficeCnvList(const AnsiString RegPath, TRVOfficeConverter* Owner, bool ExcludeHTML);
		
	AnsiString __fastcall GetFilter(bool IncludeExtensions);
	void __fastcall ImportRTF(const AnsiString FileName, int Index);
	void __fastcall ExportRTF(const AnsiString FileName, int Index);
	__property TRVOfficeConverterInfo* Items[int Index] = {read=Get, write=Put/*, default*/};
public:
	#pragma option push -w-inl
	/* TRVList.Destroy */ inline __fastcall virtual ~TRVOfficeCnvList(void) { }
	#pragma option pop
	
};

#pragma pack(pop)

//-- var, const, procedure ---------------------------------------------------
static const Shortint rvceCnvLoadError = 0x1;
static const Shortint rvceFuncError = 0x2;
static const Shortint rvceInitError = 0x3;
static const Shortint rvceOpenInFileErr = 0xffffffff;
static const Shortint rvceReadErr = 0xfffffffe;
static const Shortint rvceOpenConvErr = 0xfffffffd;
static const Shortint rvceWriteErr = 0xfffffffc;
static const Shortint rvceInvalidFile = 0xfffffffb;
static const Shortint rvceOpenExceptErr = 0xfffffffa;
static const Shortint rvceWriteExceptErr = 0xfffffff9;
static const Shortint rvceNoMemory = 0xfffffff8;
static const Shortint rvceInvalidDoc = 0xfffffff7;
static const Shortint rvceDiskFull = 0xfffffff6;
static const Shortint rvceDocTooLarge = 0xfffffff5;
static const Shortint rvceOpenOutFileErr = 0xfffffff4;
static const Shortint rvceUserCancel = 0xfffffff3;
static const Shortint rvceWrongFileType = 0xfffffff2;

}	/* namespace Rvofficecnv */
#if !defined(NO_IMPLICIT_NAMESPACE_USE)
using namespace Rvofficecnv;
#endif
#pragma option pop	// -w-

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