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

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

#ifndef RvrtfpropsHPP
#define RvrtfpropsHPP

#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 <Sysutils.hpp>	// Pascal unit
#include <Windows.hpp>	// Pascal unit
#include <Classes.hpp>	// Pascal unit
#include <Forms.hpp>	// Pascal unit
#include <Math.hpp>	// Pascal unit
#include <Rvrtf.hpp>	// Pascal unit
#include <Rvmarker.hpp>	// Pascal unit
#include <Rvdocparams.hpp>	// Pascal unit
#include <Printers.hpp>	// Pascal unit
#include <Rvscroll.hpp>	// Pascal unit
#include <Crvdata.hpp>	// Pascal unit
#include <Crvfdata.hpp>	// Pascal unit
#include <Rvstyle.hpp>	// Pascal unit
#include <Graphics.hpp>	// Pascal unit
#include <Rvrtferr.hpp>	// Pascal unit
#include <Rvuni.hpp>	// Pascal unit
#include <Rvitem.hpp>	// Pascal unit
#include <Rvmapwht.hpp>	// Pascal unit
#include <Rvfuncs.hpp>	// Pascal unit
#include <Rvclasses.hpp>	// Pascal unit
#include <Rvtypes.hpp>	// Pascal unit

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

namespace Rvrtfprops
{
//-- type declarations -------------------------------------------------------
typedef void __fastcall (__closure *TRVAllowUseStyleEvent)(int StyleNo, bool TextStyle, bool &Allow);

typedef void __fastcall (__closure *TRVCustomImageItemEvent)(Crvdata::TCustomRVData* RVData, Graphics::TGraphic* Graphic, bool Hypertext, Rvitem::TCustomRVItemInfo* &item, bool &FreeGraphic, Rvrtf::TRVRTFPicture* RTFPicture, const AnsiString FileName, AnsiString &Name);

typedef TMetaClass* TRVRTFReaderClass;

class DELPHICLASS TRVRTFReaderProperties;
class PASCALIMPLEMENTATION TRVRTFReaderProperties : public Classes::TPersistent 
{
	typedef Classes::TPersistent inherited;
	
private:
	Rvstyle::TRVReaderUnicode FUnicodeMode;
	Rvstyle::TRVReaderStyleMode FTextStyleMode;
	Rvstyle::TRVReaderStyleMode FParaStyleMode;
	bool FIgnorePictures;
	bool FIgnoreTables;
	bool FIgnoreBookmarks;
	bool FIgnoreNotes;
	bool FIgnoreSequences;
	bool FUseHypertextStyles;
	int FParaNo;
	int FStyleNo;
	bool FExplicitTableWidth;
	bool FSkipHiddenText;
	bool FHideTableGridLines;
	bool FLineBreaksAsParagraphs;
	AnsiString FBookmarkName;
	int FEmptyPara;
	Crvdata::TCustomRVData* RVData;
	Crvdata::TCustomRVData* CurrentRVData;
	Rvstyle::TRVStyle* RVStyle;
	bool PageBreak;
	Crvdata::TCustomRVData* PageBreakRVData;
	double PixelsPerTwip;
	Rvrtf::TRVRTFReader* Reader;
	bool FirstTime;
	bool FUseCharsetForUnicode;
	Graphics::TFontCharset FCharsetForUnicode;
	int InsertPoint;
	int CurrentRow;
	int CurrentCol;
	Rvclasses::TRVList* SubDataList;
	Crvdata::TCustomRVData* FHeaderRVData;
	Crvdata::TCustomRVData* FFooterRVData;
	int FHeaderYMM;
	int FFooterYMM;
	Rvscroll::TRVRTFHighlight FConvertHighlight;
	Rvrtf::TRVRTFHeaderFooterType HFType;
	AnsiString FBasePath;
	bool FExtractMetafileBitmaps;
	bool FBasePathLinks;
	bool FUseSingleCellPadding;
	bool IgnoreLists;
	int LastMarkerIndex;
	bool IsLastMarkerWord97;
	Rvclasses::TRVIntegerList* LevelToListNo;
	Rvclasses::TRVIntegerList* ListTableMap97;
	int ListStylesCountBefore;
	int LastNoteRefIndex;
	bool FReadDocParameters;
	bool FStoreImagesFileNames;
	void __fastcall InitReader(void);
	void __fastcall DoneReader(void);
	int __fastcall ReturnParaNo(Rvrtf::TRVRTFPosition Position);
	Rvitem::TRVTextItemInfo* __fastcall CreateTextItem(const AnsiString Text, const WideString WideText, int StyleNo, int ParaNo, bool UseUnicode, AnsiString &ResText);
	int __fastcall GetMarkerIndex(Rvrtf::TRVRTFMarkerProperties* RTFMarker);
	bool __fastcall InsertMarker(int ParaNo);
	bool __fastcall InsertMarker97(int ParaNo);
	void __fastcall ReaderUpdateMarker(System::TObject* Sender);
	void __fastcall MergeListTable97(void);
	bool __fastcall AreListStylesEqual97(Rvstyle::TRVListInfo* RVList, Rvrtf::TRVRTFList97* RTFList);
	int __fastcall FindListStyle97(Rvrtf::TRVRTFList97* RTFList, Rvclasses::TRVIntegerList* ForbiddenStyles);
	void __fastcall InsertItem(AnsiString &Text, Rvitem::TCustomRVItemInfo* item, Rvrtf::TRVRTFPosition Position);
	void __fastcall CurrentBorder(Rvstyle::TRVBorderStyle &RVBorderStyle, int &RVBorderWidth, int &RVBorderIntWidth, Graphics::TColor &RVBorderColor, Rvstyle::TRVRect* &RVBorderOffs);
	int __fastcall FindParaNo(Rvstyle::TRVBorderStyle RVBorderStyle, int RVBorderWidth, int RVBorderIntWidth, Graphics::TColor RVBorderColor, Rvstyle::TRVRect* RVBorderOffs);
	int __fastcall GetEmptyParaNo(Rvstyle::TRVAlignment Alignment);
	int __fastcall GetEmptyStyleNo(void);
	int __fastcall FindBestParaNo(void);
	int __fastcall FindStyleNo(bool AUnicode, bool AHypertext, bool SwitchProtect);
	int __fastcall FindBestStyleNo(bool AUnicode, bool AHypertext, bool ASwitchProtect);
	void __fastcall AddPara(Rvstyle::TRVBorderStyle RVBorderStyle, int RVBorderWidth, int RVBorderIntWidth, Graphics::TColor RVBorderColor, Rvstyle::TRVRect* RVBorderOffs);
	void __fastcall AddStyle(bool AUnicode, bool AHypertext, bool ASwitchProtect);
	int __fastcall ReturnParaNo_(void);
	int __fastcall ReturnStyleNo(bool AUnicode, bool ASwitchProtect);
	bool __fastcall IsHypertext_(void);
	bool __fastcall IsHypertext(AnsiString &Target, AnsiString &Hint, AnsiString &Extras);
	bool __fastcall AllowUseStyle(int StyleNo, bool TextStyle);
	void __fastcall SetParaNo(const int Value);
	void __fastcall SetStyleNo(const int Value);
	
protected:
	void __fastcall ReaderProgress(Rvrtf::TRVRTFReader* Sender, Rvrtf::TRVRTFProgressStage Stage, Byte PercentDone);
	void __fastcall NewReaderText(Rvrtf::TRVRTFReader* Sender, const AnsiString Text, Rvrtf::TRVRTFPosition Position);
	void __fastcall NewReaderSeq(Rvrtf::TRVRTFReader* Sender, Rvrtf::TRVRTFPosition Position, const AnsiString SeqName, Rvrtf::TRVRTFSeqType NumberingType, bool Reset, int StartFrom);
	void __fastcall ReaderNote(Rvrtf::TRVRTFReader* Sender, Rvrtf::TRVRTFNoteEventType What, Rvrtf::TRVRTFPosition Position);
	void __fastcall ReaderEndParsing(System::TObject* Sender);
	void __fastcall NewReaderUnicodeText(Rvrtf::TRVRTFReader* Sender, const WideString Text, Rvrtf::TRVRTFPosition Position);
	void __fastcall NewReaderPicture(Rvrtf::TRVRTFReader* Sender, Rvrtf::TRVRTFPicture* RTFPicture, Graphics::TGraphic* Graphic, Rvrtf::TRVRTFPosition Position, const AnsiString FileName, bool &Inserted);
	void __fastcall ReaderImportPicture(Rvrtf::TRVRTFReader* Sender, const AnsiString Location, Graphics::TGraphic* &Graphic, bool &Invalid);
	void __fastcall AssignRowProperties(void);
	void __fastcall ReaderTable(Rvrtf::TRVRTFReader* Sender, Rvrtf::TRVRTFTableEventKind WhatHappens, bool &Processed);
	void __fastcall ReaderPageBreak(System::TObject* Sender);
	void __fastcall ReaderHeaderFooter(Rvrtf::TRVRTFReader* Sender, Rvrtf::TRVRTFHeaderFooterType HFType, bool Starting, bool &Supported);
	void __fastcall ReaderBookmarkStart(Rvrtf::TRVRTFReader* Sender, const AnsiString BookmarkName);
	DYNAMIC void __fastcall ReaderTranslateKeyword(Rvrtf::TRVRTFReader* Sender, const AnsiString Keyword, int Param, bool fParam, AnsiString &Text, bool &DoDefault);
	
public:
	bool EditFlag;
	Rvrtferr::TRVRTFErrorCode ErrorCode;
	bool FailedBecauseOfProtect;
	bool FullReformat;
	int NonFirstItemsAdded;
	bool AllowNewPara;
	TRVAllowUseStyleEvent OnAllowUseStyle;
	TRVCustomImageItemEvent OnCustomImageItem;
	int Index;
	__fastcall TRVRTFReaderProperties(void);
	virtual void __fastcall Assign(Classes::TPersistent* Source);
	Rvrtferr::TRVRTFErrorCode __fastcall ReadFromFile(const 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 bool ExplicitTableWidth = {read=FExplicitTableWidth, write=FExplicitTableWidth, default=0};
	virtual TMetaClass* __fastcall GetRVRTFReaderClass(void);
	void __fastcall SetHeader(Crvdata::TCustomRVData* RVData);
	void __fastcall SetFooter(Crvdata::TCustomRVData* RVData);
	__property int HeaderYMM = {read=FHeaderYMM, nodefault};
	__property int FooterYMM = {read=FFooterYMM, nodefault};
	__property AnsiString BasePath = {read=FBasePath, write=FBasePath};
	__property Rvrtf::TRVRTFReader* RTFReader = {read=Reader};
	__property Crvdata::TCustomRVData* HeaderRVData = {read=FHeaderRVData};
	__property Crvdata::TCustomRVData* FooterRVData = {read=FFooterRVData};
	
__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 IgnoreNotes = {read=FIgnoreNotes, write=FIgnoreNotes, default=0};
	__property bool IgnoreSequences = {read=FIgnoreSequences, write=FIgnoreSequences, default=0};
	__property bool IgnoreTables = {read=FIgnoreTables, write=FIgnoreTables, default=0};
	__property bool IgnoreBookmarks = {read=FIgnoreBookmarks, write=FIgnoreBookmarks, 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=0};
	__property bool LineBreaksAsParagraphs = {read=FLineBreaksAsParagraphs, write=FLineBreaksAsParagraphs, default=0};
	__property bool ReadDocParameters = {read=FReadDocParameters, write=FReadDocParameters, default=0};
	__property bool UseSingleCellPadding = {read=FUseSingleCellPadding, write=FUseSingleCellPadding, default=0};
	__property bool ExtractMetafileBitmaps = {read=FExtractMetafileBitmaps, write=FExtractMetafileBitmaps, default=1};
	__property Rvscroll::TRVRTFHighlight ConvertHighlight = {read=FConvertHighlight, write=FConvertHighlight, default=2};
	__property bool StoreImagesFileNames = {read=FStoreImagesFileNames, write=FStoreImagesFileNames, default=0};
	__property bool BasePathLinks = {read=FBasePathLinks, write=FBasePathLinks, default=1};
	__property bool UseCharsetForUnicode = {read=FUseCharsetForUnicode, write=FUseCharsetForUnicode, default=0};
	__property Graphics::TFontCharset CharsetForUnicode = {read=FCharsetForUnicode, write=FCharsetForUnicode, default=1};
public:
	#pragma option push -w-inl
	/* TPersistent.Destroy */ inline __fastcall virtual ~TRVRTFReaderProperties(void) { }
	#pragma option pop
	
};


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

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

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