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

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

#ifndef RVRTFPropsHPP
#define RVRTFPropsHPP
#include <RVClasses.hpp>
#include <RVMapWht.hpp>
#include <RVItem.hpp>
#include <RVUni.hpp>
#include <RVRTFErr.hpp>
#include <Graphics.hpp>
#include <RVStyle.hpp>
#include <CRVFData.hpp>
#include <CRVData.hpp>
#include <RVScroll.hpp>
#include <RVRTF.hpp>
#include <Forms.hpp>
#include <Classes.hpp>
#include <Windows.hpp>
#include <SysUtils.hpp>
#include <SysInit.hpp>
#include <System.hpp>

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

namespace Rvrtfprops
{
//-- type declarations -------------------------------------------------------
enum TRVBorderGlueMode { rvbgVisibleBorders, rvbgNegativeSpacing };

class DELPHICLASS TRVRTFReaderProperties;
class PASCALIMPLEMENTATION TRVRTFReaderProperties : public Classes::TPersistent 
{
	typedef Classes::TPersistent inherited;
	
private:
	int FEmptyPara;
	TRVReaderUnicode FUnicodeMode;
	TRVReaderStyleMode FTextStyleMode;
	TRVReaderStyleMode FParaStyleMode;
	bool FIgnorePictures;
	bool FUseHypertextStyles;
	int FParaNo;
	int FStyleNo;
	TRVBorderGlueMode FTableBorderGlueMode;
	bool FExplicitTableWidth;
	bool FSkipHiddenText;
	bool FHideTableGridLines;
	Crvdata::TCustomRVData* RVData;
	Crvdata::TCustomRVData* CurrentRVData;
	Rvstyle::TRVStyle* RVStyle;
	bool PageBreak;
	double PixelsPerTwips;
	Rvrtf::TRVRTFReader* Reader;
	bool FirstTime;
	int Index;
	int CurrentRow;
	int CurrentCol;
	Rvclasses::TRVList* Tables;
	void __fastcall InitReader(void);
	void __fastcall DoneReader(void);
	int __fastcall ReturnParaNo(Rvrtf::TRVRTFPosition Position);
	Rvitem::TRVTextItemInfo* __fastcall CreateTextItem(const System::AnsiString Text, const System::WideString 
		WideText, int StyleNo, int ParaNo, bool UseUnicode, System::AnsiString &ResText);
	void __fastcall InsertItem(const System::AnsiString Text, Rvitem::TCustomRVItemInfo* item, Rvrtf::TRVRTFPosition 
		Position);
	void __fastcall CurrentBorder(Rvstyle::TRVBorderStyle &RVBorderStyle, int &RVBorderWidth, int &RVBorderIntWidth
		, Graphics::TColor &BorderColor);
	int __fastcall FindParaNo(Rvstyle::TRVBorderStyle RVBorderStyle, int RVBorderWidth, int RVBorderIntWidth
		, Graphics::TColor BorderColor);
	int __fastcall GetEmptyParaNo(Rvstyle::TRVAlignment Alignment);
	int __fastcall GetEmptyStyleNo(void);
	int __fastcall FindBestParaNo(void);
	int __fastcall FindStyleNo(bool AUnicode, bool AHypertext);
	int __fastcall FindBestStyleNo(bool AUnicode, bool AHypertext);
	void __fastcall AddPara(Rvstyle::TRVBorderStyle RVBorderStyle, int RVBorderWidth, int RVBorderIntWidth
		, Graphics::TColor BorderColor);
	void __fastcall AddStyle(bool AUnicode, bool AHypertext);
	int __fastcall ReturnParaNo_(void);
	int __fastcall ReturnStyleNo(bool AUnicode);
	bool __fastcall IsHypertext_(void);
	bool __fastcall IsHypertext(System::AnsiString &Target, System::AnsiString &Extras);
	void __fastcall SetParaNo(const int Value);
	void __fastcall SetStyleNo(const int Value);
	
protected:
	void __fastcall NewReaderText(Rvrtf::TRVRTFReader* Sender, const System::AnsiString Text, Rvrtf::TRVRTFPosition 
		Position);
	void __fastcall NewReaderUnicodeText(Rvrtf::TRVRTFReader* Sender, const System::WideString Text, Rvrtf::TRVRTFPosition 
		Position);
	void __fastcall NewReaderPicture(Rvrtf::TRVRTFReader* Sender, Rvrtf::TRVRTFPicture* RTFPicture, Graphics::TGraphic* 
		Graphic, Rvrtf::TRVRTFPosition Position);
	void __fastcall AssignRowProperties(void);
	void __fastcall ReaderTable(Rvrtf::TRVRTFReader* Sender, Rvrtf::TRVRTFTableEventKind WhatHappens);
	void __fastcall ReaderPageBreak(System::TObject* Sender);
	
public:
	bool EditFlag;
	TRVRTFErrorCode ErrorCode;
	bool FailedBecauseOfProtect;
	bool FullReformat;
	int NonFirstItemsAdded;
	bool AllowNewPara;
	__fastcall TRVRTFReaderProperties(void);
	__fastcall virtual ~TRVRTFReaderProperties(void);
	virtual void __fastcall Assign(Classes::TPersistent* Source);
	Rvrtferr::TRVRTFErrorCode __fastcall ReadFromFile(const System::AnsiString AFileName, Crvdata::TCustomRVData* 
		ARVData);
	Rvrtferr::TRVRTFErrorCode __fastcall ReadFromStream(Classes::TStream* AStream, Crvdata::TCustomRVData* 
		ARVData);
	Rvrtferr::TRVRTFErrorCode __fastcall InsertFromStreamEd(Classes::TStream* AStream, Crvdata::TCustomRVData* 
		ARVData, int AIndex);
	__property TRVBorderGlueMode TableBorderGlueMode = {read=FTableBorderGlueMode, write=FTableBorderGlueMode
		, nodefault};
	__property bool ExplicitTableWidth = {read=FExplicitTableWidth, write=FExplicitTableWidth, default=0
		};
	
__published:
	__property Rvstyle::TRVReaderUnicode UnicodeMode = {read=FUnicodeMode, write=FUnicodeMode, default=1
		};
	__property Rvstyle::TRVReaderStyleMode TextStyleMode = {read=FTextStyleMode, write=FTextStyleMode, 
		default=1};
	__property Rvstyle::TRVReaderStyleMode ParaStyleMode = {read=FParaStyleMode, write=FParaStyleMode, 
		default=1};
	__property bool IgnorePictures = {read=FIgnorePictures, write=FIgnorePictures, default=0};
	__property bool UseHypertextStyles = {read=FUseHypertextStyles, write=FUseHypertextStyles, default=0
		};
	__property int TextStyleNo = {read=FStyleNo, write=SetStyleNo, default=0};
	__property int ParaStyleNo = {read=FParaNo, write=SetParaNo, default=0};
	__property bool SkipHiddenText = {read=FSkipHiddenText, write=FSkipHiddenText, default=1};
	__property bool AutoHideTableGridLines = {read=FHideTableGridLines, write=FHideTableGridLines, default=1
		};
};

//-- var, const, procedure ---------------------------------------------------
extern PACKAGE int RV_TableGridEps;

}	/* namespace Rvrtfprops */
#if !defined(NO_IMPLICIT_NAMESPACE_USE)
using namespace Rvrtfprops;
#endif
//-- end unit ----------------------------------------------------------------
#endif	// RVRTFProps
