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

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

#ifndef Qimport3xmlbasedHPP
#define Qimport3xmlbasedHPP

#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.StrUtils.hpp>
#include <System.Variants.hpp>
#include <Winapi.Windows.hpp>
#include <System.Classes.hpp>
#include <System.SysUtils.hpp>
#include <System.IniFiles.hpp>
#include <QImport3StrTypes.hpp>
#include <QImport3.hpp>
#include <QImport3Common.hpp>
#include <QImport3XMLSax.hpp>
#include <QImport3BaseDocumentFile.hpp>
#include <QImport3ZipFile.hpp>

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

namespace Qimport3xmlbased
{
//-- forward type declarations -----------------------------------------------
class DELPHICLASS TCell;
class DELPHICLASS TCellList;
class DELPHICLASS TODCellList;
class DELPHICLASS TXMLSheet;
class DELPHICLASS TXYSheet;
class DELPHICLASS TXMLSheetList;
class DELPHICLASS TXMLDocContainer;
class DELPHICLASS TODContainer;
class DELPHICLASS TXMLDocumentFile;
class DELPHICLASS TZipDocumentFile;
class DELPHICLASS TXMLFile;
class DELPHICLASS TQImport3XMLBased;
class DELPHICLASS TQImport3WorkbookBased;
//-- type declarations -------------------------------------------------------
class PASCALIMPLEMENTATION TCell : public System::Classes::TCollectionItem
{
	typedef System::Classes::TCollectionItem inherited;
	
private:
	int FRow;
	int FCol;
	System::WideString FValue;
	TXMLSheet* __fastcall GetSheet();
	void __fastcall MapCell();
	void __fastcall UnMapCell();
	
public:
	__fastcall virtual TCell(System::Classes::TCollection* Collection);
	__fastcall virtual ~TCell();
	__property System::WideString Value = {read=FValue, write=FValue};
	__property int Row = {read=FRow, write=FRow, nodefault};
	__property int Col = {read=FCol, write=FCol, nodefault};
	__property TXMLSheet* Sheet = {read=GetSheet};
};


class PASCALIMPLEMENTATION TCellList : public System::Classes::TOwnedCollection
{
	typedef System::Classes::TOwnedCollection inherited;
	
public:
	TCell* operator[](int Index) { return this->Items[Index]; }
	
private:
	HIDESBASE TCell* __fastcall GetItem(int Index);
	HIDESBASE void __fastcall SetItem(int Index, TCell* const Value);
	
public:
	HIDESBASE TCell* __fastcall Add();
	__property TCell* Items[int Index] = {read=GetItem, write=SetItem/*, default*/};
public:
	/* TOwnedCollection.Create */ inline __fastcall TCellList(System::Classes::TPersistent* AOwner, System::Classes::TCollectionItemClass ItemClass) : System::Classes::TOwnedCollection(AOwner, ItemClass) { }
	
public:
	/* TCollection.Destroy */ inline __fastcall virtual ~TCellList() { }
	
};


class PASCALIMPLEMENTATION TODCellList : public TCellList
{
	typedef TCellList inherited;
	
public:
	TCell* __fastcall GetItemByCoords(int X, int Y);
public:
	/* TOwnedCollection.Create */ inline __fastcall TODCellList(System::Classes::TPersistent* AOwner, System::Classes::TCollectionItemClass ItemClass) : TCellList(AOwner, ItemClass) { }
	
public:
	/* TCollection.Destroy */ inline __fastcall virtual ~TODCellList() { }
	
};


typedef System::DynamicArray<void *> Qimport3xmlbased__4;

typedef System::DynamicArray<System::DynamicArray<void *> > TCellMap;

class PASCALIMPLEMENTATION TXMLSheet : public System::Classes::TCollectionItem
{
	typedef System::Classes::TCollectionItem inherited;
	
private:
	System::UnicodeString FName;
	int FColCount;
	int FRowCount;
	TCell* __fastcall GetCell(int Col, int Row);
	void __fastcall SetCell(int Col, int Row, TCell* const Value);
	
protected:
	TCellMap FCellMap;
	TCellList* FCells;
	virtual TCellList* __fastcall CreateCells();
	virtual void __fastcall SetColCount(const int Value);
	virtual void __fastcall SetRowCount(const int Value);
	
public:
	__fastcall virtual TXMLSheet(System::Classes::TCollection* Collection);
	__fastcall virtual ~TXMLSheet();
	__property TCell* Cell[int Col][int Row] = {read=GetCell, write=SetCell};
	__property System::UnicodeString Name = {read=FName, write=FName};
	__property int ColCount = {read=FColCount, write=SetColCount, nodefault};
	__property int RowCount = {read=FRowCount, write=SetRowCount, nodefault};
};


class PASCALIMPLEMENTATION TXYSheet : public TXMLSheet
{
	typedef TXMLSheet inherited;
	
private:
	int FX;
	int FY;
	
protected:
	virtual void __fastcall SetX(const int Value);
	virtual void __fastcall SetY(const int Value);
	
public:
	__fastcall virtual TXYSheet(System::Classes::TCollection* Collection);
	__property int X = {read=FX, write=SetX, nodefault};
	__property int Y = {read=FY, write=SetY, nodefault};
public:
	/* TXMLSheet.Destroy */ inline __fastcall virtual ~TXYSheet() { }
	
};


class PASCALIMPLEMENTATION TXMLSheetList : public System::Classes::TCollection
{
	typedef System::Classes::TCollection inherited;
	
public:
	TXMLSheet* operator[](int Index) { return this->Items[Index]; }
	
private:
	TXMLSheet* __fastcall GetItems(int Index);
	void __fastcall SetItems(int Index, TXMLSheet* Value);
	
public:
	HIDESBASE TXMLSheet* __fastcall Add();
	__property TXMLSheet* Items[int Index] = {read=GetItems, write=SetItems/*, default*/};
	TXMLSheet* __fastcall GetTableByName(System::WideString Name);
public:
	/* TCollection.Create */ inline __fastcall TXMLSheetList(System::Classes::TCollectionItemClass ItemClass) : System::Classes::TCollection(ItemClass) { }
	/* TCollection.Destroy */ inline __fastcall virtual ~TXMLSheetList() { }
	
};


class PASCALIMPLEMENTATION TXMLDocContainer : public System::TObject
{
	typedef System::TObject inherited;
	
private:
	System::UnicodeString FWorkDir;
	int FMaxRowCount;
	
protected:
	Qimport3xmlsax::TQISAXParser* FSAXParser;
	TXMLSheet* FCurrentSheet;
	bool FParserFlag;
	System::Variant FParserArgument;
	System::UnicodeString FParserResult;
	TCell* FCurrentCell;
	TXMLSheetList* FSheets;
	virtual void __fastcall DoLoad();
	virtual void __fastcall DoBeforeLoad();
	virtual void __fastcall DoAfterLoad();
	virtual TXMLSheetList* __fastcall CreateSheets();
	virtual void __fastcall OnGetCellText(Qimport3xmlsax::TQIXMLStreamProcessor* Sender, const System::WideString Text, Qimport3xmlsax::TQIXMLTextType TextType) = 0 ;
	virtual void __fastcall OnLoadSheet(Qimport3xmlsax::TQIXMLStreamProcessor* Sender, const System::WideString AName, Qimport3xmlsax::TQIXMLNodeAction Action) = 0 ;
	virtual void __fastcall LoadSheets() = 0 ;
	
public:
	__fastcall virtual TXMLDocContainer();
	__fastcall virtual ~TXMLDocContainer();
	void __fastcall Load();
	__property System::UnicodeString WorkDir = {read=FWorkDir, write=FWorkDir};
	__property int MaxRowCount = {read=FMaxRowCount, write=FMaxRowCount, nodefault};
};


class PASCALIMPLEMENTATION TODContainer : public TXMLDocContainer
{
	typedef TXMLDocContainer inherited;
	
private:
	void __fastcall FindTables(System::WideString NameOfFile);
	
protected:
	System::WideString FileName;
	int FColsRepeated;
	int FRowsRepeated;
	virtual void __fastcall OnLoadSheet(Qimport3xmlsax::TQIXMLStreamProcessor* Sender, const System::WideString AName, Qimport3xmlsax::TQIXMLNodeAction Action);
	virtual void __fastcall ParseSheet(Qimport3xmlsax::TQISAXParser* Sender, const System::WideString AName) = 0 ;
	virtual System::WideString __fastcall GetErrorMsg() = 0 ;
	virtual void __fastcall LoadSheets();
	
public:
	__fastcall virtual TODContainer();
public:
	/* TXMLDocContainer.Destroy */ inline __fastcall virtual ~TODContainer() { }
	
};


class PASCALIMPLEMENTATION TXMLDocumentFile : public Qimport3basedocumentfile::TBaseDocumentFile
{
	typedef Qimport3basedocumentfile::TBaseDocumentFile inherited;
	
protected:
	virtual void __fastcall DoLoad();
	virtual void __fastcall LoadXML() = 0 ;
public:
	/* TBaseDocumentFile.Create */ inline __fastcall virtual TXMLDocumentFile() : Qimport3basedocumentfile::TBaseDocumentFile() { }
	
public:
	/* TObject.Destroy */ inline __fastcall virtual ~TXMLDocumentFile() { }
	
};


class PASCALIMPLEMENTATION TZipDocumentFile : public TXMLDocumentFile
{
	typedef TXMLDocumentFile inherited;
	
protected:
	TXMLDocContainer* FContainer;
	System::WideString FCurrFolder;
	virtual void __fastcall DoAfterLoad();
	virtual void __fastcall DoBeforeLoad();
	virtual void __fastcall DoLoad();
	virtual TXMLDocContainer* __fastcall CreateContainer() = 0 ;
	virtual void __fastcall LoadXML();
	
public:
	__fastcall virtual TZipDocumentFile();
	__fastcall virtual ~TZipDocumentFile();
	void __fastcall Decompress();
	void __fastcall DeleteTempFolder();
};


class PASCALIMPLEMENTATION TXMLFile : public TXMLDocumentFile
{
	typedef TXMLDocumentFile inherited;
	
protected:
	Qimport3xmlsax::TQIXMLStreamProcessor* FXMLProcessor;
	bool FParserFlag;
	System::Variant FParserArgument;
	System::UnicodeString FParserResult;
	virtual Qimport3xmlsax::TQIXMLStreamProcessorClass __fastcall GetXMLProcessorClass();
	virtual void __fastcall LoadXML();
	
public:
	__fastcall virtual TXMLFile();
	__fastcall virtual ~TXMLFile();
};


class PASCALIMPLEMENTATION TQImport3XMLBased : public Qimport3::TQImport3
{
	typedef Qimport3::TQImport3 inherited;
	
private:
	System::Classes::TNotifyEvent FOnAfterAnalysis;
	System::Classes::TNotifyEvent FOnBeforeAnalysis;
	
protected:
	int FCounter;
	Qimport3basedocumentfile::TBaseDocumentFile* FDocFile;
	virtual void __fastcall ChangeCondition();
	virtual bool __fastcall CheckCondition();
	virtual Qimport3basedocumentfile::TBaseDocumentFile* __fastcall CreateDocFile() = 0 ;
	virtual void __fastcall LoadDocFile();
	virtual void __fastcall DoAfterImport();
	virtual void __fastcall DoBeforeImport();
	virtual void __fastcall FinishImport();
	virtual bool __fastcall Skip();
	virtual void __fastcall StartImport();
	virtual Qimport3::TQImportResult __fastcall ImportData();
	DYNAMIC void __fastcall DoBeforeAnalysis();
	DYNAMIC void __fastcall DoAfterAnalysis();
	
__published:
	__property FileName = {default=0};
	__property SkipFirstRows = {default=0};
	__property System::Classes::TNotifyEvent OnAfterAnalysis = {read=FOnAfterAnalysis, write=FOnAfterAnalysis};
	__property System::Classes::TNotifyEvent OnBeforeAnalysis = {read=FOnBeforeAnalysis, write=FOnBeforeAnalysis};
public:
	/* TQImport3.Create */ inline __fastcall virtual TQImport3XMLBased(System::Classes::TComponent* AOwner) : Qimport3::TQImport3(AOwner) { }
	/* TQImport3.Destroy */ inline __fastcall virtual ~TQImport3XMLBased() { }
	
};


class PASCALIMPLEMENTATION TQImport3WorkbookBased : public TQImport3XMLBased
{
	typedef TQImport3XMLBased inherited;
	
private:
	System::UnicodeString FSheetName;
	void __fastcall SetSheetName(const System::UnicodeString Value);
	
__published:
	__property System::UnicodeString SheetName = {read=FSheetName, write=SetSheetName};
public:
	/* TQImport3.Create */ inline __fastcall virtual TQImport3WorkbookBased(System::Classes::TComponent* AOwner) : TQImport3XMLBased(AOwner) { }
	/* TQImport3.Destroy */ inline __fastcall virtual ~TQImport3WorkbookBased() { }
	
};


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

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