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

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

#ifndef Qimport3xmldocHPP
#define Qimport3xmldocHPP

#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 <Vcl.ComCtrls.hpp>
#include <System.Variants.hpp>
#include <System.Math.hpp>
#include <System.SysUtils.hpp>
#include <Winapi.Windows.hpp>
#include <System.NetEncoding.hpp>
#include <System.Classes.hpp>
#include <System.IniFiles.hpp>
#include <QImport3.hpp>
#include <QImport3StrTypes.hpp>
#include <QImport3XMLBased.hpp>
#include <QImport3XMLSax.hpp>
#include <QImport3BaseDocumentFile.hpp>
#include <QImport3HashTable.hpp>
#include <QImport3WideStrUtils.hpp>
#include <QImport3Common.hpp>
#include <QImport3ValueTable.hpp>
#include <System.WideStrings.hpp>

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

namespace Qimport3xmldoc
{
//-- forward type declarations -----------------------------------------------
class DELPHICLASS TXMLDocFile;
class DELPHICLASS TQImport3XMLDoc;
class DELPHICLASS TQIXMLTreeBuilder;
//-- type declarations -------------------------------------------------------
enum DECLSPEC_DENUM TXMLDataLocation : unsigned char { tlAttributes, tlSubNodes };

class PASCALIMPLEMENTATION TXMLDocFile : public Qimport3xmlbased::TXMLFile
{
	typedef Qimport3xmlbased::TXMLFile inherited;
	
private:
	System::WideString FXPath;
	Qimport3hashtable::TQImportHashTable* FNamesList;
	int FNamesCounter;
	TXMLDataLocation FDataLocation;
	Qimport3valuetable::TQImport3ValueTable* FGrid;
	System::Widestrings::TWideStringList* FTextBuffer;
	int FColCount;
	int FRowCount;
	int FPreviewRowCount;
	void __fastcall OnLoadCell(Qimport3xmlsax::TQIXMLStreamProcessor* Sender, const System::WideString AName, Qimport3xmlsax::TQIXMLNodeAction Action);
	void __fastcall OnGetCellText(Qimport3xmlsax::TQIXMLStreamProcessor* Sender, const System::WideString AText, Qimport3xmlsax::TQIXMLTextType TextType);
	System::WideString __fastcall GetCells(int ACol, int ARow);
	void __fastcall SetXPath(const System::WideString Value);
	void __fastcall SetDataLocation(const TXMLDataLocation Value);
	void __fastcall LoadCells();
	
protected:
	virtual Qimport3xmlsax::TQIXMLStreamProcessorClass __fastcall GetXMLProcessorClass();
	virtual void __fastcall SetMaxRowCount(const int Value);
	virtual void __fastcall LoadXML();
	
public:
	__fastcall virtual TXMLDocFile()/* overload */;
	__fastcall virtual ~TXMLDocFile();
	void __fastcall ClearCell(int ACol, int ARow);
	virtual void __fastcall Clear();
	__property System::WideString XPath = {read=FXPath, write=SetXPath};
	__property TXMLDataLocation DataLocation = {read=FDataLocation, write=SetDataLocation, nodefault};
	__property System::WideString Cells[int ACol][int ARow] = {read=GetCells};
	__property int ColCount = {read=FColCount, nodefault};
	__property int RowCount = {read=FRowCount, nodefault};
};


class PASCALIMPLEMENTATION TQImport3XMLDoc : public Qimport3xmlbased::TQImport3XMLBased
{
	typedef Qimport3xmlbased::TQImport3XMLBased inherited;
	
private:
	System::WideString FXPath;
	TXMLDataLocation FDataLocation;
	
protected:
	virtual void __fastcall FillImportRow();
	virtual void __fastcall DoLoadConfiguration(System::Inifiles::TIniFile* IniFile);
	virtual void __fastcall DoSaveConfiguration(System::Inifiles::TIniFile* IniFile);
	virtual Qimport3basedocumentfile::TBaseDocumentFile* __fastcall CreateDocFile();
	virtual void __fastcall LoadDocFile();
	
__published:
	__property FileName = {default=0};
	__property System::WideString XPath = {read=FXPath, write=FXPath};
	__property TXMLDataLocation DataLocation = {read=FDataLocation, write=FDataLocation, nodefault};
	__property SkipFirstRows = {default=0};
public:
	/* TQImport3.Create */ inline __fastcall virtual TQImport3XMLDoc(System::Classes::TComponent* AOwner) : Qimport3xmlbased::TQImport3XMLBased(AOwner) { }
	/* TQImport3.Destroy */ inline __fastcall virtual ~TQImport3XMLDoc() { }
	
};


#pragma pack(push,4)
class PASCALIMPLEMENTATION TQIXMLTreeBuilder : public System::TObject
{
	typedef System::TObject inherited;
	
private:
	Vcl::Comctrls::TTreeNode* FCurrentNode;
	Qimport3xmlsax::TQISAXParser* FParser;
	Vcl::Comctrls::TTreeView* FTreeView;
	int FTagsProcessed;
	int FMaxTagsProcessed;
	void __fastcall OnLoadElement(Qimport3xmlsax::TQIXMLStreamProcessor* Sender, const System::WideString AName, Qimport3xmlsax::TQIXMLNodeAction Action);
	
public:
	__fastcall TQIXMLTreeBuilder();
	__fastcall virtual ~TQIXMLTreeBuilder();
	void __fastcall FillTreeView(const System::UnicodeString FileName, Vcl::Comctrls::TTreeView* TreeView);
	__property int MaxTagsProcessed = {read=FMaxTagsProcessed, write=FMaxTagsProcessed, nodefault};
};

#pragma pack(pop)

//-- var, const, procedure ---------------------------------------------------
extern DELPHI_PACKAGE void __fastcall FillStringGrid(Qimport3widestringgrid::TEmsWideStringGrid* DataGrid, TXMLDocFile* XMLFile);
extern DELPHI_PACKAGE void __fastcall XMLFile2TreeView(Vcl::Comctrls::TTreeView* TreeView, TXMLDocFile* XMLFile);
}	/* namespace Qimport3xmldoc */
#if !defined(DELPHIHEADER_NO_IMPLICIT_NAMESPACE_USE) && !defined(NO_USING_NAMESPACE_QIMPORT3XMLDOC)
using namespace Qimport3xmldoc;
#endif
#pragma pack(pop)
#pragma option pop

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