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

// (DO NOT EDIT: machine generated header) 'iemio.pas' rev: 30.00 (Windows)

#ifndef IemioHPP
#define IemioHPP

#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 <Winapi.Windows.hpp>
#include <Winapi.Messages.hpp>
#include <System.SysUtils.hpp>
#include <System.Classes.hpp>
#include <Vcl.Graphics.hpp>
#include <Vcl.Controls.hpp>
#include <Vcl.Forms.hpp>
#include <Vcl.Printers.hpp>
#include <System.UITypes.hpp>
#include <imageenview.hpp>
#include <imageenproc.hpp>
#include <Vcl.ExtCtrls.hpp>
#include <hyiedefs.hpp>
#include <imageenio.hpp>
#include <ieview.hpp>
#include <ietwain.hpp>
#include <iexAcquire.hpp>
#include <iexDCIM.hpp>
#include <iewia.hpp>
#include <hyieutils.hpp>
#include <pcxfilter.hpp>

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

namespace Iemio
{
//-- forward type declarations -----------------------------------------------
class DELPHICLASS TImageEnMIO;
//-- type declarations -------------------------------------------------------
class PASCALIMPLEMENTATION TImageEnMIO : public System::Classes::TComponent
{
	typedef System::Classes::TComponent inherited;
	
private:
	Ieview::TIEView* fImageEnMView;
	void *fImageEnMViewBitmapChangeHandle;
	System::Classes::TList* fParams;
	bool fSimplifiedParamsDialogs;
	Iexacquire::TIEAcquireParams* fAcquireParams;
	Ietwain::TIETwainParams* fTwainParams;
	Iexdcim::TIEDcimAcquire* fDCIMParams;
	Iewia::TIEWia* fWIA;
	Imageenio::TIOPreviewsParams fPreviewsParams;
	Vcl::Graphics::TFont* fPreviewFont;
	bool fPreviewFontEnabled;
	int fTwainNextToInsert;
	bool fAutoAdjustDPI;
	bool fFilteredAdjustDPI;
	Hyieutils::TIEDitherMethod fDefaultDitherMethod;
	bool fResetPrinter;
	Imageenio::TIEDialogsMeasureUnit fDialogsMeasureUnit;
	bool fNativePixelFormat;
	Hyiedefs::TResampleFilter fPrintingFilterOnSubsampling;
	Imageenio::TIEDoPreviewsEvent fOnDoPreviews;
	System::UnicodeString fLoadingFileName;
	System::UnicodeString fLastFilename;
	bool fAllowMalformedPages;
	void *fgrec;
	System::UnicodeString fProxyAddress;
	System::UnicodeString fProxyUser;
	System::UnicodeString fProxyPassword;
	Imageenio::TIOPrintPreviewParams* fPrintPreviewParams;
	void __fastcall SetAttachedMView(Ieview::TIEView* v);
	void __fastcall RemoveIOParam(int idx);
	void __fastcall InsertIOParam(int idx);
	void __fastcall MoveIOParams(int idx, int destination);
	void __fastcall SwapIOParams(int idx1, int idx2);
	Imageenio::TIOParamsVals* __fastcall GetParams(int idx);
	void __fastcall SetPreviewFont(Vcl::Graphics::TFont* f);
	void __fastcall SetPreviewFontEnabled(bool Value);
	int __fastcall GetParamsCount(void);
	void __fastcall SetIOPreviewParams(Imageenio::TIOPreviewsParams v);
	Imageenio::TIOPreviewsParams __fastcall GetIOPreviewParams(void);
	void __fastcall PrintImagesEx(Vcl::Graphics::TCanvas* PrtCanvas, int dpix, int dpiy, double pagewidth, double pageheight, bool bPreview, int Columns, int Rows, double HorizSpace, double VertSpace, bool PrintSelected, double MarginLeft, double MarginTop, double MarginRight, double MarginBottom, bool DrawBox, bool DrawText, bool DrawShadow, System::Uitypes::TColor BoxColor = (System::Uitypes::TColor)(0x0), int iPageNo = 0x0);
	System::UnicodeString __fastcall GetImageEnVersion(void);
	void __fastcall SetImageEnVersion(System::UnicodeString Value);
	void __fastcall SetAborting(bool Value);
	
protected:
	bool fAborting;
	Hyiedefs::TIEProgressEvent fOnProgress;
	Imageenio::TIEAcquireBitmapEvent fOnAcquireBitmap;
	System::Classes::TNotifyEvent fOnAcquireClose;
	Imageenio::TIEAfterAcquireBitmapEvent fOnAfterAcquireBitmap;
	System::Classes::TNotifyEvent fOnFinishWork;
	virtual void __fastcall Notification(System::Classes::TComponent* AComponent, System::Classes::TOperation Operation);
	void __fastcall OnBitmapChange(System::TObject* Sender, bool destroying);
	virtual void __fastcall DoFinishWork(void);
	void __fastcall CheckDPI(Imageenio::TIOParamsVals* p);
	virtual void __fastcall TWMultiCallBack(Hyieutils::TIEBitmap* Bitmap, System::TObject* &IOParams, int ImDpiX, int ImDpiY);
	virtual void __fastcall TWCloseCallBack(void);
	virtual Iewia::TIEWia* __fastcall GetWIAParams(void);
	bool __fastcall WiaOnProgress(int Percentage);
	Iexacquire::TIEAcquireSource __fastcall GetSelectedAcquireSource(void);
	
public:
	__fastcall virtual TImageEnMIO(System::Classes::TComponent* Owner);
	__fastcall virtual ~TImageEnMIO(void);
	void __fastcall Update(void);
	__property Hyieutils::TIEDitherMethod DefaultDitherMethod = {read=fDefaultDitherMethod, write=fDefaultDitherMethod, nodefault};
	__property Imageenio::TIOParamsVals* Params[int idx] = {read=GetParams};
	__property int ParamsCount = {read=GetParamsCount, nodefault};
	void __fastcall DuplicateCompressionInfo(void);
	__property System::UnicodeString LastFilename = {read=fLastFilename};
	__property bool AllowMalformedPages = {read=fAllowMalformedPages, write=fAllowMalformedPages, nodefault};
	bool __fastcall DoPreviews(int idx, Imageenio::TPreviewParams pp);
	__property Iexacquire::TIEAcquireParams* AcquireParams = {read=fAcquireParams};
	__property Ietwain::TIETwainParams* TwainParams = {read=fTwainParams};
	__property Iexdcim::TIEDcimAcquire* DCIMParams = {read=fDCIMParams};
	__property Iewia::TIEWia* WIAParams = {read=GetWIAParams};
	__property bool Aborting = {read=fAborting, write=SetAborting, nodefault};
	bool __fastcall LoadFromFileGIF(const System::UnicodeString FileName);
	bool __fastcall LoadFromStreamGIF(System::Classes::TStream* Stream);
	void __fastcall SaveToFileGIF(const System::UnicodeString FileName, bool SelectedOnly = false);
	void __fastcall SaveToStreamGIF(System::Classes::TStream* Stream, bool SelectedOnly = false);
	bool __fastcall LoadFromFileDCX(const System::UnicodeString FileName);
	bool __fastcall LoadFromStreamDCX(System::Classes::TStream* Stream);
	void __fastcall SaveToFileDCX(const System::UnicodeString FileName, bool SelectedOnly = false);
	void __fastcall SaveToStreamDCX(System::Classes::TStream* Stream, bool SelectedOnly = false);
	bool __fastcall LoadFromFileDICOM(const System::UnicodeString FileName);
	bool __fastcall LoadFromStreamDICOM(System::Classes::TStream* Stream);
	void __fastcall SaveToFileDICOM(const System::UnicodeString FileName, bool SelectedOnly = false);
	void __fastcall SaveToStreamDICOM(System::Classes::TStream* Stream, bool SelectedOnly = false);
	bool __fastcall LoadFromFileTIFF(const System::UnicodeString FileName);
	bool __fastcall LoadFromStreamTIFF(System::Classes::TStream* Stream);
	void __fastcall SaveToFileTIFF(const System::UnicodeString FileName, bool SelectedOnly = false);
	void __fastcall SaveToStreamTIFF(System::Classes::TStream* Stream, bool SelectedOnly = false);
	bool __fastcall LoadFromFileAVI(const System::UnicodeString FileName);
	void __fastcall SaveToFileAVI(const System::UnicodeString FileName, const System::AnsiString Codec = System::AnsiString(), bool SelectedOnly = false);
	void __fastcall SaveToFilePS(const System::UnicodeString FileName, bool SelectedOnly = false);
	void __fastcall SaveToStreamPS(System::Classes::TStream* Stream, bool SelectedOnly = false);
	void __fastcall SaveToFilePDF(const System::UnicodeString FileName, bool SelectedOnly = false);
	void __fastcall SaveToStreamPDF(System::Classes::TStream* Stream, bool SelectedOnly = false);
	bool __fastcall LoadFromFileICO(const System::UnicodeString FileName);
	bool __fastcall LoadFromStreamICO(System::Classes::TStream* Stream);
	void __fastcall SaveToFileICO(const System::UnicodeString FileName, bool SelectedOnly = false);
	void __fastcall SaveToStreamICO(System::Classes::TStream* Stream, bool SelectedOnly = false);
	bool __fastcall LoadFromURL(System::UnicodeString URL);
	bool __fastcall LoadFromMediaFile(const System::UnicodeString FileName);
	bool __fastcall Acquire(void);
	bool __fastcall SelectAcquireSource(Iexacquire::TIEAcquireApis Apis = (Iexacquire::TIEAcquireApis() << Iexacquire::TIEAcquireApi::ieaTwain << Iexacquire::TIEAcquireApi::ieaWIA << Iexacquire::TIEAcquireApi::ieaDCIM ));
	bool __fastcall SetAcquireSource(Iexacquire::TIEAcquireApi Api, const System::Variant &Location);
	__property Iexacquire::TIEAcquireSource SelectedAcquireSource = {read=GetSelectedAcquireSource};
	bool __fastcall TwainAcquireOpen(void);
	void __fastcall TwainAcquireClose(void);
	bool __fastcall AcquireOpen(void);
	void __fastcall AcquireClose(void);
	void __fastcall InitializeAcquireSource(bool bIncludeWIA);
	void __fastcall LoadFromBuffer(void * Buffer, int BufferSize, int Format = 0x0);
	bool __fastcall LoadFromFile(const System::UnicodeString FileName, bool bCheckUnknown = false);
	void __fastcall LoadFromFiles(const System::UnicodeString FileName, bool AutoDetect = false, bool LoadWhenViewed = false);
	void __fastcall SaveToFile(const System::UnicodeString FileName, bool SelectedOnly = false);
	bool __fastcall LoadFromFileFormat(const System::UnicodeString FileName, int FileFormat);
	bool __fastcall LoadFromFileAuto(const System::UnicodeString FileName);
	bool __fastcall LoadFromStream(System::Classes::TStream* Stream);
	bool __fastcall LoadFromStreamFormat(System::Classes::TStream* Stream, int FileFormat);
	System::UnicodeString __fastcall ExecuteOpenDialog(const System::WideString InitialDir = System::WideString(), const System::WideString InitialFileName = System::WideString(), bool AlwaysAnimate = false, int FilterIndex = 0x0, const System::WideString ExtendedFilters = System::WideString(), bool MultiSelect = false, const System::WideString Title = System::WideString(), const System::WideString Filter = System::WideString(), int DefaultFilter = 0xffffffff, int LimitToFileType = 0xffffffff)/* overload */;
	System::UnicodeString __fastcall ExecuteOpenDialog(const System::WideString Title, int DefaultFilter, int LimitToFileType = 0xffffffff, bool AlwaysAnimate = false, bool MultiSelect = false)/* overload */;
	System::UnicodeString __fastcall ExecuteSaveDialog(const System::WideString InitialDir = System::WideString(), const System::WideString InitialFileName = System::WideString(), bool AlwaysAnimate = false, int FilterIndex = 0x0, const System::WideString ExtendedFilters = System::WideString(), const System::WideString Title = System::WideString(), const System::WideString Filter = System::WideString(), int DefaultFilter = 0xffffffff, int LimitToFileType = 0xffffffff)/* overload */;
	System::UnicodeString __fastcall ExecuteSaveDialog(const System::WideString Title, int DefaultFilter, int LimitToFileType = 0xffffffff, bool AlwaysAnimate = false)/* overload */;
	bool __fastcall DoPrintPreviewDialog(const System::UnicodeString TaskName = System::UnicodeString(), bool PrintAnnotations = false, const System::UnicodeString Caption = System::UnicodeString(), bool ThumbnailPrinting = false);
	__property bool ResetPrinter = {read=fResetPrinter, write=fResetPrinter, nodefault};
	__property Imageenio::TIOPrintPreviewParams* PrintPreviewParams = {read=fPrintPreviewParams};
	__property bool NativePixelFormat = {read=fNativePixelFormat, write=fNativePixelFormat, nodefault};
	__property Hyiedefs::TResampleFilter PrintingFilterOnSubsampling = {read=fPrintingFilterOnSubsampling, write=fPrintingFilterOnSubsampling, nodefault};
	__property System::UnicodeString ProxyAddress = {read=fProxyAddress, write=fProxyAddress};
	__property System::UnicodeString ProxyUser = {read=fProxyUser, write=fProxyUser};
	__property System::UnicodeString ProxyPassword = {read=fProxyPassword, write=fProxyPassword};
	void __fastcall PrintImagePos(int ImageIndex, Vcl::Graphics::TCanvas* PrtCanvas, double x, double y, double Width, double Height, double GammaCorrection = 1.000000E+00);
	void __fastcall PrintImage(int ImageIndex, Vcl::Graphics::TCanvas* PrtCanvas = (Vcl::Graphics::TCanvas*)(0x0), double MarginLeft = 1.000000E+00, double MarginTop = 1.000000E+00, double MarginRight = 1.000000E+00, double MarginBottom = 1.000000E+00, Imageenio::TIEVerticalPos VerticalPos = (Imageenio::TIEVerticalPos)(0x1), Imageenio::TIEHorizontalPos HorizontalPos = (Imageenio::TIEHorizontalPos)(0x1), Imageenio::TIESize Size = (Imageenio::TIESize)(0x1), double SpecWidth = 0.000000E+00, double SpecHeight = 0.000000E+00, double GammaCorrection = 1.000000E+00);
	void __fastcall PrintImages(int Columns = 0x2, int Rows = 0x2, double HorizSpace = 5.000000E-01, double VertSpace = 5.000000E-01, bool PrintSelected = false, double MarginLeft = 0.000000E+00, double MarginTop = 0.000000E+00, double MarginRight = 0.000000E+00, double MarginBottom = 0.000000E+00, bool DrawBox = true, bool DrawText = true, bool DrawShadow = false, System::Uitypes::TColor BoxColor = (System::Uitypes::TColor)(0x0));
	void __fastcall PreviewPrintImages(Vcl::Graphics::TBitmap* DestBitmap, int MaxBitmapWidth, int MaxBitmapHeight, Vcl::Printers::TPrinter* PrinterObj, int Columns, int Rows, double HorizSpace, double VertSpace, bool PrintSelected, double MarginLeft, double MarginTop, double MarginRight, double MarginBottom, bool DrawBox, bool DrawText, bool DrawShadow, System::Uitypes::TColor BoxColor = (System::Uitypes::TColor)(0x0), int iPageNo = 0x0);
	void __fastcall PrintImagesToFile(const System::UnicodeString sFilename, int iJpegQuality, int iImageWidth, int iImageHeight, int iColumns, int iRows, int iHorzSpace = 0x6, int iVertSpace = 0x6, bool bPrintSelectedOnly = false, int iHorzMargin = 0xc, int iVertMargin = 0xc, bool bDrawBox = false, bool bDrawText = true, bool bDrawShadow = true, System::Uitypes::TColor BackgroundColor = (System::Uitypes::TColor)(0xffffff), System::Uitypes::TColor BoxColor = (System::Uitypes::TColor)(0x0), int iPageNo = 0xffffffff);
	
__published:
	__property Ieview::TIEView* AttachedMView = {read=fImageEnMView, write=SetAttachedMView};
	__property Hyiedefs::TIEProgressEvent OnProgress = {read=fOnProgress, write=fOnProgress};
	__property Imageenio::TIEAcquireBitmapEvent OnAcquireBitmap = {read=fOnAcquireBitmap, write=fOnAcquireBitmap};
	__property System::Classes::TNotifyEvent OnAcquireClose = {read=fOnAcquireClose, write=fOnAcquireClose};
	__property Imageenio::TIEAfterAcquireBitmapEvent OnAfterAcquireBitmap = {read=fOnAfterAcquireBitmap, write=fOnAfterAcquireBitmap};
	__property Imageenio::TIOPreviewsParams PreviewsParams = {read=GetIOPreviewParams, write=SetIOPreviewParams, default=0};
	__property Vcl::Graphics::TFont* PreviewFont = {read=fPreviewFont, write=SetPreviewFont};
	__property bool PreviewFontEnabled = {read=fPreviewFontEnabled, write=SetPreviewFontEnabled, default=0};
	__property bool AutoAdjustDPI = {read=fAutoAdjustDPI, write=fAutoAdjustDPI, default=0};
	__property bool FilteredAdjustDPI = {read=fFilteredAdjustDPI, write=fFilteredAdjustDPI, default=0};
	__property bool SimplifiedParamsDialogs = {read=fSimplifiedParamsDialogs, write=fSimplifiedParamsDialogs, default=1};
	__property System::Classes::TNotifyEvent OnFinishWork = {read=fOnFinishWork, write=fOnFinishWork};
	__property Imageenio::TIEDialogsMeasureUnit DialogsMeasureUnit = {read=fDialogsMeasureUnit, write=fDialogsMeasureUnit, default=0};
	__property Imageenio::TIEDoPreviewsEvent OnDoPreviews = {read=fOnDoPreviews, write=fOnDoPreviews};
	__property System::UnicodeString ImageEnVersion = {read=GetImageEnVersion, write=SetImageEnVersion, stored=false};
};


//-- var, const, procedure ---------------------------------------------------
static const System::Int8 IEM_SELECTED_IMAGES = System::Int8(-9);
static const System::Int8 IEM_ALL_IMAGES = System::Int8(-7);
}	/* namespace Iemio */
#if !defined(DELPHIHEADER_NO_IMPLICIT_NAMESPACE_USE) && !defined(NO_USING_NAMESPACE_IEMIO)
using namespace Iemio;
#endif
#pragma pack(pop)
#pragma option pop

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