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

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

#ifndef RvofficecnvHPP
#define RvofficecnvHPP

#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 <Windows.hpp>	// Pascal unit
#include <Classes.hpp>	// Pascal unit
#include <Sysutils.hpp>	// Pascal unit
#include <Rvclasses.hpp>	// Pascal unit
#include <Forms.hpp>	// Pascal unit
#include <Richview.hpp>	// Pascal unit
#include <Rvtypes.hpp>	// Pascal unit

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

namespace Rvofficecnv
{
//-- type declarations -------------------------------------------------------
class DELPHICLASS TRVOfficeConverterInfo;
class PASCALIMPLEMENTATION TRVOfficeConverterInfo : public System::TObject 
{
	typedef System::TObject inherited;
	
public:
	AnsiString ClsName;
	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
	
};


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 short __stdcall (*TIsFormatCorrect32)(unsigned ghszFile, unsigned ghszClass);

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

class DELPHICLASS TRVOfficeCnvList;
class DELPHICLASS TRVOfficeConverter;
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);
	void __fastcall SetExcludeHTMLExportConverter(const bool Value);
	void __fastcall SetExcludeHTMLImportConverter(const bool Value);
	
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();
	AnsiString __fastcall GetExportFilter();
	bool __fastcall IsValidImporter(const AnsiString FileName, int Index);
	__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=SetExcludeHTMLImportConverter, default=0};
	__property bool ExcludeHTMLExportConverter = {read=FExcludeHTMLExportConverter, write=SetExcludeHTMLExportConverter, 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};
};


class PASCALIMPLEMENTATION TRVOfficeCnvList : public Rvclasses::TRVList 
{
	typedef Rvclasses::TRVList inherited;
	
public:
	TRVOfficeConverterInfo* operator[](int Index) { return Items[Index]; }
	
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);
	bool __fastcall IsFormatCorrect(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
	
};


//-- var, const, procedure ---------------------------------------------------
static const Shortint rvceCnvLoadError = 0x1;
static const Shortint rvceFuncError = 0x2;
static const Shortint rvceInitError = 0x3;
static const Shortint rvceOpenInFileErr = -1;
static const Shortint rvceReadErr = -2;
static const Shortint rvceOpenConvErr = -3;
static const Shortint rvceWriteErr = -4;
static const Shortint rvceInvalidFile = -5;
static const Shortint rvceOpenExceptErr = -6;
static const Shortint rvceWriteExceptErr = -7;
static const Shortint rvceNoMemory = -8;
static const Shortint rvceInvalidDoc = -9;
static const Shortint rvceDiskFull = -10;
static const Shortint rvceDocTooLarge = -11;
static const Shortint rvceOpenOutFileErr = -12;
static const Shortint rvceUserCancel = -13;
static const Shortint rvceWrongFileType = -14;

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

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