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

// (DO NOT EDIT: machine generated header) 'IEMView.pas' rev: 3.00

#ifndef IEMViewHPP
#define IEMViewHPP
#include <Menus.hpp>
#include <ImageEnIO.hpp>
#include <ImageEnProc.hpp>
#include <ImageEnView.hpp>
#include <iedefs.hpp>
#include <IEUtils.hpp>
#include <StdCtrls.hpp>
#include <Clipbrd.hpp>
#include <ExtCtrls.hpp>
#include <Dialogs.hpp>
#include <Forms.hpp>
#include <Controls.hpp>
#include <Graphics.hpp>
#include <Classes.hpp>
#include <SysUtils.hpp>
#include <Messages.hpp>
#include <Windows.hpp>
#include <SysInit.hpp>
#include <System.hpp>

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

namespace Iemview
{
//-- type declarations -------------------------------------------------------
typedef void __fastcall (__closure *TIEImageSelectEvent)(System::TObject* Sender, int idx);

typedef void __fastcall (__closure *TIEImageIDRequestEvent)(System::TObject* Sender, int ID, Graphics::TBitmap* 
	&Bitmap);

typedef void __fastcall (__closure *TIEMProgressEvent)(System::TObject* Sender, int per, int idx);

typedef void __fastcall (__closure *TIEImageDrawEvent)(System::TObject* Sender, int idx, int Left, int 
	Top, Graphics::TCanvas* Canvas);

enum TIEStoreType { ietNormal, ietThumb };

struct TIEImageInfo
{
	int hbi;
	int BmpCount;
	int X;
	int Y;
	int row;
	int col;
	Graphics::TColor Background;
	char *name;
	int ID;
	int DTime;
} ;

typedef TIEImageInfo *PIEImageInfo;

enum TIEMMouseInteractItems { mmiScroll, mmiSelect };

typedef Set<TIEMMouseInteractItems, mmiScroll, mmiSelect>  TIEMMouseInteract;

enum TIEMKeyInteractItems { mkiMoveSelected };

typedef Set<TIEMKeyInteractItems, mkiMoveSelected, mkiMoveSelected>  TIEMKeyInteract;

enum TIEMDisplayMode { mdGrid, mdSingle };

enum TIESeek { iskLeft, iskRight, iskUp, iskDown, iskFirst, iskLast, iskPagDown, iskPagUp };

class DELPHICLASS TImageEnMView;
class PASCALIMPLEMENTATION TImageEnMView : public Imageenview::TIEView 
{
	typedef Imageenview::TIEView inherited;
	
private:
	int fHSVX1;
	int fHSVY1;
	TScrollStyle fScrollBars;
	int fViewX;
	int fViewY;
	Classes::TList* fImage;
	Classes::TList* fImageInfo;
	TIEStoreType fStoreType;
	int fThumbWidth;
	int fThumbHeight;
	int fHorizBorder;
	int fVertBorder;
	int fVWidth;
	int fVHeight;
	Imageenview::TViewChangeEvent fOnViewChange;
	TIEMProgressEvent fOnDrawProgress;
	int fHDrawDib;
	TIEImageIDRequestEvent fOnImageIDRequest;
	TIEImageDrawEvent fOnImageDraw;
	Iedefs::TProgressEvent fOnIOProgress;
	int fBottomGap;
	int fUpperGap;
	TIEMDisplayMode fDisplayMode;
	int fGridWidth;
	int fHSX1;
	int fHSY1;
	Imageenio::TImageEnIO* fImageEnIO;
	int fLockPaint;
	int fSelectedItem;
	bool fVisibleSelection;
	int fSelectionWidth;
	Graphics::TColor fSelectionColor;
	TIEImageSelectEvent fOnImageSelect;
	TIEMMouseInteract fMouseInteract;
	TIEMKeyInteract fKeyInteract;
	bool fPlaying;
	int fPlayTimer;
	bool fPlayLoop;
	bool fTimerInProgress;
	int fFrame;
	TIEMDisplayMode fSaveDM;
	int fSaveSel;
	int fLastImOp;
	int fLastImIdx;
	void __fastcall GetMaxViewXY(int &mx, int &my);
	void __fastcall SetViewX(int v);
	void __fastcall SetViewY(int v);
	int __fastcall GetImageX(int idx);
	int __fastcall GetImageY(int idx);
	int __fastcall GetImageCol(int idx);
	int __fastcall GetImageRow(int idx);
	void __fastcall SetThumbWidth(int v);
	void __fastcall SetThumbHeight(int v);
	int __fastcall GetImageCount(void);
	void __fastcall SetImageFileName(int idx, System::AnsiString v);
	System::AnsiString __fastcall GetImageFileName(int idx);
	void __fastcall SetImageID(int idx, int v);
	int __fastcall GetImageID(int idx);
	void __fastcall SetHorizBorder(int v);
	void __fastcall SetVertBorder(int v);
	bool __fastcall DeleteImageNU(int idx);
	void __fastcall SetVisibleSelection(bool v);
	void __fastcall SetSelectionWidth(int v);
	void __fastcall SetSelectionColor(Graphics::TColor v);
	void __fastcall SetSelectedItem(int v);
	void __fastcall SetBottomGap(int v);
	void __fastcall SetUpperGap(int v);
	void __fastcall SetImageBackground(int idx, Graphics::TColor v);
	Graphics::TColor __fastcall GetImageBackground(int idx);
	void __fastcall SetImageDelayTime(int idx, int v);
	int __fastcall GetImageDelayTime(int idx);
	void __fastcall ObtainImage(int idx);
	void __fastcall SetDisplayMode(TIEMDisplayMode v);
	void __fastcall SetGridWidth(int v);
	void __fastcall SetPlaying(bool v);
	void __fastcall PlayFrame(void);
	void __fastcall FreeImage(int idx);
	void __fastcall DecBmpCount(int idx);
	void __fastcall SetImageNU(int idx, Graphics::TBitmap* v);
	void __fastcall SetSelectedItemNU(int v);
	void __fastcall DeselectNU(void);
	void __fastcall SetVisibleFrame(int v);
	TIEMMouseInteract __fastcall GetMouseInteract(void);
	TIEMKeyInteract __fastcall GetKeyInteract(void);
	
protected:
	virtual void __fastcall SetScrollBars(Stdctrls::TScrollStyle v);
	HIDESBASE MESSAGE void __fastcall WMSize(Messages::TWMSize &Message);
	HIDESBASE MESSAGE void __fastcall WMEraseBkgnd(Messages::TMessage &Message);
	HIDESBASE MESSAGE void __fastcall WMVScroll(Messages::TMessage &Message);
	HIDESBASE MESSAGE void __fastcall WMHScroll(Messages::TMessage &Message);
	MESSAGE void __fastcall WMTimer(Messages::TWMTimer &Message);
	MESSAGE void __fastcall CMWantSpecialKey(Messages::TWMKey &Msg);
	DYNAMIC void __fastcall MouseDown(Controls::TMouseButton Button, Classes::TShiftState Shift, int X, 
		int Y);
	DYNAMIC void __fastcall MouseMove(Classes::TShiftState Shift, int X, int Y);
	DYNAMIC void __fastcall MouseUp(Controls::TMouseButton Button, Classes::TShiftState Shift, int X, int 
		Y);
	HIDESBASE MESSAGE void __fastcall WMLButtonDblClk(Messages::TWMMouse &Message);
	HIDESBASE MESSAGE void __fastcall WMKillFocus(Messages::TWMKillFocus &Msg);
	HIDESBASE MESSAGE void __fastcall WMSetFocus(Messages::TWMSetFocus &Msg);
	virtual void __fastcall ViewChange(int c);
	DYNAMIC bool __fastcall PaletteChanged(bool Foreground);
	virtual void __fastcall SetBackGround(Graphics::TColor cl);
	virtual Graphics::TBitmap* __fastcall GetFBitmap(void);
	virtual void __fastcall SetMouseInteract(TIEMMouseInteract v);
	virtual void __fastcall SetKeyInteract(TIEMKeyInteract v);
	int __fastcall GetImageWidth(int idx);
	int __fastcall GetImageHeight(int idx);
	DYNAMIC void __fastcall KeyDown(Word &Key, Classes::TShiftState Shift);
	DYNAMIC void __fastcall KeyUp(Word &Key, Classes::TShiftState Shift);
	
public:
	__fastcall virtual TImageEnMView(Classes::TComponent* Owner);
	__fastcall virtual ~TImageEnMView(void);
	virtual void __fastcall Update(void);
	HIDESBASE virtual void __fastcall PaintTo(Graphics::TCanvas* Canvas);
	virtual void __fastcall Paint(void);
	__property ClientWidth ;
	__property ClientHeight ;
	__property int ViewX = {read=fViewX, write=SetViewX, nodefault};
	__property int ViewY = {read=fViewY, write=SetViewY, nodefault};
	void __fastcall SetViewXY(int x, int y);
	void __fastcall CenterSelected(void);
	void __fastcall CenterFrame(void);
	void __fastcall LockPaint(void);
	int __fastcall UnLockPaint(void);
	int __fastcall NPUnLockPaint(void);
	__property int LockPaintCount = {read=fLockPaint, nodefault};
	__property MouseCapture ;
	virtual void __fastcall Assign(Classes::TPersistent* Source);
	virtual void __fastcall SetBounds(int ALeft, int ATop, int AWidth, int AHeight);
	int __fastcall GetLastOp(void);
	int __fastcall GetLastOpIdx(void);
	__property int ImageWidth[int idx] = {read=GetImageWidth};
	__property int ImageHeight[int idx] = {read=GetImageHeight};
	__property int ImageX[int idx] = {read=GetImageX};
	__property int ImageY[int idx] = {read=GetImageY};
	__property int ImageRow[int idx] = {read=GetImageRow};
	__property int ImageCol[int idx] = {read=GetImageCol};
	__property System::AnsiString ImageFileName[int idx] = {read=GetImageFileName, write=SetImageFileName
		};
	__property int ImageID[int idx] = {read=GetImageID, write=SetImageID};
	__property Graphics::TColor ImageBackground[int idx] = {read=GetImageBackground, write=SetImageBackground
		};
	__property int ImageDelayTime[int idx] = {read=GetImageDelayTime, write=SetImageDelayTime};
	void __fastcall UpdateImage(int idx);
	void __fastcall InsertImage(int idx);
	int __fastcall AppendImage(void);
	void __fastcall DeleteImage(int idx);
	__property int ImageCount = {read=GetImageCount, nodefault};
	void __fastcall UpdateCoords(void);
	void __fastcall SetImage(int idx, Graphics::TBitmap* v);
	void __fastcall SetImageRect(int idx, Graphics::TBitmap* v, int x1, int y1, int x2, int y2);
	void __fastcall Clear(void);
	Graphics::TBitmap* __fastcall GetBitmap(int idx);
	int __fastcall GetBitmapInfo(int idx);
	void __fastcall ReleaseBitmap(int idx);
	int __fastcall GetImageVisibility(int idx);
	int __fastcall ImageAtPos(int x, int y);
	__property int SelectedImage = {read=fSelectedItem, write=SetSelectedItem, nodefault};
	void __fastcall Deselect(void);
	void __fastcall SelectSeek(TIESeek pos);
	__property bool Playing = {read=fPlaying, write=SetPlaying, nodefault};
	__property bool PlayLoop = {read=fPlayLoop, write=fPlayLoop, nodefault};
	__property int VisibleFrame = {read=fFrame, write=SetVisibleFrame, nodefault};
	
__published:
	__property Stdctrls::TScrollStyle ScrollBars = {read=fScrollBars, write=SetScrollBars, default=0};
	__property TIEStoreType StoreType = {read=fStoreType, write=fStoreType, default=0};
	__property int ThumbWidth = {read=fThumbWidth, write=SetThumbWidth, default=100};
	__property int ThumbHeight = {read=fThumbHeight, write=SetThumbHeight, default=100};
	__property int HorizBorder = {read=fHorizBorder, write=SetHorizBorder, default=4};
	__property int VertBorder = {read=fVertBorder, write=SetVertBorder, default=4};
	__property int BottomGap = {read=fBottomGap, write=SetBottomGap, default=0};
	__property int UpperGap = {read=fUpperGap, write=SetUpperGap, default=0};
	__property Imageenview::TViewChangeEvent OnViewChange = {read=fOnViewChange, write=fOnViewChange};
	__property TIEImageIDRequestEvent OnImageIDRequest = {read=fOnImageIDRequest, write=fOnImageIDRequest
		};
	__property TIEImageDrawEvent OnImageDraw = {read=fOnImageDraw, write=fOnImageDraw};
	__property TIEImageSelectEvent OnImageSelect = {read=fOnImageSelect, write=fOnImageSelect};
	__property Iedefs::TProgressEvent OnIOProgress = {read=fOnIOProgress, write=fOnIOProgress};
	__property TIEMProgressEvent OnDrawProgress = {read=fOnDrawProgress, write=fOnDrawProgress};
	__property bool VisibleSelection = {read=fVisibleSelection, write=SetVisibleSelection, default=1};
	__property TIEMMouseInteract MouseInteract = {read=GetMouseInteract, write=SetMouseInteract, default=2
		};
	__property TIEMKeyInteract KeyInteract = {read=GetKeyInteract, write=SetKeyInteract, default=1};
	__property TIEMDisplayMode DisplayMode = {read=fDisplayMode, write=SetDisplayMode, default=0};
	__property int GridWidth = {read=fGridWidth, write=SetGridWidth, default=0};
	__property int SelectionWidth = {read=fSelectionWidth, write=SetSelectionWidth, nodefault};
	__property Graphics::TColor SelectionColor = {read=fSelectionColor, write=SetSelectionColor, nodefault
		};
	__property Align ;
	__property DragCursor ;
	__property DragMode ;
	__property Enabled ;
	__property ParentShowHint ;
	__property PopupMenu ;
	__property ShowHint ;
	__property Visible ;
	__property TabOrder ;
	__property TabStop ;
	__property OnClick ;
	__property OnDblClick ;
	__property OnDragDrop ;
	__property OnDragOver ;
	__property OnEndDrag ;
	__property OnMouseDown ;
	__property OnMouseMove ;
	__property OnMouseUp ;
	__property OnStartDrag ;
	__property OnKeyDown ;
	__property OnKeyPress ;
	__property OnKeyUp ;
public:
	/* TWinControl.CreateParented */ __fastcall TImageEnMView(HWND ParentWindow) : Imageenview::TIEView(
		ParentWindow) { }
	
};

//-- var, const, procedure ---------------------------------------------------

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