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

// (DO NOT EDIT: machine generated header) 'RVEdit.pas' rev: 5.00

#ifndef RVEditHPP
#define RVEditHPP

#pragma delphiheader begin
#pragma option push -w-
#pragma option push -Vx
#include <RVRTFProps.hpp>	// Pascal unit
#include <Menus.hpp>	// Pascal unit
#include <RVRTFErr.hpp>	// Pascal unit
#include <RVRVData.hpp>	// Pascal unit
#include <CRVFData.hpp>	// Pascal unit
#include <CRVData.hpp>	// Pascal unit
#include <RVUni.hpp>	// Pascal unit
#include <RVFuncs.hpp>	// Pascal unit
#include <Clipbrd.hpp>	// Pascal unit
#include <DLines.hpp>	// Pascal unit
#include <RichView.hpp>	// Pascal unit
#include <RVItem.hpp>	// Pascal unit
#include <RVStyle.hpp>	// Pascal unit
#include <RVScroll.hpp>	// Pascal unit
#include <Imm.hpp>	// Pascal unit
#include <RichEdit.hpp>	// Pascal unit
#include <Forms.hpp>	// Pascal unit
#include <Controls.hpp>	// Pascal unit
#include <Graphics.hpp>	// Pascal unit
#include <Classes.hpp>	// Pascal unit
#include <SysUtils.hpp>	// Pascal unit
#include <Messages.hpp>	// Pascal unit
#include <Windows.hpp>	// Pascal unit
#include <SysInit.hpp>	// Pascal unit
#include <System.hpp>	// Pascal unit

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

namespace Rvedit
{
//-- type declarations -------------------------------------------------------
#pragma option push -b-
enum TRVESearchOption { rvseoMatchCase, rvseoDown, rvseoWholeWord };
#pragma option pop

typedef Set<TRVESearchOption, rvseoMatchCase, rvseoWholeWord>  TRVESearchOptions;

#pragma option push -b-
enum TRVEditorOption { rvoClearTagOnStyleApp, rvoCtrlJumps, rvoDoNotWantReturns, rvoWantTabs, rvoAutoSwitchLang, 
	rvoHideReadOnlyCaret };
#pragma option pop

typedef Set<TRVEditorOption, rvoClearTagOnStyleApp, rvoHideReadOnlyCaret>  TRVEditorOptions;

class DELPHICLASS TCustomRichViewEdit;
typedef void __fastcall (__closure *TRVStyleConversionEvent)(TCustomRichViewEdit* Sender, int StyleNo
	, int UserData, bool AppliedToText, int &NewStyleNo);

typedef void __fastcall (__closure *TRVPasteEvent)(TCustomRichViewEdit* Sender, bool &DoDefault);

#pragma option push -b-
enum TRVUndoType { rvutNone, rvutDelete, rvutInsert, rvutPara, rvutMiscTyping, rvutInsertPageBreak, 
	rvutRemovePageBreak, rvutTyping, rvutTag, rvutStyleNo, rvutAddCheckpoint, rvutRemoveCheckpoint, rvutModifyCheckpoint, 
	rvutModifyItem, rvutCustom };
#pragma option pop

#pragma option push -b-
enum TRVGetOutDirection { rvdLeft, rvdUp, rvdRight, rvdDown, rvdTop, rvdBottom };
#pragma option pop

typedef void __fastcall (__closure *TRVOnCaretGetOutEvent)(TCustomRichViewEdit* Sender, TRVGetOutDirection 
	Direction);

class PASCALIMPLEMENTATION TCustomRichViewEdit : public Richview::TCustomRichView 
{
	typedef Richview::TCustomRichView inherited;
	
private:
	Classes::TNotifyEvent FOnCurParaStyleChanged;
	Classes::TNotifyEvent FOnCurTextStyleChanged;
	Classes::TNotifyEvent FOnChange;
	Classes::TNotifyEvent FOnChanging;
	Classes::TNotifyEvent FOnCaretMove;
	bool FReadOnly;
	TRVEditorOptions FEditorOptions;
	TRVStyleConversionEvent FOnStyleConversion;
	TRVPasteEvent FOnPaste;
	TRVOnCaretGetOutEvent FOnCaretGetOut;
	void __fastcall CheckItemClass(int ItemNo, TMetaClass* RequiredClass);
	MESSAGE void __fastcall WMInputLangChange(Messages::TMessage &Message);
	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);
	MESSAGE void __fastcall WMSysChar(Messages::TWMKey &Message);
	HIDESBASE MESSAGE void __fastcall WMKeyDown(Messages::TWMKey &Message);
	MESSAGE void __fastcall WMUndoFromInplace(Messages::TMessage &Message);
	MESSAGE void __fastcall WMRedoFromInplace(Messages::TMessage &Message);
	MESSAGE void __fastcall WMClear(Messages::TMessage &Message);
	MESSAGE void __fastcall WMUndo(Messages::TMessage &Message);
	MESSAGE void __fastcall EMUndo(Messages::TMessage &Message);
	MESSAGE void __fastcall EMRedo(Messages::TMessage &Message);
	MESSAGE void __fastcall EMCanUndo(Messages::TMessage &Message);
	MESSAGE void __fastcall EMCanRedo(Messages::TMessage &Message);
	MESSAGE void __fastcall EMCanPaste(Messages::TMessage &Message);
	MESSAGE void __fastcall WMImeStartComposition(Messages::TMessage &Message);
	MESSAGE void __fastcall WMImeComposition(Messages::TMessage &Message);
	void __fastcall SetCurParaStyleNo(const int Value);
	void __fastcall SetCurTextStyleNo(const int Value);
	int __fastcall GetCurParaStyleNo(void);
	int __fastcall GetCurTextStyleNo(void);
	int __fastcall GetCurItemStyle(void);
	int __fastcall GetCurItemNo(void);
	int __fastcall GetOffsetInCurItem(void);
	void __fastcall ApplyTextStyleConversionProc(TCustomRichViewEdit* Sender, int StyleNo, int UserData
		, bool AppliedToText, int &NewStyleNo);
	int __fastcall GetUndoLimit(void);
	void __fastcall SetUndoLimit(const int Value);
	bool __fastcall IsUndoShortcut(Classes::TShiftState Shift, Word Key);
	bool __fastcall IsRedoShortcut(Classes::TShiftState Shift, Word Key);
	void __fastcall InsertTextW_(const AnsiString text);
	HIDESBASE void __fastcall SetTabNavigation(const Rvscroll::TRVTabNavigationType Value);
	
protected:
	int LockCount;
	DYNAMIC void __fastcall KeyDown(Word &Key, Classes::TShiftState Shift);
	DYNAMIC void __fastcall KeyUp(Word &Key, Classes::TShiftState Shift);
	DYNAMIC void __fastcall KeyPress(char &Key);
	virtual void __fastcall CreateParams(Controls::TCreateParams &Params);
	void __fastcall OnEnterPress(bool Shift);
	void __fastcall OnBackSpacePress(bool Ctrl);
	void __fastcall OnDeletePress(bool Ctrl);
	virtual void __fastcall AfterVScroll(void);
	virtual void __fastcall AfterHScroll(void);
	virtual TMetaClass* __fastcall GetDataClass(void);
	virtual void __fastcall SetReadOnly(const bool Value);
	virtual bool __fastcall GetReadOnly(void);
	__property Classes::TNotifyEvent OnCurParaStyleChanged = {read=FOnCurParaStyleChanged, write=FOnCurParaStyleChanged
		};
	__property Classes::TNotifyEvent OnCurTextStyleChanged = {read=FOnCurTextStyleChanged, write=FOnCurTextStyleChanged
		};
	__property Classes::TNotifyEvent OnChange = {read=FOnChange, write=FOnChange};
	__property Classes::TNotifyEvent OnCaretMove = {read=FOnCaretMove, write=FOnCaretMove};
	__property Classes::TNotifyEvent OnChanging = {read=FOnChanging, write=FOnChanging};
	__property TRVPasteEvent OnPaste = {read=FOnPaste, write=FOnPaste};
	__property TabNavigation  = {read=GetTabNavigation, write=SetTabNavigation, default=0};
	
public:
	TRVStyleConversionEvent FCurStyleConversion;
	bool __fastcall BeforeInserting(void);
	void __fastcall AfterInserting(void);
	DYNAMIC void __fastcall CurParaStyleChange(void);
	DYNAMIC void __fastcall CurTextStyleChange(void);
	virtual bool __fastcall BeforeChange(bool FromOutside);
	DYNAMIC void __fastcall DoChange(bool ClearRedo);
	DYNAMIC void __fastcall Selecting(void);
	void __fastcall AfterCaretMove(void);
	void __fastcall Change(void);
	void __fastcall InsertText(const AnsiString text);
	void __fastcall InsertStringTag(const AnsiString s, int Tag);
	bool __fastcall InsertRVFFromStreamEd(Classes::TStream* Stream);
	bool __fastcall InsertRVFFromFileEd(const AnsiString FileName);
	bool __fastcall InsertTextFromFile(const AnsiString FileName);
	bool __fastcall InsertOEMTextFromFile(const AnsiString FileName);
	bool __fastcall InsertItem(const AnsiString Name, Rvitem::TCustomRVItemInfo* Item);
	HIDESBASE void __fastcall InsertControl(const AnsiString Name, Controls::TControl* ctrl, Rvstyle::TRVVAlign 
		VAlign);
	void __fastcall InsertPicture(const AnsiString Name, Graphics::TGraphic* gr, Rvstyle::TRVVAlign VAlign
		);
	void __fastcall InsertHotPicture(const AnsiString Name, Graphics::TGraphic* gr, Rvstyle::TRVVAlign 
		VAlign);
	void __fastcall InsertBreak(Byte Width, Rvstyle::TRVBreakStyle Style, Graphics::TColor Color);
	void __fastcall InsertBullet(int ImageIndex, Controls::TImageList* ImageList);
	void __fastcall InsertHotspot(int ImageIndex, int HotImageIndex, Controls::TImageList* ImageList);
	DYNAMIC void __fastcall DeleteSelection(void);
	bool __fastcall CanDelete(void);
	__fastcall virtual TCustomRichViewEdit(Classes::TComponent* AOwner);
	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 PasteRTF(void);
	bool __fastcall CanPasteRTF(void);
	bool __fastcall InsertRTFFromStreamEd(Classes::TStream* Stream);
	bool __fastcall InsertRTFFromFileEd(const AnsiString FileName);
	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, Rvstyle::TRVBreakStyle &AStyle, Graphics::TColor 
		&AColor, int &ATag);
	void __fastcall GetCurrentBulletInfo(AnsiString &AName, int &AImageIndex, Controls::TImageList* &AImageList
		, int &ATag);
	void __fastcall GetCurrentHotspotInfo(AnsiString &AName, int &AImageIndex, int &AHotImageIndex, Controls::TImageList* 
		&AImageList, int &ATag);
	void __fastcall GetCurrentPictureInfo(AnsiString &AName, Graphics::TGraphic* &Agr, Rvstyle::TRVVAlign 
		&AVAlign, int &ATag);
	void __fastcall GetCurrentControlInfo(AnsiString &AName, Controls::TControl* &Actrl, Rvstyle::TRVVAlign 
		&AVAlign, int &ATag);
	void __fastcall GetCurrentTextInfo(AnsiString &AText, int &ATag);
	int __fastcall GetCurrentTag(void);
	AnsiString __fastcall GetCurrentItemText(void);
	Rvstyle::TCheckpointData __fastcall GetCurrentCheckpoint(void);
	void __fastcall SetBreakInfoEd(int ItemNo, Byte AWidth, Rvstyle::TRVBreakStyle AStyle, Graphics::TColor 
		AColor, int ATag);
	void __fastcall SetBulletInfoEd(int ItemNo, const AnsiString AName, int AImageIndex, Controls::TImageList* 
		AImageList, int ATag);
	void __fastcall SetHotspotInfoEd(int ItemNo, const AnsiString AName, int AImageIndex, int AHotImageIndex
		, Controls::TImageList* AImageList, int ATag);
	void __fastcall SetPictureInfoEd(int ItemNo, const AnsiString AName, Graphics::TGraphic* Agr, Rvstyle::TRVVAlign 
		AVAlign, int ATag);
	void __fastcall SetControlInfoEd(int ItemNo, const AnsiString AName, Rvstyle::TRVVAlign AVAlign, int 
		ATag);
	void __fastcall SetItemTagEd(int ItemNo, int ATag);
	void __fastcall SetItemTextEd(int ItemNo, const AnsiString s);
	void __fastcall SetCheckpointInfoEd(int ItemNo, int ATag, const AnsiString AName, bool ARaiseEvent)
		;
	void __fastcall RemoveCheckpointEd(int ItemNo);
	void __fastcall SetCurrentBreakInfo(Byte AWidth, Rvstyle::TRVBreakStyle AStyle, Graphics::TColor AColor
		, int ATag);
	void __fastcall SetCurrentBulletInfo(const AnsiString AName, int AImageIndex, Controls::TImageList* 
		AImageList, int ATag);
	void __fastcall SetCurrentHotspotInfo(const AnsiString AName, int AImageIndex, int AHotImageIndex, 
		Controls::TImageList* AImageList, int ATag);
	void __fastcall SetCurrentPictureInfo(const AnsiString AName, Graphics::TGraphic* Agr, Rvstyle::TRVVAlign 
		AVAlign, int ATag);
	void __fastcall SetCurrentControlInfo(const AnsiString AName, Rvstyle::TRVVAlign AVAlign, int ATag)
		;
	void __fastcall SetCurrentItemText(const AnsiString s);
	void __fastcall SetCurrentTag(int ATag);
	void __fastcall SetCurrentCheckpointInfo(int ATag, const AnsiString AName, bool ARaiseEvent);
	void __fastcall RemoveCurrentCheckpoint(void);
	void __fastcall ResizeControl(int ItemNo, int NewWidth, int NewHeight);
	void __fastcall ResizeCurrentControl(int NewWidth, int NewHeight);
	void __fastcall AdjustControlPlacement(int ItemNo);
	void __fastcall AdjustControlPlacement2(Controls::TControl* Control);
	HIDESBASE bool __fastcall SearchText(AnsiString s, TRVESearchOptions SrchOptions);
	void __fastcall SelectCurrentWord(void);
	void __fastcall SelectCurrentLine(void);
	void __fastcall BeginUpdate(void);
	void __fastcall EndUpdate(void);
	DYNAMIC void __fastcall Undo(void);
	DYNAMIC void __fastcall Redo(void);
	TRVUndoType __fastcall UndoAction(void);
	TRVUndoType __fastcall RedoAction(void);
	AnsiString __fastcall UndoName(void);
	AnsiString __fastcall RedoName(void);
	void __fastcall ClearUndo(void);
	void __fastcall SetUndoGroupMode(bool GroupUndo);
	void __fastcall BeginUndoGroup(TRVUndoType UndoType);
	void __fastcall BeginUndoCustomGroup(const AnsiString Name);
	void __fastcall BeforeUnicode(void);
	bool __fastcall InsertTextFromFileW(const AnsiString FileName);
	void __fastcall PasteTextW(void);
	void __fastcall InsertTextW(const WideString text);
	void __fastcall InsertStringWTag(const WideString s, int Tag);
	void __fastcall BeginItemModify(int ItemNo, int &ModifyData);
	void __fastcall EndItemModify(int ItemNo, int ModifyData);
	void __fastcall BeginCurrentItemModify(int &ModifyData);
	void __fastcall EndCurrentItemModify(int ModifyData);
	TCustomRichViewEdit* __fastcall GetActiveRichViewEdit(void);
	Rvitem::TCustomRVItemInfo* __fastcall GetCurrentItem(void);
	bool __fastcall GetCurrentItemEx(TMetaClass* RequiredClass, TCustomRichViewEdit* &ItemRichViewEdit, 
		Rvitem::TCustomRVItemInfo* &Item);
	bool __fastcall CanChange(void);
	HIDESBASE void __fastcall AssignEvents(Richview::TCustomRichView* Source);
	__property int CurItemNo = {read=GetCurItemNo, nodefault};
	__property int CurItemStyle = {read=GetCurItemStyle, nodefault};
	__property int CurParaStyleNo = {read=GetCurParaStyleNo, write=SetCurParaStyleNo, nodefault};
	__property int CurTextStyleNo = {read=GetCurTextStyleNo, write=SetCurTextStyleNo, nodefault};
	__property int OffsetInCurItem = {read=GetOffsetInCurItem, nodefault};
	__property TRVEditorOptions EditorOptions = {read=FEditorOptions, write=FEditorOptions, default=1};
		
	__property bool ReadOnly = {read=GetReadOnly, write=SetReadOnly, nodefault};
	__property int UndoLimit = {read=GetUndoLimit, write=SetUndoLimit, default=-1};
	__property TRVOnCaretGetOutEvent OnCaretGetOut = {read=FOnCaretGetOut, write=FOnCaretGetOut};
	__property TRVStyleConversionEvent OnStyleConversion = {read=FOnStyleConversion, write=FOnStyleConversion
		};
	__property OnMouseMove ;
public:
	#pragma option push -w-inl
	/* TCustomRichView.Destroy */ inline __fastcall virtual ~TCustomRichViewEdit(void) { }
	#pragma option pop
	
public:
	#pragma option push -w-inl
	/* TWinControl.CreateParented */ inline __fastcall TCustomRichViewEdit(HWND ParentWindow) : Richview::TCustomRichView(
		ParentWindow) { }
	#pragma option pop
	
};


class DELPHICLASS TRichViewEdit;
class PASCALIMPLEMENTATION TRichViewEdit : public TCustomRichViewEdit 
{
	typedef TCustomRichViewEdit inherited;
	
__published:
	__property EditorOptions ;
	__property ReadOnly ;
	__property UndoLimit ;
	__property OnCaretGetOut ;
	__property OnChange ;
	__property OnChanging ;
	__property OnCaretMove ;
	__property OnCurParaStyleChanged ;
	__property OnCurTextStyleChanged ;
	__property OnPaste ;
	__property OnStyleConversion ;
	__property TabNavigation ;
	__property Align ;
	__property Anchors ;
	__property Constraints ;
	__property Color ;
	__property Ctl3D ;
	__property DragMode ;
	__property Enabled ;
	__property HelpContext ;
	__property ParentCtl3D ;
	__property PopupMenu ;
	__property ShowHint ;
	__property TabOrder ;
	__property TabStop ;
	__property Visible ;
	__property OnClick ;
	__property OnContextPopup ;
	__property OnDragDrop ;
	__property OnDragOver ;
	__property OnEndDrag ;
	__property OnEnter ;
	__property OnExit ;
	__property OnKeyDown ;
	__property OnKeyPress ;
	__property OnKeyUp ;
	__property OnMouseMove ;
	__property OnMouseWheel ;
	__property OnMouseWheelDown ;
	__property OnMouseWheelUp ;
	__property OnResize ;
	__property OnStartDrag ;
	__property BackgroundBitmap ;
	__property BackgroundStyle ;
	__property BiDiMode ;
	__property BorderStyle ;
	__property BottomMargin ;
	__property CPEventKind  = {stored=false};
	__property Cursor ;
	__property Delimiters ;
	__property DoInPaletteMode ;
	__property FirstJumpNo ;
	__property HScrollVisible ;
	__property LeftMargin ;
	__property MaxTextWidth ;
	__property MinTextWidth ;
	__property Options ;
	__property RightMargin ;
	__property RTFOptions ;
	__property RTFReadProperties ;
	__property RVFOptions ;
	__property RVFParaStylesReadMode ;
	__property RVFTextStylesReadMode ;
	__property Style ;
	__property TopMargin ;
	__property Tracking ;
	__property VScrollVisible ;
	__property WheelStep ;
	__property OnControlAction ;
	__property OnCopy ;
	__property OnJump ;
	__property OnHScrolled ;
	__property OnHTMLSaveImage ;
	__property OnReadHyperlink ;
	__property OnRVDblClick ;
	__property OnRVFImageListNeeded ;
	__property OnRVFControlNeeded ;
	__property OnRVFPictureNeeded ;
	__property OnRVMouseDown ;
	__property OnRVMouseMove ;
	__property OnRVMouseUp ;
	__property OnRVRightClick ;
	__property OnSaveComponentToFile ;
	__property OnSelect ;
	__property OnURLNeeded ;
	__property OnVScrolled ;
	__property AllowSelection ;
	__property SingleClick ;
public:
	#pragma option push -w-inl
	/* TCustomRichViewEdit.Create */ inline __fastcall virtual TRichViewEdit(Classes::TComponent* AOwner
		) : TCustomRichViewEdit(AOwner) { }
	#pragma option pop
	
public:
	#pragma option push -w-inl
	/* TCustomRichView.Destroy */ inline __fastcall virtual ~TRichViewEdit(void) { }
	#pragma option pop
	
public:
	#pragma option push -w-inl
	/* TWinControl.CreateParented */ inline __fastcall TRichViewEdit(HWND ParentWindow) : TCustomRichViewEdit(
		ParentWindow) { }
	#pragma option pop
	
};


//-- var, const, procedure ---------------------------------------------------
static const Word WM_RVUNDOFROMINPLACE = 0x40d;
static const Word WM_RVREDOFROMINPLACE = 0x40e;
#define DEFAULT_RVEDITOROPTIONS (System::Set<TRVEditorOption, rvoClearTagOnStyleApp, rvoHideReadOnlyCaret> () \
	)

}	/* namespace Rvedit */
#if !defined(NO_IMPLICIT_NAMESPACE_USE)
using namespace Rvedit;
#endif
#pragma option pop	// -w-
#pragma option pop	// -Vx

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