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

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

#ifndef Qimport3HPP
#define Qimport3HPP

#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.Classes.hpp>
#include <Data.DB.hpp>
#include <Vcl.ComCtrls.hpp>
#include <Vcl.DBGrids.hpp>
#include <Vcl.Grids.hpp>
#include <System.IniFiles.hpp>
#include <System.SysUtils.hpp>
#include <System.Variants.hpp>
#include <Winapi.ShellAPI.hpp>
#include <Winapi.Windows.hpp>
#include <QImport3StrTypes.hpp>
#include <QImport3WideStrUtils.hpp>
#include <QImport3HashTable.hpp>
#include <QImport3Common.hpp>
#include <QImport3StrIDs.hpp>
#include <System.WideStrings.hpp>

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

namespace Qimport3
{
//-- forward type declarations -----------------------------------------------
class DELPHICLASS WideException;
class DELPHICLASS TQImportFormats;
class DELPHICLASS TQImportReplacement;
class DELPHICLASS TQImportReplacements;
class DELPHICLASS TQImportFieldFormat;
class DELPHICLASS TQImportFieldFormats;
class DELPHICLASS TQImportCol;
class DELPHICLASS TQImportRow;
class DELPHICLASS TQImportGenerator;
class DELPHICLASS TQImportGenerators;
class DELPHICLASS TQImport3;
//-- type declarations -------------------------------------------------------
class PASCALIMPLEMENTATION WideException : public System::Sysutils::Exception
{
	typedef System::Sysutils::Exception inherited;
	
private:
	System::WideString FWideMessage;
	
public:
	__fastcall WideException(const System::WideString Msg);
	__fastcall WideException(const System::WideString Msg, const System::TVarRec *Args, const int Args_High);
	__property System::WideString Message = {read=FWideMessage, write=FWideMessage};
public:
	/* Exception.CreateRes */ inline __fastcall WideException(NativeUInt Ident)/* overload */ : System::Sysutils::Exception(Ident) { }
	/* Exception.CreateRes */ inline __fastcall WideException(System::PResStringRec ResStringRec)/* overload */ : System::Sysutils::Exception(ResStringRec) { }
	/* Exception.CreateResFmt */ inline __fastcall WideException(NativeUInt Ident, const System::TVarRec *Args, const int Args_High)/* overload */ : System::Sysutils::Exception(Ident, Args, Args_High) { }
	/* Exception.CreateResFmt */ inline __fastcall WideException(System::PResStringRec ResStringRec, const System::TVarRec *Args, const int Args_High)/* overload */ : System::Sysutils::Exception(ResStringRec, Args, Args_High) { }
	/* Exception.CreateHelp */ inline __fastcall WideException(const System::UnicodeString Msg, int AHelpContext) : System::Sysutils::Exception(Msg, AHelpContext) { }
	/* Exception.CreateFmtHelp */ inline __fastcall WideException(const System::UnicodeString Msg, const System::TVarRec *Args, const int Args_High, int AHelpContext) : System::Sysutils::Exception(Msg, Args, Args_High, AHelpContext) { }
	/* Exception.CreateResHelp */ inline __fastcall WideException(NativeUInt Ident, int AHelpContext)/* overload */ : System::Sysutils::Exception(Ident, AHelpContext) { }
	/* Exception.CreateResHelp */ inline __fastcall WideException(System::PResStringRec ResStringRec, int AHelpContext)/* overload */ : System::Sysutils::Exception(ResStringRec, AHelpContext) { }
	/* Exception.CreateResFmtHelp */ inline __fastcall WideException(System::PResStringRec ResStringRec, const System::TVarRec *Args, const int Args_High, int AHelpContext)/* overload */ : System::Sysutils::Exception(ResStringRec, Args, Args_High, AHelpContext) { }
	/* Exception.CreateResFmtHelp */ inline __fastcall WideException(NativeUInt Ident, const System::TVarRec *Args, const int Args_High, int AHelpContext)/* overload */ : System::Sysutils::Exception(Ident, Args, Args_High, AHelpContext) { }
	/* Exception.Destroy */ inline __fastcall virtual ~WideException() { }
	
};


enum DECLSPEC_DENUM TQuoteAction : unsigned char { qaNone, qaAdd, qaRemove };

enum DECLSPEC_DENUM TQImportCharCase : unsigned char { iccNone, iccUpper, iccLower, iccUpperFirst, iccUpperFirstWord };

enum DECLSPEC_DENUM TQImportCharSet : unsigned char { icsNone, icsAnsi, icsOem };

class PASCALIMPLEMENTATION TQImportFormats : public System::Classes::TPersistent
{
	typedef System::Classes::TPersistent inherited;
	
private:
	System::WideChar FDecimalSeparator;
	System::WideChar FThousandSeparator;
	System::UnicodeString FShortDateFormat;
	System::UnicodeString FLongDateFormat;
	System::WideChar FDateSeparator;
	System::UnicodeString FShortTimeFormat;
	System::UnicodeString FLongTimeFormat;
	System::WideChar FTimeSeparator;
	System::Classes::TStrings* FBooleanTrue;
	System::Classes::TStrings* FBooleanFalse;
	System::Classes::TStrings* FNullValues;
	System::WideChar FOldDecimalSeparator;
	System::WideChar FOldThousandSeparator;
	System::UnicodeString FOldShortDateFormat;
	System::UnicodeString FOldLongDateFormat;
	System::WideChar FOldDateSeparator;
	System::UnicodeString FOldShortTimeFormat;
	System::UnicodeString FOldLongTimeFormat;
	System::WideChar FOldTimeSeparator;
	void __fastcall SetBooleanTrue(System::Classes::TStrings* const Value);
	void __fastcall SetBooleanFalse(System::Classes::TStrings* const Value);
	void __fastcall SetNullValues(System::Classes::TStrings* const Value);
	
protected:
	virtual void __fastcall DefineProperties(System::Classes::TFiler* Filer);
	void __fastcall ReadShortDateFormat(System::Classes::TReader* Reader);
	void __fastcall ReadLongDateFormat(System::Classes::TReader* Reader);
	void __fastcall ReadShortTimeFormat(System::Classes::TReader* Reader);
	void __fastcall ReadLongTimeFormat(System::Classes::TReader* Reader);
	void __fastcall WriteShortDateFormat(System::Classes::TWriter* Writer);
	void __fastcall WriteLongDateFormat(System::Classes::TWriter* Writer);
	void __fastcall WriteShortTimeFormat(System::Classes::TWriter* Writer);
	void __fastcall WriteLongTimeFormat(System::Classes::TWriter* Writer);
	
public:
	__fastcall TQImportFormats();
	__fastcall virtual ~TQImportFormats();
	virtual void __fastcall Assign(System::Classes::TPersistent* Source);
	void __fastcall StoreFormats();
	void __fastcall RestoreFormats();
	void __fastcall ApplyParams();
	
__published:
	__property System::WideChar DecimalSeparator = {read=FDecimalSeparator, write=FDecimalSeparator, stored=true, nodefault};
	__property System::WideChar ThousandSeparator = {read=FThousandSeparator, write=FThousandSeparator, stored=true, nodefault};
	__property System::UnicodeString ShortDateFormat = {read=FShortDateFormat, write=FShortDateFormat, stored=false};
	__property System::UnicodeString LongDateFormat = {read=FLongDateFormat, write=FLongDateFormat, stored=false};
	__property System::WideChar DateSeparator = {read=FDateSeparator, write=FDateSeparator, stored=true, nodefault};
	__property System::UnicodeString ShortTimeFormat = {read=FShortTimeFormat, write=FShortTimeFormat, stored=false};
	__property System::UnicodeString LongTimeFormat = {read=FLongTimeFormat, write=FLongTimeFormat, stored=false};
	__property System::WideChar TimeSeparator = {read=FTimeSeparator, write=FTimeSeparator, stored=true, nodefault};
	__property System::Classes::TStrings* BooleanTrue = {read=FBooleanTrue, write=SetBooleanTrue};
	__property System::Classes::TStrings* BooleanFalse = {read=FBooleanFalse, write=SetBooleanFalse};
	__property System::Classes::TStrings* NullValues = {read=FNullValues, write=SetNullValues};
};


class PASCALIMPLEMENTATION TQImportReplacement : public System::Classes::TCollectionItem
{
	typedef System::Classes::TCollectionItem inherited;
	
private:
	System::WideString FTextToFind;
	System::WideString FReplaceWith;
	bool FIgnoreCase;
	
protected:
	virtual System::UnicodeString __fastcall GetDisplayName();
	
public:
	__fastcall virtual TQImportReplacement(System::Classes::TCollection* Collection);
	virtual void __fastcall Assign(System::Classes::TPersistent* Source);
	
__published:
	__property System::WideString TextToFind = {read=FTextToFind, write=FTextToFind};
	__property System::WideString ReplaceWith = {read=FReplaceWith, write=FReplaceWith};
	__property bool IgnoreCase = {read=FIgnoreCase, write=FIgnoreCase, default=0};
public:
	/* TCollectionItem.Destroy */ inline __fastcall virtual ~TQImportReplacement() { }
	
};


class PASCALIMPLEMENTATION TQImportReplacements : public System::Classes::TCollection
{
	typedef System::Classes::TCollection inherited;
	
public:
	TQImportReplacement* operator[](int Index) { return this->Items[Index]; }
	
private:
	System::Classes::TPersistent* FHolder;
	HIDESBASE TQImportReplacement* __fastcall GetItem(int Index);
	HIDESBASE void __fastcall SetItem(int Index, TQImportReplacement* Replacement);
	
protected:
	DYNAMIC System::Classes::TPersistent* __fastcall GetOwner();
	
public:
	__property System::Classes::TPersistent* Holder = {read=FHolder};
	__fastcall TQImportReplacements(System::Classes::TPersistent* Holder);
	HIDESBASE TQImportReplacement* __fastcall Add();
	__property TQImportReplacement* Items[int Index] = {read=GetItem, write=SetItem/*, default*/};
	bool __fastcall ItemExists(const System::WideString ATextToFind, const System::WideString AReplaceWith, bool AIgnoreCase);
public:
	/* TCollection.Destroy */ inline __fastcall virtual ~TQImportReplacements() { }
	
};


enum DECLSPEC_DENUM TQImportFunctions : unsigned char { ifNone, ifDate, ifTime, ifDateTime, ifLongFileName, ifShortFileName };

class PASCALIMPLEMENTATION TQImportFieldFormat : public System::Classes::TCollectionItem
{
	typedef System::Classes::TCollectionItem inherited;
	
private:
	System::UnicodeString FFieldName;
	__int64 FGeneratorValue;
	int FGeneratorStep;
	System::WideString FConstantValue;
	System::WideString FNullValue;
	System::WideString FDefaultValue;
	System::WideString FLeftQuote;
	System::WideString FRightQuote;
	TQuoteAction FQuoteAction;
	TQImportCharCase FCharCase;
	TQImportCharSet FCharSet;
	TQImportReplacements* FReplacements;
	TQImportFunctions FFunctions;
	System::Widestrings::TWideStrings* FScript;
	bool __fastcall IsConstant();
	bool __fastcall IsNull();
	bool __fastcall IsDefault();
	bool __fastcall IsLeftQuote();
	bool __fastcall IsRightQuote();
	void __fastcall SetReplacements(TQImportReplacements* const Value);
	
protected:
	virtual System::UnicodeString __fastcall GetDisplayName();
	
public:
	__fastcall virtual TQImportFieldFormat(System::Classes::TCollection* Collection);
	__fastcall virtual ~TQImportFieldFormat();
	virtual void __fastcall Assign(System::Classes::TPersistent* Source);
	bool __fastcall IsDefaultValues();
	
__published:
	__property System::UnicodeString FieldName = {read=FFieldName, write=FFieldName};
	__property __int64 GeneratorValue = {read=FGeneratorValue, write=FGeneratorValue, default=0};
	__property int GeneratorStep = {read=FGeneratorStep, write=FGeneratorStep, default=0};
	__property System::WideString ConstantValue = {read=FConstantValue, write=FConstantValue, stored=IsConstant};
	__property System::WideString NullValue = {read=FNullValue, write=FNullValue, stored=IsNull};
	__property System::WideString DefaultValue = {read=FDefaultValue, write=FDefaultValue, stored=IsDefault};
	__property System::WideString LeftQuote = {read=FLeftQuote, write=FLeftQuote, stored=IsLeftQuote};
	__property System::WideString RightQuote = {read=FRightQuote, write=FRightQuote, stored=IsRightQuote};
	__property TQuoteAction QuoteAction = {read=FQuoteAction, write=FQuoteAction, default=0};
	__property TQImportCharCase CharCase = {read=FCharCase, write=FCharCase, default=0};
	__property TQImportCharSet CharSet = {read=FCharSet, write=FCharSet, default=0};
	__property TQImportReplacements* Replacements = {read=FReplacements, write=SetReplacements};
	__property TQImportFunctions Functions = {read=FFunctions, write=FFunctions, nodefault};
	
protected:
	__property System::Widestrings::TWideStrings* Script = {read=FScript, write=FScript};
};


class PASCALIMPLEMENTATION TQImportFieldFormats : public System::Classes::TCollection
{
	typedef System::Classes::TCollection inherited;
	
public:
	TQImportFieldFormat* operator[](int Index) { return this->Items[Index]; }
	
private:
	System::Classes::TComponent* FHolder;
	HIDESBASE TQImportFieldFormat* __fastcall GetItem(int Index);
	HIDESBASE void __fastcall SetItem(int Index, TQImportFieldFormat* FieldFormat);
	
protected:
	DYNAMIC System::Classes::TPersistent* __fastcall GetOwner();
	
public:
	__property System::Classes::TComponent* Holder = {read=FHolder};
	__fastcall TQImportFieldFormats(System::Classes::TComponent* AHolder);
	HIDESBASE TQImportFieldFormat* __fastcall Add();
	int __fastcall IndexByName(const System::UnicodeString FieldName);
	__property TQImportFieldFormat* Items[int Index] = {read=GetItem, write=SetItem/*, default*/};
public:
	/* TCollection.Destroy */ inline __fastcall virtual ~TQImportFieldFormats() { }
	
};


class PASCALIMPLEMENTATION TQImportCol : public System::TObject
{
	typedef System::TObject inherited;
	
private:
	System::WideString FValue;
	System::UnicodeString FName;
	bool FIsBinary;
	int FColumnIndex;
	
public:
	__fastcall TQImportCol();
	__property int ColumnIndex = {read=FColumnIndex, nodefault};
	__property System::UnicodeString Name = {read=FName, write=FName};
	__property System::WideString Value = {read=FValue, write=FValue};
	__property bool IsBinary = {read=FIsBinary, nodefault};
public:
	/* TObject.Destroy */ inline __fastcall virtual ~TQImportCol() { }
	
};


class PASCALIMPLEMENTATION TQImportRow : public System::Classes::TList
{
	typedef System::Classes::TList inherited;
	
public:
	TQImportCol* operator[](int Index) { return this->Items[Index]; }
	
private:
	Qimport3hashtable::TQImportHashTable* FMapNameIdxHash;
	Qimport3hashtable::TQImportHashTable* FColHash;
	TQImport3* FQImport;
	HIDESBASE TQImportCol* __fastcall Get(int Index);
	HIDESBASE void __fastcall Put(int Index, TQImportCol* const Value);
	
public:
	__fastcall TQImportRow(TQImport3* AImport);
	__fastcall virtual ~TQImportRow();
	HIDESBASE TQImportCol* __fastcall Add(const System::UnicodeString AName);
	virtual void __fastcall Clear();
	HIDESBASE void __fastcall Delete(int Index);
	HIDESBASE TQImportCol* __fastcall First();
	void __fastcall SetValue(const System::WideString AName, const System::WideString AValue, bool AIsBinary);
	void __fastcall ClearValues();
	HIDESBASE TQImportCol* __fastcall Last();
	HIDESBASE int __fastcall IndexOf(TQImportCol* Item);
	TQImportCol* __fastcall ColByName(const System::UnicodeString AName);
	__property TQImport3* QImport = {read=FQImport};
	__property TQImportCol* Items[int Index] = {read=Get, write=Put/*, default*/};
	__property Qimport3hashtable::TQImportHashTable* MapNameIdxHash = {read=FMapNameIdxHash};
};


class PASCALIMPLEMENTATION TQImportGenerator : public System::TObject
{
	typedef System::TObject inherited;
	
private:
	System::UnicodeString FName;
	__int64 FValue;
	__int64 FStep;
	bool FIsFirstRequest;
	
public:
	__fastcall TQImportGenerator();
	__int64 __fastcall GetNewValue();
	__property System::UnicodeString Name = {read=FName, write=FName};
	__property __int64 Value = {read=FValue, write=FValue};
	__property __int64 Step = {read=FStep, write=FStep};
public:
	/* TObject.Destroy */ inline __fastcall virtual ~TQImportGenerator() { }
	
};


class PASCALIMPLEMENTATION TQImportGenerators : public System::Classes::TList
{
	typedef System::Classes::TList inherited;
	
public:
	TQImportGenerator* operator[](int Index) { return this->Items[Index]; }
	
private:
	HIDESBASE TQImportGenerator* __fastcall Get(int Index);
	HIDESBASE void __fastcall Put(int Index, TQImportGenerator* const Value);
	
public:
	__fastcall virtual ~TQImportGenerators();
	HIDESBASE TQImportGenerator* __fastcall Add(const System::UnicodeString AName, __int64 AValue, __int64 AStep);
	HIDESBASE void __fastcall Delete(int Index);
	__int64 __fastcall GetNewValue(const System::UnicodeString AName);
	TQImportGenerator* __fastcall GenByName(const System::UnicodeString AName);
	__property TQImportGenerator* Items[int Index] = {read=Get, write=Put/*, default*/};
public:
	/* TObject.Create */ inline __fastcall TQImportGenerators() : System::Classes::TList() { }
	
};


enum DECLSPEC_DENUM TQImportFieldType : unsigned char { iftUnknown, iftString, iftInteger, iftBoolean, iftDouble, iftCurrency, iftDateTime, iftBytes };

enum DECLSPEC_DENUM TQImportAddType : unsigned char { qatAppend, qatInsert };

enum DECLSPEC_DENUM TQImportResult : unsigned char { qirOk, qirContinue, qirBreak };

enum DECLSPEC_DENUM TQImportMode : unsigned char { qimInsertAll, qimInsertNew, qimUpdate, qimUpdateOrInsert, qimDelete, qimDeleteOrInsert };

enum DECLSPEC_DENUM TQImportAction : unsigned char { qiaNone, qiaInsert, qiaUpdate, qiaDelete };

enum DECLSPEC_DENUM TQImportStage : unsigned char { qisLoadConf, qisSaveConf, qisBefore, qisImport, qisAfter };

typedef void __fastcall (__closure *TImportCancelEvent)(System::TObject* Sender, bool &Continue);

typedef void __fastcall (__closure *TImportBeforePostEvent)(System::TObject* Sender, TQImportRow* Row, bool &Accept);

typedef void __fastcall (__closure *TUserDefinedImportEvent)(System::TObject* Sender, TQImportRow* Row);

typedef void __fastcall (__closure *TImportAfterPostEvent)(System::TObject* Sender, TQImportRow* Row);

typedef void __fastcall (__closure *TImportLoadTemplateEvent)(System::TObject* Sender, const System::UnicodeString FileName);

typedef void __fastcall (__closure *TDestinationLocateEvent)(System::TObject* Sender, System::Classes::TStrings* KeyColumns, TQImportRow* Row, System::UnicodeString &KeyFields, System::Variant &KeyValues);

typedef void __fastcall (__closure *TSetCharsetTypeEvent)(System::TObject* Sender, const System::AnsiString Charset);

typedef void __fastcall (__closure *TWideStringToCharsetEvent)(System::TObject* Sender, const System::WideString SourceStr, System::AnsiString &EncodedStr);

typedef void __fastcall (__closure *TImportCheckFieldEvent)(System::TObject* Sender, Data::Db::TField* Field, System::WideString AValue);

typedef void __fastcall (__closure *TImportErrorEvent)(System::TObject* Sender, TQImportStage Stage);

typedef void __fastcall (__closure *TSetFieldValueActionEvent)(System::TObject* Sender, Data::Db::TDataSet* DataSet, TQImportCol* Col);

typedef void __fastcall (__closure *TCancelSetFieldValueEvent)(System::TObject* Sender, Data::Db::TField* Field, bool &Cancel);

class PASCALIMPLEMENTATION TQImport3 : public System::Classes::TComponent
{
	typedef System::Classes::TComponent inherited;
	
private:
	System::WideString FLastError;
	Data::Db::TDataSet* FDataSet;
	Vcl::Dbgrids::TDBGrid* FDBGrid;
	Vcl::Comctrls::TListView* FListView;
	Vcl::Grids::TStringGrid* FStringGrid;
	int FGridCaptionRow;
	int FGridStartRow;
	bool FAutoTrimValue;
	bool FImportEmptyRows;
	bool FSkipInvisibleColumns;
	bool FRowIsEmpty;
	System::UnicodeString FFileName;
	System::Widestrings::TWideStrings* FErrors;
	System::Classes::TStrings* FMap;
	int FImportRecCount;
	int FCommitRecCount;
	bool FCommitAfterDone;
	bool FErrorLog;
	System::UnicodeString FErrorLogFileName;
	bool FRewriteErrorLogFile;
	bool FShowErrorLog;
	System::Classes::TFileStream* FErrorLogFS;
	int FSkipFirstRows;
	int FSkipFirstCols;
	int FImportedRecs;
	bool FCanceled;
	TQImportFormats* FFormats;
	TQImportFieldFormats* FFieldFormats;
	TQImportAddType FAddType;
	Qimport3common::TQImportDestination FImportDestination;
	TQImportMode FImportMode;
	System::Classes::TStrings* FKeyColumns;
	int FCurrentLineNumber;
	bool FIsCSV;
	TQImportAction FLastAction;
	TQImportAction FPrevAction;
	System::Classes::TStream* FStream;
	char FComma;
	char FQuote;
	System::Classes::TNotifyEvent FOnBeforeImport;
	System::Classes::TNotifyEvent FOnAfterImport;
	System::Classes::TNotifyEvent FOnImportRecord;
	System::Classes::TNotifyEvent FOnImportError;
	System::Classes::TNotifyEvent FOnImportErrorAdv;
	TImportErrorEvent FOnError;
	System::Classes::TNotifyEvent FOnNeedCommit;
	System::Classes::TNotifyEvent FOnGetTotalRecCount;
	TImportCancelEvent FOnImportCancel;
	TImportBeforePostEvent FOnBeforePost;
	TImportAfterPostEvent FOnAfterPost;
	TUserDefinedImportEvent FOnUserDefinedImport;
	TUserDefinedImportEvent FOnImportRowComplete;
	TDestinationLocateEvent FOnDestinationLocate;
	TImportCheckFieldEvent FOnImportCheckField;
	TSetFieldValueActionEvent FOnSetFieldValueAction;
	TCancelSetFieldValueEvent FOnCancelSetFieldValue;
	System::UnicodeString FAbout;
	System::UnicodeString FVersion;
	System::Classes::TStrings* FMappedColumns;
	bool FAllowDuplicates;
	bool FDecodeBase64Blobs;
	void __fastcall SetDataSet(Data::Db::TDataSet* const Value);
	void __fastcall SetDBGrid(Vcl::Dbgrids::TDBGrid* const Value);
	void __fastcall SetListView(Vcl::Comctrls::TListView* const Value);
	void __fastcall SetStringGrid(Vcl::Grids::TStringGrid* const Value);
	void __fastcall SetKeyColumns(System::Classes::TStrings* const Value);
	void __fastcall SetFileName(const System::UnicodeString Value);
	void __fastcall SetMap(System::Classes::TStrings* const Value);
	int __fastcall GetErrorRecs();
	void __fastcall SetFormats(TQImportFormats* const Value);
	void __fastcall SetFieldFormats(TQImportFieldFormats* const Value);
	Vcl::Comctrls::TListItem* FCurrListItem;
	int FCurrStrGrRow;
	int FFindPos;
	int FAddPos;
	void __fastcall InitializeImportRow();
	
protected:
	int FTotalRecCount;
	TQImportRow* FImportRow;
	TQImportGenerators* FImportGenerators;
	bool FImportSuccess;
	bool __fastcall IsBinary(int ColumnIndex);
	__property bool IsCSV = {read=FIsCSV, nodefault};
	virtual void __fastcall Notification(System::Classes::TComponent* AComponent, System::Classes::TOperation Operation);
	void __fastcall DoImport();
	virtual void __fastcall DoUserDefinedImport();
	virtual void __fastcall DoImportRowComplete();
	virtual void __fastcall StartImport() = 0 ;
	virtual bool __fastcall CheckCondition() = 0 ;
	virtual bool __fastcall Skip() = 0 ;
	virtual void __fastcall FillImportRow() = 0 ;
	virtual TQImportResult __fastcall ImportData() = 0 ;
	void __fastcall DataManipulation();
	virtual void __fastcall ChangeCondition() = 0 ;
	virtual void __fastcall FinishImport() = 0 ;
	virtual void __fastcall DoAfterSetFileName();
	virtual void __fastcall CheckProperties();
	void __fastcall DoUserDataFormat(TQImportCol* Col);
	bool __fastcall CanContinue();
	virtual bool __fastcall AllowImportRowComplete();
	System::UnicodeString __fastcall StringToField(Data::Db::TField* Field, const System::WideString Str, bool AIsBinary);
	System::Variant __fastcall PrepareImportValue(const System::WideString AValue, const bool AIsBinary, const Data::Db::TFieldType AFieldType);
	virtual void __fastcall DoLoadConfiguration(System::Inifiles::TIniFile* IniFile);
	virtual void __fastcall DoSaveConfiguration(System::Inifiles::TIniFile* IniFile);
	__property int SkipFirstCols = {read=FSkipFirstCols, write=FSkipFirstCols, nodefault};
	__property bool RowIsEmpty = {read=FRowIsEmpty, write=FRowIsEmpty, nodefault};
	
private:
	bool __fastcall StringToBoolean(const System::UnicodeString Str);
	
protected:
	void __fastcall AfterImport();
	void __fastcall BeforeImport();
	virtual void __fastcall DoAfterImport();
	virtual void __fastcall DoBeforeImport();
	virtual System::Variant __fastcall GetFloatValue(const System::WideString AValue, const Data::Db::TFieldType AFieldType);
	virtual System::Variant __fastcall GetIntegerValue(const System::WideString AValue, const Data::Db::TFieldType AFieldType);
	virtual System::Variant __fastcall GetDateTimeValue(const System::WideString AValue);
	virtual System::Variant __fastcall GetStringValue(const System::WideString AValue, const Data::Db::TFieldType AFieldType);
	virtual System::Variant __fastcall GetBitesValue(const System::WideString AValue);
	void __fastcall DestinationInsert();
	void __fastcall DestinationEdit();
	void __fastcall DestinationDelete();
	void __fastcall DestinationSetValues();
	void __fastcall DestinationPost();
	void __fastcall DestinationCancel();
	int __fastcall DestinationFindColumn(const System::UnicodeString ColName);
	void __fastcall DestinationDisableControls();
	void __fastcall DestinationEnableControls();
	void __fastcall CheckDestination();
	bool __fastcall DestinationFindByKey();
	bool __fastcall DestinationFindByFields();
	int __fastcall DestinationColCount();
	System::UnicodeString __fastcall DestinationColName(int Index);
	DYNAMIC void __fastcall DoBeginImport();
	DYNAMIC bool __fastcall DoBeforePost();
	DYNAMIC void __fastcall DoAfterPost();
	DYNAMIC void __fastcall DoImportRecord();
	DYNAMIC void __fastcall DoImportError(System::Sysutils::Exception* Error, TQImportStage Stage = (TQImportStage)(0x3));
	void __fastcall WriteErrorLog(const System::UnicodeString ErrorMsg, TQImportStage Stage = (TQImportStage)(0x3));
	DYNAMIC void __fastcall DoError(const System::WideString ErrorMsg, TQImportStage Stage = (TQImportStage)(0x3));
	DYNAMIC void __fastcall DoNeedCommit();
	DYNAMIC void __fastcall DoEndImport();
	DYNAMIC void __fastcall DoSetFieldValueAction(Data::Db::TDataSet* DataSet, TQImportCol* Col);
	DYNAMIC bool __fastcall DoCancelSetFieldValue(Data::Db::TField* Field);
	
public:
	__fastcall virtual TQImport3(System::Classes::TComponent* AOwner);
	__fastcall virtual ~TQImport3();
	bool __fastcall Execute();
	void __fastcall ImportToCSV(System::Classes::TStream* Stream, char Comma, char Quote);
	bool __fastcall StrIsNull(const System::UnicodeString Str);
	void __fastcall Cancel();
	void __fastcall LoadConfiguration(const System::UnicodeString FileName);
	void __fastcall SaveConfiguration(const System::UnicodeString FileName);
	__property System::Widestrings::TWideStrings* Errors = {read=FErrors};
	__property int ImportedRecs = {read=FImportedRecs, nodefault};
	__property int ErrorRecs = {read=GetErrorRecs, nodefault};
	__property bool Canceled = {read=FCanceled, nodefault};
	__property TQImportAction LastAction = {read=FLastAction, write=FLastAction, nodefault};
	__property int TotalRecCount = {read=FTotalRecCount, nodefault};
	__property System::UnicodeString FileName = {read=FFileName, write=SetFileName};
	__property int CurrentLineNumber = {read=FCurrentLineNumber, write=FCurrentLineNumber, nodefault};
	__property System::WideString LastError = {read=FLastError, write=FLastError};
	
__published:
	__property System::UnicodeString About = {read=FAbout, write=FAbout};
	__property bool AutoTrimValue = {read=FAutoTrimValue, write=FAutoTrimValue, default=0};
	__property bool ImportEmptyRows = {read=FImportEmptyRows, write=FImportEmptyRows, default=1};
	__property bool SkipInvisibleColumns = {read=FSkipInvisibleColumns, write=FSkipInvisibleColumns, default=0};
	__property System::UnicodeString Version = {read=FVersion, write=FVersion};
	__property Data::Db::TDataSet* DataSet = {read=FDataSet, write=SetDataSet};
	__property Vcl::Dbgrids::TDBGrid* DBGrid = {read=FDBGrid, write=SetDBGrid};
	__property Vcl::Comctrls::TListView* ListView = {read=FListView, write=SetListView};
	__property Vcl::Grids::TStringGrid* StringGrid = {read=FStringGrid, write=SetStringGrid};
	__property int GridCaptionRow = {read=FGridCaptionRow, write=FGridCaptionRow, default=-1};
	__property int GridStartRow = {read=FGridStartRow, write=FGridStartRow, default=-1};
	__property Qimport3common::TQImportDestination ImportDestination = {read=FImportDestination, write=FImportDestination, default=0};
	__property TQImportMode ImportMode = {read=FImportMode, write=FImportMode, default=0};
	__property System::Classes::TStrings* Map = {read=FMap, write=SetMap};
	__property TQImportFormats* Formats = {read=FFormats, write=SetFormats};
	__property TQImportFieldFormats* FieldFormats = {read=FFieldFormats, write=SetFieldFormats};
	__property bool ErrorLog = {read=FErrorLog, write=FErrorLog, default=0};
	__property System::UnicodeString ErrorLogFileName = {read=FErrorLogFileName, write=FErrorLogFileName};
	__property bool RewriteErrorLogFile = {read=FRewriteErrorLogFile, write=FRewriteErrorLogFile, default=1};
	__property bool ShowErrorLog = {read=FShowErrorLog, write=FShowErrorLog, default=0};
	__property int ImportRecCount = {read=FImportRecCount, write=FImportRecCount, default=0};
	__property int CommitRecCount = {read=FCommitRecCount, write=FCommitRecCount, default=1000};
	__property bool CommitAfterDone = {read=FCommitAfterDone, write=FCommitAfterDone, default=0};
	__property TQImportAddType AddType = {read=FAddType, write=FAddType, default=0};
	__property System::Classes::TStrings* KeyColumns = {read=FKeyColumns, write=SetKeyColumns};
	__property bool AllowDuplicates = {read=FAllowDuplicates, write=FAllowDuplicates, default=1};
	__property bool DecodeBase64Blobs = {read=FDecodeBase64Blobs, write=FDecodeBase64Blobs, default=0};
	__property System::Classes::TNotifyEvent OnBeforeImport = {read=FOnBeforeImport, write=FOnBeforeImport};
	__property System::Classes::TNotifyEvent OnAfterImport = {read=FOnAfterImport, write=FOnAfterImport};
	__property System::Classes::TNotifyEvent OnImportRecord = {read=FOnImportRecord, write=FOnImportRecord};
	__property System::Classes::TNotifyEvent OnImportError = {read=FOnImportError, write=FOnImportError};
	__property System::Classes::TNotifyEvent OnImportErrorAdv = {read=FOnImportErrorAdv, write=FOnImportErrorAdv};
	__property TImportErrorEvent OnError = {read=FOnError, write=FOnError};
	__property System::Classes::TNotifyEvent OnNeedCommit = {read=FOnNeedCommit, write=FOnNeedCommit};
	__property System::Classes::TNotifyEvent OnGetTotalRecCount = {read=FOnGetTotalRecCount, write=FOnGetTotalRecCount};
	__property TImportCancelEvent OnImportCancel = {read=FOnImportCancel, write=FOnImportCancel};
	__property TImportBeforePostEvent OnBeforePost = {read=FOnBeforePost, write=FOnBeforePost};
	__property TImportAfterPostEvent OnAfterPost = {read=FOnAfterPost, write=FOnAfterPost};
	__property TUserDefinedImportEvent OnUserDefinedImport = {read=FOnUserDefinedImport, write=FOnUserDefinedImport};
	__property TUserDefinedImportEvent OnImportRowComplete = {read=FOnImportRowComplete, write=FOnImportRowComplete};
	__property TDestinationLocateEvent OnDestinationLocate = {read=FOnDestinationLocate, write=FOnDestinationLocate};
	__property TImportCheckFieldEvent OnImportCheckField = {read=FOnImportCheckField, write=FOnImportCheckField};
	__property TSetFieldValueActionEvent OnSetFieldValueAction = {read=FOnSetFieldValueAction, write=FOnSetFieldValueAction};
	__property TCancelSetFieldValueEvent OnCancelSetFieldValue = {read=FOnCancelSetFieldValue, write=FOnCancelSetFieldValue};
	
private:
	bool FAfterImport;
	bool FBeforeImport;
	bool FCustomImportMode;
	bool FCustomImportError;
	System::AnsiString FTempFileCharset;
	TSetCharsetTypeEvent FOnSetCharsetType;
	TWideStringToCharsetEvent FOnWideStringToCharset;
	
public:
	__property bool CustomImportMode = {read=FCustomImportMode, write=FCustomImportMode, nodefault};
	__property TQImportRow* ImportRow = {read=FImportRow};
	__property int SkipFirstRows = {read=FSkipFirstRows, write=FSkipFirstRows, nodefault};
	__property System::AnsiString TempFileCharset = {read=FTempFileCharset, write=FTempFileCharset};
	__property TSetCharsetTypeEvent OnSetCharsetType = {read=FOnSetCharsetType, write=FOnSetCharsetType};
	__property TWideStringToCharsetEvent OnWideStringToCharset = {read=FOnWideStringToCharset, write=FOnWideStringToCharset};
};


//-- var, const, procedure ---------------------------------------------------
extern DELPHI_PACKAGE System::Set<Data::Db::TFieldType, Data::Db::TFieldType::ftUnknown, Data::Db::TFieldType::ftSingle> qiBlobFieldTypes;
extern DELPHI_PACKAGE System::UnicodeString __fastcall StringToHex(const System::UnicodeString Str);
extern DELPHI_PACKAGE bool __fastcall HexToString(const System::UnicodeString HexStr, /* out */ System::UnicodeString &Str);
extern DELPHI_PACKAGE TQImportFieldType __fastcall GetImportFieldType(Data::Db::TField* Field);
extern DELPHI_PACKAGE void __fastcall StrReplace(System::UnicodeString &S, const System::UnicodeString Search, const System::UnicodeString Replace, System::Sysutils::TReplaceFlags Flags);
extern DELPHI_PACKAGE void __fastcall WideStrReplace(System::WideString &S, const System::WideString Search, const System::WideString Replace, System::Sysutils::TReplaceFlags Flags);
}	/* namespace Qimport3 */
#if !defined(DELPHIHEADER_NO_IMPLICIT_NAMESPACE_USE) && !defined(NO_USING_NAMESPACE_QIMPORT3)
using namespace Qimport3;
#endif
#pragma pack(pop)
#pragma option pop

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