//----------------------------------------------------------------------------
// RVEdit.hpp - bcbdcc32 generated hdr (DO NOT EDIT) rev: 0
// From: RVEdit.pas
//----------------------------------------------------------------------------
#ifndef RVEditHPP
#define RVEditHPP
//----------------------------------------------------------------------------
#include <Clipbrd.hpp>
#include <DLines.hpp>
#include <RichView.hpp>
#include <RVStyle.hpp>
#include <RVScroll.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 Rvedit
{
//-- type declarations -------------------------------------------------------
enum TRVESearchOption { rvseoMatchCase, rvseoDown };

typedef Set<TRVESearchOption, rvseoMatchCase, rvseoDown>  TRVESearchOptions;

class __declspec(delphiclass) TRVCharPos;
class __declspec(pascalimplementation) TRVCharPos : public Classes::TCollectionItem
{
	typedef Classes::TCollectionItem inherited;
	
public:
	int X;
	int DrawLineNo;
	int Offset;
	int MoveRightTo;
	__fastcall virtual TRVCharPos(Classes::TCollection* Owner);
	virtual void __fastcall Assign(Classes::TPersistent* Source);
public:
	/* TCollectionItem.Destroy */ __fastcall virtual ~TRVCharPos(void) { }
	
};

enum TRVEditorOption { rvoClearTagOnStyleApp, rvoCtrlJumps };

typedef Set<TRVEditorOption, rvoClearTagOnStyleApp, rvoCtrlJumps>  TRVEditorOptions;

class __declspec(delphiclass) TRichViewEdit;
typedef void __fastcall (__closure *TRVStyleConversionEvent)(TRichViewEdit* Sender, int StyleNo, int 
	UserData, bool AppliedToText, int &NewStyleNo);

class __declspec(pascalimplementation) TRichViewEdit : public Richview::TRichView
{
	typedef Richview::TRichView inherited;
	
private:
	int LockCount;
	Controls::TControl* ResizingControl;
	Classes::TCollection* CharEnds;
	int CaretDrawLineNo;
	int CaretOffs;
	short CaretHeight;
	int FCurTextStyleNo;
	int FCurParaStyleNo;
	int FPrevTextStyleNo;
	Classes::TNotifyEvent FOnCurParaStyleChanged;
	Classes::TNotifyEvent FOnCurTextStyleChanged;
	Classes::TNotifyEvent FOnChange;
	Classes::TNotifyEvent FOnChanging;
	bool AlreadyFormatted;
	bool FReadOnly;
	TRVEditorOptions FEditorOptions;
	TRVStyleConversionEvent FOnStyleConversion;
	HIDESBASE MESSAGE void __fastcall WMSetFocus(Messages::TWMSetFocus &Message);
	HIDESBASE MESSAGE void __fastcall WMKillFocus(Messages::TWMKillFocus &Message);
	MESSAGE void __fastcall WMCut(Messages::TWMNoParams &Message);
	MESSAGE void __fastcall WMPaste(Messages::TWMNoParams &Message);
	HIDESBASE MESSAGE void __fastcall WMGetDlgCode(Messages::TWMNoParams &Message);
	void __fastcall OnChangeCaretLine(int DLOffs);
	void __fastcall ChangeCaret(bool ForceCreate, bool ScrollToCaret, bool DontChangeStyle, bool RefreshBefore
		);
	void __fastcall SetCurParaStyleNo(const int Value);
	void __fastcall SetCurTextStyleNo(const int Value);
	int __fastcall GetCurItemStyle(void);
	int __fastcall GetCurItemNo(void);
	int __fastcall GetOffsetInCurItem(void);
	bool __fastcall CanConcate(Richview::TRVItemInfo* li1, Richview::TRVItemInfo* li2, bool IgnorePara)
		;
	void __fastcall ConcateLines(int LineNo1, int LineNo2);
	void __fastcall DoResizeControl(int ItemNo, int OldWidth, int OldHeight, int NewWidth, int NewHeight
		);
	void __fastcall Reformat(bool FullFormat, int ItemNo);
	void __fastcall ApplyTextStyleConversionProc(TRichViewEdit* Sender, int StyleNo, int UserData, bool 
		AppliedToText, int &NewStyleNo);
	void __fastcall ApplyStyleConversion_(int UserData, TRVStyleConversionEvent ConversionProc);
	void __fastcall BuildJumpsCoords(void);
	void __fastcall ClearJumpsCoords(void);
	
protected:
	virtual void __fastcall InsertFirstRVFItem(int &Index, const System::AnsiString s, Richview::TRVItemInfo* 
		li, bool EditFlag);
	void __fastcall PrepareForEdit(void);
	virtual bool __fastcall BeforeChange(void);
	virtual void __fastcall ClearTemporal(void);
	virtual void __fastcall KeyDown(Word &Key, Classes::TShiftState Shift);
	virtual void __fastcall KeyUp(Word &Key, Classes::TShiftState Shift);
	virtual void __fastcall KeyPress(char &Key);
	virtual void __fastcall DoOnSelection(void);
	virtual void __fastcall CreateParams(Controls::TCreateParams &Params);
	virtual void __fastcall Format_(bool OnlyResized, int depth, Graphics::TCanvas* Canvas, bool OnlyTail
		);
	void __fastcall FormatParas(int StartDrawLineNo, int EndDrawLineNo, int LinesInserted);
	void __fastcall FormatParasExact(int StartDrawLineNo, int EndDrawLineNo, int LinesInserted);
	void __fastcall InsSomething(Richview::TRVItemInfo* info, const System::AnsiString s, int &InsertPoint
		, int &LinesAdded);
	void __fastcall InsertSomething(Richview::TRVItemInfo* info, const System::AnsiString s);
	void __fastcall OnEnterPress_(bool Shift);
	void __fastcall OnEnterPress(bool Shift);
	void __fastcall OnBackSpacePress(bool Ctrl);
	void __fastcall OnBackSpacePress_(bool Ctrl);
	void __fastcall OnDeletePress(bool Ctrl);
	void __fastcall OnDeletePress_(bool Ctrl);
	void __fastcall OnHomePress(bool Ctrl);
	void __fastcall OnEndPress(bool Ctrl);
	void __fastcall OnLeftPress(bool Ctrl);
	void __fastcall OnRightPress(bool Ctrl);
	void __fastcall OnUpPress(void);
	void __fastcall OnDownPress(void);
	void __fastcall OnPgUpPress(void);
	void __fastcall OnPgDownPress(void);
	void __fastcall InsEmptyString(int Index, int Tag, int ParaStyle, int FontStyle, bool BR);
	Richview::TRVItemInfo* __fastcall InsString( System::AnsiString s, int Index, int Tag, int ParaStyle
		, int FontStyle, bool SameAsPrev, bool BR);
	void __fastcall GetParaBounds(int DLNo1, int DLNo2, int &ParaStart, int &ParaEnd);
	void __fastcall InsertString(const System::AnsiString s, int StyleNo);
	void __fastcall DeleteSelection_(void);
	Richview::TRVItemInfo* __fastcall CreateCopy(Richview::TRVItemInfo* li, bool movecheckpoint);
	void __fastcall InsertText_( System::AnsiString text);
	bool __fastcall InsertRVFFromStreamEd_(Classes::TStream* Stream);
	virtual void __fastcall GetSelStart(int &DLNo, int &DLOffs);
	virtual void __fastcall AfterVScroll(void);
	virtual void __fastcall AfterHScroll(void);
	virtual void __fastcall SrchSelectIt(int strt, int offs, int len);
	virtual void __fastcall SrchStart(bool Down, int &strt, int &offs);
	
public:
	virtual void __fastcall Change(void);
	void __fastcall InsertText(const System::AnsiString text);
	bool __fastcall InsertRVFFromStreamEd(Classes::TStream* Stream);
	bool __fastcall InsertRVFFromFileEd(const System::AnsiString FileName);
	bool __fastcall InsertTextFromFile(const System::AnsiString FileName);
	bool __fastcall InsertOEMTextFromFile(const System::AnsiString FileName);
	HIDESBASE void __fastcall InsertControl(const System::AnsiString Name, Controls::TControl* ctrl, Richview::TRVVAlign 
		VAlign);
	void __fastcall InsertPicture(const System::AnsiString Name, Graphics::TGraphic* gr, Richview::TRVVAlign 
		VAlign);
	void __fastcall InsertBreak(Byte Width, Richview::TRVBreakStyle Style, Graphics::TColor Color);
	void __fastcall InsertBullet(int ImageIndex, Controls::TImageList* ImageList);
	void __fastcall InsertHotspot(int ImageIndex, int HotImageIndex, Controls::TImageList* ImageList);
	void __fastcall DeleteSelection(void);
	__fastcall virtual TRichViewEdit(Classes::TComponent* AOwner);
	__fastcall virtual ~TRichViewEdit(void);
	virtual void __fastcall Clear(void);
	void __fastcall InsertPageBreak(void);
	void __fastcall RemoveCurrentPageBreak(void);
	void __fastcall PasteBitmap(bool TextAsName);
	void __fastcall PasteMetafile(bool TextAsName);
	void __fastcall PasteText(void);
	void __fastcall PasteRVF(void);
	void __fastcall Paste(void);
	bool __fastcall CanPaste(void);
	bool __fastcall CanPasteRVF(void);
	void __fastcall CutDef(void);
	void __fastcall ApplyParaStyle(int ParaStyleNo);
	void __fastcall ApplyTextStyle(int TextStyleNo);
	void __fastcall ApplyStyleConversion(int UserData);
	void __fastcall GetCurrentBreakInfo(Byte &AWidth, Richview::TRVBreakStyle &AStyle, Graphics::TColor 
		&AColor, int &ATag);
	void __fastcall GetCurrentBulletInfo( System::AnsiString &AName, int &AImageIndex, Controls::TImageList* 
		&AImageList, int &ATag);
	void __fastcall GetCurrentHotspotInfo( System::AnsiString &AName, int &AImageIndex, int &AHotImageIndex
		, Controls::TImageList* &AImageList, int &ATag);
	void __fastcall GetCurrentPictureInfo( System::AnsiString &AName, Graphics::TGraphic* &Agr, Richview::TRVVAlign 
		&AVAlign, int &ATag);
	void __fastcall GetCurrentControlInfo( System::AnsiString &AName, Controls::TControl* &Actrl, Richview::TRVVAlign 
		&AVAlign, int &ATag);
	void __fastcall GetCurrentTextInfo( System::AnsiString &AText, int &ATag);
	int __fastcall GetCurrentTag(void);
	Richview::TCheckpointData __fastcall GetCurrentCheckpoint(void);
	void __fastcall SetBreakInfoEd(int ItemNo, Byte AWidth, Richview::TRVBreakStyle AStyle, Graphics::TColor 
		AColor, int ATag);
	void __fastcall SetBulletInfoEd(int ItemNo, const System::AnsiString AName, int AImageIndex, Controls::TImageList* 
		AImageList, int ATag);
	void __fastcall SetHotspotInfoEd(int ItemNo, const System::AnsiString AName, int AImageIndex, int AHotImageIndex
		, Controls::TImageList* AImageList, int ATag);
	void __fastcall SetPictureInfoEd(int ItemNo, const System::AnsiString AName, Graphics::TGraphic* Agr
		, Richview::TRVVAlign AVAlign, int ATag);
	void __fastcall SetControlInfoEd(int ItemNo, const System::AnsiString AName, Richview::TRVVAlign AVAlign
		, int ATag);
	void __fastcall SetItemTagEd(int ItemNo, int ATag);
	void __fastcall SetCheckpointInfoEd(int ItemNo, int ATag, const System::AnsiString AName, bool ARaiseEvent
		);
	void __fastcall RemoveCheckpointEd(int ItemNo);
	void __fastcall SetCurrentBreakInfo(Byte AWidth, Richview::TRVBreakStyle AStyle, Graphics::TColor AColor
		, int ATag);
	void __fastcall SetCurrentBulletInfo(const System::AnsiString AName, int AImageIndex, Controls::TImageList* 
		AImageList, int ATag);
	void __fastcall SetCurrentHotspotInfo(const System::AnsiString AName, int AImageIndex, int AHotImageIndex
		, Controls::TImageList* AImageList, int ATag);
	void __fastcall SetCurrentPictureInfo(const System::AnsiString AName, Graphics::TGraphic* Agr, Richview::TRVVAlign 
		AVAlign, int ATag);
	void __fastcall SetCurrentControlInfo(const System::AnsiString AName, Richview::TRVVAlign AVAlign, 
		int ATag);
	void __fastcall SetCurrentTag(int ATag);
	void __fastcall SetCurrentCheckpointInfo(int ATag, const System::AnsiString AName, bool ARaiseEvent
		);
	void __fastcall RemoveCurrentCheckpoint(void);
	void __fastcall ResizeControl(int ItemNo, int NewWidth, int NewHeight);
	void __fastcall AdjustControlPlacement(int ItemNo);
	HIDESBASE bool __fastcall SearchText( System::AnsiString s, TRVESearchOptions SrchOptions);
	void __fastcall SelectCurrentWord(void);
	void __fastcall BeginUpdate(void);
	void __fastcall EndUpdate(void);
	__property int CurTextStyleNo = {read=FCurTextStyleNo, write=SetCurTextStyleNo, nodefault};
	__property int CurParaStyleNo = {read=FCurParaStyleNo, write=SetCurParaStyleNo, nodefault};
	__property int CurItemStyle = {read=GetCurItemStyle, nodefault};
	__property int CurItemNo = {read=GetCurItemNo, nodefault};
	__property int OffsetInCurItem = {read=GetOffsetInCurItem, nodefault};
	
__published:
	__property bool ReadOnly = {read=FReadOnly, write=FReadOnly, nodefault};
	__property Classes::TNotifyEvent OnCurParaStyleChanged = {read=FOnCurParaStyleChanged, write=FOnCurParaStyleChanged
		};
	__property Classes::TNotifyEvent OnCurTextStyleChanged = {read=FOnCurTextStyleChanged, write=FOnCurTextStyleChanged
		};
	__property TRVStyleConversionEvent OnStyleConversion = {read=FOnStyleConversion, write=FOnStyleConversion
		};
	__property Classes::TNotifyEvent OnChange = {read=FOnChange, write=FOnChange};
	__property Classes::TNotifyEvent OnChanging = {read=FOnChanging, write=FOnChanging};
	__property TRVEditorOptions EditorOptions = {read=FEditorOptions, write=FEditorOptions, nodefault};
		
public:
	/* TWinControl.CreateParented */ __fastcall TRichViewEdit(HWND ParentWindow) : Richview::TRichView(
		ParentWindow) { }
	
};

//-- var, const, procedure ---------------------------------------------------
extern void __fastcall Register(void);
//-- template instantiations -------------------------------------------------
template class TRVEditorOptions ;
template class TRVESearchOptions ;

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