// CodeGear C++Builder
// Copyright (c) 1995, 2020 by Embarcadero Technologies, Inc.
// All rights reserved

// (DO NOT EDIT: machine generated header) 'QImport3TXTView.pas' rev: 34.00 (Windows)

#ifndef Qimport3txtviewHPP
#define Qimport3txtviewHPP

#pragma delphiheader begin
#pragma option push
#pragma option -w-      // All warnings off
#pragma option -Vx      // Zero-length empty class member 
#pragma pack(push,8)
#include <System.hpp>
#include <SysInit.hpp>
#include <System.WideStrings.hpp>
#include <QImport3WideStringCanvas.hpp>
#include <QImport3CustomControl.hpp>
#include <System.Classes.hpp>
#include <Vcl.Controls.hpp>
#include <Vcl.Graphics.hpp>
#include <Vcl.StdCtrls.hpp>
#include <System.SysUtils.hpp>
#include <System.UITypes.hpp>
#include <Winapi.Messages.hpp>
#include <Winapi.Windows.hpp>
#include <QImport3StrIDs.hpp>
#include <QImport3ASCII.hpp>
#include <QImport3Encoding.hpp>
#include <QImport3Common.hpp>
#include <System.Types.hpp>

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

namespace Qimport3txtview
{
//-- forward type declarations -----------------------------------------------
class DELPHICLASS TViewArrow;
class DELPHICLASS TViewArrows;
class DELPHICLASS TViewRuler;
class DELPHICLASS TViewSelection;
class DELPHICLASS TQImport3TXTViewer;
//-- type declarations -------------------------------------------------------
#pragma pack(push,4)
class PASCALIMPLEMENTATION TViewArrow : public System::Classes::TCollectionItem
{
	typedef System::Classes::TCollectionItem inherited;
	
private:
	int FPosition;
	void __fastcall SetPosition(int Value);
	
public:
	__fastcall virtual TViewArrow(System::Classes::TCollection* Collection);
	virtual void __fastcall Assign(System::Classes::TPersistent* Source);
	__property int Position = {read=FPosition, write=SetPosition, nodefault};
public:
	/* TCollectionItem.Destroy */ inline __fastcall virtual ~TViewArrow() { }
	
};

#pragma pack(pop)

#pragma pack(push,4)
class PASCALIMPLEMENTATION TViewArrows : public System::Classes::TCollection
{
	typedef System::Classes::TCollection inherited;
	
public:
	TViewArrow* operator[](int Index) { return this->Items[Index]; }
	
private:
	TQImport3TXTViewer* FViewer;
	HIDESBASE TViewArrow* __fastcall GetItem(int Index);
	HIDESBASE void __fastcall SetItem(int Index, TViewArrow* Value);
	
public:
	__fastcall TViewArrows(TQImport3TXTViewer* Viewer);
	HIDESBASE TViewArrow* __fastcall Add();
	bool __fastcall FindBetweenExcept(int Start, int Finish, int ExceptIndex, int &Index);
	bool __fastcall FindLeftAndRight(int Position, int &Left, int &Right);
	bool __fastcall FindByPosition(int Position);
	__property TViewArrow* Items[int Index] = {read=GetItem, write=SetItem/*, default*/};
public:
	/* TCollection.Destroy */ inline __fastcall virtual ~TViewArrows() { }
	
};

#pragma pack(pop)

enum DECLSPEC_DENUM TViewRulerAlign : unsigned char { raTop, raBottom };

class PASCALIMPLEMENTATION TViewRuler : public Vcl::Controls::TGraphicControl
{
	typedef Vcl::Controls::TGraphicControl inherited;
	
private:
	TViewRulerAlign FAlign;
	int FOffset;
	int FStep;
	HIDESBASE void __fastcall SetAlign(const TViewRulerAlign Value);
	void __fastcall SetOffset(int Value);
	void __fastcall SetStep(int Value);
	HIDESBASE MESSAGE void __fastcall CMColorChanged(Winapi::Messages::TMessage &Message);
	
protected:
	virtual void __fastcall Paint();
	__property int Offset = {read=FOffset, write=SetOffset, nodefault};
	__property int Step = {read=FStep, write=SetStep, nodefault};
	
public:
	__fastcall virtual TViewRuler(System::Classes::TComponent* AOwner);
	__property TViewRulerAlign Align = {read=FAlign, write=SetAlign, nodefault};
	__property Color = {default=-16777211};
public:
	/* TGraphicControl.Destroy */ inline __fastcall virtual ~TViewRuler() { }
	
};


class PASCALIMPLEMENTATION TViewSelection : public System::TObject
{
	typedef System::TObject inherited;
	
private:
	TQImport3TXTViewer* FViewer;
	System::Types::TRect FVisibleRect;
	TViewArrow* FLeftArrow;
	TViewArrow* FRightArrow;
	bool FInverted;
	System::Classes::TNotifyEvent FOnChange;
	bool __fastcall GetExists();
	void __fastcall Update();
	
public:
	__fastcall TViewSelection(TQImport3TXTViewer* Viewer);
	void __fastcall SetSelection(TViewArrow* Left, TViewArrow* Right);
	__property TQImport3TXTViewer* Viewer = {read=FViewer};
	__property TViewArrow* LeftArrow = {read=FLeftArrow, write=FLeftArrow};
	__property TViewArrow* RightArrow = {read=FRightArrow, write=FRightArrow};
	__property bool Exists = {read=GetExists, nodefault};
	__property System::Types::TRect VisibleRect = {read=FVisibleRect};
	__property System::Classes::TNotifyEvent OnChange = {read=FOnChange, write=FOnChange};
public:
	/* TObject.Destroy */ inline __fastcall virtual ~TViewSelection() { }
	
};


typedef void __fastcall (__closure *TDeleteArrowEvent)(System::TObject* Sender, int Position);

typedef void __fastcall (__closure *TMoveArrowEvent)(System::TObject* Sender, int OldPos, int NewPos);

typedef void __fastcall (__closure *TIntersectArrowsEvent)(System::TObject* Sender, int Position);

class PASCALIMPLEMENTATION TQImport3TXTViewer : public Qimport3customcontrol::TEmsCustomControl
{
	typedef Qimport3customcontrol::TEmsCustomControl inherited;
	
private:
	Qimport3ascii::TQImport3ASCII* FImport;
	Qimport3encoding::TQICharsetType FCharset;
	System::Uitypes::TScrollStyle FScrollBars;
	int FCharWidth;
	int FCharHeight;
	int FRealHeight;
	int FRealLeft;
	int FRealTop;
	int FRealWidth;
	TViewRuler* FTopRuler;
	TViewRuler* FBottomRuler;
	System::Widestrings::TWideStrings* FLinesW;
	int FLineCount;
	int FMaxLineLength;
	TViewArrows* FArrows;
	TViewArrow* FActiveArrow;
	TViewSelection* FSelection;
	System::Classes::TNotifyEvent FOnChangeSelection;
	TDeleteArrowEvent FOnDeleteArrow;
	TMoveArrowEvent FOnMoveArrow;
	TIntersectArrowsEvent FOnIntersectArrows;
	void __fastcall SetScrollBars(const System::Uitypes::TScrollStyle Value);
	TViewRuler* __fastcall CreateRuler(TViewRulerAlign Align);
	int __fastcall GetFullWidth();
	int __fastcall GetFullHeight();
	HIDESBASE MESSAGE void __fastcall WMHScroll(Winapi::Messages::TWMScroll &Msg);
	HIDESBASE MESSAGE void __fastcall WMVScroll(Winapi::Messages::TWMScroll &Msg);
	int __fastcall GetNewArrowPosition(int X);
	void __fastcall ChangeSelection(System::TObject* Sender);
	
protected:
	virtual void __fastcall CreateParams(Vcl::Controls::TCreateParams &Params);
	void __fastcall DrawRulers();
	void __fastcall DrawLines();
	void __fastcall DrawArrow(int Index);
	void __fastcall DrawArrows();
	virtual void __fastcall Paint();
	DYNAMIC void __fastcall MouseMove(System::Classes::TShiftState Shift, int X, int Y);
	DYNAMIC void __fastcall MouseUp(System::Uitypes::TMouseButton Button, System::Classes::TShiftState Shift, int X, int Y);
	__property System::Uitypes::TScrollStyle ScrollBars = {read=FScrollBars, write=SetScrollBars, nodefault};
	
public:
	__fastcall virtual TQImport3TXTViewer(System::Classes::TComponent* AOwner);
	__fastcall virtual ~TQImport3TXTViewer();
	void __fastcall LoadFromFile(const System::UnicodeString AFileName);
	void __fastcall SetSelection(int Pos, int Size);
	void __fastcall GetSelection(int &Pos, int &Size);
	void __fastcall AddArrow(int Pos);
	void __fastcall DeleteArrows();
	DYNAMIC void __fastcall MouseDown(System::Uitypes::TMouseButton Button, System::Classes::TShiftState Shift, int X, int Y);
	__property TViewArrows* Arrows = {read=FArrows};
	__property int RealLeft = {read=FRealLeft, nodefault};
	__property int LineCount = {read=FLineCount, write=FLineCount, nodefault};
	__property int CharWidth = {read=FCharWidth, nodefault};
	__property System::Classes::TNotifyEvent OnChangeSelection = {read=FOnChangeSelection, write=FOnChangeSelection};
	__property TDeleteArrowEvent OnDeleteArrow = {read=FOnDeleteArrow, write=FOnDeleteArrow};
	__property TMoveArrowEvent OnMoveArrow = {read=FOnMoveArrow, write=FOnMoveArrow};
	__property TIntersectArrowsEvent OnIntersectArrows = {read=FOnIntersectArrows, write=FOnIntersectArrows};
	__property Qimport3ascii::TQImport3ASCII* Import = {read=FImport, write=FImport};
	__property Qimport3encoding::TQICharsetType Charset = {read=FCharset, write=FCharset, nodefault};
	__property OnDragDrop;
	__property OnDragOver;
	__property OnResize;
	__property System::Widestrings::TWideStrings* Lines = {read=FLinesW};
public:
	/* TWinControl.CreateParented */ inline __fastcall TQImport3TXTViewer(HWND ParentWindow) : Qimport3customcontrol::TEmsCustomControl(ParentWindow) { }
	
};


//-- var, const, procedure ---------------------------------------------------
}	/* namespace Qimport3txtview */
#if !defined(DELPHIHEADER_NO_IMPLICIT_NAMESPACE_USE) && !defined(NO_USING_NAMESPACE_QIMPORT3TXTVIEW)
using namespace Qimport3txtview;
#endif
#pragma pack(pop)
#pragma option pop

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