// CodeGear C++Builder
// Copyright (c) 1995, 2008 by CodeGear
// All rights reserved

// (DO NOT EDIT: machine generated header) 'Rvofficecnv.pas' rev: 20.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:
	Rvtypes::TRVAnsiString ClsName;
	System::UnicodeString Name;
	System::UnicodeString Path;
	System::UnicodeString Filter;
public:
	/* TObject.Create */ inline __fastcall TRVOfficeConverterInfo(void) : System::TObject() { }
	/* TObject.Destroy */ inline __fastcall virtual ~TRVOfficeConverterInfo(void) { }
	
};


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 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 System::UnicodeString RegPath, bool ExcludeHTML);
	
public:
	__fastcall TRVOfficeCnvList(const System::UnicodeString RegPath, TRVOfficeConverter* Owner, bool ExcludeHTML);
	System::UnicodeString __fastcall GetFilter(bool IncludeExtensions);
	void __fastcall ImportRTF(const System::UnicodeString FileName, int Index);
	void __fastcall ExportRTF(const System::UnicodeString FileName, int Index);
	bool __fastcall IsFormatCorrect(const System::UnicodeString FileName, int Index);
	__property TRVOfficeConverterInfo* Items[int Index] = {read=Get, write=Put/*, default*/};
public:
	/* TRVList.Destroy */ inline __fastcall virtual ~TRVOfficeCnvList(void) { }
	
};


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 System::UnicodeString FileName, int ConverterIndex);
	bool __fastcall ExportRTF(const System::UnicodeString FileName, int ConverterIndex);
	bool __fastcall ImportRV(const System::UnicodeString FileName, Richview::TCustomRichView* rv, int ConverterIndex);
	bool __fastcall ExportRV(const System::UnicodeString FileName, Richview::TCustomRichView* rv, int ConverterIndex);
	System::UnicodeString __fastcall GetImportFilter();
	System::UnicodeString __fastcall GetExportFilter();
	bool __fastcall IsValidImporter(const System::UnicodeString 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};
};


//-- 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	// RvofficecnvHPP
