//----------------------------------------------------------------------------
// CRVData.hpp - bcbdcc32 generated hdr (DO NOT EDIT) rev: 0
// From: CRVData.pas
//----------------------------------------------------------------------------
#ifndef CRVDataHPP
#define CRVDataHPP
//----------------------------------------------------------------------------
#include <RVRTFErr.hpp>
#include <RVClasses.hpp>
#include <RVUni.hpp>
#include <RVStyle.hpp>
#include <RVScroll.hpp>
#include <RVItem.hpp>
#include <RVFuncs.hpp>
#include <RVBack.hpp>
#include <Forms.hpp>
#include <Controls.hpp>
#include <Graphics.hpp>
#include <Classes.hpp>
#include <SysUtils.hpp>
#include <Messages.hpp>
#include <Windows.hpp>
#include <System.hpp>
namespace Crvdata
{
//-- type declarations -------------------------------------------------------
class __declspec(delphiclass) TRVHTMLBulletInfo;
class __declspec(pascalimplementation) TRVHTMLBulletInfo : public System::TObject
{
	typedef System::TObject inherited;
	
public:
	System::AnsiString FileName;
	Controls::TImageList* ImageList;
	int ImageIndex;
	Graphics::TColor BackColor;
public:
	/* TObject.Create */ __fastcall TRVHTMLBulletInfo(void) : System::TObject() { }
	/* TObject.Destroy */ __fastcall virtual ~TRVHTMLBulletInfo(void) { }
	
};

enum TRVFSaveScope { rvfss_Full, rvfss_Selection, rvfss_Page };

typedef Rvclasses::TRVIntegerList* *PRVIntegerList;

class __declspec(delphiclass) TCustomRVData;
class __declspec(pascalimplementation) TCustomRVData : public Classes::TPersistent
{
	typedef Classes::TPersistent inherited;
	
private:
	int FFirstJumpNo;
	Classes::TStringList* FItems;
	bool __fastcall GetPageBreaksBeforeItems(int Index);
	void __fastcall SetPageBreaksBeforeItems(int Index, bool Value);
	
protected:
	bool FAllowNewPara;
	Rvitem::TRVCPInfo* FirstCP;
	Rvitem::TRVCPInfo* LastCP;
	Rvitem::TRVCPInfo* NotAddedCP;
	int CPCount;
	void __fastcall CheckItemClass(int ItemNo, System::TMetaClass* RequiredClass);
	virtual bool __fastcall ShareItems(void);
	virtual Rvscroll::TRVPaletteAction __fastcall GetDoInPaletteMode(void);
	virtual HPALETTE __fastcall GetRVPalette(void);
	virtual Windows::PLogPalette __fastcall GetRVLogPalette(void);
	virtual System::AnsiString __fastcall GetURL(int id);
	virtual Rvscroll::TRVOptions __fastcall GetOptions(void);
	virtual void __fastcall SetOptions(const Rvscroll::TRVOptions Value);
	virtual Rvstyle::TRVFOptions __fastcall GetRVFOptions(void);
	virtual void __fastcall SetRVFOptions(const Rvstyle::TRVFOptions Value);
	virtual Rvstyle::TRVRTFOptions __fastcall GetRTFOptions(void);
	virtual void __fastcall SetRTFOptions(const Rvstyle::TRVRTFOptions Value);
	virtual Rvstyle::TRVFWarnings __fastcall GetRVFWarnings(void);
	virtual void __fastcall SetRVFWarnings(const Rvstyle::TRVFWarnings Value);
	virtual System::AnsiString __fastcall GetDelimiters(void);
	virtual Rvstyle::TRVFReaderStyleMode __fastcall GetRVFTextStylesReadMode(void);
	virtual Rvstyle::TRVFReaderStyleMode __fastcall GetRVFParaStylesReadMode(void);
	virtual void __fastcall RVFGetLimits(TRVFSaveScope SaveScope, int &StartItem, int &EndItem, int &StartOffs
		, int &EndOffs, Rvitem::TRVMultiDrawItemPart* &StartPart, Rvitem::TRVMultiDrawItemPart* &EndPart);
		
	virtual Classes::TPersistent* __fastcall GetRTFProperties(void);
	bool __fastcall InsertRVFFromStream_(Classes::TStream* Stream, int Index, int AParaNo, bool AllowReplaceStyles
		, bool AppendMode, bool EditFlag, Graphics::TColor &Color, Rvback::TRVBackground* Background, int 
		&NonFirstItemsAdded, bool &Protect, bool &FullReformat);
	void __fastcall DataWriter(Classes::TStream* Stream);
	void __fastcall DataReader(Classes::TStream* Stream);
	void __fastcall NormalizeParas(int StartItemNo);
	void __fastcall InsertCheckpoint(int ItemNo, int Tag, const System::AnsiString Name, bool RaiseEvent
		);
	void __fastcall UpdateCPPos(Rvitem::TRVCPInfo* cp, int ItemNo);
	void __fastcall UnlinkCheckpoint(Rvitem::TRVCPInfo* cp, bool DecCPCount);
	Rvitem::TRVCPInfo* __fastcall FindCPBeforeItem(int ItemNo);
	void __fastcall UpdateCPItemNo(void);
	virtual void __fastcall InternalFreeItem(Rvitem::TCustomRVItemInfo* item);
	bool __fastcall IsDelimiterA(char ch);
	bool __fastcall IsDelimiterW(Word ch);
	bool __fastcall IsDelimiter(const System::AnsiString s, int Index, Rvitem::TRVItemOptions ItemOptions
		);
	Rvitem::TRVItemOptions __fastcall GetItemOptions(int ItemNo);
	void __fastcall Replace0( System::AnsiString &s);
	void __fastcall StartExport(void);
	void __fastcall EndExport(void);
	void __fastcall StartPartialExport(int StartItem, int EndItem);
	void __fastcall EndPartialExport(int StartItem, int EndItem);
	bool __fastcall RV_CanConcateItems(int FirstItemNo, Rvitem::TCustomRVItemInfo* li1, Rvitem::TCustomRVItemInfo* 
		li2, bool IgnorePara);
	void __fastcall SimpleConcate(int FirstItemNo, Rvitem::TCustomRVItemInfo* li1, Rvitem::TCustomRVItemInfo* 
		li2);
	void __fastcall MassSimpleConcate(int FirstItemNo, int LastItemNo);
	virtual void __fastcall AfterDeleteStyles(Rvclasses::TRVIntegerList* TextStylesShift, Rvclasses::TRVIntegerList* 
		ParaStylesShift);
	virtual void __fastcall InitStyleMappings(PRVIntegerList &PTextStylesMapping, PRVIntegerList &PParaStylesMapping
		);
	virtual void __fastcall DoneStyleMappings(PRVIntegerList PTextStylesMapping, PRVIntegerList PParaStylesMapping
		);
	virtual bool __fastcall SupportsPageBreaks(void);
	void __fastcall AdjustInItemsRange(int &ItemNo);
	
public:
	bool RTFSkipPar;
	virtual System::AnsiString __fastcall GetExtraRTFCode(Rvstyle::TRVRTFSaveArea Area, System::TObject* 
		Obj, int Index1, int Index2, bool InStyleSheet);
	int __fastcall ItemLength(int ItemNo);
	virtual void __fastcall ReadHyperlink(const System::AnsiString Target, const System::AnsiString Extras
		, Rvscroll::TRVLoadFormat DocFormat, int &StyleNo, int &ItemTag,  System::AnsiString &ItemName);
	virtual bool __fastcall InsertFirstRVFItem(int &Index, const System::AnsiString s, Rvitem::TCustomRVItemInfo* 
		li, bool EditFlag, bool &FullReformat);
	virtual System::AnsiString __fastcall GetNextFileName(const System::AnsiString ImagesPrefix, const System::AnsiString 
		Path, const System::AnsiString Ext, int &imgSaveNo, bool OverrideFiles);
	virtual TCustomRVData* __fastcall GetRVData(void);
	virtual TCustomRVData* __fastcall GetSourceRVData(void);
	Rvstyle::TRVCodePage __fastcall GetStyleCodePage(int StyleNo);
	Rvstyle::TRVCodePage __fastcall GetDefaultCodePage(void);
	void __fastcall FreeCheckpoint(Rvitem::TRVCPInfo* &cp, bool AdjustLinks, bool DecCPCount);
	void __fastcall SetCP(Rvitem::TCustomRVItemInfo* Item, Rvitem::TRVCPInfo* &PrevCP, Rvitem::TRVCPInfo* 
		&CP);
	void __fastcall FreeItem(int ItemNo);
	virtual void __fastcall Clear(void);
	System::AnsiString __fastcall ReplaceTabs(const System::AnsiString s, int StyleNo, bool UnicodeDef)
		;
	virtual System::AnsiString __fastcall SaveComponentToFile(const System::AnsiString Path, Classes::TComponent* 
		SaveMe, Rvscroll::TRVSaveFormat SaveFormat);
	virtual System::AnsiString __fastcall SavePicture(Rvscroll::TRVSaveFormat DocumentSaveFormat, const System::AnsiString 
		imgSavePrefix, const System::AnsiString Path, int &imgSaveNo, bool OverrideFiles, Graphics::TColor 
		CurrentFileColor, Graphics::TGraphic* gr);
	virtual Graphics::TGraphic* __fastcall RVFPictureNeeded(const System::AnsiString ItemName, int ItemTag
		);
	void __fastcall ControlAction(Rvstyle::TRVControlAction ControlAction, int ItemNo, Rvitem::TCustomRVItemInfo* 
		Item);
	virtual void __fastcall ControlAction2(Rvstyle::TRVControlAction ControlAction, int ItemNo, Controls::TControl* 
		Control);
	virtual Controls::TControl* __fastcall RVFControlNeeded(const System::AnsiString ItemName, int ItemTag
		);
	virtual Controls::TImageList* __fastcall RVFImageListNeeded(int ImageListTag);
	virtual void __fastcall HTMLSaveImage(TCustomRVData* RVData, int ItemNo, const System::AnsiString Path
		, Graphics::TColor BackgroundColor,  System::AnsiString &Location, bool &DoDefault);
	virtual Rvstyle::TRVStyle* __fastcall GetRVStyle(void);
	virtual Controls::TWinControl* __fastcall GetParentControl(void);
	void __fastcall ShareItemsFrom(TCustomRVData* Source);
	void __fastcall UpdateItemsPaletteInfo(void);
	void __fastcall DrainFrom(TCustomRVData* Victim);
	void __fastcall SetParagraphStyleToAll(int ParaNo);
	void __fastcall MakeRTFColorTable(Rvclasses::TRVColorList* ColorList, bool TopLevel);
	virtual void __fastcall MarkStylesInUse(Rvclasses::TRVIntegerList* UsedTextStyles, Rvclasses::TRVIntegerList* 
		UsedParaStyles);
	void __fastcall UpdateStyles(Rvclasses::TRVIntegerList* TextStylesShift, Rvclasses::TRVIntegerList* 
		ParaStylesShift);
	__property Classes::TStringList* Items = {read=FItems, nodefault};
	__fastcall TCustomRVData(void);
	__fastcall virtual ~TCustomRVData(void);
	void __fastcall DeleteUnusedStyles(bool TextStyles, bool ParaStyles);
	void __fastcall AddItem(const System::AnsiString Text, Rvitem::TCustomRVItemInfo* Item);
	void __fastcall AddBreakExTag(Byte Width, Rvstyle::TRVBreakStyle Style, Graphics::TColor Color, int 
		Tag);
	void __fastcall AddBreak(void);
	void __fastcall AddBreakEx(Byte Width, Rvstyle::TRVBreakStyle Style, Graphics::TColor Color);
	void __fastcall AddBreakTag(int Tag);
	void __fastcall AddFmt(const System::AnsiString FormatStr, const System::TVarRec * Args, const int 
		Args_Size, int StyleNo, int ParaNo);
	void __fastcall AddNL(const System::AnsiString s, int StyleNo, int ParaNo);
	void __fastcall AddNLTag(const System::AnsiString s, int StyleNo, int ParaNo, int Tag);
	void __fastcall AddTextNL( System::AnsiString s, int StyleNo, int FirstParaNo, int OtherParaNo);
	void __fastcall AddTextBlockNL( System::AnsiString s, int StyleNo, int ParaNo);
	void __fastcall AddBulletEx(const System::AnsiString Name, int ImageIndex, Controls::TImageList* ImageList
		, int ParaNo);
	void __fastcall AddBulletExTag(const System::AnsiString Name, int ImageIndex, Controls::TImageList* 
		ImageList, int ParaNo, int Tag);
	void __fastcall AddHotspotEx(const System::AnsiString Name, int ImageIndex, int HotImageIndex, Controls::TImageList* 
		ImageList, int ParaNo);
	void __fastcall AddHotspotExTag(const System::AnsiString Name, int ImageIndex, int HotImageIndex, Controls::TImageList* 
		ImageList, int ParaNo, int Tag);
	int __fastcall AddNamedCheckpointExTag(const System::AnsiString CpName, bool RaiseEvent, int Tag);
	void __fastcall AddPictureExTag(const System::AnsiString Name, Graphics::TGraphic* gr, int ParaNo, 
		Rvstyle::TRVVAlign VAlign, int Tag);
	void __fastcall AddControlExTag(const System::AnsiString Name, Controls::TControl* ctrl, int ParaNo
		, Rvstyle::TRVVAlign VAlign, int Tag);
	void __fastcall AddPictureEx(const System::AnsiString Name, Graphics::TGraphic* gr, int ParaNo, Rvstyle::TRVVAlign 
		VAlign);
	void __fastcall AddControlEx(const System::AnsiString Name, Controls::TControl* ctrl, int ParaNo, Rvstyle::TRVVAlign 
		VAlign);
	void __fastcall AddHotPicture(const System::AnsiString Name, Graphics::TGraphic* gr, int ParaNo, Rvstyle::TRVVAlign 
		VAlign);
	void __fastcall AddHotPictureTag(const System::AnsiString Name, Graphics::TGraphic* gr, int ParaNo, 
		Rvstyle::TRVVAlign VAlign, int Tag);
	Rvstyle::TCheckpointData __fastcall GetFirstCheckpoint(void);
	Rvstyle::TCheckpointData __fastcall GetNextCheckpoint(Rvstyle::TCheckpointData CheckpointData);
	Rvstyle::TCheckpointData __fastcall GetLastCheckpoint(void);
	Rvstyle::TCheckpointData __fastcall GetPrevCheckpoint(Rvstyle::TCheckpointData CheckpointData);
	Rvstyle::TCheckpointData __fastcall GetItemCheckpoint(int ItemNo);
	Rvstyle::TCheckpointData __fastcall FindCheckpointByName(const System::AnsiString Name);
	Rvstyle::TCheckpointData __fastcall FindCheckpointByTag(int Tag);
	Rvstyle::TCheckpointData __fastcall GetCheckpointByNo(int No);
	int __fastcall GetCheckpointItemNo(Rvstyle::TCheckpointData CheckpointData);
	int __fastcall GetCheckpointNo(Rvstyle::TCheckpointData CheckpointData);
	void __fastcall GetCheckpointInfo(Rvstyle::TCheckpointData CheckpointData, int &Tag,  System::AnsiString &
		Name, bool &RaiseEvent);
	void __fastcall GetBreakInfo(int ItemNo, Byte &AWidth, Rvstyle::TRVBreakStyle &AStyle, Graphics::TColor 
		&AColor, int &ATag);
	void __fastcall GetBulletInfo(int ItemNo,  System::AnsiString &AName, int &AImageIndex, Controls::TImageList* 
		&AImageList, int &ATag);
	void __fastcall GetHotspotInfo(int ItemNo,  System::AnsiString &AName, int &AImageIndex, int &AHotImageIndex
		, Controls::TImageList* &AImageList, int &ATag);
	void __fastcall GetPictureInfo(int ItemNo,  System::AnsiString &AName, Graphics::TGraphic* &Agr, Rvstyle::TRVVAlign 
		&AVAlign, int &ATag);
	void __fastcall GetControlInfo(int ItemNo,  System::AnsiString &AName, Controls::TControl* &Actrl, 
		Rvstyle::TRVVAlign &AVAlign, int &ATag);
	void __fastcall GetTextInfo(int ItemNo,  System::AnsiString &AText, int &ATag);
	int __fastcall GetItemTag(int ItemNo);
	bool __fastcall IsParaStart(int ItemNo);
	int __fastcall GetItemPara(int ItemNo);
	bool __fastcall IsFromNewLine(int ItemNo);
	void __fastcall SetBreakInfo(int ItemNo, Byte AWidth, Rvstyle::TRVBreakStyle AStyle, Graphics::TColor 
		AColor, int ATag);
	void __fastcall SetBulletInfo(int ItemNo, const System::AnsiString AName, int AImageIndex, Controls::TImageList* 
		AImageList, int ATag);
	void __fastcall SetHotspotInfo(int ItemNo, const System::AnsiString AName, int AImageIndex, int AHotImageIndex
		, Controls::TImageList* AImageList, int ATag);
	bool __fastcall SetPictureInfo(int ItemNo, const System::AnsiString AName, Graphics::TGraphic* Agr, 
		Rvstyle::TRVVAlign AVAlign, int ATag);
	bool __fastcall SetControlInfo(int ItemNo, const System::AnsiString AName, Rvstyle::TRVVAlign AVAlign
		, int ATag);
	void __fastcall SetItemTag(int ItemNo, int ATag);
	void __fastcall SetCheckpointInfo(int ItemNo, int ATag, const System::AnsiString AName, bool ARaiseEvent
		);
	bool __fastcall RemoveCheckpoint(int ItemNo);
	int __fastcall FindControlItemNo(Controls::TControl* actrl);
	int __fastcall GetItemStyle(int ItemNo);
	bool __fastcall SaveTextToStream(const System::AnsiString Path, Classes::TStream* Stream, int LineWidth
		, bool SelectionOnly, bool TextOnly, bool Unicode);
	bool __fastcall SaveText(const System::AnsiString FileName, int LineWidth, bool Unicode);
	bool __fastcall LoadText(const System::AnsiString FileName, int StyleNo, int ParaNo, bool AsSingleParagraph
		);
	virtual bool __fastcall SaveHTMLToStreamEx(Classes::TStream* Stream, const System::AnsiString Path, 
		const System::AnsiString Title, const System::AnsiString ImagesPrefix, const System::AnsiString ExtraStyles
		, const System::AnsiString ExternalCSS, const System::AnsiString CPPrefix, Rvstyle::TRVSaveOptions 
		Options, Graphics::TColor Color, Graphics::TColor &CurrentFileColor, int &imgSaveNo, int LeftMargin
		, int TopMargin, int RightMargin, int BottomMargin, Rvback::TRVBackground* Background, Rvclasses::TRVList* 
		Bullets);
	virtual bool __fastcall SaveHTMLToStream(Classes::TStream* Stream, const System::AnsiString Path, const System::AnsiString 
		Title, const System::AnsiString ImagesPrefix, Rvstyle::TRVSaveOptions Options, Graphics::TColor Color
		, int &imgSaveNo, int LeftMargin, int TopMargin, int RightMargin, int BottomMargin, Rvback::TRVBackground* 
		Background, Rvclasses::TRVList* Bullets);
	bool __fastcall SaveHTMLEx(const System::AnsiString FileName, const System::AnsiString Title, const System::AnsiString 
		ImagesPrefix, const System::AnsiString ExtraStyles, const System::AnsiString ExternalCSS, const System::AnsiString 
		CPPrefix, Rvstyle::TRVSaveOptions Options, Graphics::TColor Color, Graphics::TColor &CurrentFileColor
		, int &imgSaveNo, int LeftMargin, int TopMargin, int RightMargin, int BottomMargin, Rvback::TRVBackground* 
		Background);
	bool __fastcall SaveHTML(const System::AnsiString FileName, const System::AnsiString Title, const System::AnsiString 
		ImagesPrefix, Rvstyle::TRVSaveOptions Options, Graphics::TColor Color, int &imgSaveNo, int LeftMargin
		, int TopMargin, int RightMargin, int BottomMargin, Rvback::TRVBackground* Background);
	void __fastcall AddNLATag(const System::AnsiString s, int StyleNo, int ParaNo, int Tag);
	void __fastcall AddTextNLW(const System::AnsiString s, int StyleNo, int FirstParaNo, int OtherParaNo
		, bool DefAsSingleParagraph);
	bool __fastcall LoadTextW(const System::AnsiString FileName, int StyleNo, int ParaNo, bool DefAsSingleParagraph
		);
	void __fastcall SetAddParagraphMode(bool AllowNewPara);
	virtual void __fastcall DeleteItems(int FirstItemNo, int Count);
	void __fastcall DeleteSection(const System::AnsiString CpName);
	int __fastcall GetOffsAfterItem(int ItemNo);
	int __fastcall GetOffsBeforeItem(int ItemNo);
	void __fastcall AppendFrom(TCustomRVData* Source);
	bool __fastcall LoadRVFFromStream(Classes::TStream* Stream, Graphics::TColor &Color, Rvback::TRVBackground* 
		Background);
	bool __fastcall InsertRVFFromStream(Classes::TStream* Stream, int Index, Graphics::TColor &Color, Rvback::TRVBackground* 
		Background, bool AllowReplaceStyles);
	bool __fastcall AppendRVFFromStream(Classes::TStream* Stream, int ParaNo, Graphics::TColor &Color, 
		Rvback::TRVBackground* Background);
	bool __fastcall LoadRVF(const System::AnsiString FileName, Graphics::TColor &Color, Rvback::TRVBackground* 
		Background);
	TRVFSaveScope __fastcall GetRVFSaveScope(bool SelectionOnly);
	bool __fastcall SaveRVFToStream(Classes::TStream* Stream, bool SelectionOnly, Graphics::TColor Color
		, Rvback::TRVBackground* Background);
	bool __fastcall SaveRVFToStreamEx(Classes::TStream* Stream, TRVFSaveScope SaveScope, Graphics::TColor 
		Color, Rvback::TRVBackground* Background);
	bool __fastcall SaveRVF(const System::AnsiString FileName, bool SelectionOnly, Graphics::TColor Color
		, Rvback::TRVBackground* Background);
	virtual bool __fastcall SaveRTFToStream(Classes::TStream* Stream, bool SelectionOnly, int Level, Graphics::TColor 
		Color, Rvback::TRVBackground* Background, Rvclasses::TRVColorList* ColorList, Rvclasses::TRVIntegerList* 
		StyleToFont, Rvclasses::TRVIntegerList* FontToStyle, double tpp);
	bool __fastcall SaveRTF(const System::AnsiString FileName, bool SelectionOnly, Graphics::TColor Color
		, Rvback::TRVBackground* Background);
	Rvrtferr::TRVRTFErrorCode __fastcall LoadRTFFromStream(Classes::TStream* Stream);
	Rvrtferr::TRVRTFErrorCode __fastcall LoadRTF(const System::AnsiString FileName);
	virtual TCustomRVData* __fastcall GetParentData(void);
	virtual TCustomRVData* __fastcall GetRootData(void);
	virtual TCustomRVData* __fastcall GetAbsoluteParentData(void);
	virtual TCustomRVData* __fastcall GetAbsoluteRootData(void);
	int __fastcall GetItemNo(Rvitem::TCustomRVItemInfo* Item);
	Rvitem::TCustomRVItemInfo* __fastcall GetItem(int ItemNo);
	void __fastcall Inserted(TCustomRVData* RVData, bool Safe);
	void __fastcall Beep(void);
	__property Rvscroll::TRVOptions Options = {read=GetOptions, write=SetOptions, nodefault};
	__property Rvstyle::TRVFOptions RVFOptions = {read=GetRVFOptions, write=SetRVFOptions, nodefault};
	__property Rvstyle::TRVRTFOptions RTFOptions = {read=GetRTFOptions, write=SetRTFOptions, nodefault}
		;
	__property Rvstyle::TRVFWarnings RVFWarnings = {read=GetRVFWarnings, write=SetRVFWarnings, nodefault
		};
	__property int FirstJumpNo = {read=FFirstJumpNo, write=FFirstJumpNo, nodefault};
	__property bool PageBreaksBeforeItems[int Index] = {read=GetPageBreaksBeforeItems, write=SetPageBreaksBeforeItems
		};
};

//-- var, const, procedure ---------------------------------------------------
extern void __fastcall RVCheckUni(int Length);
extern System::AnsiString __fastcall RV_MakeHTMLStr(const System::AnsiString str, bool NoEmptyLines)
	;

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